singleComponentMixture.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::singleComponentMixture
26 
27 Description
28  Single component mixture
29 
30 SourceFiles
31  singleComponentMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef singleComponentMixture_H
36 #define singleComponentMixture_H
37 
38 #include "basicSpecieMixture.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class singleComponentMixture Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class ThermoType>
51 :
52  public basicSpecieMixture
53 {
54  // Private Data
55 
56  //- Thermo model
57  ThermoType thermo_;
58 
59 
60 public:
61 
62  //- The type of thermodynamics this mixture is instantiated for
63  typedef ThermoType thermoType;
64 
65 
66  // Constructors
67 
68  //- Construct from dictionary, mesh and phase name
69  singleComponentMixture(const dictionary&, const fvMesh&, const word&);
70 
71 
72  //- Destructor
73  virtual ~singleComponentMixture();
74 
75 
76  // Member Functions
77 
78  //- Return the instantiated type name
79  // Note: This defines the same name as pureMixture so that
80  // non-reacting and reacting solvers are compatible
81  static word typeName()
82  {
83  return "pureMixture<" + ThermoType::typeName() + '>';
84  }
85 
86  //- Get the mixture for the given cell
87  const ThermoType& cellMixture(const label celli) const
88  {
89  return thermo_;
90  }
91 
92  //- Get the mixture for the given patch face
93  const ThermoType& patchFaceMixture
94  (
95  const label patchi,
96  const label facei
97  ) const
98  {
99  return thermo_;
100  }
101 
102  //- Get the volumetric mixture for the given cell
103  const ThermoType& cellVolMixture
104  (
105  const scalar p,
106  const scalar T,
107  const label celli
108  )
109  {
110  return thermo_;
111  }
112 
113  //- Get the volumetric mixture for the given patch face
114  const ThermoType& patchFaceVolMixture
115  (
116  const scalar p,
117  const scalar T,
118  const label patchi,
119  const label facei
120  ) const
121  {
122  return thermo_;
123  }
124 
125  //- Read dictionary
126  void read(const dictionary&);
127 
128  //- Return thermo based on index
129  inline const ThermoType& getLocalThermo(const label speciei) const
130  {
131  #ifdef FULLDEBUG
132  if (speciei != 0)
133  {
135  << "Specie index must be zero for a single component "
136  << "mixture" << exit(FatalError);
137  }
138  #endif
139  return thermo_;
140  }
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #ifdef NoRepository
151  #include "singleComponentMixture.C"
152 #endif
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
void read(const dictionary &)
Read dictionary.
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
Specialization of basicMultiComponentMixture for a mixture consisting of a number for molecular speci...
virtual ~singleComponentMixture()
Destructor.
static word typeName()
Return the instantiated type name.
A class for handling words, derived from string.
Definition: word.H:59
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Get the mixture for the given patch face.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const ThermoType & cellMixture(const label celli) const
Get the mixture for the given cell.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const ThermoType & cellVolMixture(const scalar p, const scalar T, const label celli)
Get the volumetric mixture for the given cell.
singleComponentMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
volScalarField & p
const ThermoType & patchFaceVolMixture(const scalar p, const scalar T, const label patchi, const label facei) const
Get the volumetric mixture for the given patch face.
Single component mixture.
Namespace for OpenFOAM.