1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "SinglePhaseMixture.H"
29 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
31 template<class CloudType>
32 void Foam::SinglePhaseMixture<CloudType>::constructIds()
34 if (this->phaseProps().size() == 0)
38 "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
39 ) << "Phase list is empty" << nl << exit(FatalError);
41 else if (this->phaseProps().size() > 1)
45 "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
46 ) << "Only one phase permitted" << nl << exit(FatalError);
49 switch (this->phaseProps()[0].phase())
51 case phaseProperties::GAS:
56 case phaseProperties::LIQUID:
61 case phaseProperties::SOLID:
70 "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
71 ) << "Unknown phase enumeration" << nl << abort(FatalError);
77 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
79 template<class CloudType>
80 Foam::SinglePhaseMixture<CloudType>::SinglePhaseMixture
82 const dictionary& dict,
86 CompositionModel<CloudType>(dict, owner, typeName),
95 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
97 template<class CloudType>
98 Foam::SinglePhaseMixture<CloudType>::~SinglePhaseMixture()
102 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
104 template<class CloudType>
105 const Foam::scalarField&
106 Foam::SinglePhaseMixture<CloudType>::YGas0() const
110 "const Foam::scalarField& "
111 "Foam::SinglePhaseMixture<CloudType>::YGas0() const"
113 return this->phaseProps()[0].Y();
117 template<class CloudType>
118 const Foam::scalarField&
119 Foam::SinglePhaseMixture<CloudType>::YLiquid0() const
123 "const Foam::scalarField& "
124 "Foam::SinglePhaseMixture<CloudType>::YLiquid0() const"
126 return this->phaseProps()[0].Y();
130 template<class CloudType>
131 const Foam::scalarField&
132 Foam::SinglePhaseMixture<CloudType>::YSolid0() const
136 "const Foam::scalarField& "
137 "Foam::SinglePhaseMixture<CloudType>::YSolid0() const"
139 return this->phaseProps()[0].Y();
143 template<class CloudType>
144 const Foam::scalarField&
145 Foam::SinglePhaseMixture<CloudType>::YMixture0() const
147 return this->phaseProps()[0].Y();
151 template<class CloudType>
152 Foam::label Foam::SinglePhaseMixture<CloudType>::idGas() const
158 template<class CloudType>
159 Foam::label Foam::SinglePhaseMixture<CloudType>::idLiquid() const
165 template<class CloudType>
166 Foam::label Foam::SinglePhaseMixture<CloudType>::idSolid() const
172 // ************************************************************************* //