scalarTransport.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::functionObjects::scalarTransport
26 
27 Description
28  Evolves a passive scalar transport equation.
29 
30  - To specify the field name set the \c field entry
31  - To employ the same numerical schemes as another field set
32  the \c schemesField entry,
33  - A constant diffusivity may be specified with the \c D entry,
34 
35  - Alternatively if a turbulence model is available a turbulent diffusivity
36  may be constructed from the laminar and turbulent viscosities using the
37  optional diffusivity coefficients \c alphaD and \c alphaDt (which default
38  to 1):
39  \verbatim
40  D = alphaD*nu + alphaDt*nut
41  \endverbatim
42 
43 See also
44  Foam::functionObjects::fvMeshFunctionObject
45 
46 SourceFiles
47  scalarTransport.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef functionObjects_scalarTransport_H
52 #define functionObjects_scalarTransport_H
53 
54 #include "fvMeshFunctionObject.H"
55 #include "volFields.H"
56 #include "fvOptionList.H"
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 namespace functionObjects
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class scalarTransport Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 class scalarTransport
70 :
72 {
73  // Private Data
74 
75  //- Name of field to process
76  word fieldName_;
77 
78  //- Name of flux field (optional)
79  word phiName_;
80 
81  //- Name of density field (optional)
82  word rhoName_;
83 
84  //- Diffusion coefficient (optional)
85  scalar D_;
86 
87  //- Flag to indicate whether a constant, uniform D_ is specified
88  bool constantD_;
89 
90  //- Laminar diffusion coefficient (optional)
91  scalar alphaD_;
92 
93  //- Turbulent diffusion coefficient (optional)
94  scalar alphaDt_;
95 
96  //- Number of corrector iterations (optional)
97  label nCorr_;
98 
99  //- Name of field whose schemes are used (optional)
100  word schemesField_;
101 
102  //- Run-time selectable finite volume options, e.g. sources, constraints
103  fv::optionList fvOptions_;
104 
105  //- The scalar field
106  volScalarField s_;
107 
108 
109  // Private Member Functions
110 
111  //- Return the diffusivity field
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("scalarTransport");
119 
120 
121  // Constructors
122 
123  //- Construct from Time and dictionary
125  (
126  const word& name,
127  const Time& runTime,
128  const dictionary& dict
129  );
130 
131  //- Disallow default bitwise copy construction
132  scalarTransport(const scalarTransport&) = delete;
133 
134 
135  //- Destructor
136  virtual ~scalarTransport();
137 
138 
139  // Member Functions
140 
141  //- Read the scalarTransport data
142  virtual bool read(const dictionary&);
143 
144  //- Calculate the scalarTransport
145  virtual bool execute();
146 
147  //- Do nothing.
148  // The volScalarField is registered and written automatically
149  virtual bool write();
150 
151 
152  // Member Operators
153 
154  //- Disallow default bitwise assignment
155  void operator=(const scalarTransport&) = delete;
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace functionObjects
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
surfaceScalarField & phi
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
engineTime & runTime
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
scalarTransport(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool execute()
Calculate the scalarTransport.
Evolves a passive scalar transport equation.
A class for handling words, derived from string.
Definition: word.H:59
virtual bool read(const dictionary &)
Read the scalarTransport data.
void operator=(const scalarTransport &)=delete
Disallow default bitwise assignment.
TypeName("scalarTransport")
Runtime type information.
virtual bool write()
Do nothing.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
List of finite volume options.
Definition: fvOptionList.H:64
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.