Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GubserHydro.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file GubserHydro.cc
1 /*******************************************************************************
2  * Copyright (c) The JETSCAPE Collaboration, 2018
3  *
4  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
5  *
6  * For the list of contributors see AUTHORS.
7  *
8  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
9  *
10  * or via email to bugs.jetscape@gmail.com
11  *
12  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
13  * See COPYING for details.
14  ******************************************************************************/
15 
16 #include <stdio.h>
17 #include <sys/stat.h>
18 
19 #include <cstring>
20 #include <cmath>
21 #include <iostream>
22 #include <MakeUniqueHelper.h>
23 #include "GubserHydro.h"
24 
25 #define hbarc 0.19733
26 
27 // using namespace std;
28 using namespace Jetscape;
29 
30 // Register the module with the base class
32 
34  // initialize the parameter reader
35  q = 1.0;
36  e_0 = 1.0;
37 
39  SetId("Gubser");
40  VERBOSE(8);
41 }
42 
44 
46  VERBOSE(8);
48 }
49 
51  VERBOSE(8);
53 }
54 
55 double GubserHydro::temperature(double e_local) {
56  double N_c = 3.;
57  double N_f = 2.5;
58  double T_local = pow(90.0 / M_PI / M_PI * e_local / 3. /
59  (2. * (N_c * N_c - 1.) + 7. / 2. * N_c * N_f),
60  0.25);
61  T_local *= hbarc;
62  return (T_local);
63 }
64 
67  // FluidCellInfo* fluid_cell_info_ptr) {
68  std::unique_ptr<FluidCellInfo> &fluid_cell_info_ptr) {
69  // create the unique FluidCellInfo here
70  fluid_cell_info_ptr = make_unique<FluidCellInfo>();
71 
72  double t_local = static_cast<double>(t);
73  double x_local = static_cast<double>(x);
74  double y_local = static_cast<double>(y);
75  double z_local = static_cast<double>(z);
76 
77  double tau_local = sqrt(t * t - z * z);
78  double r_local = sqrt(x_local * x_local + y_local * y_local);
79 
80  double temp =
81  (1. + 2. * q * q * (tau_local * tau_local + r_local * r_local) +
82  q * q * q * q * pow(tau_local * tau_local - r_local * r_local, 2));
83 
84  double e_local = ((e_0 / pow(tau_local, 4. / 3.)) * (pow(2. * q, 8. / 3.)) /
85  (pow(temp, 4. / 3.)));
86  double T_local = temperature(e_local); // GeV
87  e_local *= hbarc; // GeV/fm^3
88  double p_local = e_local / 3.; // GeV/fm^3
89  double s_local = (e_local + p_local) / T_local; // 1/fm^3
90 
91  double kappa =
92  atanh((2. * q * q * tau_local * r_local) /
93  (1. + q * q * tau_local * tau_local + q * q * r_local * r_local));
94  double ux_local = sinh(kappa) * x_local / (r_local + 1e-15);
95  double uy_local = sinh(kappa) * y_local / (r_local + 1e-15);
96  double gamma = sqrt(1. + ux_local * ux_local + uy_local * uy_local);
97  double vx_local = ux_local / gamma;
98  double vy_local = uy_local / gamma;
99  double vz_local = z / t;
100 
101  // assign all the quantites to JETSCAPE output
102  // thermodyanmic quantities
103  fluid_cell_info_ptr->energy_density = e_local;
104  fluid_cell_info_ptr->entropy_density = s_local;
105  fluid_cell_info_ptr->temperature = T_local;
106  fluid_cell_info_ptr->pressure = p_local;
107  // QGP fraction
108  fluid_cell_info_ptr->qgp_fraction = 1.0;
109  // chemical potentials
110  fluid_cell_info_ptr->mu_B = 0.0;
111  fluid_cell_info_ptr->mu_C = 0.0;
112  fluid_cell_info_ptr->mu_S = 0.0;
113  // dynamical quantites
114  fluid_cell_info_ptr->vx = vx_local;
115  fluid_cell_info_ptr->vy = vy_local;
116  fluid_cell_info_ptr->vz = vz_local;
117  for (int i = 0; i < 4; i++) {
118  for (int j = 0; j < 4; j++) {
119  fluid_cell_info_ptr->pi[i][j] = 0.0;
120  }
121  }
122  fluid_cell_info_ptr->bulk_Pi = 0.0;
123 }