Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Heed::VanDerWaals Class Reference

Helper class for Van-der-Waals equation. More...

#include <MoleculeDef.h>

Public Member Functions

 VanDerWaals (double fPk, double fTk)
 
double a () const
 
double b () const
 
double Vk () const
 
double Pk () const
 
double Tk () const
 
double volume_of_mole (double T, double p, int &s_not_single)
 
VanDerWaalscopy () const
 

Detailed Description

Helper class for Van-der-Waals equation.

Definition at line 10 of file MoleculeDef.h.

Constructor & Destructor Documentation

◆ VanDerWaals()

Heed::VanDerWaals::VanDerWaals ( double  fPk,
double  fTk 
)

Definition at line 17 of file MoleculeDef.cpp.

17 : Pkh(fPk), Tkh(fTk) {
18 // Rydberg constant
19 const double R = k_Boltzmann * Avogadro;
20
21 Vkh = R * 3.0 / 8.0 * Tkh / Pkh;
22 ah = 3 * Pkh * Vkh * Vkh;
23 bh = 1.0 / 3.0 * Vkh;
24}

Member Function Documentation

◆ a()

double Heed::VanDerWaals::a ( ) const
inline

Definition at line 20 of file MoleculeDef.h.

20{ return ah; }

Referenced by Heed::operator<<().

◆ b()

double Heed::VanDerWaals::b ( ) const
inline

Definition at line 21 of file MoleculeDef.h.

21{ return bh; }

Referenced by Heed::operator<<().

◆ copy()

VanDerWaals * Heed::VanDerWaals::copy ( ) const

Definition at line 43 of file MoleculeDef.cpp.

43{ return new VanDerWaals(*this); }
VanDerWaals(double fPk, double fTk)
Definition: MoleculeDef.cpp:17

◆ Pk()

double Heed::VanDerWaals::Pk ( ) const
inline

Definition at line 23 of file MoleculeDef.h.

23{ return Pkh; }

Referenced by Heed::operator<<().

◆ Tk()

double Heed::VanDerWaals::Tk ( ) const
inline

Definition at line 24 of file MoleculeDef.h.

24{ return Tkh; }

Referenced by Heed::operator<<().

◆ Vk()

double Heed::VanDerWaals::Vk ( ) const
inline

Definition at line 22 of file MoleculeDef.h.

22{ return Vkh; }

Referenced by Heed::operator<<().

◆ volume_of_mole()

double Heed::VanDerWaals::volume_of_mole ( double  T,
double  p,
int &  s_not_single 
)

Definition at line 26 of file MoleculeDef.cpp.

26 {
27 mfunname("VanDerWaals::volume_of_mole(...)");
28
29 double Tr = T / Tkh;
30 double Pr = p / Pkh;
31 Iprint2n(mcout, Tr, Pr);
32 Cubic cb(Pr, -1.0 / 3.0 * (Pr + 8 * Tr), 3, -1);
33 double r[3];
34 int q = cb.find_real_zero(r);
35 check_econd11(q, <= 0, mcerr);
36 double x = r[q - 1]; // this is the relative volume taken by one mole
37 double res = x * Vkh; // this is the absolute volume taken by one mole
38 Iprint2n(mcout, x, res);
39 s_not_single = q == 2 ? 1 : 0;
40 return res;
41}
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:155
#define mfunname(string)
Definition: FunNameStack.h:45
#define mcout
Definition: prstream.h:126
#define mcerr
Definition: prstream.h:128
#define Iprint2n(file, name1, name2)
Definition: prstream.h:220

Referenced by Heed::GasDef::GasDef().


The documentation for this class was generated from the following files: