source: trunk/source/processes/hadronic/models/de_excitation/multifragmentation/src/G4StatMFMacroTemperature.cc@ 1201

Last change on this file since 1201 was 1196, checked in by garnier, 16 years ago

update CVS release candidate geant4.9.3.01

File size: 7.7 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// $Id: G4StatMFMacroTemperature.cc,v 1.7 2008/11/19 14:33:31 vnivanch Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30// Hadronic Process: Nuclear De-excitations
31// by V. Lara
32//
33// Modified:
34// 25.07.08 I.Pshenichnov (in collaboration with Alexander Botvina and Igor
35// Mishustin (FIAS, Frankfurt, INR, Moscow and Kurchatov Institute,
36// Moscow, pshenich@fias.uni-frankfurt.de) make algorithm closer to
37// original MF model
38
39#include "G4StatMFMacroTemperature.hh"
40
41// operators definitions
42G4StatMFMacroTemperature &
43G4StatMFMacroTemperature::operator=(const G4StatMFMacroTemperature & )
44{
45 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::operator= meant to not be accessable");
46 return *this;
47}
48
49G4bool G4StatMFMacroTemperature::operator==(const G4StatMFMacroTemperature & ) const
50{
51 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::operator== meant to not be accessable");
52 return false;
53}
54
55
56G4bool G4StatMFMacroTemperature::operator!=(const G4StatMFMacroTemperature & ) const
57{
58 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::operator!= meant to not be accessable");
59 return true;
60}
61
62
63
64
65G4double G4StatMFMacroTemperature::CalcTemperature(void)
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 while (fTa < 0.0 && iterations++ < 10) {
85 Ta -= 0.5*Ta;
86 fTa = this->operator()(Ta);
87 }
88 // Usually, fTb will be less than 0, but if it is not the case:
89 iterations = 0;
90 while (fTa*fTb > 0.0 && iterations++ < 10) {
91 Tb += 2.*std::abs(Tb-Ta);
92 fTb = this->operator()(Tb);
93 }
94
95 if (fTa*fTb > 0.0) {
96 G4cerr <<"G4StatMFMacroTemperature:"<<" Ta="<<Ta<<" Tb="<<Tb<< G4endl;
97 G4cerr <<"G4StatMFMacroTemperature:"<<" fTa="<<fTa<<" fTb="<<fTb<< G4endl;
98 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::CalcTemperature: I couldn't bracket the solution.");
99 }
100
101 G4Solver<G4StatMFMacroTemperature> * theSolver = new G4Solver<G4StatMFMacroTemperature>(100,1.e-4);
102 theSolver->SetIntervalLimits(Ta,Tb);
103 if (!theSolver->Crenshaw(*this)){
104 G4cerr <<"G4StatMFMacroTemperature, Crenshaw method failed:"<<" Ta="<<Ta<<" Tb="<<Tb<< G4endl;
105 G4cerr <<"G4StatMFMacroTemperature, Crenshaw method failed:"<<" fTa="<<fTa<<" fTb="<<fTb<< G4endl;
106 }
107 _MeanTemperature = theSolver->GetRoot();
108 G4double FunctionValureAtRoot = this->operator()(_MeanTemperature);
109 delete theSolver;
110
111 // Verify if the root is found and it is indeed within the physical domain,
112 // say, between 1 and 50 MeV, otherwise try Brent method:
113 if (_MeanTemperature < 1. || _MeanTemperature > 50. || std::abs(FunctionValureAtRoot) > 5.e-2) {
114 G4cout << "Crenshaw method failed; function = " << FunctionValureAtRoot << " solution? = " << _MeanTemperature << " MeV " << G4endl;
115 G4Solver<G4StatMFMacroTemperature> * theSolverBrent = new G4Solver<G4StatMFMacroTemperature>(200,1.e-3);
116 theSolverBrent->SetIntervalLimits(Ta,Tb);
117 if (!theSolverBrent->Brent(*this)){
118 G4cerr <<"G4StatMFMacroTemperature, Brent method failed:"<<" Ta="<<Ta<<" Tb="<<Tb<< G4endl;
119 G4cerr <<"G4StatMFMacroTemperature, Brent method failed:"<<" fTa="<<fTa<<" fTb="<<fTb<< G4endl;
120 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method.");
121 }
122
123 _MeanTemperature = theSolverBrent->GetRoot();
124 FunctionValureAtRoot = this->operator()(_MeanTemperature);
125 delete theSolverBrent;
126
127 if (_MeanTemperature < 1. || _MeanTemperature > 50. || std::abs(FunctionValureAtRoot) > 5.e-2) {
128 G4cout << "Brent method failed; function = " << FunctionValureAtRoot << " solution? = " << _MeanTemperature << " MeV " << G4endl;
129 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method.");
130 }
131 }
132
133 return _MeanTemperature;
134}
135
136
137
138G4double G4StatMFMacroTemperature::FragsExcitEnergy(const G4double T)
139 // Calculates excitation energy per nucleon and summed fragment multiplicity and entropy
140{
141
142 // Model Parameters
143 G4double R0 = G4StatMFParameters::Getr0()*std::pow(theA,1./3.);
144 G4double R = R0*std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(), 1./3.);
145 G4double FreeVol = _Kappa*(4.*pi/3.)*R0*R0*R0;
146
147
148 // Calculate Chemical potentials
149 CalcChemicalPotentialNu(T);
150
151
152 // Average total fragment energy
153 G4double AverageEnergy = 0.0;
154 std::vector<G4VStatMFMacroCluster*>::iterator i;
155 for (i = _theClusters->begin(); i != _theClusters->end(); ++i)
156 {
157 AverageEnergy += (*i)->GetMeanMultiplicity() * (*i)->CalcEnergy(T);
158 }
159
160 // Add Coulomb energy
161 AverageEnergy += (3./5.)*elm_coupling*theZ*theZ/R;
162
163 // Calculate mean entropy
164 _MeanEntropy = 0.0;
165 for (i = _theClusters->begin(); i != _theClusters->end(); ++i)
166 {
167 _MeanEntropy += (*i)->CalcEntropy(T,FreeVol);
168 }
169
170 // Excitation energy per nucleon
171 G4double FragsExcitEnergy = AverageEnergy - _FreeInternalE0;
172
173 return FragsExcitEnergy;
174
175}
176
177
178void G4StatMFMacroTemperature::CalcChemicalPotentialNu(const G4double T)
179 // Calculates the chemical potential \nu
180
181{
182 G4StatMFMacroChemicalPotential * theChemPot = new
183 G4StatMFMacroChemicalPotential(theA,theZ,_Kappa,T,_theClusters);
184
185
186 _ChemPotentialNu = theChemPot->CalcChemicalPotentialNu();
187 _ChemPotentialMu = theChemPot->GetChemicalPotentialMu();
188 _MeanMultiplicity = theChemPot->GetMeanMultiplicity();
189
190 delete theChemPot;
191
192 return;
193
194}
195
196
Note: See TracBrowser for help on using the repository browser.