|
Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
|
#include <selfgrav_hydrostatic_col.h>
Public Member Functions | |
| DerivFn ()=delete | |
!< Caches the value of other_phi_fn(0.0) | |
| DerivFn (Real isoth_term, Real cur_R, Real rho_midplane_guess, OtherPhiFn other_phi_fn) noexcept | |
| Real | calc_PhiOtherZ (Real z) const noexcept |
| std::array< Real, 3 > | operator() (Real z, std::array< Real, 3 > cur_val) const noexcept |
This is all functionality related to initialization strategy described in Wang+ (2010), https://ui.adsabs.harvard.edu/abs/2010MNRAS.407..705W
In this paper, they show how to initialize a self-gravitating gas disk in the limit where the disk is relatively thin. This lets them come up with a reduced form of the Poisson Equation for the gas potential: d2_PhiGas_dz2 = 4 * pi * G (Eqn 14) where d2_PhiGas_dz2 is the second derivative of the gas gravitational potential with respect to z.
In particular, we use their "Potential method", to solve for a vertical density profiles at fixed cyclindrical radius. This only works for a disk where the gas is isothermal. By assuming that the gas is isothermal, they derive that the gas density is given by: rho_gas(z) = rho_midplane * exp(-1 * PhiZ(z) / isoth_term), (Eqn 18)
The primary equation we solve comes from plugging Eqn 18 into Eqn 14. This produces the following equation: d2_PhiGasZ_dz2 = alpha*rho_midplane * exp(-1*PhiZ(z)/isoth_term) (Eqn 19)
where:
alpha is 4 * pi * Gisoth_term has multiple equivalent definitions. In short it is the constant ratio between p and rho in the disk. Other equivalent definitions include:c_s,isothermal^2 where c_s,isothermal is the isothermal sound-speed in the disk. This sound speed is given by sqrt(kboltz*T/(mu*mH))c_s,ad) -(gamma - 1) * specific_internal_energyor(c_s,ad)^2/gamma. In these formulas,gammais the adiabatic index held fixed throughout the sim.c_s,adis -PhiZ(z)is the TOTAL gravitational potential measured with respect toz = 0(usually gravitational potentials are written such that they approach zero at infinity). It's equal toPhiOtherZ + PhiGasZ -d2_PhiGasZ_dz2is the second derivative of the gravitational potential of just the gas, where the potential has been measured with respect toz=0`.At the same time that we solve Eqn 19, we also want to solve for posZ_unnormalized_Sigma0, (the integral or rho_gas(z) from z = 0 to some large z, assuming rho_midplane is temporarily 1). This last quantity is important if we know Sigma(R), the surface density as a function of cylindrical radius.
We can recast these 2 equations into a system of 3 coupled first-order ordinary differential equations:
(d/dz) dPhiGasZ_dz = alpha * rho_midplane *
exp(-1 * (PhiGasZ(z) + PhiOtherZ(z)) /
isoth_term)
(d/dz) PhiGasZ = d_PhiGasZ_dz`
(d/dz) posZ_unnormalized_Sigma = exp(-(PhiGasZ(z) + PhiOtherZ(z)) /
isoth_term)
With this in mind here is our procedure (again this is just for a single cylindrical radius):
rho_midplane to integrate the system of 3 differential equations from z = 0 out to "large z." At z = 0: d_PhiGasZ_dz, PhiGasZ, & posZ_unnormalized_Sigma are all 0.rho_midplane from Sigma(R) / (2 * posZ_unnormalized_Sigma)
|
inlinenoexcept |
helper function that computes the gravitational potential (not contributed by the gas) measured with respect to the midplane
|
inlinenoexcept |
Compute the actual derivative of the 3 quantities at the given z and current values.