phaseModel.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 Class
28  Foam::phaseModel
29 
30 SourceFiles
31  phaseModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef Foam_multiphaseEuler_phaseModel_H
36 #define Foam_multiphaseEuler_phaseModel_H
37 
38 #include "dictionary.H"
39 #include "dictionaryEntry.H"
40 #include "dimensionedScalar.H"
41 #include "volFields.H"
42 #include "surfaceFields.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 namespace multiphaseEuler
50 {
51 // Forward declarations
52 class diameterModel;
53 }
54 
55 /*---------------------------------------------------------------------------*\
56  Class phaseModel Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class phaseModel
60 :
61  public volScalarField
62 {
63  // Private data
64 
65  //- Name of phase
66  word name_;
67 
68  dictionary phaseDict_;
69 
70  //- Kinematic viscosity
72 
73  //- Thermal conductivity
74  dimensionedScalar kappa_;
75 
76  //- Heat capacity
78 
79  //- Density
80  dimensionedScalar rho_;
81 
82  //- Velocity
83  volVectorField U_;
84 
85  //- Substantive derivative of the velocity
86  volVectorField DDtU_;
87 
88  //- Volumetric flux of the phase
89  surfaceScalarField alphaPhi_;
90 
91  //- Volumetric flux for the phase
93 
94  //- Diameter model
96 
97 
98 public:
99 
100  // Constructors
101 
102  phaseModel
103  (
104  const word& phaseName,
105  const dictionary& phaseDict,
106  const fvMesh& mesh
107  );
108 
109  //- Return clone
110  autoPtr<phaseModel> clone() const;
111 
112  //- Return a pointer to a new phase created on freestore
113  // from Istream
114  class iNew
115  {
116  const fvMesh& mesh_;
117 
118  public:
119 
120  iNew
121  (
122  const fvMesh& mesh
123  )
124  :
125  mesh_(mesh)
126  {}
127 
129  {
131  return autoPtr<phaseModel>
132  (
133  new phaseModel(ent.keyword(), ent, mesh_)
134  );
135  }
136  };
137 
138 
139  //- Destructor
140  virtual ~phaseModel();
141 
142 
143  // Member Functions
144 
145  const word& name() const
146  {
147  return name_;
148  }
149 
150  const word& keyword() const
151  {
152  return name();
153  }
154 
155  tmp<volScalarField> d() const;
156 
157  const dimensionedScalar& nu() const
158  {
159  return nu_;
160  }
161 
162  const dimensionedScalar& kappa() const
163  {
164  return kappa_;
165  }
167  const dimensionedScalar& Cp() const
168  {
169  return Cp_;
170  }
172  const dimensionedScalar& rho() const
173  {
174  return rho_;
175  }
176 
177  const volVectorField& U() const
178  {
179  return U_;
180  }
181 
182  volVectorField& U()
183  {
184  return U_;
185  }
186 
187  const volVectorField& DDtU() const
188  {
189  return DDtU_;
190  }
191 
193  {
194  return DDtU_;
195  }
196 
197  const surfaceScalarField& phi() const
198  {
199  return *phiPtr_;
200  }
201 
203  {
204  return *phiPtr_;
205  }
206 
207  const surfaceScalarField& alphaPhi() const
208  {
209  return alphaPhi_;
210  }
211 
213  {
214  return alphaPhi_;
215  }
216 
217  //- Ensure that the flux at inflow/outflow BCs is preserved
219 
220  //- Correct the phase properties
221  void correct();
222 
223  //-Inherit read from volScalarField
224  using volScalarField::read;
225 
226  //- Read base transportProperties dictionary
227  bool read(const dictionary& phaseDict);
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace Foam
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
Foam::surfaceFields.
const dimensionedScalar & Cp() const
Definition: phaseModel.H:188
void correctInflowOutflow(surfaceScalarField &alphaPhi) const
Ensure that the flux at inflow/outflow BCs is preserved.
Definition: phaseModel.C:233
virtual bool read()
Read object.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
autoPtr< phaseModel > clone() const
Return clone.
Definition: phaseModel.C:201
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
autoPtr< phaseModel > operator()(Istream &is) const
Definition: phaseModel.H:147
const word & keyword() const
Definition: phaseModel.H:171
const surfaceScalarField & phi() const
Definition: phaseModel.H:218
A keyword and a list of tokens is a &#39;dictionaryEntry&#39;.
const volVectorField & DDtU() const
Definition: phaseModel.H:208
const surfaceScalarField & alphaPhi() const
Definition: phaseModel.H:228
const volVectorField & U() const
Definition: phaseModel.H:198
const keyType & keyword() const noexcept
Return keyword.
Definition: entry.H:231
A class for handling words, derived from Foam::string.
Definition: word.H:63
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:474
void correct()
Correct the phase properties.
Definition: phaseModel.C:209
const dimensionedScalar & kappa() const
Definition: phaseModel.H:183
const Mesh & mesh() const noexcept
Return mesh.
const dimensionedScalar & nu() const
Return the laminar viscosity.
Definition: phaseModel.H:178
const dimensionedScalar & rho() const
Definition: phaseModel.H:193
phaseModel(const word &phaseName, const dictionary &phaseDict, const fvMesh &mesh)
Definition: phaseModel.C:33
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
iNew(const fvMesh &mesh)
Definition: phaseModel.H:140
const word & name() const
Definition: phaseModel.H:166
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual bool read()
Read phase properties dictionary.
Definition: phaseModel.C:193
tmp< volScalarField > d() const
Definition: phaseModel.C:251
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:53
Namespace for OpenFOAM.
virtual ~phaseModel()
Destructor.
Definition: phaseModel.C:195