Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
icGubser.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file icGubser.cpp
1 #include <fstream>
2 #include <iomanip>
3 #include <iomanip>
4 #include <TF1.h>
5 #include <TF2.h>
6 #include <TGraph.h>
7 
8 #include "fld.h"
9 #include "eos.h"
10 #include "icGubser.h"
11 #include "inc.h"
12 #include "s95p.h"
13 
14 using namespace std;
15 
17 }
18 
20 
21 
22 void ICGubser::setIC(Fluid *f, EoS *eos, double tau) {
23  double e, nb, nq, vx = 0., vy = 0., vz = 0.;
24  Cell *c;
25 
26  double avv_num = 0., avv_den = 0.;
27  double Etotal = 0.0;
28 
29  for (int ix = 0; ix < f->getNX(); ix++)
30  for (int iy = 0; iy < f->getNY(); iy++)
31  for (int iz = 0; iz < f->getNZ(); iz++) {
32  c = f->getCell(ix, iy, iz);
33  double x = f->getX(ix);
34  double y = f->getY(iy);
35  double eta = f->getZ(iz);
36 
37  const double _t = 1.0;
38  const double q = 1.0;
39  const double r = sqrt(x * x + y * y);
40  const double _k =
41  2. * q * q * _t * r / (1. + q * q * _t * _t + q * q * r * r);
42  e = 4. * q * q / (1. + 2. * q * q * (_t * _t + r * r) +
43  pow(q * q * (_t * _t - r * r), 2)) /
44  _t;
45  if (e < 0.) e = 0.;
46  e = pow(e, 4. / 3.);
47  vx = x / (r + 1e-50) * _k;
48  vy = y / (r + 1e-50) * _k;
49  nb = nq = 0.0;
50  vz = 0.0;
51 
52  avv_num += sqrt(vx * vx + vy * vy) * e;
53  avv_den += e;
54 
55  c->setPrimVar(eos, tau, e, nb, nq, 0., vx, vy, vz);
56  double _p = eos->p(e, nb, nq, 0.);
57  const double gamma2 = 1.0 / (1.0 - vx * vx - vy * vy - vz * vz);
58  Etotal +=
59  ((e + _p) * gamma2 * (cosh(eta) + vz * sinh(eta)) - _p * cosh(eta));
60  c->saveQprev();
61 
62  if (e > 0.) c->setAllM(1.);
63  }
64  cout << "average initial flow = " << avv_num / avv_den << endl;
65  cout << "total energy = " << Etotal *f->getDx() * f->getDy() * f->getDz() *
66  tau << endl;
67 }