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) 2013 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::phaseModel
28
29Description
30 Single incompressible phase derived from the phase-fraction.
31 Used as part of the multiPhaseMixture for interface-capturing multi-phase
32 simulations.
33
34SourceFiles
35 phaseModel.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef phaseModel_H
40#define phaseModel_H
41
42#include "rhoThermo.H"
43#include "volFields.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class phaseModel Declaration
52\*---------------------------------------------------------------------------*/
53
54class phaseModel
55:
56 public volScalarField
57{
58 // Private data
59
60 word name_;
61 const volScalarField& p_;
62 const volScalarField& T_;
63 autoPtr<rhoThermo> thermo_;
64 volScalarField dgdt_;
65
66
67public:
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
81
82 //- Return a pointer to a new phaseModel created on freestore
83 // from Istream
84 class iNew
85 {
86 const volScalarField& p_;
87 const volScalarField& T_;
88
89 public:
91 iNew
92 (
93 const volScalarField& p,
94 const volScalarField& T
95 )
96 :
97 p_(p),
98 T_(T)
99 {}
102 {
103 return autoPtr<phaseModel>::New(word(is), p_, T_);
104 }
105 };
106
107
108 // Member Functions
110 const word& name() const
111 {
112 return name_;
113 }
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
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 }
144 void correct();
145};
146
147
148// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149
150} // End namespace Foam
151
152// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153
154#endif
155
156// ************************************************************************* //
tmp< GeometricField< scalar, fvPatchField, volMesh > > T() const
Return transpose (only if it is a tensor field)
const Internal & operator()() const
Return a const-reference to the dimensioned internal field.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Return a pointer to a new phase created on freestore.
Definition: phaseModel.H:114
iNew(const volScalarField &p, const volScalarField &T)
Definition: phaseModel.H:91
autoPtr< phaseModel > operator()(Istream &is) const
Definition: phaseModel.H:100
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:61
const rhoThermo & thermo() const
Return const-access to phase rhoThermo.
Definition: phaseModel.H:120
void correct()
Correct the laminar viscosity.
phaseModel(const word &phaseName, const volScalarField &p, const volScalarField &T)
Construct from components.
const word & name() const
Definition: phaseModel.H:109
const volScalarField & dgdt() const
Return const-access to phase divergence.
Definition: phaseModel.H:132
volScalarField & dgdt()
Return access to phase divergence.
Definition: phaseModel.H:138
rhoThermo & thermo()
Return access to phase rhoThermo.
Definition: phaseModel.H:126
autoPtr< phaseModel > clone() const
Return clone.
const word & keyword() const
Definition: phaseModel.H:114
const word & keyword() const
Definition: phaseModel.H:149
autoPtr< phaseModel > clone() const
Return clone.
Definition: phaseModel.C:208
const word & name() const
Definition: phaseModel.H:144
virtual const rhoThermo & thermo() const =0
Return the thermophysical model.
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:58
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
Namespace for OpenFOAM.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82