atmPlantCanopyTSource.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2020 ENERCON GmbH
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fv::atmPlantCanopyTSource
29 
30 Group
31  grpFvOptionsSources
32 
33 Description
34  Applies sources on temperature, i.e. \c T, to incorporate
35  effects of plant canopy for atmospheric boundary layer modelling.
36 
37  Corrections applied to:
38  \verbatim
39  T | Temperature [K]
40  \endverbatim
41 
42  Required fields:
43  \verbatim
44  T | Temperature [K]
45  qPlant | Tree-height based specific heat flux [m2/s3]
46  \endverbatim
47 
48 Usage
49  Example by using \c constant/fvOptions:
50  \verbatim
51  atmPlantCanopyTSource1
52  {
53  // Mandatory entries (unmodifiable)
54  type atmPlantCanopyTSource;
55 
56  atmPlantCanopyTSourceCoeffs
57  {
58  // Mandatory (inherited) entries (unmodifiable)
59  selectionMode all;
60 
61  // Optional entries (unmodifiable)
62  rho rho;
63  Cp0 1005.0;
64  }
65 
66  // Optional (inherited) entries
67  ...
68  }
69  \endverbatim
70 
71  where the entries mean:
72  \table
73  Property | Description | Type | Req'd | Dflt
74  type | Type name: atmPlantCanopyTSource | word | yes | -
75  rho | Name of density field | word | no | rho
76  Cp0 | Specific heat capacity [m2/s2/K] | scalar | no | 1005.0
77  \endtable
78 
79  The inherited entries are elaborated in:
80  - \link fvOption.H \endlink
81  - \link cellSetOption.H \endlink
82 
83 SourceFiles
84  atmPlantCanopyTSource.C
85  atmPlantCanopyTSourceTemplates.C
86 
87 \*---------------------------------------------------------------------------*/
88 
89 #ifndef fv_atmPlantCanopyTSource_H
90 #define fv_atmPlantCanopyTSource_H
91 
92 #include "cellSetOption.H"
93 #include "fvMatrices.H"
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 namespace Foam
98 {
99 namespace fv
100 {
101 
102 /*---------------------------------------------------------------------------*\
103  Class atmPlantCanopyTSource Declaration
104 \*---------------------------------------------------------------------------*/
105 
106 class atmPlantCanopyTSource
107 :
108  public fv::cellSetOption
109 {
110  // Private Data
111 
112  //- Name of density field
113  const word rhoName_;
114 
115  //- Specific heat capacity
116  const dimensionedScalar Cp0_;
117 
118  // Fields
119 
120  //- Heat flux
121  volScalarField qPlant_;
122 
123 
124 public:
125 
126  //- Runtime type information
127  TypeName("atmPlantCanopyTSource");
128 
129 
130  // Constructors
131 
132  //- Construct from explicit source name and mesh
134  (
135  const word& sourceName,
136  const word& modelType,
137  const dictionary& dict,
138  const fvMesh& mesh
139  );
140 
141  //- No copy construct
143 
144  //- No copy assignment
145  void operator=(const atmPlantCanopyTSource&) = delete;
146 
147 
148  // Member Functions
149 
150  //- Add explicit contribution to temperature equation
151  //- for incompressible flow computations
152  virtual void addSup
153  (
154  fvMatrix<scalar>& eqn,
155  const label fieldi
156  );
157 
158  //- Add explicit contribution to temperature equation
159  //- for compressible flow computations
160  virtual void addSup
161  (
162  const volScalarField& rho,
163  fvMatrix<scalar>& eqn,
164  const label fieldi
165  );
166 
167  //- Add explicit contribution to temperature equation
168  //- for multiphase flow computations
169  virtual void addSup
170  (
171  const volScalarField& alpha,
172  const volScalarField& rho,
173  fvMatrix<scalar>& eqn,
174  const label fieldi
175  );
176 
177  //- Read source dictionary (effectively no-op)
178  virtual bool read(const dictionary& dict)
179  {
180  return true;
181  }
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace fv
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Foam::fv::atmPlantCanopyTSource::TypeName
TypeName("atmPlantCanopyTSource")
Runtime type information.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fv::cellSetOption
Intermediate abstract class for handling cell-set options for the derived fvOptions.
Definition: cellSetOption.H:163
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::fv::atmPlantCanopyTSource
Applies sources on temperature, i.e. T, to incorporate effects of plant canopy for atmospheric bounda...
Definition: atmPlantCanopyTSource.H:129
rho
rho
Definition: readInitialConditions.H:88
cellSetOption.H
Foam::fv::atmPlantCanopyTSource::operator=
void operator=(const atmPlantCanopyTSource &)=delete
No copy assignment.
Foam::fv::atmPlantCanopyTSource::atmPlantCanopyTSource
atmPlantCanopyTSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
Definition: atmPlantCanopyTSource.C:47
fvMatrices.H
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::dimensioned< scalar >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fv
labelList fv(nPoints)
Foam::fv::atmPlantCanopyTSource::read
virtual bool read(const dictionary &dict)
Read source dictionary (effectively no-op)
Definition: atmPlantCanopyTSource.H:201
Foam::fv::option::mesh
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
Foam::fv::atmPlantCanopyTSource::addSup
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Definition: atmPlantCanopyTSource.C:93
Foam::GeometricField< scalar, fvPatchField, volMesh >