scalarTransport.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 | Copyright (C) 2012-2017 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 Group
28  grpSolversFunctionObjects
29 
30 Description
31  Evolves a passive scalar transport equation.
32 
33  - To specify the field name set the \c field entry
34  - To employ the same numerical schemes as another field set
35  the \c schemesField entry,
36  - A constant diffusivity may be specified with the \c D entry,
37 
38  - Alternatively if a turbulence model is available a turbulent diffusivity
39  may be constructed from the laminar and turbulent viscosities using the
40  optional diffusivity coefficients \c alphaD and \c alphaDt (which default
41  to 1):
42  \verbatim
43  D = alphaD*nu + alphaDt*nut
44  \endverbatim
45 
46 See also
47  Foam::functionObjects::fvMeshFunctionObject
48 
49 SourceFiles
50  scalarTransport.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef functionObjects_scalarTransport_H
55 #define functionObjects_scalarTransport_H
56 
57 #include "fvMeshFunctionObject.H"
58 #include "volFields.H"
59 #include "fvOptionList.H"
60 
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 
63 namespace Foam
64 {
65 namespace functionObjects
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class scalarTransport Declaration
70 \*---------------------------------------------------------------------------*/
71 
72 class scalarTransport
73 :
75 {
76  // Private data
77 
78  //- Name of field to process
79  word fieldName_;
80 
81  //- Name of flux field (optional)
82  word phiName_;
83 
84  //- Name of density field (optional)
85  word rhoName_;
86 
87  //- Diffusion coefficient (optional)
88  scalar D_;
89 
90  //- Flag to indicate whether a constant, uniform D_ is specified
91  bool constantD_;
92 
93  //- Laminar diffusion coefficient (optional)
94  scalar alphaD_;
95 
96  //- Turbulent diffusion coefficient (optional)
97  scalar alphaDt_;
98 
99  //- Number of corrector iterations (optional)
100  label nCorr_;
101 
102  //- Name of field whose schemes are used (optional)
103  word schemesField_;
104 
105  //- Run-time selectable finite volume options, e.g. sources, constraints
106  fv::optionList fvOptions_;
107 
108  //- The scalar field
109  volScalarField s_;
110 
111 
112  // Private Member Functions
113 
114  //- Return the diffusivity field
116 
117  //- Disallow default bitwise copy construct
119 
120  //- Disallow default bitwise assignment
121  void operator=(const scalarTransport&);
122 
123 
124 public:
125 
126  //- Runtime type information
127  TypeName("scalarTransport");
128 
129 
130  // Constructors
131 
132  //- Construct from Time and dictionary
134  (
135  const word& name,
136  const Time& runTime,
137  const dictionary& dict
138  );
139 
140 
141  //- Destructor
142  virtual ~scalarTransport();
143 
144 
145  // Member Functions
146 
147  //- Read the scalarTransport data
148  virtual bool read(const dictionary&);
149 
150  //- Calculate the scalarTransport
151  virtual bool execute();
152 
153  //- Do nothing.
154  // The volScalarField is registered and written automatically
155  virtual bool write();
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace functionObjects
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
surfaceScalarField & phi
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
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:137
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
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.
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.