44 std::shared_ptr<MiyamotoNagaiPotential> stellar_disk;
45 std::shared_ptr<GasDiskProps> gas_disk;
46 std::shared_ptr<NFWHaloPotential> halo_potential;
47 Real M_vir, R_vir, r_cool;
65 Real gr_disk_D3D(Real R, Real z)
const noexcept;
68 Real gr_halo_D3D(Real R, Real z)
const noexcept;
78 Real
gr_total_D3D(Real R, Real z)
const noexcept {
return gr_disk_D3D(R, z) + gr_halo_D3D(R, z); };
80 Real gr_total_with_GasSelfGravEstimate(Real R, Real z)
const noexcept;
84 Real circular_vel2(Real R, Real z)
const noexcept {
return R * std::fabs(
gr_total_D3D(R, z)); }
89 Real circular_vel2_with_selfgrav_estimates(Real R, Real z)
const noexcept
91 return R * std::fabs(gr_total_with_GasSelfGravEstimate(R, z));
95 Real phi_halo_D3D(Real R, Real z)
const noexcept;
98 Real phi_disk_D3D(Real R, Real z)
const noexcept;
104 Real
phi_total_D3D(Real R, Real z)
const noexcept {
return phi_halo_D3D(R, z) + phi_disk_D3D(R, z); };
109 Real
kappa2(Real R, Real z)
const;
119 Real getGasDiskR_d()
const;
123 Real getM_vir()
const {
return M_vir; };
124 Real getR_vir()
const {
return R_vir; };
125 Real getR_cool()
const {
return r_cool; };
143 : lo_mass_(lower_mass), hi_mass_(higher_mass), alpha_(alpha)
145 CHOLLA_ASSERT(lower_mass > 0.0,
"The minimum cluster-mass must exceed 0");
146 CHOLLA_ASSERT(higher_mass > lower_mass,
"The max mass must exceed the min mass");
147 CHOLLA_ASSERT(alpha_ > 1.0,
"alpha must exceed 1.0");
150 Real getLowerClusterMass()
const {
return lo_mass_; }
151 Real getHigherClusterMass()
const {
return hi_mass_; }
153 Real meanClusterMass()
const
155 Real normalization = (1 - alpha_) / (std::pow(hi_mass_, 1 - alpha_) - std::pow(lo_mass_, 1 - alpha_));
157 return normalization * std::log(hi_mass_ / lo_mass_);
159 CHOLLA_ERROR(
"UNTESTED LOGIC");
160 return normalization * (std::pow(hi_mass_, 2 - alpha_) - std::pow(lo_mass_, 2 - alpha_)) / (2 - alpha_);
164 Real singleClusterMass(std::mt19937_64 generator)
const
166 std::uniform_real_distribution<Real> uniform_distro(0, 1);
167 Real X = uniform_distro(generator);
168 Real mclmin = lo_mass_;
169 Real mclmax = hi_mass_;
171 Real tmp = std::pow(mclmin, -alpha_ + 1) - (std::pow(mclmin, -alpha_ + 1) - std::pow(mclmax, -alpha_ + 1)) * X;
172 return std::pow(tmp, 1.0 / (-alpha_ + 1));
190 const GasDiskProps& gas_disk, Real mvir, Real rvir, Real cvir, Real rcool)
191 :
DiskGalaxy{stellar_disk, gas_disk, mvir, rvir, cvir, rcool},
192 cluster_mass_distribution_(cluster_mass_distribution)
199 return cluster_mass_distribution_;