Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:19:17

0001 /*******************************************************************************
0002  * Copyright (c) The JETSCAPE Collaboration, 2018
0003  *
0004  * Modular, task-based framework for simulating all aspects of heavy-ion collisions
0005  * 
0006  * For the list of contributors see AUTHORS.
0007  *
0008  * Report issues at https://github.com/JETSCAPE/JETSCAPE/issues
0009  *
0010  * or via email to bugs.jetscape@gmail.com
0011  *
0012  * Distributed under the GNU General Public License 3.0 (GPLv3 or later).
0013  * See COPYING for details.
0014  ******************************************************************************/
0015 // This is a general basic class for hydrodynamics
0016 
0017 #ifndef FLUIDCELLINFO_H
0018 #define FLUIDCELLINFO_H
0019 
0020 #include "RealType.h"
0021 
0022 namespace Jetscape {
0023 
0024 class FluidCellInfo {
0025 public:
0026   // data structure for outputing fluid cell information
0027   Jetscape::real energy_density;  //!< Local energy density [GeV/fm^3].
0028   Jetscape::real entropy_density; //!< Local entropy density [1/fm^3].
0029   Jetscape::real temperature;     //!< Local temperature [GeV].
0030   Jetscape::real pressure;        //!< Thermal pressure [GeV/fm^3].
0031   Jetscape::real
0032       qgp_fraction; //!< Fraction of quark gluon plasma assuming medium is in QGP+HRG phase.
0033   Jetscape::real mu_B;       //!< Net baryon chemical potential [GeV].
0034   Jetscape::real mu_C;       //!< Net charge chemical potential [GeV]
0035   Jetscape::real mu_S;       //!< Net strangeness chemical potential [GeV].
0036   Jetscape::real vx, vy, vz; //!< Flow velocity.
0037   Jetscape::real pi[4][4];   //!< Shear stress tensor [GeV/fm^3].
0038   Jetscape::real bulk_Pi;    //!< Bulk viscous pressure [GeV/fm^3].
0039 
0040   /** Default constructor.*/
0041   FluidCellInfo();
0042 
0043   /** @param b Multiply the fluid cell by scalar factor b. */
0044   FluidCellInfo inline operator*=(Jetscape::real b);
0045 
0046   /** Prints fluid cell properties to the screen. */
0047   //void Print();
0048 };
0049 
0050 //overload +-*/ for easier linear interpolation
0051 /// adds \f$ c = a + b \f$
0052 inline FluidCellInfo operator+(FluidCellInfo a, const FluidCellInfo &b) {
0053   a.energy_density += b.energy_density;
0054   a.entropy_density += b.entropy_density;
0055   a.temperature += b.temperature;
0056   a.pressure += b.pressure;
0057   a.qgp_fraction += b.qgp_fraction;
0058   a.mu_B += b.mu_B;
0059   a.mu_C += b.mu_C;
0060   a.mu_S += b.mu_S;
0061   a.vx += b.vx;
0062   a.vy += b.vy;
0063   a.vz += b.vz;
0064   for (int i = 0; i < 4; i++) {
0065     for (int j = 0; j < 4; j++) {
0066       a.pi[i][j] += b.pi[i][j];
0067     }
0068   }
0069   a.bulk_Pi += b.bulk_Pi;
0070   return a;
0071 }
0072 
0073 // Multiply the fluid cell with a scalar factor
0074 FluidCellInfo inline FluidCellInfo::operator*=(Jetscape::real b) {
0075   this->energy_density *= b;
0076   this->entropy_density *= b;
0077   this->temperature *= b;
0078   this->pressure *= b;
0079   this->qgp_fraction *= b;
0080   this->mu_B *= b;
0081   this->mu_C *= b;
0082   this->mu_S *= b;
0083   this->vx *= b;
0084   this->vy *= b;
0085   this->vz *= b;
0086   for (int i = 0; i < 4; i++) {
0087     for (int j = 0; j < 4; j++) {
0088       this->pi[i][j] *= b;
0089     }
0090   }
0091   this->bulk_Pi *= b;
0092   return *this;
0093 }
0094 
0095 /// multiply \f$ c = a * b \f$
0096 inline FluidCellInfo operator*(Jetscape::real a, FluidCellInfo b) {
0097   b *= a;
0098   return b;
0099 }
0100 
0101 /// multiply \f$ c = a * b \f$
0102 inline FluidCellInfo operator*(FluidCellInfo a, Jetscape::real b) {
0103   a *= b;
0104   return a;
0105 }
0106 
0107 /// division \f$ c = a / b \f$
0108 inline FluidCellInfo operator/(FluidCellInfo a, Jetscape::real b) {
0109   a *= 1.0 / b;
0110   return a;
0111 }
0112 
0113 // print the fluid cell information for debuging
0114 // this function has bugs
0115 //std::ostream &operator<<(std::ostream &os, const FluidCellInfo &cell) {
0116 //    os << "energy_density=" << cell.energy_density << std::endl;
0117 //    os << "entropy_density=" << cell.entropy_density << std::endl;
0118 //    os << "temperature=" << cell.temperature << std::endl;
0119 //    os << "pressure=" << cell.pressure << std::endl;
0120 //    os << "qgp_fraction=" << cell.qgp_fraction << std::endl;
0121 //    os << "mu_B=" << cell.mu_B << std::endl;
0122 //    os << "mu_C=" << cell.mu_C << std::endl;
0123 //    os << "mu_S=" << cell.mu_S << std::endl;
0124 //    os << "vx=" << cell.vx << std::endl;
0125 //    os << "vy=" << cell.vy << std::endl;
0126 //    os << "vz=" << cell.vz << std::endl;
0127 //    os << "pi[mu][nu]=" << std::endl;
0128 //    for (int i = 0; i < 4; i++) {
0129 //        for (int j = 0; j < 4; j++) {
0130 //            os << cell.pi[i][j] << ' ';
0131 //        }
0132 //        os << std::endl;
0133 //    }
0134 //    os << "bulk_Pi=" << cell.bulk_Pi;
0135 //    return os << std::endl;
0136 //}
0137 
0138 } // end namespace Jetscape
0139 
0140 #endif // FluidCellInfo