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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "SingleMixtureFraction.H"
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
30 template<class CloudType>
31 void Foam::SingleMixtureFraction<CloudType>::constructIds()
33 forAll(this->phaseProps(), phaseI)
35 switch (this->phaseProps()[phaseI].phase())
37 case phaseProperties::GAS:
42 case phaseProperties::LIQUID:
47 case phaseProperties::SOLID:
56 "void Foam::SingleMixtureFraction<CloudType>::"
58 ) << "Unknown phase enumeration" << nl << abort(FatalError);
65 FatalErrorIn("Foam::SingleMixtureFraction<CloudType>::constructIds()")
66 << "No gas phase found in phase list:" << nl
67 << this->phaseTypes() << nl << endl;
71 FatalErrorIn("Foam::SingleMixtureFraction<CloudType>::constructIds()")
72 << "No liquid phase found in phase list:" << nl
73 << this->phaseTypes() << nl << endl;
77 FatalErrorIn("Foam::SingleMixtureFraction<CloudType>::constructIds()")
78 << "No solid phase found in phase list:" << nl
79 << this->phaseTypes() << nl << endl;
84 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
86 template<class CloudType>
87 Foam::SingleMixtureFraction<CloudType>::SingleMixtureFraction
89 const dictionary& dict,
93 CompositionModel<CloudType>(dict, owner, typeName),
103 if (this->phaseProps().size() != 3)
107 "Foam::SingleMixtureFraction<CloudType>::"
108 "SingleMixtureFraction"
110 "const dictionary&, "
113 ) << "Incorrect numebr of phases: " << nl
114 << " Please specify 1 gas, 1 liquid and 1 solid" << nl
118 this->coeffDict().lookup("YGasTot0") >> YMixture0_[idGas_];
119 this->coeffDict().lookup("YLiquidTot0") >> YMixture0_[idLiquid_];
120 this->coeffDict().lookup("YSolidTot0") >> YMixture0_[idSolid_];
122 if (mag(sum(YMixture0_) - 1.0) > SMALL)
126 "Foam::SingleMixtureFraction<CloudType>::"
127 "SingleMixtureFraction"
129 "const dictionary&, "
132 ) << "Sum of phases should be 1. Phase fractions:" << nl
133 << YMixture0_ << nl << exit(FatalError);
138 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
140 template<class CloudType>
141 Foam::SingleMixtureFraction<CloudType>::~SingleMixtureFraction()
145 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
147 template<class CloudType>
148 const Foam::scalarField&
149 Foam::SingleMixtureFraction<CloudType>::YGas0() const
151 return this->phaseProps()[idGas_].Y();
155 template<class CloudType>
156 const Foam::scalarField&
157 Foam::SingleMixtureFraction<CloudType>::YLiquid0() const
159 return this->phaseProps()[idLiquid_].Y();
163 template<class CloudType>
164 const Foam::scalarField&
165 Foam::SingleMixtureFraction<CloudType>::YSolid0() const
167 return this->phaseProps()[idSolid_].Y();
171 template<class CloudType>
172 const Foam::scalarField&
173 Foam::SingleMixtureFraction<CloudType>::YMixture0() const
179 template<class CloudType>
180 Foam::label Foam::SingleMixtureFraction<CloudType>::idGas() const
186 template<class CloudType>
187 Foam::label Foam::SingleMixtureFraction<CloudType>::idLiquid() const
193 template<class CloudType>
194 Foam::label Foam::SingleMixtureFraction<CloudType>::idSolid() const
200 // ************************************************************************* //