Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
G4StatMFMacroTemperature Class Reference

#include <G4StatMFMacroTemperature.hh>

Public Member Functions

G4double CalcTemperature (void)
 
 G4StatMFMacroTemperature (const G4double anA, const G4double aZ, const G4double ExEnergy, const G4double FreeE0, const G4double kappa, std::vector< G4VStatMFMacroCluster * > *ClusterVector)
 
G4double GetChemicalPotentialMu (void) const
 
G4double GetChemicalPotentialNu (void) const
 
G4double GetEntropy (void) const
 
G4double GetMeanMultiplicity (void) const
 
G4double GetTemperature (void) const
 
G4double operator() (const G4double T)
 
 ~G4StatMFMacroTemperature ()
 

Private Member Functions

void CalcChemicalPotentialNu (const G4double T)
 
G4double FragsExcitEnergy (const G4double T)
 
 G4StatMFMacroTemperature ()
 
 G4StatMFMacroTemperature (const G4StatMFMacroTemperature &)
 
G4bool operator!= (const G4StatMFMacroTemperature &right) const
 
G4StatMFMacroTemperatureoperator= (const G4StatMFMacroTemperature &right)
 
G4bool operator== (const G4StatMFMacroTemperature &right) const
 

Private Attributes

G4double _ChemPotentialMu
 
G4double _ChemPotentialNu
 
G4double _ExEnergy
 
G4double _FreeInternalE0
 
G4double _Kappa
 
G4double _MeanEntropy
 
G4double _MeanMultiplicity
 
G4double _MeanTemperature
 
std::vector< G4VStatMFMacroCluster * > * _theClusters
 
G4double theA
 
G4double theZ
 

Detailed Description

Definition at line 41 of file G4StatMFMacroTemperature.hh.

Constructor & Destructor Documentation

◆ G4StatMFMacroTemperature() [1/3]

G4StatMFMacroTemperature::G4StatMFMacroTemperature ( const G4double  anA,
const G4double  aZ,
const G4double  ExEnergy,
const G4double  FreeE0,
const G4double  kappa,
std::vector< G4VStatMFMacroCluster * > *  ClusterVector 
)

◆ ~G4StatMFMacroTemperature()

G4StatMFMacroTemperature::~G4StatMFMacroTemperature ( )

Definition at line 62 of file G4StatMFMacroTemperature.cc.

63{}

◆ G4StatMFMacroTemperature() [2/3]

G4StatMFMacroTemperature::G4StatMFMacroTemperature ( )
private

◆ G4StatMFMacroTemperature() [3/3]

G4StatMFMacroTemperature::G4StatMFMacroTemperature ( const G4StatMFMacroTemperature )
inlineprivate

Definition at line 61 of file G4StatMFMacroTemperature.hh.

61{};

Member Function Documentation

◆ CalcChemicalPotentialNu()

void G4StatMFMacroTemperature::CalcChemicalPotentialNu ( const G4double  T)
private

◆ CalcTemperature()

G4double G4StatMFMacroTemperature::CalcTemperature ( void  )

Definition at line 65 of file G4StatMFMacroTemperature.cc.

