source: trunk/source/processes/hadronic/models/de_excitation/multifragmentation/src/G4StatMFMacroMultiplicity.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: 6.4 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: G4StatMFMacroMultiplicity.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) additional checks in
37// solver of equation for the chemical potential
38
39#include "G4StatMFMacroMultiplicity.hh"
40
41// operators definitions
42G4StatMFMacroMultiplicity &
43G4StatMFMacroMultiplicity::operator=(const G4StatMFMacroMultiplicity & )
44{
45 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::operator= meant to not be accessable");
46 return *this;
47}
48
49G4bool G4StatMFMacroMultiplicity::operator==(const G4StatMFMacroMultiplicity & ) const
50{
51 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::operator== meant to not be accessable");
52 return false;
53}
54
55
56G4bool G4StatMFMacroMultiplicity::operator!=(const G4StatMFMacroMultiplicity & ) const
57{
58 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::operator!= meant to not be accessable");
59 return true;
60}
61
62
63
64
65G4double G4StatMFMacroMultiplicity::CalcChemicalPotentialMu(void)
66 // Calculate Chemical potential \mu
67 // For that is necesary to calculate mean multiplicities
68{
69 G4double CP = ((3./5.)*elm_coupling/G4StatMFParameters::Getr0())*
70 (1.0-1.0/std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(),1.0/3.0));
71
72 // starting value for chemical potential \mu
73 // it is the derivative of F(T,V)-\nu*Z w.r.t. Af in Af=5
74 G4double ZA5 = _theClusters->operator[](4)->GetZARatio();
75 G4double ILD5 = _theClusters->operator[](4)->GetInvLevelDensity();
76 _ChemPotentialMu = -G4StatMFParameters::GetE0()-
77 _MeanTemperature*_MeanTemperature/ILD5 -
78 _ChemPotentialNu*ZA5 +
79 G4StatMFParameters::GetGamma0()*(1.0-2.0*ZA5)*(1.0-2.0*ZA5) +
80 (2.0/3.0)*G4StatMFParameters::Beta(_MeanTemperature)/std::pow(5.,1./3.) +
81 (5.0/3.0)*CP*ZA5*ZA5*std::pow(5.,2./3.) -
82 1.5*_MeanTemperature/5.0;
83
84
85
86 G4double ChemPa = _ChemPotentialMu;
87 if (ChemPa/_MeanTemperature > 10.0) ChemPa = 10.0*_MeanTemperature;
88 G4double ChemPb = ChemPa - 0.5*std::abs(ChemPa);
89
90
91 G4double fChemPa = this->operator()(ChemPa);
92 G4double fChemPb = this->operator()(ChemPb);
93
94
95 // Set the precision level for locating the root.
96 // If the root is inside this interval, then it's done!
97 G4double intervalWidth = 1.e-4;
98
99 // bracketing the solution
100 G4int iterations = 0;
101 while (fChemPa*fChemPb > 0.0 && iterations < 100)
102 {
103 if (std::abs(fChemPa) <= std::abs(fChemPb))
104 {
105 ChemPa += 0.6*(ChemPa-ChemPb);
106 fChemPa = this->operator()(ChemPa);
107 iterations++;
108 }
109 else
110 {
111 ChemPb += 0.6*(ChemPb-ChemPa);
112 fChemPb = this->operator()(ChemPb);
113 iterations++;
114 }
115 }
116
117 if (fChemPa*fChemPb > 0.0) // the bracketing failed, complain
118 {
119 G4cerr <<"G4StatMFMacroMultiplicity:"<<" ChemPa="<<ChemPa<<" ChemPb="<<ChemPb<< G4endl;
120 G4cerr <<"G4StatMFMacroMultiplicity:"<<" fChemPa="<<fChemPa<<" fChemPb="<<fChemPb<< G4endl;
121 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::CalcChemicalPotentialMu: I couldn't bracket the root.");
122 }
123 else if (fChemPa*fChemPb < 0.0 && std::abs(ChemPa-ChemPb) > intervalWidth) // the bracketing was OK, try to locate the root
124 {
125 G4Solver<G4StatMFMacroMultiplicity> * theSolver = new G4Solver<G4StatMFMacroMultiplicity>(100,intervalWidth);
126 theSolver->SetIntervalLimits(ChemPa,ChemPb);
127 // if (!theSolver->Crenshaw(*this))
128 if (!theSolver->Brent(*this))
129 {
130 G4cerr <<"G4StatMFMacroMultiplicity:"<<" ChemPa="<<ChemPa<<" ChemPb="<<ChemPb<< G4endl;
131 G4cerr <<"G4StatMFMacroMultiplicity:"<<" fChemPa="<<fChemPa<<" fChemPb="<<fChemPb<< G4endl;
132 throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroMultiplicity::CalcChemicalPotentialMu: I couldn't find the root.");
133 }
134 _ChemPotentialMu = theSolver->GetRoot();
135 delete theSolver;
136 }
137 else // the root is within the interval, which is shorter then the precision level - all done
138 {
139 _ChemPotentialMu = ChemPa;
140 }
141
142 return _ChemPotentialMu;
143}
144
145
146
147G4double G4StatMFMacroMultiplicity::CalcMeanA(const G4double mu)
148{
149 G4double r03 = G4StatMFParameters::Getr0(); r03 *= r03*r03;
150 G4double V0 = (4.0/3.0)*pi*theA*r03;
151
152 G4double MeanA = 0.0;
153
154 _MeanMultiplicity = 0.0;
155
156
157 G4int n = 1;
158 for (std::vector<G4VStatMFMacroCluster*>::iterator i = _theClusters->begin();
159 i != _theClusters->end(); ++i)
160 {
161 G4double multip = (*i)->CalcMeanMultiplicity(V0*_Kappa,mu,_ChemPotentialNu,_MeanTemperature);
162 MeanA += multip*static_cast<G4double>(n++);
163 _MeanMultiplicity += multip;
164 }
165
166 return MeanA;
167}
Note: See TracBrowser for help on using the repository browser.