30 template<
class Specie>
50 template<
class Specie>
65 template<
class Specie>
76 template<
class Specie>
87 template<
class Specie>
103 template<
class Specie>
110 return rho0_*
pow((p + B_)/(p0_ + B_), 1.0/gamma_);
114 template<
class Specie>
125 template<
class Specie>
136 template<
class Specie>
143 scalar
n = 1 - 1.0/gamma_;
145 -
pow(p0_ + B_, 1.0/gamma_)*(
pow((p + B_), n) -
pow((
Pstd + B_), n))
150 template<
class Specie>
158 (rho0_/(gamma_*(p0_ + B_)))
159 *
pow((p + B_)/(p0_ + B_), 1.0/gamma_ - 1.0);
163 template<
class Specie>
170 template<
class Specie>
183 template<
class Specie>
184 inline void Foam::adiabaticPerfectFluid<Specie>::operator+=
189 scalar molr1 = this->nMoles();
191 Specie::operator+=(pf);
193 molr1 /= this->nMoles();
194 scalar molr2 = pf.nMoles()/this->nMoles();
196 p0_ = molr1*p0_ + molr2*pf.p0_;
197 rho0_ = molr1*rho0_ + molr2*pf.rho0_;
198 gamma_ = molr1*gamma_ + molr2*pf.gamma_;
199 B_ = molr1*B_ + molr2*pf.B_;
203 template<
class Specie>
204 inline void Foam::adiabaticPerfectFluid<Specie>::operator-=
209 scalar molr1 = this->nMoles();
211 Specie::operator-=(pf);
213 molr1 /= this->nMoles();
214 scalar molr2 = pf.nMoles()/this->nMoles();
216 p0_ = molr1*p0_ - molr2*pf.p0_;
217 rho0_ = molr1*rho0_ - molr2*pf.rho0_;
218 gamma_ = molr1*gamma_ - molr2*pf.gamma_;
219 B_ = molr1*B_ - molr2*pf.B_;
223 template<
class Specie>
226 Specie::operator*=(s);
232 template<
class Specie>
239 scalar nMoles = pf1.nMoles() + pf2.nMoles();
240 scalar molr1 = pf1.nMoles()/nMoles;
241 scalar molr2 = pf2.nMoles()/nMoles;
245 static_cast<const Specie&
>(pf1)
246 + static_cast<const Specie&>(pf2),
247 molr1*pf1.p0_ + molr2*pf2.p0_,
248 molr1*pf1.rho0_ + molr2*pf2.rho0_,
249 molr1*pf1.gamma_ + molr2*pf2.gamma_,
250 molr1*pf1.B_ + molr2*pf2.B_
255 template<
class Specie>
262 scalar nMoles = pf1.nMoles() + pf2.nMoles();
263 scalar molr1 = pf1.nMoles()/nMoles;
264 scalar molr2 = pf2.nMoles()/nMoles;
268 static_cast<const Specie&
>(pf1)
269 - static_cast<const Specie&>(pf2),
270 molr1*pf1.p0_ - molr2*pf2.p0_,
271 molr1*pf1.rho0_ - molr2*pf2.rho0_,
272 molr1*pf1.gamma_ - molr2*pf2.gamma_,
273 molr1*pf1.B_ - molr2*pf2.B_
278 template<
class Specie>
287 s*
static_cast<const Specie&
>(pf),
296 template<
class Specie>
A list of keyword definitions, which are a keyword followed by any number of values (e...
adiabaticPerfectFluid(const Specie &sp, const scalar p0, const scalar rho0, const scalar gamma, const scalar B)
Construct from components.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
scalar cpMcv(scalar p, scalar T) const
Return (cp - cv) [J/(kmol K].
scalar psi(scalar p, scalar T) const
Return compressibility rho/p [s^2/m^2].
scalar Z(scalar p, scalar T) const
Return compression factor [].
static autoPtr< adiabaticPerfectFluid > New(Istream &is)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().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))
A class for handling words, derived from string.
scalar s(const scalar p, const scalar T) const
Return entropy [J/(kmol K)].
autoPtr< adiabaticPerfectFluid > clone() const
Construct and return a clone.
const dimensionedScalar Pstd
Standard pressure.
scalar rho(scalar p, scalar T) const
Return density [kg/m^3].
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
scalar cp(scalar p, scalar T) const
Return cp departure [J/(kmol K].
AdiabaticPerfect gas equation of state.
scalar h(const scalar p, const scalar T) const
Return enthalpy departure [J/kmol].
void operator*=(const scalar)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
RhoConst (rho = const) of state.