1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "SinglePhaseMixture.H"
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
30 template<class CloudType>
31 void Foam::SinglePhaseMixture<CloudType>::constructIds()
33 if (this->phaseProps().size() == 0)
37 "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
38 ) << "Phase list is empty" << exit(FatalError);
40 else if (this->phaseProps().size() > 1)
44 "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
45 ) << "Only one phase permitted" << exit(FatalError);
48 switch (this->phaseProps()[0].phase())
50 case phaseProperties::GAS:
55 case phaseProperties::LIQUID:
60 case phaseProperties::SOLID:
69 "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
70 ) << "Unknown phase enumeration" << abort(FatalError);
76 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
78 template<class CloudType>
79 Foam::SinglePhaseMixture<CloudType>::SinglePhaseMixture
81 const dictionary& dict,
85 CompositionModel<CloudType>(dict, owner, typeName),
94 template<class CloudType>
95 Foam::SinglePhaseMixture<CloudType>::SinglePhaseMixture
97 const SinglePhaseMixture<CloudType>& cm
100 CompositionModel<CloudType>(cm),
102 idLiquid_(cm.idLiquid_),
103 idSolid_(cm.idSolid_)
107 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
109 template<class CloudType>
110 Foam::SinglePhaseMixture<CloudType>::~SinglePhaseMixture()
114 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
116 template<class CloudType>
117 const Foam::scalarField&
118 Foam::SinglePhaseMixture<CloudType>::YGas0() const
122 "const Foam::scalarField& "
123 "Foam::SinglePhaseMixture<CloudType>::YGas0() const"
125 return this->phaseProps()[0].Y();
129 template<class CloudType>
130 const Foam::scalarField&
131 Foam::SinglePhaseMixture<CloudType>::YLiquid0() const
135 "const Foam::scalarField& "
136 "Foam::SinglePhaseMixture<CloudType>::YLiquid0() const"
138 return this->phaseProps()[0].Y();
142 template<class CloudType>
143 const Foam::scalarField&
144 Foam::SinglePhaseMixture<CloudType>::YSolid0() const
148 "const Foam::scalarField& "
149 "Foam::SinglePhaseMixture<CloudType>::YSolid0() const"
151 return this->phaseProps()[0].Y();
155 template<class CloudType>
156 const Foam::scalarField&
157 Foam::SinglePhaseMixture<CloudType>::YMixture0() const
159 return this->phaseProps()[0].Y();
163 template<class CloudType>
164 Foam::label Foam::SinglePhaseMixture<CloudType>::idGas() const
170 template<class CloudType>
171 Foam::label Foam::SinglePhaseMixture<CloudType>::idLiquid() const
177 template<class CloudType>
178 Foam::label Foam::SinglePhaseMixture<CloudType>::idSolid() const
184 // ************************************************************************* //