Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4StatMFMacroChemicalPotential.cc
Go to the documentation of this file.
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// Hadronic Process: Nuclear De-excitations
27// by V. Lara
28//
29// Modification: 13.08.2025 V.Ivanchenko rewrite
30
32#include "G4StatMFParameters.hh"
35#include "G4Pow.hh"
36
42
43
45{
46 delete fSolver;
47 delete theMultip;
48}
49
51 const G4int anA, const G4int aZ,
52 const G4double kappa,
53 const G4double temp,
54 std::vector<G4VStatMFMacroCluster*>* v)
55{
56 theA = anA;
57 theZ = aZ;
58 fKappa = kappa;
59 fMeanTemperature = temp;
60 fClusters = v;
61}
62
64// Calculate Chemical potential \nu
65{
66 G4Pow* g4calc = G4Pow::GetInstance();
68
69 // Initial value for fChemPotentialNu
70 fChemPotentialNu = (theZ/(G4double)theA)*
71 (8.0*G4StatMFParameters::GetGamma0() + 2.0*CP*g4calc->Z23(theA))
73
74 fSolver->SetIntervalLimits(0.5*fChemPotentialNu, 2*fChemPotentialNu);
75 fSolver->FindRoot(fChemPotentialNu);
76 return fChemPotentialNu;
77}
78
79G4double G4StatMFMacroChemicalPotential::CalcMeanZ(const G4double nu)
80{
81 CalcChemicalPotentialMu(nu);
82 // This is important, the Z over A ratio for proton and neutron depends on the
83 // chemical potential Mu, while for the first guess for Chemical potential mu
84 // some values of Z over A ratio. This is the reason for that.
85
86 G4double MeanZ = 0.0;
87 G4int n = 0;
88 G4int nn = (G4int)fClusters->size();
89 nn = std::min(nn, theA);
90 for (G4int i = 0; i < nn; ++i) {
91 G4double x = (*fClusters)[i]->CalcZARatio(nu);
92 MeanZ += (n++) * x * (*fClusters)[i]->GetMeanMultiplicity();
93 }
94 return MeanZ;
95}
96
97void G4StatMFMacroChemicalPotential::CalcChemicalPotentialMu(const G4double nu)
98// Calculate Chemical potential \mu
99// For that is necesary to calculate mean multiplicities
100{
101 theMultip->Initialise(theA, fKappa, fMeanTemperature, nu, fClusters);
102 fChemPotentialMu = theMultip->CalcChemicalPotentialMu();
103 fMeanMultiplicity = theMultip->GetMeanMultiplicity();
104}
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
Definition G4Pow.hh:49
static G4Pow * GetInstance()
Definition G4Pow.cc:41
G4double Z23(G4int Z) const
Definition G4Pow.hh:125
void Initialise(const G4int anA, const G4int aZ, const G4double kappa, const G4double temp, std::vector< G4VStatMFMacroCluster * > *cVector)
static G4double GetGamma0()
static G4double GetCoulomb()