[819] | 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 | // |
---|
[1315] | 27 | // $Id: G4StatMFMacroTemperature.cc,v 1.8 2010/04/16 17:04:08 vnivanch Exp $ |
---|
| 28 | // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ |
---|
[819] | 29 | // |
---|
| 30 | // Hadronic Process: Nuclear De-excitations |
---|
| 31 | // by V. Lara |
---|
[962] | 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 |
---|
[1315] | 38 | // 16.04.10 V.Ivanchenko improved logic of solving equation for tempetature |
---|
| 39 | // to protect code from rare unwanted exception; moved constructor |
---|
| 40 | // and destructor to source |
---|
[819] | 41 | |
---|
| 42 | #include "G4StatMFMacroTemperature.hh" |
---|
| 43 | |
---|
[1315] | 44 | G4StatMFMacroTemperature::G4StatMFMacroTemperature(const G4double anA, const G4double aZ, |
---|
| 45 | const G4double ExEnergy, const G4double FreeE0, const G4double kappa, |
---|
| 46 | std::vector<G4VStatMFMacroCluster*> * ClusterVector) : |
---|
| 47 | theA(anA), |
---|
| 48 | theZ(aZ), |
---|
| 49 | _ExEnergy(ExEnergy), |
---|
| 50 | _FreeInternalE0(FreeE0), |
---|
| 51 | _Kappa(kappa), |
---|
| 52 | _MeanMultiplicity(0.0), |
---|
| 53 | _MeanTemperature(0.0), |
---|
| 54 | _ChemPotentialMu(0.0), |
---|
| 55 | _ChemPotentialNu(0.0), |
---|
| 56 | _theClusters(ClusterVector) |
---|
| 57 | {} |
---|
| 58 | |
---|
| 59 | G4StatMFMacroTemperature::G4StatMFMacroTemperature() |
---|
| 60 | {} |
---|
| 61 | |
---|
| 62 | G4StatMFMacroTemperature::~G4StatMFMacroTemperature() |
---|
| 63 | {} |
---|
| 64 | |
---|
[819] | 65 | // operators definitions |
---|
| 66 | G4StatMFMacroTemperature & |
---|
| 67 | G4StatMFMacroTemperature::operator=(const G4StatMFMacroTemperature & ) |
---|
| 68 | { |
---|
| 69 | throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::operator= meant to not be accessable"); |
---|
| 70 | return *this; |
---|
| 71 | } |
---|
| 72 | |
---|
| 73 | G4bool G4StatMFMacroTemperature::operator==(const G4StatMFMacroTemperature & ) const |
---|
| 74 | { |
---|
| 75 | throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::operator== meant to not be accessable"); |
---|
| 76 | return false; |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | G4bool G4StatMFMacroTemperature::operator!=(const G4StatMFMacroTemperature & ) const |
---|
| 81 | { |
---|
| 82 | throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::operator!= meant to not be accessable"); |
---|
| 83 | return true; |
---|
| 84 | } |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | |
---|
| 89 | G4double G4StatMFMacroTemperature::CalcTemperature(void) |
---|
| 90 | { |
---|
[962] | 91 | // Inital guess for the interval of the ensemble temperature values |
---|
| 92 | G4double Ta = 0.5; |
---|
[819] | 93 | G4double Tb = std::max(std::sqrt(_ExEnergy/(theA*0.12)),0.01*MeV); |
---|
| 94 | |
---|
| 95 | G4double fTa = this->operator()(Ta); |
---|
| 96 | G4double fTb = this->operator()(Tb); |
---|
| 97 | |
---|
| 98 | // Bracketing the solution |
---|
| 99 | // T should be greater than 0. |
---|
| 100 | // The interval is [Ta,Tb] |
---|
[962] | 101 | // We start with a value for Ta = 0.5 MeV |
---|
[819] | 102 | // it should be enough to have fTa > 0 If it isn't |
---|
| 103 | // the case, we decrease Ta. But carefully, because |
---|
| 104 | // fTa growes very fast when Ta is near 0 and we could have |
---|
| 105 | // an overflow. |
---|
| 106 | |
---|
| 107 | G4int iterations = 0; |
---|
[1315] | 108 | while (fTa < 0.0 && ++iterations < 10) { |
---|
[819] | 109 | Ta -= 0.5*Ta; |
---|
| 110 | fTa = this->operator()(Ta); |
---|
| 111 | } |
---|
| 112 | // Usually, fTb will be less than 0, but if it is not the case: |
---|
| 113 | iterations = 0; |
---|
| 114 | while (fTa*fTb > 0.0 && iterations++ < 10) { |
---|
[1315] | 115 | Tb += 2.*std::fabs(Tb-Ta); |
---|
[819] | 116 | fTb = this->operator()(Tb); |
---|
| 117 | } |
---|
| 118 | |
---|
| 119 | if (fTa*fTb > 0.0) { |
---|
[962] | 120 | G4cerr <<"G4StatMFMacroTemperature:"<<" Ta="<<Ta<<" Tb="<<Tb<< G4endl; |
---|
| 121 | G4cerr <<"G4StatMFMacroTemperature:"<<" fTa="<<fTa<<" fTb="<<fTb<< G4endl; |
---|
[1315] | 122 | throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::CalcTemperature: I couldn't bracket the solution."); |
---|
[819] | 123 | } |
---|
| 124 | |
---|
| 125 | G4Solver<G4StatMFMacroTemperature> * theSolver = new G4Solver<G4StatMFMacroTemperature>(100,1.e-4); |
---|
| 126 | theSolver->SetIntervalLimits(Ta,Tb); |
---|
[962] | 127 | if (!theSolver->Crenshaw(*this)){ |
---|
[1315] | 128 | G4cout <<"G4StatMFMacroTemperature, Crenshaw method failed:"<<" Ta="<<Ta<<" Tb="<<Tb<< G4endl; |
---|
| 129 | G4cout <<"G4StatMFMacroTemperature, Crenshaw method failed:"<<" fTa="<<fTa<<" fTb="<<fTb<< G4endl; |
---|
[962] | 130 | } |
---|
[819] | 131 | _MeanTemperature = theSolver->GetRoot(); |
---|
[962] | 132 | G4double FunctionValureAtRoot = this->operator()(_MeanTemperature); |
---|
| 133 | delete theSolver; |
---|
| 134 | |
---|
| 135 | // Verify if the root is found and it is indeed within the physical domain, |
---|
| 136 | // say, between 1 and 50 MeV, otherwise try Brent method: |
---|
[1315] | 137 | if (std::fabs(FunctionValureAtRoot) > 5.e-2) { |
---|
| 138 | if (_MeanTemperature < 1. || _MeanTemperature > 50.) { |
---|
| 139 | G4cout << "Crenshaw method failed; function = " << FunctionValureAtRoot |
---|
| 140 | << " solution? = " << _MeanTemperature << " MeV " << G4endl; |
---|
| 141 | G4Solver<G4StatMFMacroTemperature> * theSolverBrent = new G4Solver<G4StatMFMacroTemperature>(200,1.e-3); |
---|
| 142 | theSolverBrent->SetIntervalLimits(Ta,Tb); |
---|
| 143 | if (!theSolverBrent->Brent(*this)){ |
---|
| 144 | G4cout <<"G4StatMFMacroTemperature, Brent method failed:"<<" Ta="<<Ta<<" Tb="<<Tb<< G4endl; |
---|
| 145 | G4cout <<"G4StatMFMacroTemperature, Brent method failed:"<<" fTa="<<fTa<<" fTb="<<fTb<< G4endl; |
---|
| 146 | throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method."); |
---|
| 147 | } |
---|
[962] | 148 | |
---|
[1315] | 149 | _MeanTemperature = theSolverBrent->GetRoot(); |
---|
| 150 | FunctionValureAtRoot = this->operator()(_MeanTemperature); |
---|
| 151 | delete theSolverBrent; |
---|
| 152 | } |
---|
| 153 | if (std::abs(FunctionValureAtRoot) > 5.e-2) { |
---|
| 154 | //if (_MeanTemperature < 1. || _MeanTemperature > 50. || std::abs(FunctionValureAtRoot) > 5.e-2) { |
---|
| 155 | G4cout << "Brent method failed; function = " << FunctionValureAtRoot << " solution? = " << _MeanTemperature << " MeV " << G4endl; |
---|
[962] | 156 | throw G4HadronicException(__FILE__, __LINE__, "G4StatMFMacroTemperature::CalcTemperature: I couldn't find the root with any method."); |
---|
[1315] | 157 | } |
---|
[962] | 158 | } |
---|
[1315] | 159 | //G4cout << "G4StatMFMacroTemperature::CalcTemperature: function = " << FunctionValureAtRoot |
---|
| 160 | // << " T(MeV)= " << _MeanTemperature << G4endl; |
---|
[819] | 161 | return _MeanTemperature; |
---|
| 162 | } |
---|
| 163 | |
---|
| 164 | |
---|
| 165 | |
---|
| 166 | G4double G4StatMFMacroTemperature::FragsExcitEnergy(const G4double T) |
---|
| 167 | // Calculates excitation energy per nucleon and summed fragment multiplicity and entropy |
---|
| 168 | { |
---|
| 169 | |
---|
| 170 | // Model Parameters |
---|
| 171 | G4double R0 = G4StatMFParameters::Getr0()*std::pow(theA,1./3.); |
---|
| 172 | G4double R = R0*std::pow(1.0+G4StatMFParameters::GetKappaCoulomb(), 1./3.); |
---|
| 173 | G4double FreeVol = _Kappa*(4.*pi/3.)*R0*R0*R0; |
---|
| 174 | |
---|
| 175 | |
---|
| 176 | // Calculate Chemical potentials |
---|
| 177 | CalcChemicalPotentialNu(T); |
---|
| 178 | |
---|
| 179 | |
---|
| 180 | // Average total fragment energy |
---|
| 181 | G4double AverageEnergy = 0.0; |
---|
| 182 | std::vector<G4VStatMFMacroCluster*>::iterator i; |
---|
| 183 | for (i = _theClusters->begin(); i != _theClusters->end(); ++i) |
---|
| 184 | { |
---|
| 185 | AverageEnergy += (*i)->GetMeanMultiplicity() * (*i)->CalcEnergy(T); |
---|
| 186 | } |
---|
| 187 | |
---|
| 188 | // Add Coulomb energy |
---|
| 189 | AverageEnergy += (3./5.)*elm_coupling*theZ*theZ/R; |
---|
| 190 | |
---|
| 191 | // Calculate mean entropy |
---|
| 192 | _MeanEntropy = 0.0; |
---|
| 193 | for (i = _theClusters->begin(); i != _theClusters->end(); ++i) |
---|
| 194 | { |
---|
| 195 | _MeanEntropy += (*i)->CalcEntropy(T,FreeVol); |
---|
| 196 | } |
---|
| 197 | |
---|
| 198 | // Excitation energy per nucleon |
---|
| 199 | G4double FragsExcitEnergy = AverageEnergy - _FreeInternalE0; |
---|
| 200 | |
---|
| 201 | return FragsExcitEnergy; |
---|
| 202 | |
---|
| 203 | } |
---|
| 204 | |
---|
| 205 | |
---|
| 206 | void G4StatMFMacroTemperature::CalcChemicalPotentialNu(const G4double T) |
---|
| 207 | // Calculates the chemical potential \nu |
---|
| 208 | |
---|
| 209 | { |
---|
| 210 | G4StatMFMacroChemicalPotential * theChemPot = new |
---|
| 211 | G4StatMFMacroChemicalPotential(theA,theZ,_Kappa,T,_theClusters); |
---|
| 212 | |
---|
| 213 | |
---|
| 214 | _ChemPotentialNu = theChemPot->CalcChemicalPotentialNu(); |
---|
| 215 | _ChemPotentialMu = theChemPot->GetChemicalPotentialMu(); |
---|
| 216 | _MeanMultiplicity = theChemPot->GetMeanMultiplicity(); |
---|
| 217 | |
---|
| 218 | delete theChemPot; |
---|
| 219 | |
---|
| 220 | return; |
---|
| 221 | |
---|
| 222 | } |
---|
| 223 | |
---|
| 224 | |
---|