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) 2013 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 Description
28  Single incompressible phase derived from the phase-fraction.
29  Used as part of the multiPhaseMixture for interface-capturing multi-phase
30  simulations.
31 
32 SourceFiles
33  phaseModel.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef phaseModel_H
38 #define phaseModel_H
39 
40 #include "rhoThermo.H"
41 #include "volFields.H"
42 #include "dictionaryEntry.H"
43 
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class phaseModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class phaseModel
55 :
56  public volScalarField
57 {
58  // Private data
59 
65 
66 
67 public:
68 
69  // Constructors
70 
71  //- Construct from components
73  (
74  const word& phaseName,
75  const volScalarField& p,
76  const volScalarField& T
77  );
78 
79  //- Return clone
80  autoPtr<phaseModel> clone() const;
81 
82  //- Return a pointer to a new phaseModel created on freestore
83  // from Istream
84  class iNew
85  {
87  const volScalarField& T_;
88 
89  public:
90 
92  (
93  const volScalarField& p,
94  const volScalarField& T
95  )
96  :
97  p_(p),
98  T_(T)
99  {}
100 
102  {
103  return autoPtr<phaseModel>(new phaseModel(is, p_, T_));
104  }
105  };
106 
107 
108  // Member Functions
109 
110  const word& name() const
111  {
112  return name_;
113  }
114 
115  const word& keyword() const
116  {
117  return name();
118  }
119 
120  //- Return const-access to phase rhoThermo
121  const rhoThermo& thermo() const
122  {
123  return thermo_();
124  }
125 
126  //- Return access to phase rhoThermo
127  rhoThermo& thermo()
128  {
129  return thermo_();
130  }
131 
132  //- Return const-access to phase divergence
133  const volScalarField& dgdt() const
134  {
135  return dgdt_;
136  }
137 
138  //- Return access to phase divergence
140  {
141  return dgdt_;
142  }
143 
144  void correct();
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
volFields.H
Foam::phaseModel
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:53
Foam::phaseModel::thermo_
autoPtr< rhoThermo > thermo_
Thermophysical properties.
Definition: phaseModel.H:62
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::phaseModel::thermo
const rhoThermo & thermo() const
Return const-access to phase rhoThermo.
Definition: phaseModel.H:120
Foam::phaseModel::correct
void correct()
Foam::phaseModel::T_
const volScalarField & T_
Definition: phaseModel.H:61
Foam::phaseModel::dgdt_
volScalarField dgdt_
Definition: phaseModel.H:63
rhoThermo.H
Foam::rhoThermo
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:49
Foam::phaseModel::iNew::T_
const volScalarField & T_
Definition: phaseModel.H:86
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:100
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::name
const word & name() const
Definition: phaseModel.H:109
Foam::phaseModel::iNew
Return a pointer to a new phaseModel created on freestore.
Definition: phaseModel.H:83
Foam::phaseModel::iNew::p_
const volScalarField & p_
Definition: phaseModel.H:85
Foam::phaseModel::dgdt
const volScalarField & dgdt() const
Return const-access to phase divergence.
Definition: phaseModel.H:132
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
dictionaryEntry.H
Foam::phaseModel::thermo
rhoThermo & thermo()
Return access to phase rhoThermo.
Definition: phaseModel.H:126
Foam::phaseModel::name_
word name_
Name of phase.
Definition: phaseModel.H:59
Foam::GeometricField::T
tmp< GeometricField< Type, PatchField, GeoMesh > > T() const
Return transpose (only if it is a tensor field)
Definition: GeometricField.C:996
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::keyword
const word & keyword() const
Definition: phaseModel.H:114
Foam::phaseModel::dgdt
volScalarField & dgdt()
Return access to phase divergence.
Definition: phaseModel.H:138
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::phaseModel::p_
const volScalarField & p_
Definition: phaseModel.H:60