Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4StatMFMacroChemicalPotential Class Reference

#include <G4StatMFMacroChemicalPotential.hh>

Public Member Functions

 G4StatMFMacroChemicalPotential (const G4double anA, const G4double aZ, const G4double kappa, const G4double temp, std::vector< G4VStatMFMacroCluster * > *ClusterVector)
 
 ~G4StatMFMacroChemicalPotential ()
 
G4double operator() (const G4double nu)
 
G4double GetMeanMultiplicity (void) const
 
G4double GetChemicalPotentialMu (void) const
 
G4double GetChemicalPotentialNu (void) const
 
G4double CalcChemicalPotentialNu (void)
 

Detailed Description

Definition at line 44 of file G4StatMFMacroChemicalPotential.hh.

Constructor & Destructor Documentation

◆ G4StatMFMacroChemicalPotential()

G4StatMFMacroChemicalPotential::G4StatMFMacroChemicalPotential ( const G4double  anA,
const G4double  aZ,
const G4double  kappa,
const G4double  temp,
std::vector< G4VStatMFMacroCluster * > *  ClusterVector 
)
inline

Definition at line 48 of file G4StatMFMacroChemicalPotential.hh.

51 :
52 theA(anA),
53 theZ(aZ),
54 _Kappa(kappa),
55 _MeanMultiplicity(0.0),
56 _MeanTemperature(temp),
57 _ChemPotentialMu(0.0),
58 _ChemPotentialNu(0.0),
59 _theClusters(ClusterVector)
60 {};

◆ ~G4StatMFMacroChemicalPotential()

G4StatMFMacroChemicalPotential::~G4StatMFMacroChemicalPotential ( )
inline

Definition at line 62 of file G4StatMFMacroChemicalPotential.hh.

62{};

Member Function Documentation

◆ CalcChemicalPotentialNu()

G4double G4StatMFMacroChemicalPotential::CalcChemicalPotentialNu ( void  )

Definition at line 59 of file G4StatMFMacroChemicalPotential.cc.

61{
62 G4double CP = ((3./5.)*elm_coupling/G4StatMFParameters::Getr0())*
63 (1.0-1.0/std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(),1.0/3.0));
64
65 // Initial value for _ChemPotentialNu
66 _ChemPotentialNu = (theZ/theA)*(8.0*G4StatMFParameters::GetGamma0()+2.0*CP*std::pow(theA,2./3.)) -
68
69
70 G4double ChemPa = _ChemPotentialNu;
71 G4double ChemPb = 0.5*_ChemPotentialNu;
72
73 G4double fChemPa = this->operator()(ChemPa);
74 G4double fChemPb = this->operator()(ChemPb);
75
76 if (fChemPa*fChemPb > 0.0) {
77 // bracketing the solution
78 if (fChemPa < 0.0) {
79 do {
80 ChemPb -= 1.5*std::abs(ChemPb-ChemPa);
81 fChemPb = this->operator()(ChemPb);
82 } while (fChemPb < 0.0);
83 } else {
84 do {
85 ChemPb += 1.5*std::abs(ChemPb-ChemPa);
86 fChemPb = this->operator()(ChemPb);
87 } while (fChemPb > 0.0);
88 }
89 }
90
93 theSolver->SetIntervalLimits(ChemPa,ChemPb);
94 // if (!theSolver->Crenshaw(*this))
95 if (!theSolver->Brent(*this)){
96 G4cerr <<"G4StatMFMacroChemicalPotential:"<<" ChemPa="<<ChemPa<<" ChemPb="<<ChemPb<< G4endl;
97 G4cerr <<"G4StatMFMacroChemicalPotential:"<<" fChemPa="<<fChemPa<<" fChemPb="<<fChemPb<< G4endl;
98 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroChemicalPotential::CalcChemicalPotentialNu: I couldn't find the root.");
99 }
100 _ChemPotentialNu = theSolver->GetRoot();
101 delete theSolver;
102 return _ChemPotentialNu;
103}
double G4double
Definition: G4Types.hh:64
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4bool Brent(Function &theFunction)
void SetIntervalLimits(const G4double Limit1, const G4double Limit2)
G4double GetRoot(void) const
Definition: G4Solver.hh:77
static G4double Getr0()
static G4double GetGamma0()
static G4double GetKappaCoulomb()

◆ GetChemicalPotentialMu()

G4double G4StatMFMacroChemicalPotential::GetChemicalPotentialMu ( void  ) const
inline

Definition at line 84 of file G4StatMFMacroChemicalPotential.hh.

84{return _ChemPotentialMu;}

◆ GetChemicalPotentialNu()

G4double G4StatMFMacroChemicalPotential::GetChemicalPotentialNu ( void  ) const
inline

Definition at line 86 of file G4StatMFMacroChemicalPotential.hh.

86{return _ChemPotentialNu;}

◆ GetMeanMultiplicity()

G4double G4StatMFMacroChemicalPotential::GetMeanMultiplicity ( void  ) const
inline

Definition at line 82 of file G4StatMFMacroChemicalPotential.hh.

82{return _MeanMultiplicity;}

◆ operator()()

G4double G4StatMFMacroChemicalPotential::operator() ( const G4double  nu)
inline

Definition at line 64 of file G4StatMFMacroChemicalPotential.hh.

65 { return (theZ - this->CalcMeanZ(nu))/theZ; }

Referenced by CalcChemicalPotentialNu().


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