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"
using namespace std;
#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;
for (int i = 0; i < model->TPS()->ComponentsNumber(); ++i)
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;
for (int i = 0; i < model->TPS()->ComponentsNumber(); ++i) {
for (int j = 0; j < model->TPS()->ComponentsNumber(); ++j) {
int B1 = model->TPS()->Particle(i).BaryonCharge();
int B2 = model->TPS()->Particle(j).BaryonCharge();
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.);
double p = model->CalculatePressure();
printf("%15lf", pT4);
fprintf(fout, "%15lf", pT4);
double e = model->CalculateEnergyDensity();
printf("%15lf", eT4);
fprintf(fout, "%15lf", eT4);
double s = model->CalculateEntropyDensity();
printf("%15lf", sT3);
fprintf(fout, "%15lf", sT3);
vector<double> baryon_charges;
for (int i = 0; i < model->TPS()->ComponentsNumber(); ++i) {
baryon_charges.push_back(static_cast<double>(model->TPS()->Particle(i).BaryonCharge()));
}
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;
}
int main(int argc, char *argv[])
Abstract base class for an HRG model implementation.
virtual void SetTemperature(double T)
Set the temperature.
virtual void SetVirial(int, int, double)
Set the excluded volume coefficient .
virtual void FillChemicalPotentials()
Sets the chemical potentials of all particles.
void SetUseWidth(bool useWidth)
Sets whether finite resonance widths are used. Deprecated.
virtual std::vector< double > CalculateChargeFluctuations(const std::vector< double > &chgs, int order=4)
Calculates fluctuations (diagonal susceptibilities) of an arbitrary "conserved" charge.
virtual void SetBaryonChemicalPotential(double muB)
Set the baryon chemical potential.
virtual void SetRadius(double)
Set the same excluded volume radius parameter for all species.
virtual void SetElectricChemicalPotential(double muQ)
Set the electric chemical potential.
virtual void SetStrangenessChemicalPotential(double muS)
Set the strangeness chemical potential.
virtual void CalculateDensities()
Calculates the primordial and total (after decays) densities of all species.
virtual void SetAttraction(int, int, double)
Set the vdW mean field attraction coefficient .
virtual void SetCharmChemicalPotential(double muC)
Set the charm chemical potential.
virtual void SetStatistics(bool stats)
Class implementing the diagonal excluded-volume model.
Class implementing the Ideal HRG model.
@ BWTwoGamma
Energy-independent Breit-Wigner in +-2\Gamma interval.
Class containing the particle list.
constexpr double GeVtoifm()
A constant to transform GeV into fm .
The main namespace where all classes and functions of the Thermal-FIST library reside.
ThermalModelVDW ThermalModelVDWFull
For backward compatibility.