PurePhaseModel.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) 2015-2018 OpenFOAM Foundation
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::PurePhaseModel
28 
29 Description
30  Class which represents pure phases, i.e. without any species. Returns an
31  empty list of mass fractions.
32 
33 SourceFiles
34  PurePhaseModel.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef PurePhaseModel_H
39 #define PurePhaseModel_H
40 
41 #include "phaseModel.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class PurePhaseModel Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class BasePhaseModel>
53 class PurePhaseModel
54 :
55  public BasePhaseModel
56 {
57 protected:
58 
59  // Protected data
60 
61  //- Empty mass fraction field list
62  PtrList<volScalarField> Y_;
63 
64 
65 public:
66 
67  // Constructors
68 
70  (
71  const phaseSystem& fluid,
72  const word& phaseName,
73  const label index
74  );
75 
76 
77  //- Destructor
78  virtual ~PurePhaseModel();
79 
80 
81  // Member Functions
82 
83  // Species
84 
85  //- Return whether the phase is pure (i.e., not multi-component)
86  virtual bool pure() const;
87 
88  //- Return the species fraction equation
89  virtual tmp<fvScalarMatrix> YiEqn(volScalarField& Yi);
90 
91  //- Return the species mass fractions
92  virtual const PtrList<volScalarField>& Y() const;
93 
94  //- Return a species mass fraction by name
95  virtual const volScalarField& Y(const word& name) const;
96 
97  //- Access the species mass fractions
98  virtual PtrList<volScalarField>& YRef();
99 
100  //- Return the active species mass fractions
101  virtual const UPtrList<volScalarField>& YActive() const;
102 
103  //- Access the active species mass fractions
104  virtual UPtrList<volScalarField>& YActiveRef();
105 };
106 
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 } // End namespace Foam
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 #ifdef NoRepository
115  #include "PurePhaseModel.C"
116 #endif
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #endif
121 
122 // ************************************************************************* //
twoPhaseSystem & fluid
PtrList< volScalarField > Y_
Empty mass fraction field list.
virtual PtrList< volScalarField > & YRef()
Access the species mass fractions.
PurePhaseModel(const multiphaseInterSystem &fluid, const word &phaseName)
virtual const UPtrList< volScalarField > & YActive() const
Return the active species mass fractions.
virtual const PtrList< volScalarField > & Y() const
Return the species mass fractions.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
virtual ~PurePhaseModel()=default
Destructor.
virtual bool pure() const
Return whether the phase is pure (i.e., not multi-component)
virtual tmp< fvScalarMatrix > YiEqn(volScalarField &Yi)
Return the species fraction equation.
virtual UPtrList< volScalarField > & YActiveRef()
Access the active species mass fractions.
Namespace for OpenFOAM.