fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / lagrangian / intermediate / submodels / Reacting / CompositionModel / SinglePhaseMixture / SinglePhaseMixture.C
blob947770826cf833f599658a30e25f8db78d91c8fb
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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 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
19     for more details.
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)
35     {
36         FatalErrorIn
37         (
38             "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
39         )   << "Phase list is empty" << nl << exit(FatalError);
40     }
41     else if (this->phaseProps().size() > 1)
42     {
43         FatalErrorIn
44         (
45             "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
46         )   << "Only one phase permitted" << nl << exit(FatalError);
47     }
49     switch (this->phaseProps()[0].phase())
50     {
51         case phaseProperties::GAS:
52         {
53             idGas_ = 0;
54             break;
55         }
56         case phaseProperties::LIQUID:
57         {
58             idLiquid_ = 0;
59             break;
60         }
61         case phaseProperties::SOLID:
62         {
63             idSolid_ = 0;
64             break;
65         }
66         default:
67         {
68             FatalErrorIn
69             (
70                 "void Foam::SinglePhaseMixture<CloudType>::constructIds()"
71             )   << "Unknown phase enumeration" << nl << abort(FatalError);
72         }
73     }
77 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
79 template<class CloudType>
80 Foam::SinglePhaseMixture<CloudType>::SinglePhaseMixture
82     const dictionary& dict,
83     CloudType& owner
86     CompositionModel<CloudType>(dict, owner, typeName),
87     idGas_(-1),
88     idLiquid_(-1),
89     idSolid_(-1)
91     constructIds();
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
108     notImplemented
109     (
110         "const Foam::scalarField& "
111         "Foam::SinglePhaseMixture<CloudType>::YGas0() const"
112     );
113     return this->phaseProps()[0].Y();
117 template<class CloudType>
118 const Foam::scalarField&
119 Foam::SinglePhaseMixture<CloudType>::YLiquid0() const
121     notImplemented
122     (
123         "const Foam::scalarField& "
124         "Foam::SinglePhaseMixture<CloudType>::YLiquid0() const"
125     );
126     return this->phaseProps()[0].Y();
130 template<class CloudType>
131 const Foam::scalarField&
132 Foam::SinglePhaseMixture<CloudType>::YSolid0() const
134     notImplemented
135     (
136         "const Foam::scalarField& "
137         "Foam::SinglePhaseMixture<CloudType>::YSolid0() const"
138     );
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
154     return idGas_;
158 template<class CloudType>
159 Foam::label Foam::SinglePhaseMixture<CloudType>::idLiquid() const
161     return idLiquid_;
165 template<class CloudType>
166 Foam::label Foam::SinglePhaseMixture<CloudType>::idSolid() const
168     return idSolid_;
172 // ************************************************************************* //