Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / lagrangian / intermediate / submodels / Reacting / CompositionModel / SinglePhaseMixture / SinglePhaseMixture.C
blob0a00db6b3b72f0033bc26fbed5e07fcb4381dbdb
1 /*---------------------------------------------------------------------------*\
2   =========                 |
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 -------------------------------------------------------------------------------
8 License
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 "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" << nl << 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" << nl << 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" << nl << 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 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
96 template<class CloudType>
97 Foam::SinglePhaseMixture<CloudType>::~SinglePhaseMixture()
101 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
103 template<class CloudType>
104 const Foam::scalarField&
105 Foam::SinglePhaseMixture<CloudType>::YGas0() const
107     notImplemented
108     (
109         "const Foam::scalarField& "
110         "Foam::SinglePhaseMixture<CloudType>::YGas0() const"
111     );
112     return this->phaseProps()[0].Y();
116 template<class CloudType>
117 const Foam::scalarField&
118 Foam::SinglePhaseMixture<CloudType>::YLiquid0() const
120     notImplemented
121     (
122         "const Foam::scalarField& "
123         "Foam::SinglePhaseMixture<CloudType>::YLiquid0() const"
124     );
125     return this->phaseProps()[0].Y();
129 template<class CloudType>
130 const Foam::scalarField&
131 Foam::SinglePhaseMixture<CloudType>::YSolid0() const
133     notImplemented
134     (
135         "const Foam::scalarField& "
136         "Foam::SinglePhaseMixture<CloudType>::YSolid0() const"
137     );
138     return this->phaseProps()[0].Y();
142 template<class CloudType>
143 const Foam::scalarField&
144 Foam::SinglePhaseMixture<CloudType>::YMixture0() const
146     return this->phaseProps()[0].Y();
150 template<class CloudType>
151 Foam::label Foam::SinglePhaseMixture<CloudType>::idGas() const
153     return idGas_;
157 template<class CloudType>
158 Foam::label Foam::SinglePhaseMixture<CloudType>::idLiquid() const
160     return idLiquid_;
164 template<class CloudType>
165 Foam::label Foam::SinglePhaseMixture<CloudType>::idSolid() const
167     return idSolid_;
171 // ************************************************************************* //