Version: SMASH-1.7
potentials.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2019
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #include "smash/potentials.h"
11 
12 #include "smash/constants.h"
13 #include "smash/density.h"
14 
15 namespace smash {
16 
17 Potentials::Potentials(Configuration conf, const DensityParameters &param)
18  : param_(param),
19  use_skyrme_(conf.has_value({"Skyrme"})),
20  use_symmetry_(conf.has_value({"Symmetry"})) {
72  if (use_skyrme_) {
73  skyrme_a_ = conf.take({"Skyrme", "Skyrme_A"});
74  skyrme_b_ = conf.take({"Skyrme", "Skyrme_B"});
75  skyrme_tau_ = conf.take({"Skyrme", "Skyrme_Tau"});
76  }
77 
96  if (use_symmetry_) {
97  symmetry_S_Pot_ = conf.take({"Symmetry", "S_Pot"});
98  if (conf.has_value({"Symmetry", "gamma"})) {
99  symmetry_gamma_ = conf.take({"Symmetry", "gamma"});
100  symmetry_is_rhoB_dependent_ = true;
101  }
102  }
103 }
104 
106 
107 double Potentials::skyrme_pot(const double baryon_density) const {
108  const double tmp = baryon_density / nuclear_density;
109  /* U = U(|rho|) * sgn , because the sign of the potential changes
110  * under a charge reversal transformation. */
111  const int sgn = tmp > 0 ? 1 : -1;
112  // Return in GeV
113  return 1.0e-3 * sgn *
114  (skyrme_a_ * std::abs(tmp) +
115  skyrme_b_ * std::pow(std::abs(tmp), skyrme_tau_));
116 }
117 double Potentials::symmetry_S(const double baryon_density) const {
119  return 12.3 * std::pow(baryon_density / nuclear_density, 2. / 3.) +
120  20.0 * std::pow(baryon_density / nuclear_density, symmetry_gamma_);
121  } else {
122  return 0.;
123  }
124 }
125 double Potentials::symmetry_pot(const double baryon_isospin_density,
126  const double baryon_density) const {
127  double pot =
128  1.0e-3 * 2. * symmetry_S_Pot_ * baryon_isospin_density / nuclear_density;
130  pot += 1.0e-3 * symmetry_S(baryon_density) * baryon_isospin_density *
131  baryon_isospin_density / (baryon_density * baryon_density);
132  }
133  return pot;
134 }
135 
136 double Potentials::potential(const ThreeVector &r, const ParticleList &plist,
137  const ParticleType &acts_on) const {
138  double total_potential = 0.0;
139  const bool compute_gradient = false;
140  const bool smearing = true;
141  const auto scale = force_scale(acts_on);
142 
143  if (!acts_on.is_baryon()) {
144  return total_potential;
145  }
146  const double rho_B = std::get<0>(current_eckart(
147  r, plist, param_, DensityType::Baryon, compute_gradient, smearing));
148  if (use_skyrme_) {
149  total_potential += scale.first * skyrme_pot(rho_B);
150  }
151  if (use_symmetry_) {
152  const double rho_iso = std::get<0>(
154  compute_gradient, smearing));
155  const double sym_pot =
156  symmetry_pot(rho_iso, rho_B) * acts_on.isospin3_rel();
157  total_potential += scale.second * sym_pot;
158  }
159  return total_potential;
160 }
161 
162 std::pair<double, int> Potentials::force_scale(const ParticleType &data) const {
163  double skyrme_scale = data.is_baryon() ? 1.0 : 0.0;
164  if (data.pdgcode().is_hyperon()) {
165  if (data.pdgcode().is_Xi()) {
166  skyrme_scale = 1. / 3.;
167  } else if (data.pdgcode().is_Omega()) {
168  skyrme_scale = 0.;
169  } else {
170  skyrme_scale = 2. / 3.;
171  }
172  }
173  skyrme_scale = skyrme_scale * data.pdgcode().baryon_number();
174  const int symmetry_scale = data.pdgcode().baryon_number();
175  return std::make_pair(skyrme_scale, symmetry_scale);
176 }
177 
178 std::pair<ThreeVector, ThreeVector> Potentials::skyrme_force(
179  const double density, const ThreeVector grad_rho, const ThreeVector dj_dt,
180  const ThreeVector rot_j) const {
181  ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
182  if (use_skyrme_) {
183  const double dV_drho =
185  std::pow(density / nuclear_density, skyrme_tau_ - 1)) *
187  E_component -= dV_drho * (grad_rho + dj_dt);
188  B_component += dV_drho * rot_j;
189  }
190  return std::make_pair(E_component, B_component);
191 }
192 
193 std::pair<ThreeVector, ThreeVector> Potentials::symmetry_force(
194  const double rhoI3, const ThreeVector grad_rhoI3, const ThreeVector djI3_dt,
195  const ThreeVector rot_jI3, const double rhoB, const ThreeVector grad_rhoB,
196  const ThreeVector djB_dt, const ThreeVector rot_jB) const {
197  ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
198  if (use_symmetry_) {
199  E_component -= dVsym_drhoI3(rhoB, rhoI3) * (grad_rhoI3 + djI3_dt) +
200  dVsym_drhoB(rhoB, rhoI3) * (grad_rhoB + djB_dt);
201  B_component +=
202  dVsym_drhoI3(rhoB, rhoI3) * rot_jI3 + dVsym_drhoB(rhoB, rhoI3) * rot_jB;
203  }
204  return std::make_pair(E_component, B_component);
205 }
206 
207 double Potentials::dVsym_drhoI3(const double rhoB, const double rhoI3) const {
208  double term1 = 2. * symmetry_S_Pot_ / nuclear_density;
210  double term2 = 2. * rhoI3 * symmetry_S(rhoB) / (rhoB * rhoB);
211  return mev_to_gev * (term1 + term2);
212  } else {
213  return mev_to_gev * term1;
214  }
215 }
216 
217 double Potentials::dVsym_drhoB(const double rhoB, const double rhoI3) const {
219  double rhoB_over_rho0 = rhoB / nuclear_density;
220  double term1 = 8.2 * std::pow(rhoB_over_rho0, -1. / 3.) / nuclear_density +
221  20. * symmetry_gamma_ *
222  std::pow(rhoB_over_rho0, symmetry_gamma_) / rhoB;
223  double term2 = -2. * symmetry_S(rhoB) / rhoB;
224  return mev_to_gev * (term1 + term2) * rhoI3 * rhoI3 / (rhoB * rhoB);
225  } else {
226  return 0.;
227  }
228 }
229 
230 std::tuple<ThreeVector, ThreeVector, ThreeVector, ThreeVector>
231 Potentials::all_forces(const ThreeVector &r, const ParticleList &plist) const {
232  const bool compute_gradient = true;
233  const bool smearing = true;
234  auto F_skyrme =
235  std::make_pair(ThreeVector(0., 0., 0.), ThreeVector(0., 0., 0.));
236  auto F_symmetry =
237  std::make_pair(ThreeVector(0., 0., 0.), ThreeVector(0., 0., 0.));
238 
239  const auto baryon_density_and_gradient = current_eckart(
240  r, plist, param_, DensityType::Baryon, compute_gradient, smearing);
241  const double rhoB = std::get<0>(baryon_density_and_gradient);
242  const ThreeVector grad_rhoB = std::get<2>(baryon_density_and_gradient);
243  const ThreeVector djB_dt = std::get<3>(baryon_density_and_gradient);
244  const ThreeVector rot_jB = std::get<4>(baryon_density_and_gradient);
245  if (use_skyrme_) {
246  F_skyrme = skyrme_force(rhoB, grad_rhoB, djB_dt, rot_jB);
247  }
248 
249  if (use_symmetry_) {
250  const auto density_and_gradient =
252  compute_gradient, smearing);
253  const double rhoI3 = std::get<0>(density_and_gradient);
254  const ThreeVector grad_rhoI3 = std::get<2>(density_and_gradient);
255  const ThreeVector djI3_dt = std::get<3>(density_and_gradient);
256  const ThreeVector rot_jI3 = std::get<4>(density_and_gradient);
257  F_symmetry = symmetry_force(rhoI3, grad_rhoI3, djI3_dt, rot_jI3, rhoB,
258  grad_rhoB, djB_dt, rot_jB);
259  }
260 
261  return std::make_tuple(F_skyrme.first, F_skyrme.second, F_symmetry.first,
262  F_symmetry.second);
263 }
264 
265 } // namespace smash
double symmetry_pot(const double baryon_isospin_density, const double baryon_density) const
Evaluates symmetry potential given baryon isospin density.
Definition: potentials.cc:125
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
bool symmetry_is_rhoB_dependent_
Wheter the baryon density dependence of the symmetry potential is included.
Definition: potentials.h:232
double skyrme_pot(const double baryon_density) const
Evaluates skyrme potential given a baryon density.
Definition: potentials.cc:107
double symmetry_gamma_
Power in formula for : .
Definition: potentials.h:239
double skyrme_a_
Parameter of skyrme potentials: the coefficient in front of in GeV.
Definition: potentials.h:211
bool use_symmetry_
Symmetry potential on/off.
Definition: potentials.h:205
virtual ~Potentials()
Standard destructor.
Definition: potentials.cc:105
Collection of useful constants that are known at compile time.
int baryon_number() const
Definition: pdgcode.h:308
bool is_Omega() const
Definition: pdgcode.h:346
Potentials(Configuration conf, const DensityParameters &parameters)
Potentials constructor.
virtual std::tuple< ThreeVector, ThreeVector, ThreeVector, ThreeVector > all_forces(const ThreeVector &r, const ParticleList &plist) const
Evaluates the electrical and magnetic components of the forces at point r.
Definition: potentials.cc:231
std::pair< ThreeVector, ThreeVector > symmetry_force(const double rhoI3, const ThreeVector grad_rhoI3, const ThreeVector djI3_dt, const ThreeVector rot_jI3, const double rhoB, const ThreeVector grad_rhoB, const ThreeVector djB_dt, const ThreeVector rot_jB) const
Evaluates the electrical and magnetic components of the symmetry force.
Definition: potentials.cc:193
double symmetry_S_Pot_
Parameter S_Pot in the symmetry potential in MeV.
Definition: potentials.h:226
bool is_baryon() const
Definition: particletype.h:200
double dVsym_drhoI3(const double rhoB, const double rhoI3) const
Calculate the derivative of the symmetry potential with respect to the isospin density in GeV * fm^3 ...
Definition: potentials.cc:207
double symmetry_S(const double baryon_density) const
Calculate the factor in the symmetry potential.
Definition: potentials.cc:117
Particle type contains the static properties of a particle species.
Definition: particletype.h:97
constexpr double mev_to_gev
MeV to GeV conversion factor.
Definition: constants.h:34
const DensityParameters param_
Struct that contains the gaussian smearing width , the distance cutoff and the testparticle number n...
Definition: potentials.h:199
bool use_skyrme_
Skyrme potential on/off.
Definition: potentials.h:202
double dVsym_drhoB(const double rhoB, const double rhoI3) const
Calculate the derivative of the symmetry potential with respect to the net baryon density in GeV * fm...
Definition: potentials.cc:217
bool is_Xi() const
Definition: pdgcode.h:351
double skyrme_b_
Parameters of skyrme potentials: the coefficient in front of in GeV.
Definition: potentials.h:217
double potential(const ThreeVector &r, const ParticleList &plist, const ParticleType &acts_on) const
Evaluates potential at point r.
Definition: potentials.cc:136
std::tuple< double, FourVector, ThreeVector, ThreeVector, ThreeVector > current_eckart(const ThreeVector &r, const ParticleList &plist, const DensityParameters &par, DensityType dens_type, bool compute_gradient, bool smearing)
Calculates Eckart rest frame density and 4-current of a given density type and optionally the gradien...
Definition: density.cc:149
std::pair< double, int > force_scale(const ParticleType &data) const
Evaluates the scaling factor of the forces acting on the particles.
Definition: potentials.cc:162
PdgCode pdgcode() const
Definition: particletype.h:156
double skyrme_tau_
Parameters of skyrme potentials: the power index.
Definition: potentials.h:223
constexpr double nuclear_density
Ground state density of symmetric nuclear matter [fm^-3].
Definition: constants.h:45
std::pair< ThreeVector, ThreeVector > skyrme_force(const double density, const ThreeVector grad_rho, const ThreeVector dj_dt, const ThreeVector rot_j) const
Evaluates the electrical and magnetic components of the skyrme force.
Definition: potentials.cc:178
double isospin3_rel() const
Definition: particletype.h:179
bool is_hyperon() const
Definition: pdgcode.h:343
Definition: action.h:24
int sgn(T val)
Signum function.
Definition: random.h:190