1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Single incompressible phase derived from the phase-fraction.
29 Used as part of the multiPhaseMixture for interface-capturing multi-phase
35 \*---------------------------------------------------------------------------*/
40 #include "volFields.H"
41 #include "dictionaryEntry.H"
42 #include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class phase Declaration
51 \*---------------------------------------------------------------------------*/
60 dictionary phaseDict_;
61 autoPtr<viscosityModel> nuModel_;
62 dimensionedScalar rho_;
69 //- Construct from components
73 const dictionary& phaseDict,
74 const volVectorField& U,
75 const surfaceScalarField& phi
79 autoPtr<phase> clone() const;
81 //- Return a pointer to a new phase created on freestore
85 const volVectorField& U_;
86 const surfaceScalarField& phi_;
92 const volVectorField& U,
93 const surfaceScalarField& phi
100 autoPtr<phase> operator()(Istream& is) const
102 dictionaryEntry ent(dictionary::null, is);
103 return autoPtr<phase>(new phase(ent.keyword(), ent, U_, phi_));
110 const word& name() const
115 const word& keyword() const
120 //- Return const-access to phase1 viscosityModel
121 const viscosityModel& nuModel() const
126 //- Return limited phase indicator
127 tmp<volScalarField> limitedAlpha() const
129 const volScalarField& alpha = *this;
131 return Foam::min(Foam::max(alpha, scalar(0)), scalar(1));
134 //- Return the kinematic laminar viscosity
135 tmp<volScalarField> nu() const
137 return nuModel_->nu();
140 //- Return const-access to phase density
141 const dimensionedScalar& rho() const
146 //- Correct the phase properties
149 //- Read base transportProperties dictionary
150 bool read(const dictionary& phaseDict);
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 } // End namespace Foam
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 // ************************************************************************* //