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-2021 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 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 namespace functionObjects
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class scalarTransport Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class scalarTransport
69 :
71 {
72  // Private Data
73 
74  //- Name of field to process
75  word fieldName_;
76 
77  //- Name of flux field (optional)
78  word phiName_;
79 
80  //- Name of density field (optional)
81  word rhoName_;
82 
83  //- Diffusion coefficient (optional)
84  scalar D_;
85 
86  //- Flag to indicate whether a constant, uniform D_ is specified
87  bool constantD_;
88 
89  //- Laminar diffusion coefficient (optional)
90  scalar alphaD_;
91 
92  //- Turbulent diffusion coefficient (optional)
93  scalar alphaDt_;
94 
95  //- Number of corrector iterations (optional)
96  int nCorr_;
97 
98  //- Name of field whose schemes are used (optional)
99  word schemesField_;
100 
101  //- The scalar field
102  volScalarField s_;
103 
104 
105  // Private Member Functions
106 
107  //- Return the diffusivity field
109 
110 
111 public:
112 
113  //- Runtime type information
114  TypeName("scalarTransport");
115 
116 
117  // Constructors
118 
119  //- Construct from Time and dictionary
121  (
122  const word& name,
123  const Time& runTime,
124  const dictionary& dict
125  );
126 
127  //- Disallow default bitwise copy construction
128  scalarTransport(const scalarTransport&) = delete;
129 
130 
131  //- Destructor
132  virtual ~scalarTransport();
133 
134 
135  // Member Functions
136 
137  //- Read the scalarTransport data
138  virtual bool read(const dictionary&);
139 
140  //- Calculate the scalarTransport
141  virtual bool execute();
142 
143  //- Do nothing.
144  // The volScalarField is registered and written automatically
145  virtual bool write();
146 
147 
148  // Member Operators
149 
150  //- Disallow default bitwise assignment
151  void operator=(const scalarTransport&) = delete;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace functionObjects
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
dictionary dict
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:156
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.
phi
Definition: correctPhi.H:3
void operator=(const scalarTransport &)=delete
Disallow default bitwise assignment.
TypeName("scalarTransport")
Runtime type information.
virtual bool write()
Do nothing.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.