66{
67 // Inital guess for the interval of the ensemble temperature values
68 G4double Ta = 0.5;
69 G4double Tb = std::max(std::sqrt(_ExEnergy/(theA*0.12)),0.01*MeV);
70
71 G4double fTa = this->operator()(Ta);
72 G4double fTb = this->operator()(Tb);
73
74 // Bracketing the solution
75 // T should be greater than 0.
76 // The interval is [Ta,Tb]
77 // We start with a value for Ta = 0.5 MeV
78 // it should be enough to have fTa > 0 If it isn't
79 // the case, we decrease Ta. But carefully, because
80 // fTa growes very fast when Ta is near 0 and we could have
81 // an overflow.
82
83 G4int iterations = 0;
84 // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
85 while (fTa < 0.0 && ++iterations < 10) {
86 Ta -= 0.5*Ta;
87 fTa = this->operator()(Ta);
88 }
89 // Usually, fTb will be less than 0, but if it is not the case:
90 iterations = 0;
91 // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
92 while (fTa*fTb > 0.0 && iterations++ < 10) {
93 Tb += 2.*std::fabs(Tb-Ta);
94 fTb = this->operator()(Tb);
95 }
96
97 if (fTa*fTb > 0.0) {
98 G4cerr <<"G4StatMFMacroTemperature:"<<" Ta="<<Ta<<" Tb="<<Tb<< G4endl;
99 G4cerr <<"G4StatMFMacroTemperature:"<<" fTa="<<fTa<<" fTb="<<fTb<< G4endl;
100 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::CalcTemperature: I couldn't bracket the solution.");
101 }
102
105 theSolver->SetIntervalLimits(Ta,Tb);
106 if (!theSolver->Crenshaw(*this)){
107 G4cout <<"G4StatMFMacroTemperature, Crenshaw method failed:"<<" Ta="
108 <<Ta<<" Tb="<<Tb<< G4endl;
109 G4cout <<"G4StatMFMacroTemperature, Crenshaw method failed:"<<" fTa="
110 <<fTa<<" fTb="<<fTb<< G4endl;
111 }
112 _MeanTemperature = theSolver->GetRoot();
113 G4double FunctionValureAtRoot = this->operator()(_MeanTemperature);
114 delete theSolver;
115
116 // Verify if the root is found and it is indeed within the physical domain,
117 // say, between 1 and 50 MeV, otherwise try Brent method:
118 if (std::fabs(FunctionValureAtRoot) > 5.e-2) {
119 if (_MeanTemperature < 1. || _MeanTemperature > 50.) {
120 G4cout << "Crenshaw method failed; function = " << FunctionValureAtRoot
121 << " solution? = " << _MeanTemperature << " MeV " << G4endl;
122 G4Solver<G4StatMFMacroTemperature> * theSolverBrent =
124 theSolverBrent->SetIntervalLimits(Ta,Tb);
125 if (!theSolverBrent->Brent(*this)){
126 G4cout <<"G4StatMFMacroTemperature, Brent method failed:"
127 <<" Ta="<<Ta<<" Tb="<<Tb<< G4endl;
128 G4cout <<"G4StatMFMacroTemperature, Brent method failed:"
129 <<" fTa="<<fTa<<" fTb="<<fTb<< G4endl;
130 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method.");
131 }
132
133 _MeanTemperature = theSolverBrent->GetRoot();
134 FunctionValureAtRoot = this->operator()(_MeanTemperature);
135 delete theSolverBrent;
136 }
137 if (std::abs(FunctionValureAtRoot) > 5.e-2) {
138 G4cout << "Brent method failed; function = " << FunctionValureAtRoot
139 << " solution? = " << _MeanTemperature << " MeV " << G4endl;
140 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method.");
141 }
142 }
143 //G4cout << "G4StatMFMacroTemperature::CalcTemperature: function = "
144 //<< FunctionValureAtRoot
145 // << " T(MeV)= " << _MeanTemperature << G4endl;
146 return _MeanTemperature;
147}
static constexpr double MeV
Definition: G4SIunits.hh:200
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4bool Brent(Function &theFunction)
void SetIntervalLimits(const G4double Limit1, const G4double Limit2)
G4double GetRoot(void) const
Definition: G4Solver.hh:76
G4bool Crenshaw(Function &theFunction)
G4double operator()(const G4double T)
T max(const T t1, const T t2)
brief Return the largest of the two arguments

References _ExEnergy, _MeanTemperature, G4Solver< Function >::Brent(), G4Solver< Function >::Crenshaw(), G4cerr, G4cout, G4endl, G4Solver< Function >::GetRoot(), G4INCL::Math::max(), MeV, operator()(), G4Solver< Function >::SetIntervalLimits(), and theA.

Referenced by G4StatMFMacroCanonical::CalculateTemperature().

◆ FragsExcitEnergy()

G4double G4StatMFMacroTemperature::FragsExcitEnergy ( const G4double  T)
private

Definition at line 149 of file G4StatMFMacroTemperature.cc.

152{
153 // Model Parameters
154 G4Pow* g4calc = G4Pow::GetInstance();
157 G4double FreeVol = _Kappa*(4.*pi/3.)*R0*R0*R0;
158
159 // Calculate Chemical potentials
161
162
163 // Average total fragment energy
164 G4double AverageEnergy = 0.0;
165 std::vector<G4VStatMFMacroCluster*>::iterator i;
166 for (i = _theClusters->begin(); i != _theClusters->end(); ++i)
167 {
168 AverageEnergy += (*i)->GetMeanMultiplicity() * (*i)->CalcEnergy(T);
169 }
170
171 // Add Coulomb energy
172 AverageEnergy += 0.6*elm_coupling*theZ*theZ/R;
173
174 // Calculate mean entropy
175 _MeanEntropy = 0.0;
176 for (i = _theClusters->begin(); i != _theClusters->end(); ++i)
177 {
178 _MeanEntropy += (*i)->CalcEntropy(T,FreeVol);
179 }
180
181 // Excitation energy per nucleon
182 return AverageEnergy - _FreeInternalE0;
183}
static constexpr double pi
Definition: G4SIunits.hh:55
Definition: G4Pow.hh:49
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double A13(G4double A) const
Definition: G4Pow.cc:120
G4double Z13(G4int Z) const
Definition: G4Pow.hh:123
void CalcChemicalPotentialNu(const G4double T)
static G4double Getr0()
static G4double GetKappaCoulomb()
int elm_coupling
Definition: hepunit.py:285

References _FreeInternalE0, _Kappa, _MeanEntropy, _theClusters, G4Pow::A13(), CalcChemicalPotentialNu(), source.hepunit::elm_coupling, G4Pow::GetInstance(), G4StatMFParameters::GetKappaCoulomb(), G4StatMFParameters::Getr0(), pi, theA, theZ, and G4Pow::Z13().

Referenced by operator()().

