icoPolynomialI.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) 2011-2023 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 \*---------------------------------------------------------------------------*/
25 
26 #include "icoPolynomial.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class Specie, int PolySize>
32 (
33  const Specie& sp,
34  const Polynomial<PolySize>& rhoCoeffs
35 )
36 :
37  Specie(sp),
38  rhoCoeffs_(rhoCoeffs)
39 {}
40 
41 
42 template<class Specie, int PolySize>
44 (
45  const word& name,
47 )
48 :
49  Specie(name, ip),
50  rhoCoeffs_(ip.rhoCoeffs_)
51 {}
52 
53 
54 template<class Specie, int PolySize>
57 {
59  (
61  );
62 }
63 
64 
65 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
66 
67 template<class Specie, int PolySize>
69 (
70  scalar p,
71  scalar T
72 ) const
73 {
74  return rhoCoeffs_.value(T);
75 }
76 
77 
78 template<class Specie, int PolySize>
80 (
81  scalar p,
82  scalar T
83 ) const
84 {
85  return p/this->rho(p, T);
86 }
87 
88 
89 template<class Specie, int PolySize>
91 (
92  scalar p,
93  scalar T
94 ) const
95 {
96  return 0;
97 }
98 
99 
100 template<class Specie, int PolySize>
102 (
103  scalar p,
104  scalar T
105 ) const
106 {
107  return 0;
108 }
109 
110 
111 template<class Specie, int PolySize>
113 (
114  scalar p,
115  scalar T
116 ) const
117 {
118  return 0;
119 }
120 
121 
122 template<class Specie, int PolySize>
124 (
125  scalar p,
126  scalar T
127 ) const
128 {
129  return 0;
130 }
131 
132 
133 template<class Specie, int PolySize>
135 (
136  scalar p,
137  scalar T
138 ) const
139 {
140  return 0;
141 }
142 
143 
144 template<class Specie, int PolySize>
146 (
147  scalar p,
148  scalar T
149 ) const
150 {
151  return 0;
152 }
153 
154 
155 template<class Specie, int PolySize>
157 (
158  scalar p,
159  scalar T
160 ) const
161 {
162  return p/(rho(p, T)*this->R()*T);
163 }
164 
165 
166 template<class Specie, int PolySize>
168 (
169  scalar p,
170  scalar T
171 ) const
172 {
173  return 0;
174 }
175 
176 
177 template<class Specie, int PolySize>
179 (
180  scalar p,
181  scalar T
182 ) const
183 {
184  return -rhoCoeffs_.derivative(T)/rho(p, T);
185 }
186 
187 
188 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
189 
190 template<class Specie, int PolySize>
192 (
194 )
195 {
197 }
198 
199 
200 template<class Specie, int PolySize>
202 {
203  Specie::operator*=(s);
204 }
205 
206 
207 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
208 
209 template<class Specie, int PolySize>
211 (
214 )
215 {
217  return ip1;
218 }
219 
220 
221 template<class Specie, int PolySize>
223 (
224  const scalar s,
225  const icoPolynomial<Specie, PolySize>& ip
226 )
227 {
228  return icoPolynomial<Specie, PolySize>
229  (
230  s*static_cast<const Specie&>(ip),
231  ip.rhoCoeffs_
232  );
233 }
234 
235 
236 template<class Specie, int PolySize>
238 (
239  const icoPolynomial<Specie, PolySize>& ip1,
240  const icoPolynomial<Specie, PolySize>& ip2
241 )
242 {
243  noCoefficientMixing(icoPolynomial);
244  return ip1;
245 }
246 
247 
248 // ************************************************************************* //
Polynomial templated on size (order):
Definition: Polynomial.H:84
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Incompressible, polynomial form of equation of state, using a polynomial function for density.
scalar Cv(scalar p, scalar T) const
Return Cv contribution [J/(kg K].
scalar psi(scalar p, scalar T) const
Return compressibility [s^2/m^2].
scalar alphav(const scalar p, const scalar T) const
Return volumetric coefficient of thermal expansion [1/T].
icoPolynomial(const Specie &sp, const Polynomial< PolySize > &rhoPoly)
Construct from components.
scalar e(const scalar p, const scalar T) const
Return internal energy contribution [J/kg].
scalar rho(scalar p, scalar T) const
Return density [kg/m^3].
autoPtr< icoPolynomial > clone() const
Construct and return a clone.
scalar CpMCv(scalar p, scalar T) const
Return (Cp - Cv) [J/(kg K].
scalar h(const scalar p, const scalar T) const
Return enthalpy contribution [J/kg].
scalar Cp(scalar p, scalar T) const
Return Cp contribution [J/(kg K].
scalar sv(const scalar p, const scalar T) const
Return entropy contribution to the integral of Cv/T [J/kg/K].
scalar sp(const scalar p, const scalar T) const
Return entropy contribution to the integral of Cp/T [J/kg/K].
scalar Z(scalar p, scalar T) const
Return compression factor [].
void operator*=(const scalar)
A class for handling words, derived from string.
Definition: word.H:62
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.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
static scalar R(const scalar a, const scalar x)
Definition: invIncGamma.C:102
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
volScalarField & p
#define noCoefficientMixing(Type)
Definition: specie.H:159