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-2016 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  This function object evolves a passive scalar transport equation.
32 
33  - To specify the field name set the 'field' entry
34  - To employ the same numerical schemes as another field set
35  the 'schemesField' entry,
36  - The diffusivity can be set manually using the 'D' entry, or retrieved
37  from the turbulence model (if applicable).
38 
39 See also
40  Foam::functionObjects::fvMeshFunctionObject
41 
42 SourceFiles
43  scalarTransport.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef functionObjects_scalarTransport_H
48 #define functionObjects_scalarTransport_H
49 
50 #include "fvMeshFunctionObject.H"
51 #include "volFields.H"
52 #include "fvOptionList.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 namespace functionObjects
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class scalarTransport Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class scalarTransport
66 :
68 {
69  // Private data
70 
71  //- Name of field to process
72  word fieldName_;
73 
74  //- Name of flux field (optional)
75  word phiName_;
76 
77  //- Name of density field (optional)
78  word rhoName_;
79 
80  //- Diffusion coefficient (optional)
81  scalar D_;
82 
83  //- Flag to indicate whether a constant, uniform D_ is specified
84  bool constantD_;
85 
86  //- Number of corrector iterations (optional)
87  label nCorr_;
88 
89  //- Name of field whose schemes are used (optional)
90  word schemesField_;
91 
92  //- Run-time selectable finite volume options, e.g. sources, constraints
93  fv::optionList fvOptions_;
94 
95  //- The scalar field
96  volScalarField s_;
97 
98 
99  // Private Member Functions
100 
101  //- Return the diffusivity field
103 
104  //- Disallow default bitwise copy construct
106 
107  //- Disallow default bitwise assignment
108  void operator=(const scalarTransport&);
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 
128  //- Destructor
129  virtual ~scalarTransport();
130 
131 
132  // Member Functions
133 
134  //- Read the scalarTransport data
135  virtual bool read(const dictionary&);
136 
137  //- Calculate the scalarTransport
138  virtual bool execute();
139 
140  //- Do nothing.
141  // The volScalarField is registered and written automatically
142  virtual bool write();
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace functionObjects
149 } // End namespace Foam
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
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
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.
This function object evolves a passive scalar transport equation.
const word & name() const
Return the name of this functionObject.
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:54
Namespace for OpenFOAM.