16#include <Loi_Etat_rhoT_GR_QC.h>
18#include <Fluide_Quasi_Compressible.h>
19#include <Champ_Uniforme.h>
35 double PolyRho_lu=-1, PolyT_lu=-1, MMole_lu=-1, Pr_lu=-1;
38 Motcle accouverte=
"{";
42 Cerr<<
"Reading the real gas state law rhoT"<<finl;
43 if (motlu != accouverte)
45 Cerr<<
" Expected "<<accouverte<<
" instead of "<<motlu<<finl;
50 les_mots[0] =
"Prandtl";
51 les_mots[1] =
"masse_molaire";
52 les_mots[2] =
"Poly_rho";
53 les_mots[3] =
"Poly_T";
57 while(motlu != accferme )
59 int rang=les_mots.search(motlu);
80 for (i=0 ; i<im ; i++)
81 for (j=0 ; j<jm ; j++)
92 for (i=0 ; i<im ; i++)
93 for (j=0 ; j<jm ; j++)
111 R =
Cp_ *(1.-1./1.4);
112 Cerr<<
"Debogage Gaz Reel : Cp="<<
Cp_<<
" R="<<
R<<finl;
117 Cerr<<
"An equation of state "<<
que_suis_je()<<
" does not have the property "<<motlu<<finl;
118 Cerr<<
"Expected a keyword in:"<<finl<<les_mots<<finl;
127 Cerr<<
"ERROR: expected the definition of the Prandtl number (Prandtl pr)"<<finl;
132 Cerr<<
"ERROR: expected the definition of the density polynomial (Poly_Rho nb_coeff1 nb_coeff2 a00 a01 a02 ...)"<<finl;
138 Cerr<<
"Polynomial for rho:"<<finl;
139 for (i=0 ; i<
PolyRho_.dimension(0) ; i++)
141 for (j=0 ; j<
PolyRho_.dimension(1) ; j++)
143 Cerr<<
" f("<<i<<
","<<j<<
")= "<<
PolyRho_(i,j);
150 Cerr<<
"ERROR: expected the definition of the temperature polynomial (Poly_T nb_coeff1 nb_coeff2 a00 a01 a02 ...)"<<finl;
156 Cerr<<
"Polynomial for T:"<<finl;
157 for (i=0 ; i<
PolyT_.dimension(0) ; i++)
159 for (j=0 ; j<
PolyT_.dimension(1) ; j++)
161 Cerr<<
" f("<<i<<
","<<j<<
")= "<<
PolyT_(i,j);
168 Cerr<<
"ERROR: expected the definition of the molar mass (masse_molaire m)"<<finl;
187 for (i=0 ; i<
PolyRho_.dimension(0) ; i++)
188 for (j=0 ; j<
PolyRho_.line_size() ; j++)
189 res +=
PolyRho_(i,j) *pow(P,j) *pow(H,i);
212 for (i=0 ; i<
PolyT_.dimension(0) ; i++)
213 for (j=0 ; j<
PolyT_.line_size() ; j++)
214 res +=
PolyT_(i,j) *pow(P,i) *pow(H,j);
233 int i,j, it,max_iter = 1000;
235 DoubleVect coef(
PolyT_.line_size());
238 for (i=0 ; i<
PolyT_.dimension(0) ; i++)
239 for (j=0 ; j<
PolyT_.line_size() ; j++)
240 coef(j) +=
PolyT_(i,j) * pow(Pth_,i);
243 double dH, H = -coef(0)/coef(1), num=coef(0), den=0;
244 for (j=1 ; j<
PolyT_.line_size() ; j++)
246 num += coef(j) * pow(H,j);
247 den += j*coef(j) * pow(H,j-1);
253 while (dH/H>eps && it<max_iter)
257 for (j=1 ; j<
PolyT_.line_size() ; j++)
259 num += coef(j) * pow(H,j);
260 den += j*coef(j) * pow(H,j-1);
269 Cerr<<
"Problem in Loi_Etat_rhoT_GR_QC::calculer_H: Newton resolution not possible "<<finl;
270 Cerr<<
"Pth= "<<Pth_<<
" t="<<T_<<
" H="<<H<<finl;
290 for (i=1 ; i<
PolyRho_.dimension(0) ; i++)
291 for (j=0 ; j<
PolyRho_.line_size() ; j++)
292 res += i*
PolyRho_(i,j) *pow(P,i-1) *pow(H,j);
310 for (i=1 ; i<
PolyRho_.dimension(0) ; i++)
311 for (j=0 ; j<
PolyRho_.line_size() ; j++)
312 res += i*
PolyRho_(i,j) *pow(P,j) *pow(H,i-1);
317 res = -P*
Cp_/(
R*h*h);
329 for (i=0 ; i<
PolyT_.dimension(0) ; i++)
330 for (j=1 ; j<
PolyT_.line_size() ; j++)
331 res += j*
PolyT_(i,j) *pow(P,i) *pow(H,j-1);
Class defining operators and methods for all reading operation in an input flow (file,...
Base state law class for real gases, defining a dilatable fluid with the equations of state: rho = rh...
void calculer_masse_volumique() override
Recomputes the density (masse volumique).
State law class for real gases in the quasi-compressible (QC) framework.
double Drho_DP(double, double) const override
double Drho_DT(double, double) const override
double calculer_temperature(double, double) override
Computes the pointwise temperature.
double calculer_H(double, double) const override
Real gas case: recomputes enthalpy from pressure and temperature.
double DT_DH(double, double) const override
void calculer_masse_volumique() override
Recomputes the density (masse volumique).
const Nom & que_suis_je() const
Returns the string identifying the class.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
static void abort()
Abort routine for TRUST on a fatal error.
Base class for output streams.