Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / lagrangian / intermediate / submodels / Reacting / CompositionModel / SinglePhaseMixture / SinglePhaseMixture.C
blob197611d60e561ca383b7b6fcefb799522b93a25f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2008-2010 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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)
34     {
35         FatalErrorIn
36         (
37             "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
38         )   << "Phase list is empty" << exit(FatalError);
39     }
40     else if (this->phaseProps().size() > 1)
41     {
42         FatalErrorIn
43         (
44             "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
45         )   << "Only one phase permitted" << exit(FatalError);
46     }
48     switch (this->phaseProps()[0].phase())
49     {
50         case phaseProperties::GAS:
51         {
52             idGas_ = 0;
53             break;
54         }
55         case phaseProperties::LIQUID:
56         {
57             idLiquid_ = 0;
58             break;
59         }
60         case phaseProperties::SOLID:
61         {
62             idSolid_ = 0;
63             break;
64         }
65         default:
66         {
67             FatalErrorIn
68             (
69                 "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
70             )   << "Unknown phase enumeration" << abort(FatalError);
71         }
72     }
76 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
78 template<class CloudType>
79 Foam::SinglePhaseMixture<CloudType>::SinglePhaseMixture
81     const dictionary& dict,
82     CloudType& owner
85     CompositionModel<CloudType>(dict, owner, typeName),
86     idGas_(-1),
87     idLiquid_(-1),
88     idSolid_(-1)
90     constructIds();
94 template<class CloudType>
95 Foam::SinglePhaseMixture<CloudType>::SinglePhaseMixture
97     const SinglePhaseMixture<CloudType>& cm
100     CompositionModel<CloudType>(cm),
101     idGas_(cm.idGas_),
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
120     notImplemented
121     (
122         "const Foam::scalarField& "
123         "Foam::SinglePhaseMixture<CloudType>::YGas0() const"
124     );
125     return this->phaseProps()[0].Y();
129 template<class CloudType>
130 const Foam::scalarField&
131 Foam::SinglePhaseMixture<CloudType>::YLiquid0() const
133     notImplemented
134     (
135         "const Foam::scalarField& "
136         "Foam::SinglePhaseMixture<CloudType>::YLiquid0() const"
137     );
138     return this->phaseProps()[0].Y();
142 template<class CloudType>
143 const Foam::scalarField&
144 Foam::SinglePhaseMixture<CloudType>::YSolid0() const
146     notImplemented
147     (
148         "const Foam::scalarField& "
149         "Foam::SinglePhaseMixture<CloudType>::YSolid0() const"
150     );
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
166     return idGas_;
170 template<class CloudType>
171 Foam::label Foam::SinglePhaseMixture<CloudType>::idLiquid() const
173     return idLiquid_;
177 template<class CloudType>
178 Foam::label Foam::SinglePhaseMixture<CloudType>::idSolid() const
180     return idSolid_;
184 // ************************************************************************* //