Thermal-FIST 1.6
Package for hadron resonance gas model applications
Loading...
Searching...
No Matches
CosmicEoS.h
Go to the documentation of this file.
1#ifndef COSMICEOS_H
2#define COSMICEOS_H
3#include <map>
4
6#include "HRGBase/Broyden.h"
8
9namespace thermalfist {
10
20 double IsospinCharge(const ThermalParticle& part);
21
26 struct LeptonFlavor {
31 enum Name {
33 Muon = 1,
34 Tau = 2,
35 };
36
38 static const int NumberOfFlavors = 3;
39
41 static double m_e;
42
44 static double m_mu;
45
47 static double m_tau;
48
49 };
50
57 {
58 public:
59
66 CosmicEoS(ThermalModelBase* THMbase, bool pionsinteract = false);
67
71 virtual ~CosmicEoS(void) { }
72
79
85 const std::vector<double>& ChemicalPotentials() const { return m_ChemCurrent; }
86
92 virtual void SetTemperature(double T);
93
99 double Temperature() const { return m_T; }
100
106 virtual void SetBaryonChemicalPotential(double muB) { m_ChemCurrent[0] = muB; m_modelHRG->SetBaryonChemicalPotential(muB); }
107
113 double BaryonChemicalPotential() const { return m_ChemCurrent[0]; }
114
120 virtual void SetElectricChemicalPotential(double muQ);// { m_ChemCurrent[1] = muQ; m_modelHRG->SetElectricChemicalPotential(muQ); }
121
127 double ElectricChemicalPotential() const { return m_ChemCurrent[1]; }
128
135 virtual void SetLeptonChemicalPotential(LeptonFlavor::Name flavor, double muL) { m_ChemCurrent[2 + static_cast<int>(flavor)] = muL; }
136
143 double LeptonChemicalPotential(LeptonFlavor::Name flavor) const { return m_ChemCurrent[2 + static_cast<int>(flavor)]; }
144
150 virtual void SetBaryonAsymmetry(double b) { m_Asymmetries[0] = b; }
151
157 double BaryonAsymmetry() const { return m_Asymmetries[0]; }
158
164 virtual void SetChargeAsymmetry(double q) { m_Asymmetries[1] = q; }
165
171 double ChargeAsymmetry() const { return m_Asymmetries[1]; }
172
179 virtual void SetLeptonAsymmetry(LeptonFlavor::Name flavor, double l) { m_Asymmetries[2 + static_cast<int>(flavor)] = l; }
180
187 double LeptonAsymmetry(LeptonFlavor::Name flavor) const { return m_Asymmetries[2 + static_cast<int>(flavor)]; }
188
194 void SetAsymmetries(const std::vector<double>& asymmetries) { m_Asymmetries = asymmetries; }
195
200
206 double EntropyDensity();
207
213 double EntropyDensityHRG();
214
220 double Pressure();
221
227 double PressureHRG();
228
234 double EnergyDensity();
235
241 double EnergyDensityHRG();
242
249 double NetDensityChargedLepton(int iL);
250
257 double PressureChargedLepton(int iL);
258
265 double EnergyDensityChargedLepton(int iL);
266
273 double BaryonDensity(bool absolute = false);
274
281 double ElectricChargeDensity(bool absolute = false);
282
289 double ElectricChargeDensityHRG(bool absolute = false);
290
297 double IsospinChargeDensity(bool absolute = false);
298
306 double LeptonFlavorDensity(LeptonFlavor::Name flavor, bool absolute = false);
307
316 std::vector<double> SolveChemicalPotentials(double T, const std::vector<double>& muInit = std::vector<double>());
317
321 static double fpi;
322
330 double GetPionMass() const;
331
338 void SetPionsInteracting(bool pionsinteract = true, double fpiChPT = fpi);
339
346 void SetKaonsInteracting(bool kaonsinteract = true, double fkaChPT = fpi * 1.2);
347
353 bool InteractingPions() const { return m_InteractingPions; }
354
360 bool InPionCondensedPhase() const;
361
362 // std::vector<EffectiveMassModel>& EMMPions() { return m_Pions; }
363 // double EMMPionCharge(int ipi) const { return m_PionCharges[ipi]; }
364
370 const ThermalParticle& PhotonParticle() const { return m_Photon; }
371
377 int NumberOfElectroWeakSpecies() const { return 1 + 2 * m_ChargedLeptons.size() + 2 * m_Neutrinos.size(); }
378
385 std::string GetSpeciesName(int id) const;
386
393 double GetDensity(int id) const;
394
395 protected:
398
401
403 std::vector<ThermalParticle> m_ChargedLeptons;
404
406 std::vector<ThermalParticle> m_Neutrinos;
407
408 // std::vector<EffectiveMassModel> m_Pions;
409 // std::vector<double> m_PionCharges;
410
413
416
418 double m_T;
419
421 std::vector<double> m_ChemCurrent;
422
424 std::vector<double> m_Asymmetries;
425
429 void ClearEMMs();
430
434 void ClearEMMByPdg(long long pdg);
435
443 {
444 public:
451
458 std::vector<double> Equations(const std::vector<double>& x);
459 private:
461 CosmicEoS* m_THM;
462 };
463 };
464
465} // namespace thermalfist
466
467#endif
Implementation of the generic Broyden's method routines.
Header with effective mass model implementation, including the Bose-condensed phase.
int m_N
The number of equations.
Definition Broyden.h:66
BroydenEquations()=default
Default constructor. Does nothing.
BroydenEquationsCosmology(CosmicEoS *model)
Constructor for the BroydenEquationsCosmology class.
Definition CosmicEoS.h:450
std::vector< double > Equations(const std::vector< double > &x)
Implements the equations to be solved.
double BaryonAsymmetry() const
Gets the current baryon asymmetry.
Definition CosmicEoS.h:157
double PressureHRG()
Calculates the partial pressure of the HRG part.
virtual void SetLeptonAsymmetry(LeptonFlavor::Name flavor, double l)
Sets the lepton flavor asymmetry (lepton flavor over entropy density).
Definition CosmicEoS.h:179
double Temperature() const
Gets the current temperature.
Definition CosmicEoS.h:99
bool m_IsCalculated
Whether the system has been calculated.
Definition CosmicEoS.h:415
std::string GetSpeciesName(int id) const
Gets the name of particle species of given id.
virtual void SetLeptonChemicalPotential(LeptonFlavor::Name flavor, double muL)
Set the lepton chemical potential.
Definition CosmicEoS.h:135
void ClearEMMByPdg(long long pdg)
Clears the effective mass model by PDG code.
virtual void SetChargeAsymmetry(double q)
Sets the electric charge asymmetry (charge over entropy density).
Definition CosmicEoS.h:164
bool m_InteractingPions
Whether to include pion interactions.
Definition CosmicEoS.h:412
double ChargeAsymmetry() const
Gets the current electric charge asymmetry.
Definition CosmicEoS.h:171
virtual void SetBaryonChemicalPotential(double muB)
Set the baryon chemical potential.
Definition CosmicEoS.h:106
std::vector< double > SolveChemicalPotentials(double T, const std::vector< double > &muInit=std::vector< double >())
Calculates the values of the chemical potential (B,Q,{L}) that satisfy the given asymmetry constraint...
double EnergyDensity()
Calculates the total energy density.
virtual void SetElectricChemicalPotential(double muQ)
Set the electric chemical potential.
double LeptonChemicalPotential(LeptonFlavor::Name flavor) const
Gets the current lepton chemical potential for a specific flavor.
Definition CosmicEoS.h:143
std::vector< ThermalParticle > m_Neutrinos
Neutrinos.
Definition CosmicEoS.h:406
ThermalParticle m_Photon
Photons.
Definition CosmicEoS.h:400
static double fpi
Pion decay constant for pion interactions a la ChPT.
Definition CosmicEoS.h:321
double EntropyDensityHRG()
Calculates the entropy density of the HRG part.
std::vector< double > m_Asymmetries
Vector of asymmetries (baryon, charge, lepton flavors)
Definition CosmicEoS.h:424
double LeptonAsymmetry(LeptonFlavor::Name flavor) const
Gets the current lepton flavor asymmetry.
Definition CosmicEoS.h:187
CosmicEoS(ThermalModelBase *THMbase, bool pionsinteract=false)
Constructor.
Definition CosmicEoS.cpp:25
int NumberOfElectroWeakSpecies() const
Gets the number of electroweak species (charged leptons and neutrinos) in the model.
Definition CosmicEoS.h:377
std::vector< double > m_ChemCurrent
Vector of chemical potentials (baryon, charge, lepton flavors)
Definition CosmicEoS.h:421
double ElectricChargeDensity(bool absolute=false)
Calculates the electric charge density.
ThermalModelBase * HRGModel() const
Gets the pointer to the HRG model object.
Definition CosmicEoS.h:78
double PressureChargedLepton(int iL)
Calculates the partial pressure of charged lepton flavor.
std::vector< ThermalParticle > m_ChargedLeptons
Charged leptons.
Definition CosmicEoS.h:403
double EnergyDensityHRG()
Calculates the energy density of the HRG part.
bool InPionCondensedPhase() const
Checks if the system has non-zero BEC of pions.
double ElectricChargeDensityHRG(bool absolute=false)
Calculates the electric charge density of the HRG part.
void SetPionsInteracting(bool pionsinteract=true, double fpiChPT=fpi)
Sets whether to include pion interactions via effective mass model.
virtual void SetTemperature(double T)
Set the temperature.
Definition CosmicEoS.cpp:99
double EnergyDensityChargedLepton(int iL)
Calculates the energy density of charged lepton flavor.
const std::vector< double > & ChemicalPotentials() const
Gets the chemical potentials (baryon number, electric charge, three lepton charges).
Definition CosmicEoS.h:85
void CalculatePrimordialDensities()
Calculates number densities of all particle species.
double NetDensityChargedLepton(int iL)
Calculates the net density of charged lepton flavor.
void ClearEMMs()
Clears the effective mass models.
double BaryonDensity(bool absolute=false)
Calculates the total baryon density.
virtual void SetBaryonAsymmetry(double b)
Sets the baryon number asymmetry (baryon over entropy density).
Definition CosmicEoS.h:150
void SetAsymmetries(const std::vector< double > &asymmetries)
Sets all asymmetries at once.
Definition CosmicEoS.h:194
double GetPionMass() const
Gets the mass of pi+.
void SetKaonsInteracting(bool kaonsinteract=true, double fkaChPT=fpi *1.2)
Sets whether to include kaon interactions via effective mass model.
double Pressure()
Calculates the total pressure.
bool InteractingPions() const
Checks if pions are interacting in the model.
Definition CosmicEoS.h:353
double ElectricChemicalPotential() const
Gets the current electric chemical potential.
Definition CosmicEoS.h:127
virtual ~CosmicEoS(void)
Destructor.
Definition CosmicEoS.h:71
double LeptonFlavorDensity(LeptonFlavor::Name flavor, bool absolute=false)
Calculates the lepton flavor density.
double EntropyDensity()
Calculates the total entropy density.
ThermalModelBase * m_modelHRG
Pointer to an HRG model object.
Definition CosmicEoS.h:397
double IsospinChargeDensity(bool absolute=false)
Calculates the isospin charge density.
double GetDensity(int id) const
Gets the number density for given species.
double m_T
Temperature in GeV.
Definition CosmicEoS.h:418
double BaryonChemicalPotential() const
Gets the baryon chemical potential.
Definition CosmicEoS.h:113
const ThermalParticle & PhotonParticle() const
Gets the ThermalParticle object instance corresponding to photons.
Definition CosmicEoS.h:370
Abstract base class for an HRG model implementation.
Class containing all information about a particle specie.
The main namespace where all classes and functions of the Thermal-FIST library reside.
Definition CosmicEoS.h:9
double IsospinCharge(const ThermalParticle &part)
Calculates the isospin charge of a particle.
An auxiliary struct containing the list of conserved lepton flavor charges.
Definition CosmicEoS.h:26
static const int NumberOfFlavors
Number of lepton flavors.
Definition CosmicEoS.h:38
static double m_mu
Muon mass.
Definition CosmicEoS.h:44
Name
Set of all conserved charges considered.
Definition CosmicEoS.h:31
static double m_e
Electron mass.
Definition CosmicEoS.h:41
static double m_tau
Tauon mass.
Definition CosmicEoS.h:47