Thermal-FIST 1.5
Package for hadron resonance gas model applications
Loading...
Searching...
No Matches
ThermalModelEVDiagonal.h
Go to the documentation of this file.
1/*
2 * Thermal-FIST package
3 *
4 * Copyright (c) 2014-2019 Volodymyr Vovchenko
5 *
6 * GNU General Public License (GPLv3 or later)
7 */
8#ifndef THERMALMODELEVDIAGONAL_H
9#define THERMALMODELEVDIAGONAL_H
10
12
13namespace thermalfist {
14
15 struct EVSolution {
16 double T, mu;
17 double n, P, en, s;
18 double mutil;
19 double nid, eid, sid, pid;
20 double fav, f2av, f3av, wav, wfav, w2fav, w2av;
21 double scv, scvid;
25 double skew, kurtosis;
26 double Cs;
27 double PT4, eT4, sT3;
29 };
30
46 {
47 public:
55
60 virtual ~ThermalModelEVDiagonal(void);
61
70 void FillVirialEV(const std::vector<double> & vi = std::vector<double>(0));
71
79 double ExcludedVolume(int i) const;
80
89
90
92
95 virtual void DisableMesonMesonVirial() {}
97 virtual void DisableMesonBaryonVirial() {}
99 virtual void DisableBaryonBaryonVirial() {}
104
105 // Override functions begin
106
107 void SetRadius(double rad);
108
109 void SetRadius(int i, double rad);
110
117 void FillVirial(const std::vector<double> & ri = std::vector<double>(0));
118
125 virtual void ReadInteractionParameters(const std::string &filename);
126
135 virtual void WriteInteractionParameters(const std::string &filename);
136
137 virtual double CalculateEigenvolumeFraction();
138
147 double VirialCoefficient(int i, int j) const;
148
157 void SetVirial(int i, int j, double b);
158
159 virtual void ChangeTPS(ThermalParticleSystem *TPS);
160
161 virtual void CalculatePrimordialDensities();
162
163 virtual void CalculateFluctuations();
164
166
167 virtual std::vector<double> CalculateChargeFluctuations(const std::vector<double> &chgs, int order = 4);
168
169 virtual double CalculatePressure();
170
171
172 virtual double CalculateEnergyDensity();
173
174 virtual double CalculateEntropyDensity();
175
176 virtual double CalculateEnergyDensityDerivativeT();
177
178 virtual void CalculateTemperatureDerivatives();
179
180 // Dummy
181 virtual double CalculateBaryonMatterEntropyDensity() { return 0.; }
182
183 virtual double CalculateMesonMatterEntropyDensity() { return 0.; }
184
185 // TODO properly with excluded volume
186 virtual double ParticleScaledVariance(int /*part*/) { return 1.; }
187
188 // TODO properly with excluded volume
189 virtual double ParticleSkewness(int /*part*/) { return 1.; }
190
191 // TODO properly with excluded volume
192 virtual double ParticleKurtosis(int /*part*/) { return 1.; }
193
194 virtual double ParticleScalarDensity(int part);
195
196 // Override functions end
197
198 protected:
205 virtual void SolvePressure();
206
213 double Pressure(double P);
214
223 double DensityId(int i, double Pressure);
224
233 double PressureId(int i, double Pressure);
234
244 double ScaledVarianceId(int i, double Pressure);
245
256 virtual double MuShift(int i) const;
257
258 std::vector<double> m_densitiesid;
259 std::vector<double> m_densitiesidnoshift;
260 std::vector<double> m_v;
262 double m_Pressure;
266
267 private:
268 class BroydenEquationsDEV : public BroydenEquations
269 {
270 public:
271 BroydenEquationsDEV(ThermalModelEVDiagonal *model) : BroydenEquations(), m_THM(model) { m_N = 1; m_mnc = 1.; }
272 std::vector<double> Equations(const std::vector<double> &x);
273 void SetMnc(double mnc) { m_mnc = mnc; }
274 private:
276 double m_mnc;
277 };
278
279 class BroydenJacobianDEV : public BroydenJacobian
280 {
281 public:
282 BroydenJacobianDEV(ThermalModelEVDiagonal *model) : BroydenJacobian(), m_THM(model) { m_mnc = 1.; }
283 std::vector<double> Jacobian(const std::vector<double> &x);
284 void SetMnc(double mnc) { m_mnc = mnc; }
285 private:
287 double m_mnc;
288 };
289
290 class BroydenSolutionCriteriumDEV : public Broyden::BroydenSolutionCriterium
291 {
292 public:
293 BroydenSolutionCriteriumDEV(ThermalModelEVDiagonal *model, double relative_error = Broyden::TOL) : Broyden::BroydenSolutionCriterium(relative_error), m_THM(model) { }
294 virtual bool IsSolved(const std::vector<double>& x, const std::vector<double>& f, const std::vector<double>& xdelta = std::vector<double>()) const;
295 protected:
297 };
298
299 class BroydenEquationsDEVOrig : public BroydenEquations
300 {
301 public:
302 BroydenEquationsDEVOrig(ThermalModelEVDiagonal *model) : BroydenEquations(), m_THM(model) { m_N = 1; }
303 std::vector<double> Equations(const std::vector<double> &x);
304 private:
306 };
307
308 class BroydenJacobianDEVOrig : public BroydenJacobian
309 {
310 public:
311 BroydenJacobianDEVOrig(ThermalModelEVDiagonal *model) : BroydenJacobian(), m_THM(model) {}
312 std::vector<double> Jacobian(const std::vector<double> &x);
313 private:
315 };
316 };
317
318} // namespace thermalfist
319
320#endif
321
map< string, double > params
BroydenSolutionCriterium(double maximum_error=TOL)
Definition Broyden.h:153
Abstract class which defines the system of non-linear equations to be solved by the Broyden's method.
Definition Broyden.h:32
int m_N
The number of equations.
Definition Broyden.h:66
BroydenEquations()=default
Default constructor. Does nothing.
static const double TOL
Default desired solution accuracy.
Definition Broyden.h:183
Class which implements calculation of the Jacobian needed for the Broyden's method.
Definition Broyden.h:77
BroydenJacobian(BroydenEquations *eqs=NULL)
Construct a new BroydenJacobian object.
Definition Broyden.h:89
ThermalModelBase(ThermalParticleSystem *TPS, const ThermalModelParameters &params=ThermalModelParameters())
Construct a new ThermalModelBase object.
Class implementing the diagonal excluded-volume model.
double DensityId(int i, double Pressure)
Calculate the ideal gas density of particle species i for the given pressure value.
double ExcludedVolume(int i) const
The excluded volume parameter of particle species i.
void FillVirial(const std::vector< double > &ri=std::vector< double >(0))
Fills the vector of particle eigenvolume parameters.
ThermalModelEVDiagonal(ThermalParticleSystem *TPS, const ThermalModelParameters &params=ThermalModelParameters())
Construct a new ThermalModelEVDiagonal object.
virtual void CalculateFluctuations()
Computes the fluctuation observables.
void SetRadius(double rad)
Set the same excluded volume radius parameter for all species.
virtual void CalculateTemperatureDerivatives()
Computes the temperature derivatives of densities, shifted chemical potentials, and primordial hadron...
void FillVirialEV(const std::vector< double > &vi=std::vector< double >(0))
Same as FillVirial() but uses the diagonal excluded-volume coefficients as input instead of radii.
virtual void WriteInteractionParameters(const std::string &filename)
Write the set of eigenvolume parameters for all particles to an external file.
void SetVirial(int i, int j, double b)
Sets the eigenvolume parameter of particle species i.
double CommonSuppressionFactor()
The density suppression factor , common for all species.
virtual std::vector< double > CalculateChargeFluctuations(const std::vector< double > &chgs, int order=4)
Calculates fluctuations (diagonal susceptibilities) of an arbitrary "conserved" charge.
double PressureId(int i, double Pressure)
Calculate the ideal gas pressure of particle species i for the given pressure value.
virtual double MuShift(int i) const
The shift in the chemical potential of particle species i due to the excluded volume interactions.
virtual void SolvePressure()
Solves the transcdental equation for the pressure.
virtual void CalculatePrimordialDensities()
Calculates the primordial densities of all species.
double ScaledVarianceId(int i, double Pressure)
Calculate the ideal gas scaled variance of particle species i number fluctuations for the given press...
virtual void ReadInteractionParameters(const std::string &filename)
Read the set of eigenvolume parameters for all particles from an external file.
virtual void CalculateTwoParticleCorrelations()
Computes the fluctuations and correlations of the primordial particle numbers.
virtual void ChangeTPS(ThermalParticleSystem *TPS)
Change the particle list.
double Pressure(double P)
Computes the l.h.s. of the transcdental equation for the pressure.
double VirialCoefficient(int i, int j) const
Return the eigenvolume parameter of particle species i.
virtual ~ThermalModelEVDiagonal(void)
Destroy the ThermalModelEVDiagonal object.
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.