Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include <iosfwd>
0002 #include "cll.h"
0003 
0004 class EoS;
0005 class TransportCoeff;
0006 class Cornelius;
0007 
0008 // this class contains the information and methods related to the hydro grid
0009 // 'z' direction actually denotes eta direction, as well as
0010 // dz == d(eta), getZ returns eta coordinate etc.
0011 class Fluid {
0012  private:
0013   EoS *eos, *eosH;          // equation(s) of state
0014   TransportCoeff *trcoeff;  // transport coefficients for visc fluid
0015   Cornelius *cornelius;  // instance of Cornelius to calculate the hypersurface
0016   Cell *cell;            // 3D hydro grid, packed in 1D array
0017   Cell *cell0;           // reference to cell containing all zero quantities
0018   int nx, ny, nz;        // dimensions of the grid
0019                          // physical dimensions of the grid
0020   double minx, maxx, miny, maxy, minz, maxz;
0021   double dx, dy, dz, dt;  // physical sizes of the hydro cell and timestep
0022   //  double vEff, EtotSurf ; // cumulative effective volume and
0023   std::ofstream foutkw, foutkw_dim, foutxvisc, foutyvisc, foutdiagvisc, foutx,
0024       fouty, foutdiag, foutz, fout_aniz, fout2d, ffreeze;
0025   int compress2dOut;
0026 
0027  public:
0028   Fluid(EoS *_eos, EoS *_eosH, TransportCoeff *_trcoeff, int _nx, int _ny,
0029         int _nz, double _minx, double _maxx, double _miny, double _maxy,
0030         double _minz, double _maxz, double dt, double eCrit);
0031   ~Fluid();
0032   void initOutput(char *dir, int maxstep, double tau0, int cmpr2dOut);
0033   int output_xy_spacing;
0034   int output_eta_points;
0035   int output_tau_spacing;
0036   int output_eta_spacing;
0037 
0038   int output_nt, output_nx, output_ny;
0039 
0040   inline int getNX() { return nx; }
0041   inline int getNY() { return ny; }
0042   inline int getNZ() { return nz; }
0043   inline double getDx() { return dx; }
0044   inline double getDy() { return dy; }
0045   inline double getDz() { return dz; }
0046   inline double getX(int ix) { return minx + ix * dx; }
0047   inline double getY(int iy) { return miny + iy * dy; }
0048   inline double getZ(int iz) { return minz + iz * dz; }
0049 
0050   void getCMFvariables(Cell *c, double tau, double &e, double &nb, double &nq,
0051                        double &ns, double &vx, double &vy, double &Y);
0052 
0053   inline Cell *getCell(int ix, int iy, int iz) {
0054     ix = ix > 0 ? ix : 0;
0055     ix = ix < nx ? ix : nx - 1;
0056     iy = iy > 0 ? iy : 0;
0057     iy = iy < ny ? iy : ny - 1;
0058     iz = iz > 0 ? iz : 0;
0059     iz = iz < nz ? iz : nz - 1;
0060     return &cell[ix + nx * iy + nx * ny * iz];
0061   }
0062 
0063   void correctImagCells(void);      // only ideal hydro part
0064   void correctImagCellsFull(void);  // correct ideal+visc
0065   void updateM(double tau, double dt);
0066 
0067   void outputGnuplot(double tau);
0068   void calcTotals(double tau);
0069 };