singleComponentMixture.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 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::singleComponentMixture
28 
29 Description
30  Single component mixture
31 
32 SourceFiles
33  singleComponentMixture.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef singleComponentMixture_H
38 #define singleComponentMixture_H
39 
40 #include "basicSpecieMixture.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class singleComponentMixture Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class ThermoType>
53 :
54  public basicSpecieMixture
55 {
56  // Private data
57 
58  //- Thermo model
59  ThermoType thermo_;
60 
61 
62 public:
63 
64  //- The type of thermodynamics this mixture is instantiated for
65  typedef ThermoType thermoType;
66 
67 
68  // Constructors
69 
70  //- Construct from dictionary, mesh and phase name
72  (
73  const dictionary& thermoDict,
74  const fvMesh& mesh,
75  const word& phaseName
76  );
77 
78 
79  //- Destructor
80  virtual ~singleComponentMixture() = default;
81 
82 
83  // Member Functions
84 
85  //- Return the instantiated type name
86  // Note: This defines the same name as pureMixture so that
87  // non-reacting and reacting solvers are compatible
88  static word typeName()
89  {
90  return "pureMixture<" + ThermoType::typeName() + '>';
91  }
92 
93  //- Get the mixture for the given cell
94  const ThermoType& cellMixture(const label celli) const
95  {
96  return thermo_;
97  }
98 
99  //- Get the mixture for the given patch face
100  const ThermoType& patchFaceMixture
101  (
102  const label patchi,
103  const label facei
104  ) const
105  {
106  return thermo_;
107  }
108 
109  //- Get the volumetric mixture for the given cell
110  const ThermoType& cellVolMixture
111  (
112  const scalar p,
113  const scalar T,
114  const label celli
115  )
116  {
117  return thermo_;
118  }
119 
120  //- Get the volumetric mixture for the given patch face
121  const ThermoType& patchFaceVolMixture
122  (
123  const scalar p,
124  const scalar T,
125  const label patchi,
126  const label facei
127  ) const
128  {
129  return thermo_;
130  }
131 
132  //- Read dictionary
133  void read(const dictionary&);
134 
135  //- Return thermo based on index
136  inline const ThermoType& getLocalThermo(const label speciei) const
137  {
138  #ifdef FULLDEBUG
139  if (speciei != 0)
140  {
142  << "Specie index must be zero for a single component "
143  << "mixture" << exit(FatalError);
144  }
145  #endif
146  return thermo_;
147  }
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #ifdef NoRepository
158  #include "singleComponentMixture.C"
159 #endif
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
Foam::singleComponentMixture::typeName
static word typeName()
Return the instantiated type name.
Definition: singleComponentMixture.H:87
Foam::singleComponentMixture::singleComponentMixture
singleComponentMixture(const dictionary &thermoDict, const fvMesh &mesh, const word &phaseName)
Construct from dictionary, mesh and phase name.
Definition: singleComponentMixture.C:34
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::basicSpecieMixture
Specialization of basicMultiComponentMixture for a mixture consisting of a number for molecular speci...
Definition: basicSpecieMixture.H:58
Foam::singleComponentMixture::patchFaceMixture
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Get the mixture for the given patch face.
Definition: singleComponentMixture.H:100
Foam::singleComponentMixture::thermoType
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: singleComponentMixture.H:64
Foam::singleComponentMixture::cellVolMixture
const ThermoType & cellVolMixture(const scalar p, const scalar T, const label celli)
Get the volumetric mixture for the given cell.
Definition: singleComponentMixture.H:110
Foam::singleComponentMixture::cellMixture
const ThermoType & cellMixture(const label celli) const
Get the mixture for the given cell.
Definition: singleComponentMixture.H:93
Foam::singleComponentMixture::getLocalThermo
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
Definition: singleComponentMixture.H:135
singleComponentMixture.C
Foam::singleComponentMixture::patchFaceVolMixture
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.
Definition: singleComponentMixture.H:121
Foam::singleComponentMixture
Single component mixture.
Definition: singleComponentMixture.H:51
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::singleComponentMixture::~singleComponentMixture
virtual ~singleComponentMixture()=default
Destructor.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
thermoDict
const dictionary & thermoDict
Definition: EEqn.H:16
Foam::singleComponentMixture::read
void read(const dictionary &)
Read dictionary.
Definition: singleComponentMixture.C:49
basicSpecieMixture.H