◆ GetChemicalPotentialMu()

G4double G4StatMFMacroTemperature::GetChemicalPotentialMu ( void  ) const
inline

Definition at line 73 of file G4StatMFMacroTemperature.hh.

73{return _ChemPotentialMu;}

References _ChemPotentialMu.

Referenced by G4StatMFMacroCanonical::CalculateTemperature().

◆ GetChemicalPotentialNu()

G4double G4StatMFMacroTemperature::GetChemicalPotentialNu ( void  ) const
inline

Definition at line 75 of file G4StatMFMacroTemperature.hh.

75{return _ChemPotentialNu;}

References _ChemPotentialNu.

Referenced by G4StatMFMacroCanonical::CalculateTemperature().

◆ GetEntropy()

G4double G4StatMFMacroTemperature::GetEntropy ( void  ) const
inline

Definition at line 79 of file G4StatMFMacroTemperature.hh.

79{return _MeanEntropy;}

References _MeanEntropy.

Referenced by G4StatMFMacroCanonical::CalculateTemperature().

◆ GetMeanMultiplicity()

G4double G4StatMFMacroTemperature::GetMeanMultiplicity ( void  ) const
inline

Definition at line 71 of file G4StatMFMacroTemperature.hh.

71{return _MeanMultiplicity;}

References _MeanMultiplicity.

Referenced by G4StatMFMacroCanonical::CalculateTemperature().

◆ GetTemperature()

G4double G4StatMFMacroTemperature::GetTemperature ( void  ) const
inline

Definition at line 77 of file G4StatMFMacroTemperature.hh.

77{return _MeanTemperature;}

References _MeanTemperature.

◆ operator!=()

G4bool G4StatMFMacroTemperature::operator!= ( const G4StatMFMacroTemperature right) const
private

◆ operator()()

G4double G4StatMFMacroTemperature::operator() ( const G4double  T)
inline

Definition at line 52 of file G4StatMFMacroTemperature.hh.

53 { return (_ExEnergy - this->FragsExcitEnergy(T))/_ExEnergy; }
G4double FragsExcitEnergy(const G4double T)

References _ExEnergy, and FragsExcitEnergy().

Referenced by CalcTemperature().

◆ operator=()

G4StatMFMacroTemperature & G4StatMFMacroTemperature::operator= ( const G4StatMFMacroTemperature right)
private

◆ operator==()

G4bool G4StatMFMacroTemperature::operator== ( const G4StatMFMacroTemperature right) const
private

Field Documentation

◆ _ChemPotentialMu

G4double G4StatMFMacroTemperature::_ChemPotentialMu
private

Definition at line 105 of file G4StatMFMacroTemperature.hh.

Referenced by CalcChemicalPotentialNu(), and GetChemicalPotentialMu().

◆ _ChemPotentialNu

G4double G4StatMFMacroTemperature::_ChemPotentialNu
private

Definition at line 107 of file G4StatMFMacroTemperature.hh.

Referenced by CalcChemicalPotentialNu(), and GetChemicalPotentialNu().

◆ _ExEnergy

G4double G4StatMFMacroTemperature::_ExEnergy
private

Definition at line 95 of file G4StatMFMacroTemperature.hh.

Referenced by CalcTemperature(), and operator()().

◆ _FreeInternalE0

G4double G4StatMFMacroTemperature::_FreeInternalE0
private

Definition at line 97 of file G4StatMFMacroTemperature.hh.

Referenced by FragsExcitEnergy().

◆ _Kappa

G4double G4StatMFMacroTemperature::_Kappa
private

Definition at line 99 of file G4StatMFMacroTemperature.hh.

Referenced by CalcChemicalPotentialNu(), and FragsExcitEnergy().

◆ _MeanEntropy

G4double G4StatMFMacroTemperature::_MeanEntropy
private

Definition at line 109 of file G4StatMFMacroTemperature.hh.

Referenced by FragsExcitEnergy(), and GetEntropy().

◆ _MeanMultiplicity

G4double G4StatMFMacroTemperature::_MeanMultiplicity
private

Definition at line 101 of file G4StatMFMacroTemperature.hh.

Referenced by CalcChemicalPotentialNu(), and GetMeanMultiplicity().

◆ _MeanTemperature

G4double G4StatMFMacroTemperature::_MeanTemperature
private

Definition at line 103 of file G4StatMFMacroTemperature.hh.

Referenced by CalcTemperature(), and GetTemperature().

◆ _theClusters

std::vector<G4VStatMFMacroCluster*>* G4StatMFMacroTemperature::_theClusters
private

Definition at line 111 of file G4StatMFMacroTemperature.hh.

Referenced by CalcChemicalPotentialNu(), and FragsExcitEnergy().

◆ theA

G4double G4StatMFMacroTemperature::theA
private

◆ theZ

G4double G4StatMFMacroTemperature::theZ
private

Definition at line 93 of file G4StatMFMacroTemperature.hh.

Referenced by CalcChemicalPotentialNu(), and FragsExcitEnergy().


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