Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eos.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file eos.h
1 #pragma once
2 #include <cmath>
3 #include <string>
4 
5 class TGraph;
6 
7 // NOTATIONS:
8 // e = energy density (local rest frame), [GeV/fm^3]
9 // p = equilibrium pressure, [GeV/fm^3]
10 // nb = baryon charge density [1/fm^3]
11 // nq = electric charge density [1/fm^3]
12 // ns = strange charge density [1/fm^3]
13 // s = entropy density [1/fm^3]
14 // T = temperature [GeV]
15 // mub = baryon chemical potential [GeV]
16 // muq = electric chemical potential [GeV]
17 // mus = strange chemical potential [GeV]
18 
19 // abstract EoS class.
20 // actual EoSes are implemented in derived classes
21 class EoS {
22  public:
23  virtual ~EoS() {}
24  // eos() gets all EoS relations together:
25  // {p,T,mu_b,mu_q,mu_s}={p,T,mu_b,mu_q,mu_s}(e,n_b,n_q,n_s)
26  virtual void eos(double e, double nb, double nq, double ns, double &T,
27  double &mub, double &muq, double &mus, double &p) = 0;
28  // gets only pressure : p=p(e,n_b,n_q,n_s)
29  virtual double p(double e, double nb, double ns, double nq) = 0;
30  // gets entropy density
31  double s(double e, double nb, double nq, double ns);
32  // speed of sound squared: this variant is only used in
33  // HLLE solver, where the optimal value is 1/3
34  inline double cs2(void) { return 1. / 3.; }
35  inline double cs(void) { return sqrt(1. / 3.); }
36  // speed of sound squared as a function of energy density
37  virtual inline double cs2(double e) { return 1. / 3.; }
38  ;
39 };
40 
41 // EoS class implementing two variants:
42 // 1) "SIMPLE": EoS for ultrarelativistic maseless gas
43 // 2) "TABLE" : EoS p=p(e) from a table
44 // each variant is enabled by compiling with -D SIMPLE / -D TABLE
45 class EoSs : public EoS {
46  private:
47  TGraph *gp, *gT, *gmu;
48 
49  public:
50  EoSs(std::string fname, int ncols);
51  ~EoSs();
52 
53  virtual inline void eos(double e, double nb, double nq, double ns, double &T,
54  double &mub, double &muq, double &mus, double &_p) {
55  _p = p(e);
56  T = t(e);
57  mub = muq = mus = 0.;
58  }
59  virtual inline double p(double e, double nb, double ns, double nq) {
60  return p(e);
61  }
62 
63  double p(double e);
64  double dpe(double e);
65  double t(double e);
66  double mu(double e);
67 
68  virtual double cs2(double e) { return dpe(e); }
69  // virtual double cs(double e) { return sqrt(dpe(e)) ; }
70 };