phase.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-2015 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::phase
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 phase.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef phase_H
40#define phase_H
41
42#include "volFields.H"
43#include "dictionaryEntry.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class phase Declaration
53\*---------------------------------------------------------------------------*/
55class phase
56:
57 public volScalarField
58{
59 // Private data
60
61 word name_;
62 dictionary phaseDict_;
65
66
67public:
68
69 // Constructors
70
71 //- Construct from components
72 phase
73 (
74 const word& name,
75 const dictionary& phaseDict,
76 const volVectorField& U,
78 );
79
80 //- Return clone
81 autoPtr<phase> clone() const;
82
83 //- Return a pointer to a new phase created on freestore
84 // from Istream
85 class iNew
86 {
87 const volVectorField& U_;
88 const surfaceScalarField& phi_;
89
90 public:
92 iNew
93 (
94 const volVectorField& U,
96 )
97 :
98 U_(U),
99 phi_(phi)
100 {}
103 {
105 return autoPtr<phase>(new phase(ent.keyword(), ent, U_, phi_));
106 }
107 };
108
109
110 // Member Functions
112 const word& name() const
113 {
114 return name_;
115 }
117 const word& keyword() const
118 {
119 return name();
120 }
121
122 //- Return const-access to phase1 viscosityModel
123 const viscosityModel& nuModel() const
124 {
125 return *nuModel_;
126 }
127
128 //- Return the kinematic laminar viscosity
129 tmp<volScalarField> nu() const
130 {
131 return nuModel_->nu();
132 }
133
134 //- Return the laminar viscosity for patch
135 tmp<scalarField> nu(const label patchi) const
136 {
137 return nuModel_->nu(patchi);
138 }
139
140 //- Return const-access to phase1 density
141 const dimensionedScalar& rho() const
142 {
143 return rho_;
144 }
145
146 //- Correct the phase properties
147 void correct();
148
149 //-Inherit read from volScalarField
151
152 //- Read base transportProperties dictionary
153 bool read(const dictionary& phaseDict);
154};
155
156
157// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
159} // End namespace Foam
160
161// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162
163#endif
164
165// ************************************************************************* //
surfaceScalarField & phi
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
virtual bool read()
Re-read model coefficients if they have changed.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A keyword and a list of tokens is a 'dictionaryEntry'.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const keyType & keyword() const noexcept
Return keyword.
Definition: entry.H:195
Return a pointer to a new phase created on freestore.
Definition: phase.H:85
autoPtr< phase > operator()(Istream &is) const
Definition: phase.H:101
iNew(const volVectorField &U, const surfaceScalarField &phi)
Definition: phase.H:92
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:57
void correct()
Correct the phase properties.
const viscosityModel & nuModel() const
Return const-access to phase1 viscosityModel.
Definition: phase.H:122
const word & name() const
Definition: phase.H:111
const dimensionedScalar & rho() const
Return const-access to phase1 density.
Definition: phase.H:140
autoPtr< phase > clone() const
Return clone.
tmp< scalarField > nu(const label patchi) const
Return the laminar viscosity for patch.
Definition: phase.H:134
tmp< volScalarField > nu() const
Return the kinematic laminar viscosity.
Definition: phase.H:128
phase(const word &name, const dictionary &phaseDict, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
const word & keyword() const
Definition: phase.H:116
bool read(const dictionary &phaseDict)
Read base transportProperties dictionary.
virtual bool read()
Read object.
A class for managing temporary objects.
Definition: tmp.H:65
An abstract base class for incompressible viscosityModels.
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.