Thermal-FIST 1.6
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, bool dimensionfull = false);
168
169 virtual double CalculatePressure();
170
171
172 virtual double CalculateEnergyDensity();
173
174 virtual double CalculateEntropyDensity();
175
176 virtual double CalculateEnergyDensityDerivativeT();
177
178 virtual double CalculateEntropyDensityDerivativeT();
179
180 virtual void CalculateTemperatureDerivatives();
181
182 // Dummy
183 virtual double CalculateBaryonMatterEntropyDensity() { return 0.; }
184
185 virtual double CalculateMesonMatterEntropyDensity() { return 0.; }
186
187 // TODO properly with excluded volume
188 virtual double ParticleScaledVariance(int /*part*/) { return 1.; }
189
190 // TODO properly with excluded volume
191 virtual double ParticleSkewness(int /*part*/) { return 1.; }
192
193 // TODO properly with excluded volume
194 virtual double ParticleKurtosis(int /*part*/) { return 1.; }
195
196 virtual double ParticleScalarDensity(int part);
197
198 // Override functions end
199
200 protected:
207 virtual void SolvePressure();
208
215 double Pressure(double P);
216
225 double DensityId(int i, double Pressure);
226
235 double PressureId(int i, double Pressure);
236
246 double ScaledVarianceId(int i, double Pressure);
247
258 virtual double MuShift(int i) const;
259
260 std::vector<double> m_densitiesid;
261 std::vector<double> m_densitiesidnoshift;
262 std::vector<double> m_v;
264 double m_Pressure;
268
269 private:
270 class BroydenEquationsDEV : public BroydenEquations
271 {
272 public:
273 BroydenEquationsDEV(ThermalModelEVDiagonal *model) : BroydenEquations(), m_THM(model) { m_N = 1; m_mnc = 1.; }
274 std::vector<double> Equations(const std::vector<double> &x);
275 void SetMnc(double mnc) { m_mnc = mnc; }
276 private:
278 double m_mnc;
279 };
280
281 class BroydenJacobianDEV : public BroydenJacobian
282 {
283 public:
284 BroydenJacobianDEV(ThermalModelEVDiagonal *model) : BroydenJacobian(), m_THM(model) { m_mnc = 1.; }
285 std::vector<double> Jacobian(const std::vector<double> &x);
286 void SetMnc(double mnc) { m_mnc = mnc; }
287 private:
289 double m_mnc;
290 };
291
292 class BroydenSolutionCriteriumDEV : public Broyden::BroydenSolutionCriterium
293 {
294 public:
295 BroydenSolutionCriteriumDEV(ThermalModelEVDiagonal *model, double relative_error = Broyden::TOL) : Broyden::BroydenSolutionCriterium(relative_error), m_THM(model) { }
296 virtual bool IsSolved(const std::vector<double>& x, const std::vector<double>& f, const std::vector<double>& xdelta = std::vector<double>()) const;
297 protected:
299 };
300
301 class BroydenEquationsDEVOrig : public BroydenEquations
302 {
303 public:
304 BroydenEquationsDEVOrig(ThermalModelEVDiagonal *model) : BroydenEquations(), m_THM(model) { m_N = 1; }
305 std::vector<double> Equations(const std::vector<double> &x);
306 private:
308 };
309
310 class BroydenJacobianDEVOrig : public BroydenJacobian
311 {
312 public:
313 BroydenJacobianDEVOrig(ThermalModelEVDiagonal *model) : BroydenJacobian(), m_THM(model) {}
314 std::vector<double> Jacobian(const std::vector<double> &x);
315 private:
317 };
318 };
319
320} // namespace thermalfist
321
322#endif
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.
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.
virtual std::vector< double > CalculateChargeFluctuations(const std::vector< double > &chgs, int order=4, bool dimensionfull=false)
Calculates fluctuations (diagonal susceptibilities) of an arbitrary "conserved" charge.
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.