Loading...
Searching...
No Matches
atmPlantCanopyTSource.C
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-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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\*---------------------------------------------------------------------------*/
28
32// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
33
34namespace Foam
35{
36namespace fv
37{
40}
41}
42
43
44// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45
47(
48 const word& sourceName,
49 const word& modelType,
50 const dictionary& dict,
51 const fvMesh& mesh
52)
53:
54 fv::cellSetOption(sourceName, modelType, dict, mesh),
55 rhoName_(coeffs_.getOrDefault<word>("rho", "rho")),
56 Cp0_
57 (
59 (
61 coeffs_.getCheckOrDefault<scalar>
62 (
63 "Cp0",
64 1005.0,
65 scalarMinMax::ge(SMALL)
66 )
67 )
68 ),
69 qPlant_
70 (
72 (
73 "qPlant",
74 mesh.time().timeName(),
75 mesh,
76 IOobject::MUST_READ,
77 IOobject::AUTO_WRITE
78 ),
79 mesh
80 )
81{
82 fieldNames_.resize(1, "T");
83
86 Log << " Applying atmPlantCanopyTSource to: " << fieldNames_[0] << endl;
87}
88
89
90// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
91
93(
95 const label fieldi
96)
97{
98 if (V_ > VSMALL)
99 {
100 eqn -= -qPlant_/Cp0_;
101 }
102}
103
104
106(
107 const volScalarField& rho,
108 fvMatrix<scalar>& eqn,
109 const label fieldi
110)
111{
112 if (V_ > VSMALL)
113 {
114 eqn -= -rho*qPlant_/Cp0_;
115 }
116}
117
118
120(
121 const volScalarField& alpha,
122 const volScalarField& rho,
123 fvMatrix<scalar>& eqn,
124 const label fieldi
125)
126{
127 if (V_ > VSMALL)
128 {
129 eqn -= -alpha*rho*qPlant_/Cp0_;
130 }
131}
132
133
134// ************************************************************************* //
#define Log
Definition PDRblock.C:28
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
void resize(const label len)
Adjust allocated size of list.
Definition ListI.H:153
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
Applies sources on temperature, i.e. T, to incorporate effects of plant canopy for atmospheric bounda...
atmPlantCanopyTSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to temperature equation for incompressible flow computations.
cellSetOption(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
scalar V_
Sum of cell volumes.
Base abstract class for handling finite volume options (i.e. fvOption).
Definition fvOption.H:124
wordList fieldNames_
Field names to apply source to - populated by derived models.
Definition fvOption.H:157
dictionary coeffs_
Dictionary containing source coefficients.
Definition fvOption.H:152
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
Definition fvOption.C:41
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition fvOptionI.H:30
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
word timeName
Definition getTimeIndex.H:3
Namespace for finite-volume.
Namespace for OpenFOAM.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
MinMax< scalar > scalarMinMax
A scalar min/max range.
Definition MinMax.H:97
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
volScalarField & alpha
dictionary dict