LORENE
eos_bifluid.h
1/*
2 * Definition of Lorene classes Eos_bifluid
3 * Eos_bf_poly
4 * Eos_bf_tabul
5 */
6
7/*
8 * Copyright (c) 2001-2002 Jerome Novak
9 *
10 * This file is part of LORENE.
11 *
12 * LORENE is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * LORENE is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with LORENE; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28
29#ifndef __EOS_BIFLUID_H_
30#define __EOS_BIFLUID_H_
31
32/*
33 * $Id: eos_bifluid.h,v 1.24 2021/05/14 15:39:22 g_servignat Exp $
34 * $Log: eos_bifluid.h,v $
35 * Revision 1.24 2021/05/14 15:39:22 g_servignat
36 * Added sound speed computation from enthalpy to Eos class and tabulated+polytropic derived classes
37 *
38 * Revision 1.23 2017/10/06 12:36:33 a_sourie
39 * Cleaning of tabulated 2-fluid EoS class + superfluid rotating star model.
40 *
41 * Revision 1.22 2015/06/26 14:10:08 j_novak
42 * Modified comments.
43 *
44 * Revision 1.21 2015/06/11 13:50:18 j_novak
45 * Minor corrections
46 *
47 * Revision 1.20 2015/06/10 14:39:17 a_sourie
48 * New class Eos_bf_tabul for tabulated 2-fluid EoSs and associated functions for the computation of rotating stars with such EoSs.
49 *
50 * Revision 1.19 2014/10/13 08:52:33 j_novak
51 * Lorene classes and functions now belong to the namespace Lorene.
52 *
53 * Revision 1.18 2014/04/25 10:43:50 j_novak
54 * The member 'name' is of type string now. Correction of a few const-related issues.
55 *
56 * Revision 1.17 2004/09/01 09:49:46 r_prix
57 * adapted to change in read_variable() for strings
58 *
59 * Revision 1.16 2004/03/22 13:12:41 j_novak
60 * Modification of comments to use doxygen instead of doc++
61 *
62 * Revision 1.15 2004/01/30 13:21:29 r_prix
63 * add documentation about 'special' 2-fluid typeos=5: == type0 + slow-rot style inversion
64 *
65 * Revision 1.14 2003/12/17 23:12:30 r_prix
66 * replaced use of C++ <string> by standard ANSI char* to be backwards compatible
67 * with broken compilers like MIPSpro Compiler 7.2 on SGI Origin200. ;-)
68 *
69 * Revision 1.13 2003/12/05 15:08:38 r_prix
70 * - use read_variable() to read eos_bifluid from file
71 * - changed 'contructor from file' to take filename as an argument instead of ifstream
72 * - changed 'name' member of Eos_bifluid to C++-type string (for convenience&safety)
73 *
74 * Revision 1.12 2003/12/04 14:13:32 r_prix
75 * added method get_typeos {return typeos}; and fixed some comments.
76 *
77 * Revision 1.11 2003/11/18 18:25:15 r_prix
78 * moved particle-masses m_1, m_2 of the two fluids into class eos_bifluid (from eos_bf_poly)
79 *
80 * Revision 1.10 2002/10/16 14:36:29 j_novak
81 * Reorganization of #include instructions of standard C++, in order to
82 * use experimental version 3 of gcc.
83 *
84 * Revision 1.9 2002/09/13 09:17:31 j_novak
85 * Modif. commentaires
86 *
87 * Revision 1.8 2002/06/17 14:05:16 j_novak
88 * friend functions are now also declared outside the class definition
89 *
90 * Revision 1.7 2002/06/03 13:23:16 j_novak
91 * The case when the mapping is not adapted is now treated
92 *
93 * Revision 1.6 2002/05/31 16:13:36 j_novak
94 * better inversion for eos_bifluid
95 *
96 * Revision 1.5 2002/05/02 15:16:22 j_novak
97 * Added functions for more general bi-fluid EOS
98 *
99 * Revision 1.4 2002/01/16 15:03:27 j_novak
100 * *** empty log message ***
101 *
102 * Revision 1.3 2002/01/11 14:09:34 j_novak
103 * Added newtonian version for 2-fluid stars
104 *
105 * Revision 1.2 2001/11/29 15:05:26 j_novak
106 * The entrainment term in 2-fluid eos is modified
107 *
108 * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
109 * LORENE
110 *
111 * Revision 1.6 2001/08/31 15:47:35 novak
112 * The flag tronc has been added to nbar_ent.. functions
113 *
114 * Revision 1.5 2001/08/27 12:21:11 novak
115 * The delta2 Cmp argument put to const
116 *
117 * Revision 1.4 2001/08/27 09:50:15 novak
118 * New formula for "polytrope"
119 *
120 * Revision 1.3 2001/06/22 15:36:11 novak
121 * Modification de Eos_bifluid::trans2Eos
122 *
123 * Revision 1.2 2001/06/22 11:52:44 novak
124 * *** empty log message ***
125 *
126 * Revision 1.1 2001/06/21 15:21:22 novak
127 * Initial revision
128 *
129 *
130 * $Header: /cvsroot/Lorene/C++/Include/eos_bifluid.h,v 1.24 2021/05/14 15:39:22 g_servignat Exp $
131 *
132 */
133
134// Standard C++
135#include "headcpp.h"
136#include <string>
137
138// Headers C
139#include <cstdio>
140
141// Lorene classes
142#include "param.h"
143#include "utilitaires.h"
144namespace Lorene {
145class Tbl ;
146class Param ;
147class Cmp ;
148class Eos ;
149class Eos_poly ;
150
151 //------------------------------------//
152 // base class Eos for two fluids //
153 //------------------------------------//
154#define MAX_EOSNAME 100
155
181
182 // Data :
183 // -----
184
185 protected:
186 string name;
187
191 double m_1 ;
192
196 double m_2 ;
197
198
199 // Constructors - Destructor
200 // -------------------------
201 protected:
202 Eos_bifluid() ;
203
205 explicit Eos_bifluid(const char* name_i, double mass1, double mass2) ;
206
207 Eos_bifluid(const Eos_bifluid& ) ;
208
209 protected:
216 Eos_bifluid(FILE* ) ;
217
228 Eos_bifluid (const char *fname ) ;
229
237 Eos_bifluid (ifstream& fich) ;
238
239
240 public:
241 virtual ~Eos_bifluid() ;
242
243 // Assignment
244 // ----------
246 void operator=(const Eos_bifluid& ) ;
247
248
249 // Name manipulation
250 // -----------------
251 public:
253 string get_name() const {return name;} ;
254
255 // Miscellaneous
256 // -------------
257 public:
258
263 double get_m1() const {return m_1 ;};
264
269 double get_m2() const {return m_2 ;};
270
275 static Eos_bifluid* eos_from_file (FILE* ) ;
276
284 static Eos_bifluid* eos_from_file ( const char *fname ) ;
285
297 static Eos_bifluid* eos_from_file(ifstream& ) ;
298
299
301 virtual bool operator==(const Eos_bifluid& ) const = 0 ;
302
304 virtual bool operator!=(const Eos_bifluid& ) const = 0 ;
305
309 virtual int identify() const = 0 ;
310
311 // Outputs
312 // -------
313
314 public:
315 virtual void sauve(FILE* ) const ;
316
318 friend ostream& operator<<(ostream& , const Eos_bifluid& ) ;
319
320 protected:
321 virtual ostream& operator>>(ostream &) const = 0 ;
322
323
324 // Computational functions
325 // -----------------------
326 public:
347 virtual void calcule_tout(const Cmp& ent1, const Cmp& ent2, const Cmp& delta2,
348 Cmp& nbar1, Cmp& nbar2, Cmp& ener, Cmp& press,
349 int nzet, int l_min = 0) const ;
350
363 virtual bool nbar_ent_p(const double ent1, const double ent2,
364 const double delta2, double& nbar1,
365 double& nbar2) const = 0 ;
366
373 virtual double nbar_ent_p1(const double ent1) const = 0 ;
374
381 virtual double nbar_ent_p2(const double ent2) const = 0 ;
382
403 void nbar_ent(const Cmp& ent1, const Cmp& ent2, const Cmp& delta2,
404 Cmp& nbar1, Cmp& nbar2, int nzet, int l_min = 0)
405 const ;
406
419 virtual double ener_nbar_p(const double nbar1, const double nbar2,
420 const double delta2) const = 0 ;
421
441 Cmp ener_ent(const Cmp& ent1, const Cmp& ent2, const Cmp& delta2,
442 int nzet, int l_min = 0) const ;
443
456 virtual double press_nbar_p(const double nbar1, const double nbar2,
457 const double delta2) const = 0 ;
458
477 Cmp press_ent(const Cmp& ent1, const Cmp& ent2, const Cmp& delta2,
478 int nzet, int l_min = 0) const ;
479
496 virtual double get_K11(const double n1, const double n2, const
497 double x) const = 0 ;
498
515 virtual double get_K12(const double n1, const double n2,const
516 double x) const = 0 ;
517
533 virtual double get_K22(const double n1, const double n2, const
534 double x) const = 0 ;
535
558 Cmp get_Knn(const Cmp& nbar1, const Cmp& nbar2, const Cmp& x2,
559 int nzet, int l_min = 0) const ;
560
583 Cmp get_Kpp(const Cmp& nbar1, const Cmp& nbar2, const Cmp&
584 x2, int nzet, int l_min = 0) const ;
585
609 Cmp get_Knp(const Cmp& nbar1, const Cmp& nbar2, const Cmp& x2,
610 int nzet, int l_min = 0) const ;
611
612
635 void calcule(const Cmp& nbar1, const Cmp& nbar2, const Cmp&
636 x2, int nzet, int l_min, double
637 (Eos_bifluid::*fait)(double, double, double) const,
638 Cmp& resu)
639 const ;
640
641 // Conversion functions
642 // ---------------------
643
652 virtual Eos* trans2Eos() const = 0 ;
653
654};
655ostream& operator<<(ostream& , const Eos_bifluid& ) ;
656
657
658 //------------------------------------//
659 // class Eos_bf_poly //
660 //------------------------------------//
661
717class Eos_bf_poly : public Eos_bifluid {
718
719 // Data :
720 // -----
721
722 protected:
724 double gam1 ;
725
727 double gam2 ;
728
730 double gam3 ;
731
733 double gam4 ;
734
736 double gam5 ;
737
739 double gam6 ;
740
746 double kap1 ;
747
753 double kap2 ;
754
760 double kap3 ;
761
767 double beta ;
768
769 double gam1m1 ;
770 double gam2m1 ;
771 double gam34m1 ;
772 double gam56m1 ;
773
774 protected:
796 int typeos ;
797
802 double relax ;
803
804 double precis ;
805
807 double ecart ;
808
809
810 // Constructors - Destructor
811 // -------------------------
812 public:
813
832 Eos_bf_poly(double kappa1, double kappa2, double kappa3, double beta) ;
833
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,
864 double relax=0.5, double precis = 1.e-9,
865 double ecart = 1.e-8) ;
866
867 Eos_bf_poly(const Eos_bf_poly& ) ;
868
869 protected:
876 Eos_bf_poly(FILE* ) ;
877
884 Eos_bf_poly (const char *fname) ;
885
888 friend Eos_bifluid* Eos_bifluid::eos_from_file(const char *fname ) ;
889
890 public:
891 virtual ~Eos_bf_poly() ;
892
893 // Assignment
894 // ----------
896 void operator=(const Eos_bf_poly& ) ;
897
898
899 // Miscellaneous
900 // -------------
901 public :
903 virtual bool operator==(const Eos_bifluid& ) const ;
904
906 virtual bool operator!=(const Eos_bifluid& ) const ;
907
911 virtual int identify() const ;
912
914 double get_gam1() const {return gam1 ;};
915
917 double get_gam2() const {return gam2 ;};
918
920 double get_gam3() const {return gam3 ;};
921
923 double get_gam4() const {return gam4 ;};
924
926 double get_gam5() const {return gam5 ;};
927
929 double get_gam6() const {return gam6 ;};
930
935 double get_kap1() const {return kap1 ;};
936
941 double get_kap2() const {return kap2 ;};
942
947 double get_kap3() const {return kap3 ;};
948
953 double get_beta() const {return beta ;};
954
955 // Returns (sub)type of bifluid-eos (member \c typeos})
956 int get_typeos() const {return typeos;};
957
958 protected:
962 void set_auxiliary() ;
963
965 void determine_type() ;
966
967 // Outputs
968 // -------
969
970 public:
971 virtual void sauve(FILE* ) const ;
972
973 protected:
974 virtual ostream& operator>>(ostream &) const ;
975
976
977 // Computational functions
978 // -----------------------
979
980 public:
981
993 virtual bool nbar_ent_p(const double ent1, const double ent2,
994 const double delta2, double& nbar1,
995 double& nbar2) const ;
996
1002 virtual double nbar_ent_p1(const double ent1) const ;
1003
1009 virtual double nbar_ent_p2(const double ent2) const ;
1010
1022 virtual double ener_nbar_p(const double nbar1, const double nbar2,
1023 const double delta2) const ;
1024
1036 virtual double press_nbar_p(const double nbar1, const double nbar2,
1037 const double delta2) const ;
1038 // Conversion functions
1039 // ---------------------
1040
1047 virtual Eos* trans2Eos() const ;
1048
1064 virtual double get_K11(const double n1, const double n2, const
1065 double delta2) const ;
1066
1082 virtual double get_K12(const double n1, const double n2,const
1083 double delta2) const ;
1084
1099 virtual double get_K22(const double n1, const double n2, const
1100 double delta2) const ;
1101
1102};
1103
1104 //------------------------------------//
1105 // class Eos_bf_poly_newt //
1106 //------------------------------------//
1107
1162
1163 // Data :
1164 // -----
1165
1166 // no new data with respect to Eos_bf_poly
1167
1168 // Constructors - Destructor
1169 // -------------------------
1170 public:
1171
1190 Eos_bf_poly_newt(double kappa1, double kappa2, double kappa3,
1191 double beta) ;
1192
1219 Eos_bf_poly_newt(double gamma1, double gamma2, double gamma3,
1220 double gamma4, double gamma5, double gamma6,
1221 double kappa1, double kappa2, double kappa3,
1222 double beta, double mass1, double mass2,
1223 double relax=0.5, double precis = 1.e-9,
1224 double ecart = 1.e-8) ;
1225
1226
1228
1229 protected:
1236 Eos_bf_poly_newt(FILE* ) ;
1237
1243 Eos_bf_poly_newt(const char *fname ) ;
1244
1247 friend Eos_bifluid* Eos_bifluid::eos_from_file(const char *fname) ;
1248
1249 public:
1250 virtual ~Eos_bf_poly_newt() ;
1251
1252 // Assignment
1253 // ----------
1255 void operator=(const Eos_bf_poly_newt& ) ;
1256
1257
1258 // Miscellaneous
1259 // -------------
1260
1261 public :
1263 virtual bool operator==(const Eos_bifluid& ) const ;
1264
1266 virtual bool operator!=(const Eos_bifluid& ) const ;
1267
1271 virtual int identify() const ;
1272
1273 // Outputs
1274 // -------
1275
1276 public:
1277 virtual void sauve(FILE* ) const ;
1278
1279 protected:
1280 virtual ostream& operator>>(ostream &) const ;
1281
1282
1283 // Computational functions
1284 // -----------------------
1285
1286 public:
1287
1299 virtual bool nbar_ent_p(const double ent1, const double ent2,
1300 const double delta2, double& nbar1,
1301 double& nbar2) const ;
1302
1309 virtual double nbar_ent_p1(const double ent1) const ;
1310
1316 virtual double nbar_ent_p2(const double ent2) const ;
1317
1329 virtual double ener_nbar_p(const double nbar1, const double nbar2,
1330 const double delta2) const ;
1331
1343 virtual double press_nbar_p(const double nbar1, const double nbar2,
1344 const double delta2) const ;
1345 // Conversion functions
1346 // ---------------------
1347
1354 virtual Eos* trans2Eos() const ;
1355
1371 virtual double get_K11(const double n1, const double n2, const
1372 double delta2) const ;
1373
1389 virtual double get_K12(const double n1, const double n2,const
1390 double delta2) const ;
1391
1406 virtual double get_K22(const double n1, const double n2, const
1407 double delta2) const ;
1408
1409};
1410
1411
1412/* Declaration of the new class Eos_bf_tabul derived from Eos_bifluid */
1413
1414 //------------------------------------//
1415 // class Eos_bf_tabul //
1416 //------------------------------------//
1417
1435
1437
1438 // Data :
1439 // -----
1440
1441 protected:
1443 string tablename ;
1444
1446 string authors ;
1447
1450
1453
1455 double mu1_min ;
1456
1458 double mu1_max ;
1459
1461 double mu2_min ;
1462
1464 double mu2_max ;
1465
1468
1471
1474
1477
1480
1483
1486
1489
1492
1495
1496 // To save the limit curve corresponding to n_n = 0
1497 Tbl* delta_car_n0 ;
1498 Tbl* mu1_n0 ;
1499 Tbl* mu2_n0 ;
1500
1501 // To save the limit curve corresponding to n_p = 0
1502 Tbl* delta_car_p0 ;
1503 Tbl* mu1_p0 ;
1504 Tbl* mu2_p0 ;
1505
1506 // To save the single-tab fluid
1507 Tbl* mu1_N ;
1508 Tbl* n_n_N ;
1509 Tbl* press_N ;
1510 Tbl* mu2_P ;
1511 Tbl* n_p_P ;
1512 Tbl* press_P ;
1513
1514
1515 // Constructors - Destructor
1516 // -------------------------
1517 protected:
1518
1527 Eos_bf_tabul(const char* name_i, const char* table, const char* path, double mass1, double mass2) ;
1528
1537 Eos_bf_tabul(const char* name_i, const char* file_name, double mass1, double mass2) ;
1538
1539 private:
1541
1542 protected:
1543
1550 Eos_bf_tabul(FILE* ) ;
1551
1562 Eos_bf_tabul(ifstream& ist, const char* table) ;
1563
1573 Eos_bf_tabul(ifstream& ist) ;
1574
1577 friend Eos_bifluid* Eos_bifluid::eos_from_file(ifstream& ) ;
1578
1579 public:
1580 virtual ~Eos_bf_tabul() ;
1581
1582 // Assignment
1583 // ----------
1584 private :
1586 void operator=(const Eos_bf_tabul& ) ;
1587
1588
1589 // Miscellaneous
1590 // -------------
1591
1592 protected:
1598 void read_table() ;
1599
1600 public :
1602 virtual bool operator==(const Eos_bifluid& ) const ;
1603
1605 virtual bool operator!=(const Eos_bifluid& ) const ;
1606
1610 virtual int identify() const ;
1611
1612
1613 // Outputs
1614 // -------
1615
1616 public:
1617 virtual void sauve(FILE* ) const ;
1618
1619
1620 protected:
1621 virtual ostream& operator>>(ostream &) const ;
1622
1623
1624 // Computational functions
1625 // -----------------------
1626
1627 public:
1653 void calcule_interpol(const Cmp& ent1, const Cmp& ent2, const Cmp& delta2,
1654 Cmp& nbar1, Cmp& nbar2, Cmp& ener, Cmp& press,
1655 Cmp& K_nn, Cmp& K_np, Cmp& K_pp, Cmp& alpha_eos,
1656 int nzet, int l_min = 0) const ;
1657
1669 virtual bool nbar_ent_p(const double ent1, const double ent2,
1670 const double delta2, double& nbar1,
1671 double& nbar2) const ;
1672
1678 virtual double nbar_ent_p1(const double ent1) const ;
1679
1685 virtual double nbar_ent_p2(const double ent2) const ;
1686
1698 virtual double ener_nbar_p(const double nbar1, const double nbar2,
1699 const double delta2) const ;
1700
1712 virtual double press_nbar_p(const double nbar1, const double nbar2,
1713 const double delta2) const ;
1714
1727 virtual double get_K11(const double delta2, const double ent1,
1728 const double ent2) const ;
1729
1742 virtual double get_K12(const double delta2, const double ent1 ,
1743 const double ent2) const ;
1744
1756 virtual double get_K22(const double delta2, const double ent1,
1757 const double ent2) const ;
1758
1769 virtual double ener_ent_p(const double ent1, const double ent2,
1770 const double delta_car) const ;
1771
1782 virtual double press_ent_p(const double ent1, const double ent2,
1783 const double delta_car) const ;
1784
1795 virtual double alpha_ent_p(const double ent1, const double ent2,
1796 const double delta_car) const ;
1797
1815 void interpol_3d_bifluid(const double delta2, const double mu1,
1816 const double mu2, double& press, double& nbar1, double& nbar2, double& alpha) const ;
1817
1823 void interpol_2d_Tbl3d(const int i, const int j, const int k, const Tbl& ytab, const Tbl& ztab,
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 ;
1826
1827 // Conversion function
1828 // ---------------------
1829
1835 virtual Eos* trans2Eos() const ;
1836
1847 virtual double csound_square_ent_p(double , const Param*) const {
1848 c_est_pas_fait(__FILE__) ;
1849 return 0;
1850 } ;
1851};
1852
1853
1854}
1855#endif
Component of a tensorial field *** DEPRECATED : use class Scalar instead ***.
Definition cmp.h:446
virtual Eos * trans2Eos() const
Makes a translation from Eos_bifluid to Eos .
virtual bool operator!=(const Eos_bifluid &) const
Comparison operator (difference).
void operator=(const Eos_bf_poly_newt &)
Assignment to another Eos_bf_poly_newt.
virtual double get_K22(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy/(baryonic density 2) .
virtual int identify() const
Returns a number to identify the sub-classe of Eos_bifluid the object belongs to.
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...
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 ostream & operator>>(ostream &) const
Operator >>.
virtual bool operator==(const Eos_bifluid &) const
Comparison operator (egality).
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_newt(double kappa1, double kappa2, double kappa3, double beta)
Standard constructor.
virtual void sauve(FILE *) const
Save in a file.
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_bf_poly_newt()
Destructor.
virtual double get_K12(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy with respect to .
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 press_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the pressure from the baryonic densities and the relative velocity.
double gam5
Adiabatic indexes , see Eq.~eeosbfpolye}.
virtual bool operator!=(const Eos_bifluid &) const
Comparison operator (difference).
double kap1
Pressure coefficient , see Eq.
double get_kap1() const
Returns the pressure coefficient [unit: ], where .
void determine_type()
Determines the type of the analytical EOS (see typeos ).
double gam1
Adiabatic indexes , see Eq.~eeosbfpolye}.
double kap2
Pressure coefficient , see Eq.
void operator=(const Eos_bf_poly &)
Assignment to another Eos_bf_poly.
double gam4
Adiabatic indexes , see Eq.~eeosbfpolye}.
double get_gam6() const
Returns the adiabatic index .
double gam3
Adiabatic indexes , see Eq.~eeosbfpolye}.
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_K12(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy with respect to .
double get_gam4() const
Returns the adiabatic index .
double get_gam1() const
Returns the adiabatic index .
double get_gam5() const
Returns the adiabatic index .
virtual bool operator==(const Eos_bifluid &) const
Comparison operator (egality).
virtual ostream & operator>>(ostream &) const
Operator >>.
virtual Eos * trans2Eos() const
Makes a translation from Eos_bifluid to Eos .
virtual double get_K22(const double n1, const double n2, const double delta2) const
Computes the derivative of the energy/(baryonic density 2) .
double gam6
Adiabatic indexes , see Eq.~eeosbfpolye}.
double gam2
Adiabatic indexes , see Eq.~eeosbfpolye}.
double precis
contains the precision required in zerosec_b
virtual int identify() const
Returns a number to identify the sub-classe of Eos_bifluid the object belongs to.
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.
double get_gam2() const
Returns the adiabatic index .
double get_gam3() const
Returns the adiabatic index .
double get_kap3() const
Returns the pressure coefficient [unit: ], where .
double get_beta() const
Returns the coefficient [unit: ], where .
virtual void sauve(FILE *) const
Save in a file.
void set_auxiliary()
Computes the auxiliary quantities gam1m1 , gam2m1 and gam3m1.
double get_kap2() const
Returns the pressure coefficient [unit: ], where .
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 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.
int typeos
The bi-fluid analytical EOS type:
double beta
Coefficient , see Eq.
double kap3
Pressure coefficient , see Eq.
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 double nbar_ent_p1(const double ent1) const
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present.
double ecart
contains the precision required in the relaxation nbar_ent_p
Eos_bf_poly(double kappa1, double kappa2, double kappa3, double beta)
Standard constructor.
double relax
Parameters needed for some inversions of the EOS.
virtual ~Eos_bf_poly()
Destructor.
Tbl * n2_tab
Table of .
double mu2_max
Upper boundary of the chemical-potential interval (fluid 2 = p).
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.
Tbl * dpsddelta_car_tab
Table of .
virtual int identify() const
Returns a number to identify the sub-classe of Eos the object belongs to.
void operator=(const Eos_bf_tabul &)
Assignment to another Eos_bf_tabul.
Tbl * dn2sddelta_car_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.
double delta_car_max
Upper boundary of the relative velocity interval.
string authors
Authors.
virtual bool operator!=(const Eos_bifluid &) const
Comparison operator (difference).
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...
Tbl * press_tab
Table of .
virtual ~Eos_bf_tabul()
Destructor.
string tablename
Name of the file containing the tabulated data (be careful, Eos_bifluid uses char*).
double mu2_min
Lower boundary of the chemical-potential interval (fluid 2 = p).
double mu1_min
Lower boundary of the chemical-potential interval (fluid 1 = n).
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...
Eos_bf_tabul(const Eos_bf_tabul &)
Copy constructor.
virtual bool operator==(const Eos_bifluid &) const
Comparison operator (egality).
double delta_car_min
Lower boundary of the relative velocity interval.
double mu1_max
Upper boundary of the chemical-potential interval (fluid 1 = n).
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...
virtual Eos * trans2Eos() const
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.
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 press_nbar_p(const double nbar1, const double nbar2, const double delta2) const
Computes the pressure from the baryonic densities and the relative velocity.
Tbl * n1_tab
Table of .
Tbl * d2psdmu1dmu2_tab
Table of .
virtual double get_K22(const double delta2, const double ent1, const double ent2) const
Computes the derivative of the energy/(baryonic density 2) .
void read_table()
Reads the file containing the table and initializes the arrays mu1_tab, mu2_tab, delta_car_tab,...
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 * delta_car_tab
Table of .
virtual ostream & operator>>(ostream &) const
Operator >>.
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 double get_K12(const double delta2, const double ent1, const double ent2) const
Computes the derivative of the energy with respect to .
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) .
Tbl * mu2_tab
Table of where .
virtual void sauve(FILE *) const
Save in a file.
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 nbar_ent_p1(const double ent1) const
Computes baryon density out of the log-enthalpy asuming that only fluid 1 is present.
Tbl * dn1sddelta_car_tab
Table of .
Eos_bf_tabul(const char *name_i, const char *table, const char *path, double mass1, double mass2)
Standard constructor.
Tbl * mu1_tab
Table of where .
2-fluids equation of state base class.
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 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 ostream & operator>>(ostream &) const =0
Operator >>.
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...
double get_m1() const
Return the individual particule mass .
virtual void sauve(FILE *) const
Save in a file.
static Eos_bifluid * eos_from_file(FILE *)
Construction of an EOS from a binary file.
virtual ~Eos_bifluid()
Destructor.
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 bool operator==(const Eos_bifluid &) const =0
Comparison operator (egality).
double m_1
Individual particle mass [unit: ].
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...
string name
EOS name.
double get_m2() const
Return the individual particule mass .
virtual bool operator!=(const Eos_bifluid &) const =0
Comparison operator (difference).
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) .
virtual int identify() const =0
Returns a number to identify the sub-classe of Eos_bifluid the object belongs to.
virtual double get_K22(const double n1, const double n2, const double x) const =0
Computes the derivative of the energy/(baryonic density 2) .
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) .
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 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.
string get_name() const
Returns the EOS name.
virtual Eos * trans2Eos() const =0
Makes a translation from Eos_bifluid to Eos .
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 get_K12(const double n1, const double n2, const double x) const =0
Computes the derivative of the energy with respect to .
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.
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.
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 .
friend ostream & operator<<(ostream &, const Eos_bifluid &)
Display.
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...
void operator=(const Eos_bifluid &)
Assignment to another Eos_bifluid.
double m_2
Individual particle mass [unit: ].
Eos_bifluid()
Standard constructor.
Polytropic equation of state (relativistic case).
Definition eos.h:809
Equation of state base class.
Definition eos.h:206
Parameter storage.
Definition param.h:125
Basic array class.
Definition tbl.h:161
void c_est_pas_fait(const char *)
Helpful function to say something is not implemented yet.
Lorene prototypes.
Definition app_hor.h:67
Coord z
z coordinate centered on the grid
Definition map.h:740
Coord y
y coordinate centered on the grid
Definition map.h:739
Coord x
x coordinate centered on the grid
Definition map.h:738