Calculates the temperature dependence of HRG thermodynamics at zero chemical potentials.
The calculated quantities include scaled pressure, scaled energy density, scaled entropy density, the 2nd and 4th order baryon number susceptibilities.
#include <string.h>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdio>
#include "ThermalFISTConfig.h"
#ifdef ThermalFIST_USENAMESPACE
#endif
int main(
int argc,
char *argv[])
{
string listname = string(ThermalFIST_INPUT_FOLDER) + "/list/thermus23/list.dat";
int config = 0;
if (argc > 1)
config = atoi(argv[1]);
string modeltype;
if (config == 0)
{
printf("#Calculating thermodynamics at \\mu = 0 in Id-HRG model\n");
modeltype = "Id-HRG";
}
else if (config == 1)
{
double rad = 0.3;
printf("#Calculating thermodynamics at \\mu = 0 in EV-HRG model with r = %lf fm\n", rad);
modeltype = "EV-HRG";
}
else if (config == 2)
{
double a = 0.329;
double b = 3.42;
if ((B1 > 0 && B2 > 0) || (B1 < 0 && B2 < 0))
{
}
else
{
}
}
}
printf("#Calculating thermodynamics at \\mu = 0 in QvdW-HRG model\n");
modeltype = "QvdW-HRG";
}
else
{
modeltype = "Id-HRG";
}
char tmpc[1000];
sprintf(tmpc, "cpc1.%s.TDep.out", modeltype.c_str());
FILE *fout = fopen(tmpc, "w");
printf("%15s%15s%15s%15s%15s%15s%15s\n",
"T[MeV]",
"p/T^4",
"e/T^4",
"s/T^3",
"chi2B",
"chi4B",
"chi2B-chi4B"
);
fprintf(fout, "%15s%15s%15s%15s%15s%15s%15s\n",
"T[MeV]",
"p/T^4",
"e/T^4",
"s/T^3",
"chi2B",
"chi4B",
"chi2B-chi4B"
);
int iters = 0;
double Tmin = 0.020;
double Tmax = 0.2001;
double dT = 0.001;
for (double T = Tmin; T <= Tmax; T += dT) {
printf("%15lf", T * 1000.);
fprintf(fout, "%15lf", T * 1000.);
printf("%15lf", pT4);
fprintf(fout, "%15lf", pT4);
printf("%15lf", eT4);
fprintf(fout, "%15lf", eT4);
printf("%15lf", sT3);
fprintf(fout, "%15lf", sT3);
vector<double> baryon_charges;
}
if (chiB.size() >= 4) {
printf("%15E", chiB[1]);
fprintf(fout, "%15E", chiB[1]);
printf("%15E", chiB[3]);
fprintf(fout, "%15E", chiB[3]);
printf("%15E", chiB[1] - chiB[3]);
fprintf(fout, "%15E", chiB[1] - chiB[3]);
}
printf("\n");
fprintf(fout, "\n");
iters++;
}
fclose(fout);
delete model;
printf("%30s %lf s\n", "Running time:", (wt2 - wt1));
printf("%30s %lf s\n", "Time per single calculation:", (wt2 - wt1) / iters);
return 0;
}