Thermal-FIST 1.5
Package for hadron resonance gas model applications
Loading...
Searching...
No Matches
ThermalModelPCE.h
Go to the documentation of this file.
1#ifndef THERMALMODELPCE_H
2#define THERMALMODELPCE_H
3#include <map>
4
6#include "HRGBase/Broyden.h"
7
8namespace thermalfist {
9
10
37 {
38 public:
52
53
61 ThermalModelPCE(ThermalModelBase *THMbase, bool FreezeLonglived = false, double LonglivedResoWidthCut = 0.015);
62
67 virtual ~ThermalModelPCE(void) { }
68
70
77 void UseSahaForNuclei(bool flag) { m_UseSahaForNuclei = flag; m_StabilityFlagsSet = false; }
78 bool UseSahaForNuclei() const { return m_UseSahaForNuclei; }
80
82
93
95
102 void SetLonglivedResonanceWidthCut(double width_cut) { m_ResoWidthCut = width_cut; FreezeLonglivedResonances(true); }
105
107
114 virtual void SetStabilityFlags(const std::vector<int>& StabilityFlags);
115 const std::vector<int>& StabilityFlags() const { return m_StabilityFlags; }
117
119
126 void SetChemicalFreezeout(const ThermalModelParameters& params, const std::vector<double>& ChemInit = std::vector<double>(0));
128
130
135 void SetEntropyDensityChem(double sinit) { m_EntropyDensityInit = sinit; }
136 double EntropyDensityChem() const { return m_EntropyDensityInit; }
138
143
152 virtual void CalculatePCE(double param, PCEMode mode = AtFixedTemperature);
153
157 const std::vector<double>& ChemicalPotentials() const { return m_ChemCurrent; }
158 std::vector<double>& ChemicalPotentials() { return m_ChemCurrent; }
159
163 double Volume() const { return m_ParametersCurrent.V; }
164
171
180 static std::vector<int> ComputePCEStabilityFlags(
181 const ThermalParticleSystem* TPS,
182 bool SahaEquationForNuclei = true,
183 bool FreezeLongLived = false,
184 double WidthCut = 0.015);
185
192
193 const std::vector< std::vector<double> >& EffectiveCharges() const { return m_EffectiveCharges; }
194 const std::vector<int>& StableMapTo() const { return m_StableMapTo; }
195
196
197 protected:
199
202
207
210
213
216 std::vector<int> m_StabilityFlags;
218 std::vector< std::vector<double> > m_EffectiveCharges;
219 std::vector<int> m_StableMapTo;
220
223 std::vector<double> m_ChemInit;
224 std::vector<double> m_DensitiesInit;
225 std::vector<double> m_StableDensitiesInit;
228
231 std::vector<double> m_ChemCurrent;
232
233
234
246 {
247 public:
248 BroydenEquationsPCE(ThermalModelPCE *model, int mode = 0) : BroydenEquations(), m_THM(model), m_Mode(mode) { m_N = m_THM->m_StableComponentsNumber + 1; }
249
258 std::vector<double> Equations(const std::vector<double> &x);
259 private:
260 ThermalModelPCE *m_THM;
261 int m_Mode;
262 };
263
264 };
265
266} // namespace thermalfist
267
268#endif
269
Implementation of the generic Broyden's method routines.
map< string, double > params
int m_N
The number of equations.
Definition Broyden.h:66
BroydenEquations()=default
Default constructor. Does nothing.
Abstract base class for an HRG model implementation.
BroydenEquationsPCE(ThermalModelPCE *model, int mode=0)
std::vector< double > Equations(const std::vector< double > &x)
const std::vector< std::vector< double > > & EffectiveCharges() const
ThermalModelPCE(ThermalModelBase *THMbase, bool FreezeLonglived=false, double LonglivedResoWidthCut=0.015)
Construct a new ThermalModelPCE object.
double LonglivedResonanceWidthCut() const
const std::vector< int > & StableMapTo() const
void SetChemicalFreezeout(const ThermalModelParameters &params, const std::vector< double > &ChemInit=std::vector< double >(0))
Sets the chemical freeze-out conditions to be used as an initial condition for PCE calculations.
ThermalModelParameters m_ParametersCurrent
The current PCE thermal paratmeres and chemical potentials.
ThermalModelParameters m_ParametersInit
Parameters at the chemical freeze-out.
void FreezeLonglivedResonances(bool flag)
Whether long-lived resonances yields should be frozen.
bool m_ChemicalFreezeoutSet
Whether the chemical freeze-out "initial" condition has been set.
virtual void SetStabilityFlags(const std::vector< int > &StabilityFlags)
Manually set the PCE stability flags for all species.
const std::vector< double > & ChemicalPotentials() const
std::vector< double > m_StableDensitiesInit
bool m_UseSahaForNuclei
Whether nuclear abundances are calculated via the Saha equation.
std::vector< int > m_StableMapTo
double m_ResoWidthCut
Resonance width cut for freezeing the resonance abundances.
std::vector< double > m_ChemCurrent
void SetEntropyDensityChem(double sinit)
Sets the entropy density at the chemical freeze-out.
void ApplyFixForBoseCondensation()
Modifies the decay threshold masses of bosonic resonances such that the Bose-Condesation does not occ...
static void PrepareNucleiForPCE(ThermalParticleSystem *TPS)
Fills the "decay" products of light nuclei in accordance with their baryon content.
virtual ~ThermalModelPCE(void)
Destroy the ThermalModelPCE object.
std::vector< double > m_DensitiesInit
void SetLonglivedResonanceWidthCut(double width_cut)
The threshold resonance width value to consider the resonance long-lived and its abundance frozen in ...
void UseSahaForNuclei(bool flag)
Whether the nuclear abundances are evaluated through the Saha equation.
bool m_IsCalculated
Whether PCE has been calculated.
std::vector< int > m_StabilityFlags
std::vector< double > m_ChemInit
std::vector< double > & ChemicalPotentials()
static std::vector< int > ComputePCEStabilityFlags(const ThermalParticleSystem *TPS, bool SahaEquationForNuclei=true, bool FreezeLongLived=false, double WidthCut=0.015)
Computes the PCE stability flags based on the provided particle list and a number of parameters.
ThermalModelBase * ThermalModel() const
Pointer to the HRG model used in calculations.
PCEMode
Whether partial chemical equilibrium should be calculated at a fixed value of the temperature or a fi...
@ AtFixedVolume
Partial chemical equilibrium at fixed value of the volume.
@ AtFixedTemperature
Partial chemical equilibrium at fixed value of the temperature.
const std::vector< int > & StabilityFlags() const
virtual void CalculatePCE(double param, PCEMode mode=AtFixedTemperature)
Solves the equations of partial chemical equilibrium at a fixed temperature or a fixed volume.
std::vector< std::vector< double > > m_EffectiveCharges
bool m_FreezeLonglivedResonances
Whether long-lived resonances are frozen at Tch.
bool m_StabilityFlagsSet
PCE configuration, list of stable species etc.
Class containing the particle list.
The main namespace where all classes and functions of the Thermal-FIST library reside.
Definition CosmicEoS.h:9
Structure containing all thermal parameters of the model.