SinglePhaseMixture.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2015 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "SinglePhaseMixture.H"
29
30// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
31
32template<class CloudType>
34{
35 if (this->phaseProps().size() == 0)
36 {
38 << "Phase list is empty" << exit(FatalError);
39 }
40 else if (this->phaseProps().size() > 1)
41 {
43 << "Only one phase permitted" << exit(FatalError);
44 }
45
46 switch (this->phaseProps()[0].phase())
47 {
48 case phaseProperties::GAS:
49 {
50 idGas_ = 0;
51 break;
52 }
53 case phaseProperties::LIQUID:
54 {
55 idLiquid_ = 0;
56 break;
57 }
58 case phaseProperties::SOLID:
59 {
60 idSolid_ = 0;
61 break;
62 }
63 default:
64 {
66 << "Unknown phase enumeration" << abort(FatalError);
67 }
68 }
69}
70
71
72// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
73
74template<class CloudType>
76(
77 const dictionary& dict,
78 CloudType& owner
79)
80:
81 CompositionModel<CloudType>(dict, owner, typeName),
82 idGas_(-1),
83 idLiquid_(-1),
84 idSolid_(-1)
85{
86 constructIds();
87}
88
89
90template<class CloudType>
92(
94)
95:
97 idGas_(cm.idGas_),
98 idLiquid_(cm.idLiquid_),
99 idSolid_(cm.idSolid_)
100{}
101
102
103// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
104
105template<class CloudType>
107{}
108
109
110// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
111
112template<class CloudType>
115{
116 return this->phaseProps()[0].Y();
117}
118
119
120template<class CloudType>
122{
123 return idGas_;
124}
125
126
127template<class CloudType>
129{
130 return idLiquid_;
131}
132
133
134template<class CloudType>
136{
137 return idSolid_;
138}
139
140
141// ************************************************************************* //
Templated reacting parcel composition model class Consists of carrier species (via thermo package),...
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Templated parcel single phase, multi-component class.
virtual const scalarField & YMixture0() const
Return the list of mixture mass fractions.
virtual ~SinglePhaseMixture()
Destructor.
virtual label idGas() const
Gas id.
virtual label idLiquid() const
Liquid id.
virtual label idSolid() const
Solid id.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
errorManip< error > abort(error &err)
Definition: errorManip.H:144
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
dictionary dict