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 | Copyright (C) 2011-2015 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::phaseModel
26 
27 SourceFiles
28  phaseModel.C
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef phaseModel_H
33 #define phaseModel_H
34 
35 #include "dictionary.H"
36 #include "dictionaryEntry.H"
37 #include "dimensionedScalar.H"
38 #include "volFields.H"
39 #include "surfaceFields.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declarations
47 class diameterModel;
48 
49 /*---------------------------------------------------------------------------*\
50  Class phaseModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class phaseModel
54 :
55  public volScalarField
56 {
57  // Private data
58 
59  //- Name of phase
60  word name_;
61 
63 
64  //- Kinematic viscosity
66 
67  //- Thermal conductivity
69 
70  //- Heat capacity
72 
73  //- Density
75 
76  //- Velocity
78 
79  //- Substantive derivative of the velocity
81 
82  //- Volumetric flux of the phase
84 
85  //- Volumetric flux for the phase
87 
88  //- Diameter model
90 
91 
92 public:
93 
94  // Constructors
95 
97  (
98  const word& phaseName,
99  const dictionary& phaseDict,
100  const fvMesh& mesh
101  );
102 
103  //- Return clone
104  autoPtr<phaseModel> clone() const;
105 
106  //- Return a pointer to a new phase created on freestore
107  // from Istream
108  class iNew
109  {
110  const fvMesh& mesh_;
111 
112  public:
113 
115  (
116  const fvMesh& mesh
117  )
118  :
119  mesh_(mesh)
120  {}
121 
123  {
125  return autoPtr<phaseModel>
126  (
127  new phaseModel(ent.keyword(), ent, mesh_)
128  );
129  }
130  };
131 
132 
133  //- Destructor
134  virtual ~phaseModel();
135 
136 
137  // Member Functions
138 
139  const word& name() const
140  {
141  return name_;
142  }
143 
144  const word& keyword() const
145  {
146  return name();
147  }
148 
149  tmp<volScalarField> d() const;
150 
151  const dimensionedScalar& nu() const
152  {
153  return nu_;
154  }
155 
156  const dimensionedScalar& kappa() const
157  {
158  return kappa_;
159  }
160 
161  const dimensionedScalar& Cp() const
162  {
163  return Cp_;
164  }
165 
166  const dimensionedScalar& rho() const
167  {
168  return rho_;
169  }
170 
171  const volVectorField& U() const
172  {
173  return U_;
174  }
175 
176  volVectorField& U()
177  {
178  return U_;
179  }
180 
181  const volVectorField& DDtU() const
182  {
183  return DDtU_;
184  }
185 
187  {
188  return DDtU_;
189  }
190 
191  const surfaceScalarField& phi() const
192  {
193  return phiPtr_();
194  }
195 
197  {
198  return phiPtr_();
199  }
200 
201  const surfaceScalarField& alphaPhi() const
202  {
203  return alphaPhi_;
204  }
205 
207  {
208  return alphaPhi_;
209  }
210 
211  //- Correct the phase properties
212  void correct();
213 
214  //-Inherit read from volScalarField
215  using volScalarField::read;
216 
217  //- Read base transportProperties dictionary
218  bool read(const dictionary& phaseDict);
219 };
220 
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 } // End namespace Foam
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
volFields.H
Foam::phaseModel::iNew::mesh_
const fvMesh & mesh_
Definition: phaseModel.H:109
Foam::dictionaryEntry
A keyword and a list of tokens is a 'dictionaryEntry'.
Definition: dictionaryEntry.H:57
Foam::phaseModel::phiPtr_
autoPtr< surfaceScalarField > phiPtr_
Volumetric flux for the phase.
Definition: phaseModel.H:85
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::phaseModel::U
volVectorField & U()
Definition: phaseModel.H:175
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::phaseModel::alphaPhi
const surfaceScalarField & alphaPhi() const
Definition: phaseModel.H:200
Foam::phaseModel::~phaseModel
virtual ~phaseModel()
Destructor.
Foam::read
bool read(const char *, int32_t &)
Definition: int32IO.C:87
Foam::phaseModel::read
virtual bool read()
Read phase properties dictionary.
Foam::phaseModel::U_
volVectorField U_
Velocity.
Definition: phaseModel.H:76
Foam::phaseModel::correct
void correct()
Foam::phaseModel::phaseDict_
dictionary phaseDict_
Definition: phaseModel.H:61
surfaceFields.H
Foam::surfaceFields.
Foam::phaseModel::Cp_
dimensionedScalar Cp_
Heat capacity.
Definition: phaseModel.H:70
Foam::phaseModel::Cp
const dimensionedScalar & Cp() const
Definition: phaseModel.H:160
Foam::phaseModel::nu
const dimensionedScalar & nu() const
Definition: phaseModel.H:150
Foam::phaseModel::d
tmp< volScalarField > d() const
Foam::phaseModel::phaseModel
phaseModel(const word &phaseName, const volScalarField &p, const volScalarField &T)
Construct from components.
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::phaseModel::iNew::operator()
autoPtr< phaseModel > operator()(Istream &is) const
Definition: phaseModel.H:121
Foam::phaseModel::clone
autoPtr< phaseModel > clone() const
Return clone.
Foam::phaseModel::iNew::iNew
iNew(const volScalarField &p, const volScalarField &T)
Definition: phaseModel.H:91
Foam::phaseModel::DDtU
const volVectorField & DDtU() const
Definition: phaseModel.H:180
Foam::phaseModel::phi
surfaceScalarField & phi()
Definition: phaseModel.H:195
Foam::phaseModel::name
const word & name() const
Definition: phaseModel.H:138
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
Foam::phaseModel::iNew
Return a pointer to a new phaseModel created on freestore.
Definition: phaseModel.H:83
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::phaseModel::kappa_
dimensionedScalar kappa_
Thermal conductivity.
Definition: phaseModel.H:67
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::phaseModel::rho
const dimensionedScalar & rho() const
Definition: phaseModel.H:165
dictionaryEntry.H
Foam::phaseModel::phi
const surfaceScalarField & phi() const
Definition: phaseModel.H:190
Foam::phaseModel::name_
word name_
Name of phase.
Definition: phaseModel.H:59
ent::keyword
const word & keyword() const
Definition: Test-Dictionary.C:52
dimensionedScalar.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::phaseModel::dPtr_
autoPtr< diameterModel > dPtr_
Diameter model.
Definition: phaseModel.H:88
Foam::phaseModel::U
const volVectorField & U() const
Definition: phaseModel.H:170
Foam::phaseModel::rho_
dimensionedScalar rho_
Density.
Definition: phaseModel.H:73
Foam::phaseModel::nu_
dimensionedScalar nu_
Kinematic viscosity.
Definition: phaseModel.H:64
Foam::phaseModel::keyword
const word & keyword() const
Definition: phaseModel.H:143
dictionary.H
Foam::phaseModel::alphaPhi_
surfaceScalarField alphaPhi_
Volumetric flux of the phase.
Definition: phaseModel.H:82
Foam::phaseModel::DDtU_
volVectorField DDtU_
Substantive derivative of the velocity.
Definition: phaseModel.H:79
Foam::phaseModel::DDtU
volVectorField & DDtU()
Definition: phaseModel.H:185
Foam::phaseModel::alphaPhi
surfaceScalarField & alphaPhi()
Definition: phaseModel.H:205
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::phaseModel::kappa
const dimensionedScalar & kappa() const
Definition: phaseModel.H:155
Foam::dictionary::null
static const dictionary null
Null dictionary.
Definition: dictionary.H:193
ent
Definition: Test-Dictionary.C:37