29 #ifndef __EOS_BIFLUID_H_ 30 #define __EOS_BIFLUID_H_ 143 #include "utilitaires.h" 154 #define MAX_EOSNAME 100 205 explicit Eos_bifluid(
const char* name_i,
double mass1,
double mass2) ;
315 virtual void sauve(FILE* )
const ;
321 virtual ostream&
operator>>(ostream &)
const = 0 ;
349 int nzet,
int l_min = 0)
const ;
363 virtual bool nbar_ent_p(
const double ent1,
const double ent2,
364 const double delta2,
double& nbar1,
365 double& nbar2)
const = 0 ;
373 virtual double nbar_ent_p1(
const double ent1)
const = 0 ;
381 virtual double nbar_ent_p2(
const double ent2)
const = 0 ;
404 Cmp& nbar1,
Cmp& nbar2,
int nzet,
int l_min = 0)
419 virtual double ener_nbar_p(
const double nbar1,
const double nbar2,
420 const double delta2)
const = 0 ;
442 int nzet,
int l_min = 0)
const ;
456 virtual double press_nbar_p(
const double nbar1,
const double nbar2,
457 const double delta2)
const = 0 ;
478 int nzet,
int l_min = 0)
const ;
496 virtual double get_K11(
const double n1,
const double n2,
const 497 double x)
const = 0 ;
515 virtual double get_K12(
const double n1,
const double n2,
const 516 double x)
const = 0 ;
533 virtual double get_K22(
const double n1,
const double n2,
const 534 double x)
const = 0 ;
559 int nzet,
int l_min = 0)
const ;
584 x2,
int nzet,
int l_min = 0)
const ;
610 int nzet,
int l_min = 0)
const ;
636 x2,
int nzet,
int l_min,
double 637 (
Eos_bifluid::*fait)(
double,
double,
double)
const,
655 ostream& operator<<(ostream& ,
const Eos_bifluid& ) ;
832 Eos_bf_poly(
double kappa1,
double kappa2,
double kappa3,
double beta) ;
860 Eos_bf_poly(
double gamma1,
double gamma2,
double gamma3,
861 double gamma4,
double gamma5,
double gamma6,
862 double kappa1,
double kappa2,
double kappa3,
863 double beta,
double mass1=1,
double mass2=1,
865 double ecart = 1.e-8) ;
956 int get_typeos()
const {
return typeos;};
971 virtual void sauve(FILE* )
const ;
974 virtual ostream&
operator>>(ostream &)
const ;
993 virtual bool nbar_ent_p(
const double ent1,
const double ent2,
994 const double delta2,
double& nbar1,
995 double& nbar2)
const ;
1002 virtual double nbar_ent_p1(
const double ent1)
const ;
1009 virtual double nbar_ent_p2(
const double ent2)
const ;
1022 virtual double ener_nbar_p(
const double nbar1,
const double nbar2,
1023 const double delta2)
const ;
1036 virtual double press_nbar_p(
const double nbar1,
const double nbar2,
1037 const double delta2)
const ;
1064 virtual double get_K11(
const double n1,
const double n2,
const 1065 double delta2)
const ;
1082 virtual double get_K12(
const double n1,
const double n2,
const 1083 double delta2)
const ;
1099 virtual double get_K22(
const double n1,
const double n2,
const 1100 double delta2)
const ;
1220 double gamma4,
double gamma5,
double gamma6,
1221 double kappa1,
double kappa2,
double kappa3,
1222 double beta,
double mass1,
double mass2,
1224 double ecart = 1.e-8) ;
1277 virtual void sauve(FILE* )
const ;
1280 virtual ostream&
operator>>(ostream &)
const ;
1299 virtual bool nbar_ent_p(
const double ent1,
const double ent2,
1300 const double delta2,
double& nbar1,
1301 double& nbar2)
const ;
1309 virtual double nbar_ent_p1(
const double ent1)
const ;
1316 virtual double nbar_ent_p2(
const double ent2)
const ;
1329 virtual double ener_nbar_p(
const double nbar1,
const double nbar2,
1330 const double delta2)
const ;
1343 virtual double press_nbar_p(
const double nbar1,
const double nbar2,
1344 const double delta2)
const ;
1371 virtual double get_K11(
const double n1,
const double n2,
const 1372 double delta2)
const ;
1389 virtual double get_K12(
const double n1,
const double n2,
const 1390 double delta2)
const ;
1406 virtual double get_K22(
const double n1,
const double n2,
const 1407 double delta2)
const ;
1527 Eos_bf_tabul(
const char* name_i,
const char* table,
const char* path,
double mass1,
double mass2) ;
1537 Eos_bf_tabul(
const char* name_i,
const char* file_name,
double mass1,
double mass2) ;
1617 virtual void sauve(FILE* )
const ;
1621 virtual ostream&
operator>>(ostream &)
const ;
1656 int nzet,
int l_min = 0)
const ;
1669 virtual bool nbar_ent_p(
const double ent1,
const double ent2,
1670 const double delta2,
double& nbar1,
1671 double& nbar2)
const ;
1678 virtual double nbar_ent_p1(
const double ent1)
const ;
1685 virtual double nbar_ent_p2(
const double ent2)
const ;
1698 virtual double ener_nbar_p(
const double nbar1,
const double nbar2,
1699 const double delta2)
const ;
1712 virtual double press_nbar_p(
const double nbar1,
const double nbar2,
1713 const double delta2)
const ;
1727 virtual double get_K11(
const double delta2,
const double ent1,
1728 const double ent2)
const ;
1742 virtual double get_K12(
const double delta2,
const double ent1 ,
1743 const double ent2)
const ;
1756 virtual double get_K22(
const double delta2,
const double ent1,
1757 const double ent2)
const ;
1769 virtual double ener_ent_p(
const double ent1,
const double ent2,
1770 const double delta_car)
const ;
1782 virtual double press_ent_p(
const double ent1,
const double ent2,
1783 const double delta_car)
const ;
1795 virtual double alpha_ent_p(
const double ent1,
const double ent2,
1796 const double delta_car)
const ;
1816 const double mu2,
double& press,
double& nbar1,
double& nbar2,
double& alpha)
const ;
1824 const Tbl& ftab,
const Tbl& dfdytab,
const Tbl& dfdztab,
const Tbl& d2fdydztab,
1825 const double y,
const double z,
double& f,
double& dfdy,
double& dfdz)
const ;
Cmp get_Kpp(const Cmp &nbar1, const Cmp &nbar2, const Cmp &x2, int nzet, int l_min=0) const
Computes the derivatives of the energy/(baryonic density 2) .
virtual double get_K12(const double n1, const double n2, const double x) const =0
Computes the derivative of the energy with respect to .
virtual bool operator!=(const Eos_bifluid &) const
Comparison operator (difference)
virtual double get_K12(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy with respect to .
double get_m2() const
Return the individual particule mass .
double mu1_max
Upper boundary of the chemical-potential interval (fluid 1 = n)
virtual bool operator!=(const Eos_bifluid &) const =0
Comparison operator (difference)
virtual void sauve(FILE *) const
Save in a file.
virtual double get_K22(const double n1, const double n2, const double x) const =0
Computes the derivative of the energy/(baryonic density 2) .
double m_1
Individual particle mass [unit: ].
void calcule_interpol(const Cmp &ent1, const Cmp &ent2, const Cmp &delta2, Cmp &nbar1, Cmp &nbar2, Cmp &ener, Cmp &press, Cmp &K_nn, Cmp &K_np, Cmp &K_pp, Cmp &alpha_eos, int nzet, int l_min=0) const
General computational method for Cmp 's, it computes both baryon densities, energy and pressure profi...
double get_gam5() const
Returns the adiabatic index .
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
double kap2
Pressure coefficient , see Eq.
Cmp press_ent(const Cmp &ent1, const Cmp &ent2, const Cmp &delta2, int nzet, int l_min=0) const
Computes the pressure from the log-enthalpy fields and the relative velocity.
virtual double nbar_ent_p1(const double ent1) const =0
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present (virtual functio...
virtual double ener_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the total energy density from the baryonic densities and the relative velocity.
double relax
Parameters needed for some inversions of the EOS.
double get_kap2() const
Returns the pressure coefficient [unit: ], where .
void operator=(const Eos_bf_poly_newt &)
Assignment to another Eos_bf_poly_newt.
virtual bool operator==(const Eos_bifluid &) const
Comparison operator (egality)
Equation of state base class.
virtual int identify() const =0
Returns a number to identify the sub-classe of Eos_bifluid the object belongs to.
virtual ostream & operator>>(ostream &) const
Operator >>
Cmp ener_ent(const Cmp &ent1, const Cmp &ent2, const Cmp &delta2, int nzet, int l_min=0) const
Computes the total energy density from the log-enthalpy fields and the relative velocity.
void operator=(const Eos_bf_poly &)
Assignment to another Eos_bf_poly.
virtual double get_K12(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy with respect to .
Analytic equation of state for two fluids (relativistic case).
virtual bool nbar_ent_p(const double ent1, const double ent2, const double delta2, double &nbar1, double &nbar2) const
Computes both baryon densities from the log-enthalpies.
Tbl * dn1sddelta_car_tab
Table of .
double get_kap3() const
Returns the pressure coefficient [unit: ], where .
Tbl * dn2sddelta_car_tab
Table of .
Eos_bf_poly_newt(double kappa1, double kappa2, double kappa3, double beta)
Standard constructor.
virtual double nbar_ent_p1(const double ent1) const
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present.
void determine_type()
Determines the type of the analytical EOS (see typeos )
virtual double get_K11(const double delta2, const double ent1, const double ent2) const
Computes the derivative of the energy with respect to (baryonic density 1) .
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
virtual Eos * trans2Eos() const
Makes a translation from Eos_bifluid to Eos .
virtual ~Eos_bf_poly()
Destructor.
void operator=(const Eos_bifluid &)
Assignment to another Eos_bifluid.
virtual double ener_ent_p(const double ent1, const double ent2, const double delta_car) const
Computes the total energy density from the baryonic log-enthalpies and the relative velocity...
virtual double alpha_ent_p(const double ent1, const double ent2, const double delta_car) const
Computes alpha, the derivative of the total energy density with respect to from the baryonic log-ent...
virtual ostream & operator>>(ostream &) const
Operator >>
virtual double get_K22(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy/(baryonic density 2) .
double ecart
contains the precision required in the relaxation nbar_ent_p
Tbl * mu2_tab
Table of where .
Tbl * mu1_tab
Table of where .
2-fluids equation of state base class.
int typeos
The bi-fluid analytical EOS type:
double get_gam4() const
Returns the adiabatic index .
double beta
Coefficient , see Eq.
Cmp get_Knn(const Cmp &nbar1, const Cmp &nbar2, const Cmp &x2, int nzet, int l_min=0) const
Computes the derivatives of the energy/(baryonic density 1) .
double get_gam1() const
Returns the adiabatic index .
virtual double get_K11(const double n1, const double n2, const double x) const =0
Computes the derivative of the energy with respect to (baryonic density 1) .
static Eos_bifluid * eos_from_file(FILE *)
Construction of an EOS from a binary file.
double m_2
Individual particle mass [unit: ].
virtual bool operator==(const Eos_bifluid &) const =0
Comparison operator (egality)
virtual Eos * trans2Eos() const =0
Makes a translation from Eos_bifluid to Eos .
virtual double nbar_ent_p2(const double ent2) const
Computes baryon density out of the log-enthalpy assuming that only fluid 2 is present.
void set_auxiliary()
Computes the auxiliary quantities gam1m1 , gam2m1 and gam3m1.
Eos_bifluid()
Standard constructor.
virtual ~Eos_bf_poly_newt()
Destructor.
virtual double csound_square_ent_p(double, const Param *) const
Computes the sound speed squared from the enthapy with extra parameters (virtual function implemente...
virtual ostream & operator>>(ostream &) const
Operator >>
virtual double ener_nbar_p(const double nbar1, const double nbar2, const double delta2) const =0
Computes the total energy density from the baryonic densities and the relative velocity.
double get_kap1() const
Returns the pressure coefficient [unit: ], where .
virtual double get_K11(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy with respect to (baryonic density 1) .
virtual double get_K22(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy/(baryonic density 2) .
virtual bool nbar_ent_p(const double ent1, const double ent2, const double delta2, double &nbar1, double &nbar2) const
Computes both baryon densities from the log-enthalpies.
Tbl * dpsddelta_car_tab
Table of .
void nbar_ent(const Cmp &ent1, const Cmp &ent2, const Cmp &delta2, Cmp &nbar1, Cmp &nbar2, int nzet, int l_min=0) const
Computes both baryon density fields from the log-enthalpy fields and the relative velocity...
virtual int identify() const
Returns a number to identify the sub-classe of Eos_bifluid the object belongs to.
double kap3
Pressure coefficient , see Eq.
double delta_car_min
Lower boundary of the relative velocity interval.
virtual bool nbar_ent_p(const double ent1, const double ent2, const double delta2, double &nbar1, double &nbar2) const =0
Computes both baryon densities from the log-enthalpies (virtual function implemented in the derived c...
virtual bool operator==(const Eos_bifluid &) const
Comparison operator (egality)
Tbl * d2psdmu1dmu2_tab
Table of .
Analytic equation of state for two fluids (Newtonian case).
virtual double get_K22(const double delta2, const double ent1, const double ent2) const
Computes the derivative of the energy/(baryonic density 2) .
virtual Eos * trans2Eos() const
Makes a translation from Eos_bifluid to Eos .
double get_gam2() const
Returns the adiabatic index .
virtual void sauve(FILE *) const
Save in a file.
virtual ~Eos_bf_tabul()
Destructor.
friend ostream & operator<<(ostream &, const Eos_bifluid &)
Display.
virtual void sauve(FILE *) const
Save in a file.
virtual double nbar_ent_p2(const double ent2) const =0
Computes baryon density out of the log-enthalpy assuming that only fluid 2 is present (virtual functi...
void read_table()
Reads the file containing the table and initializes the arrays mu1_tab, mu2_tab, delta_car_tab, press_tab, n1_tab, n2_tab, c\ d2psdmu1dmu2_tab , c\ dpsddelta_car_tab, c\ dn1sddelta_car_tab, c\ dn2sddelta_car_tab.
virtual double nbar_ent_p2(const double ent2) const
Computes baryon density out of the log-enthalpy assuming that only fluid 2 is present.
virtual bool operator!=(const Eos_bifluid &) const
Comparison operator (difference)
void calcule(const Cmp &nbar1, const Cmp &nbar2, const Cmp &x2, int nzet, int l_min, double(Eos_bifluid::*fait)(double, double, double) const, Cmp &resu) const
General computational method for Cmp 's ( 's).
virtual double press_nbar_p(const double nbar1, const double nbar2, const double delta2) const =0
Computes the pressure from the baryonic densities and the relative velocity.
virtual double press_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the pressure from the baryonic densities and the relative velocity.
virtual double nbar_ent_p1(const double ent1) const
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present (virtual functio...
double mu2_max
Upper boundary of the chemical-potential interval (fluid 2 = p)
virtual double press_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the pressure from the baryonic densities and the relative velocity.
virtual void sauve(FILE *) const
Save in a file.
double precis
contains the precision required in zerosec_b
virtual double press_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the pressure from the baryonic densities and the relative velocity.
virtual double ener_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the total energy density from the baryonic densities and the relative velocity.
virtual void calcule_tout(const Cmp &ent1, const Cmp &ent2, const Cmp &delta2, Cmp &nbar1, Cmp &nbar2, Cmp &ener, Cmp &press, int nzet, int l_min=0) const
General computational method for Cmp 's, it computes both baryon densities, energy and pressure profi...
virtual double press_ent_p(const double ent1, const double ent2, const double delta_car) const
Computes the pressure from the baryonic log-enthalpies and the relative velocity. ...
virtual bool operator!=(const Eos_bifluid &) const
Comparison operator (difference)
virtual double get_K11(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy with respect to (baryonic density 1) .
double get_gam6() const
Returns the adiabatic index .
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
double get_beta() const
Returns the coefficient [unit: ], where .
virtual ~Eos_bifluid()
Destructor.
string get_name() const
Returns the EOS name.
double gam5
Adiabatic indexes , see Eq.~eeosbfpolye}.
Class for a two-fluid (tabulated) equation of state.
virtual double get_K12(const double delta2, const double ent1, const double ent2) const
Computes the derivative of the energy with respect to .
virtual int identify() const
Returns a number to identify the sub-classe of Eos_bifluid the object belongs to.
double kap1
Pressure coefficient , see Eq.
double delta_car_max
Upper boundary of the relative velocity interval.
void operator=(const Eos_bf_tabul &)
Assignment to another Eos_bf_tabul.
virtual ostream & operator>>(ostream &) const =0
Operator >>
virtual double ener_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the total energy density from the baryonic densities and the relative velocity.
virtual double nbar_ent_p1(const double ent1) const
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present.
void interpol_2d_Tbl3d(const int i, const int j, const int k, const Tbl &ytab, const Tbl &ztab, const Tbl &ftab, const Tbl &dfdytab, const Tbl &dfdztab, const Tbl &d2fdydztab, const double y, const double z, double &f, double &dfdy, double &dfdz) const
Routine used by interpol_3d_bifluid to perform the 2D interpolation on the chemical potentials on eac...
Cmp get_Knp(const Cmp &nbar1, const Cmp &nbar2, const Cmp &x2, int nzet, int l_min=0) const
Computes the derivatives of the energy with respect to .
virtual double nbar_ent_p2(const double ent2) const
Computes baryon density out of the log-enthalpy assuming that only fluid 2 is present.
virtual Eos * trans2Eos() const
Makes a translation from Eos_bifluid to Eos .
string tablename
Name of the file containing the tabulated data (be careful, Eos_bifluid uses char*) ...
Eos_bf_tabul(const char *name_i, const char *table, const char *path, double mass1, double mass2)
Standard constructor.
double gam1
Adiabatic indexes , see Eq.~eeosbfpolye}.
double mu2_min
Lower boundary of the chemical-potential interval (fluid 2 = p)
double get_gam3() const
Returns the adiabatic index .
double gam6
Adiabatic indexes , see Eq.~eeosbfpolye}.
double mu1_min
Lower boundary of the chemical-potential interval (fluid 1 = n)
virtual bool operator==(const Eos_bifluid &) const
Comparison operator (egality)
double gam3
Adiabatic indexes , see Eq.~eeosbfpolye}.
double get_m1() const
Return the individual particule mass .
void interpol_3d_bifluid(const double delta2, const double mu1, const double mu2, double &press, double &nbar1, double &nbar2, double &alpha) const
General method computing the pressure, both baryon densities and alpha from the values of both chemic...
Tbl * press_tab
Table of .
virtual bool nbar_ent_p(const double ent1, const double ent2, const double delta2, double &nbar1, double &nbar2) const
Computes both baryon densities from the log-enthalpies.
Eos_bf_poly(double kappa1, double kappa2, double kappa3, double beta)
Standard constructor.
double gam4
Adiabatic indexes , see Eq.~eeosbfpolye}.
double gam2
Adiabatic indexes , see Eq.~eeosbfpolye}.
Tbl * delta_car_tab
Table of .