incompressiblePerfectGasI.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) 2012-2017 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
29
30// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31
32template<class Specie>
34(
35 const Specie& sp,
36 const scalar pRef
37)
38:
39 Specie(sp),
40 pRef_(pRef)
41{}
42
43
44template<class Specie>
46(
47 const word& name,
49)
50:
51 Specie(name, ipg),
52 pRef_(ipg.pRef_)
53{}
54
55
56template<class Specie>
59{
61}
62
63
64template<class Specie>
67(
68 const dictionary& dict
69)
70{
72}
73
74
75// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
76
77template<class Specie>
79(
80 scalar p,
81 scalar T
82) const
83{
84 return pRef_/(this->R()*T);
85}
86
87
88template<class Specie>
90(
91 scalar p,
92 scalar T
93) const
94{
95 return 0;
96}
97
98
99template<class Specie>
101(
102 scalar p,
103 scalar T
104) const
105{
106 return 0;
107}
108
109
110template<class Specie>
112(
113 scalar p,
114 scalar T
115) const
116{
117 return 0;
118}
119
120
121template<class Specie>
123(
124 scalar p,
125 scalar T
126) const
127{
128 return 0;
129}
130
131
132template<class Specie>
134(
135 scalar p,
136 scalar T
137) const
138{
139 return 0;
140}
141
142
143template<class Specie>
145(
146 scalar p,
147 scalar T
148) const
149{
150 return 0;
151}
152
153
154template<class Specie>
156(
157 scalar p,
158 scalar T
159) const
160{
161 return 0;
162}
163
164
165template<class Specie>
167(
168 scalar p,
169 scalar T
170) const
171{
172 return 0;
173}
174
175
176// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
177
178template<class Specie>
180(
182)
183{
184 scalar Y1 = this->Y();
185 Specie::operator+=(ipg);
186
187 if (mag(this->Y()) > SMALL)
188 {
189 Y1 /= this->Y();
190 const scalar Y2 = ipg.Y()/this->Y();
191
192 pRef_ = Y1*pRef_ + Y2*ipg.pRef_;
193 }
194}
195
196
197template<class Specie>
199{
200 Specie::operator*=(s);
201}
202
203
204// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
205
206template<class Specie>
207inline Foam::incompressiblePerfectGas<Specie> Foam::operator+
208(
211)
212{
213 Specie sp
214 (
215 static_cast<const Specie&>(ipg1)
216 + static_cast<const Specie&>(ipg2)
217 );
218
219 if (mag(sp.Y()) < SMALL)
220 {
222 (
223 sp,
224 ipg1.pRef_
225 );
226 }
227 else
228 {
229 const scalar Y1 = ipg1.Y()/sp.Y();
230 const scalar Y2 = ipg2.Y()/sp.Y();
231
232 return incompressiblePerfectGas<Specie>
233 (
234 sp,
235 Y1*ipg1.pRef_ + Y2*ipg2.pRef_
236 );
237 }
238}
239
240
241template<class Specie>
242inline Foam::incompressiblePerfectGas<Specie> Foam::operator*
243(
244 const scalar s,
245 const incompressiblePerfectGas<Specie>& ipg
246)
247{
248 return incompressiblePerfectGas<Specie>
249 (
250 s*static_cast<const Specie&>(ipg),
251 ipg.pRef_
252 );
253}
254
255
256template<class Specie>
257inline Foam::incompressiblePerfectGas<Specie> Foam::operator==
258(
259 const incompressiblePerfectGas<Specie>& ipg1,
260 const incompressiblePerfectGas<Specie>& ipg2
261)
262{
263 Specie sp
264 (
265 static_cast<const Specie&>(ipg1)
266 == static_cast<const Specie&>(ipg2)
267 );
268
269 const scalar Y1 = ipg1.Y()/sp.Y();
270 const scalar Y2 = ipg2.Y()/sp.Y();
271
272 return incompressiblePerfectGas<Specie>
273 (
274 sp,
275 Y2*ipg2.pRef_ - Y1*ipg1.pRef_
276 );
277}
278
279
280// ************************************************************************* //
#define R(A, B, C, D, E, F, K, M)
compactSpatialTensor S
The joint motion sub-space (3-DoF)
Definition: joint.H:132
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
tmp< GeometricField< Type, faPatchField, areaMesh > > H() const
Return the H operation source.
Definition: faMatrix.C:633
Incompressible gas equation of state using a constant reference pressure in the perfect gas equation ...
autoPtr< incompressiblePerfectGas > clone() const
Construct and return a clone.
scalar CpMCv(scalar p, scalar T) const
Return (Cp - Cv) [J/(kg K].
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
PtrList< volScalarField > & Y
const volScalarField & psi
const volScalarField & T
const volScalarField & Cv
Definition: EEqn.H:8
const volScalarField & Cp
Definition: EEqn.H:7
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
dictionary dict