MultiComponentPhaseModel.H
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) 2017 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
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 Class
27  Foam::MultiComponentPhaseModel
28 
29 Description
30  Class which represents a phase with multiple species. Returns the species'
31  mass fractions, and their governing equations.
32 
33 SourceFiles
34  MultiComponentPhaseModel.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef MultiComponentPhaseModel_H
39 #define MultiComponentPhaseModel_H
40 
41 #include "phaseModel.H"
42 #include "hashedWordList.H"
43 #include "rhoReactionThermo.H"
44 #include "basicThermo.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class phaseModel Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class BasePhaseModel, class phaseThermo>
57 :
58  public BasePhaseModel
59 {
60 protected:
61 
62  // Protected data
63 
64  //- Species table
66 
67  //- Inert species index
68  label inertIndex_;
69 
70  //- Thermophysical model
72 
73  //- Ptr list of volumetric fractions for species
75 
76 
77  // Protected functions
78 
79  //- Transfor volume fraction into mass fractions
81 
82  //- Transfor mass fraction into volume fractions
84 
85 
86 public:
87 
88  // Constructors
89 
91  (
92  const phaseSystem& fluid,
93  const word& phaseName
94  );
95 
96 
97  //- Destructor
98  virtual ~MultiComponentPhaseModel() = default;
99 
100 
101  // Member Functions
102 
103  // Access
104 
105  //- Species table
106  const hashedWordList& species() const
107  {
108  return species_;
109  }
110 
111 
112  // Thermo
113 
114  //- Access to thermo
115  virtual const phaseThermo& thermo() const;
116 
117  //- Access non-const thermo
118  virtual phaseThermo& thermo();
119 
120  //- Correct phase thermo
121  virtual void correct();
122 
123  //- Solve species fraction equation
124  virtual void solveYi
125  (
128  );
129 
130  //- Constant access the species mass fractions
131  virtual const PtrList<volScalarField>& Y() const;
132 
133  //- Access the species mass fractions
134  virtual PtrList<volScalarField>& Y();
135 
136  //- Return inert species index
137  label inertIndex() const;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #ifdef NoRepository
148 # include "MultiComponentPhaseModel.C"
149 #endif
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
basicThermo.H
Foam::MultiComponentPhaseModel::thermoPtr_
autoPtr< phaseThermo > thermoPtr_
Definition: MultiComponentPhaseModel.H:66
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:63
Foam::MultiComponentPhaseModel::solveYi
virtual void solveYi(PtrList< volScalarField::Internal > &, PtrList< volScalarField::Internal > &)
Definition: MultiComponentPhaseModel.C:195
Foam::MultiComponentPhaseModel::~MultiComponentPhaseModel
virtual ~MultiComponentPhaseModel()=default
Definition: MultiComponentPhaseModel.C:86
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
Foam::MultiComponentPhaseModel::inertIndex_
label inertIndex_
Definition: MultiComponentPhaseModel.H:63
Foam::MultiComponentPhaseModel::Y
virtual const PtrList< volScalarField > & Y() const
Definition: MultiComponentPhaseModel.C:405
Foam::MultiComponentPhaseModel
Class which represents a phase with multiple species. Returns the species' mass fractions,...
Definition: MultiComponentPhaseModel.H:51
Foam::MultiComponentPhaseModel::thermo
virtual const phaseThermo & thermo() const
Definition: MultiComponentPhaseModel.C:172
Foam::MultiComponentPhaseModel::calculateMassFractions
void calculateMassFractions()
Definition: MultiComponentPhaseModel.C:150
Foam::MultiComponentPhaseModel::MultiComponentPhaseModel
MultiComponentPhaseModel(const phaseSystem &fluid, const word &phaseName)
Definition: MultiComponentPhaseModel.C:42
rhoReactionThermo.H
Foam::MultiComponentPhaseModel::inertIndex
label inertIndex() const
Definition: MultiComponentPhaseModel.C:421
Foam::hashedWordList
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Definition: hashedWordList.H:50
Foam::MultiComponentPhaseModel::correct
virtual void correct()
Definition: MultiComponentPhaseModel.C:187
Foam::MultiComponentPhaseModel::X_
PtrList< volScalarField > X_
Definition: MultiComponentPhaseModel.H:69
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:55
Foam::MultiComponentPhaseModel::species_
hashedWordList species_
Definition: MultiComponentPhaseModel.H:60
Foam
Definition: atmBoundaryLayer.C:26
Foam::autoPtr< phaseThermo >
hashedWordList.H
Foam::phaseSystem
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:62
Foam::MultiComponentPhaseModel::calculateVolumeFractions
void calculateVolumeFractions()
Definition: MultiComponentPhaseModel.C:105
Foam::MultiComponentPhaseModel::species
const hashedWordList & species() const
Definition: MultiComponentPhaseModel.H:101