Add vertical field vector potential and remove unify vector potential parameters
This PR provides an implementation of vertical (and vertical-adjoint) magnetic field vector potentials in the gr_torus problem generator.
It also removes the is_sane
and is_mad
parameters in favor of a unified always-available set of "vector potential tuning" parameters. Standardized values for these parameters are available in the comments of the pgen/gr_torus.cpp
file near the parameter-parsing code.
Physics
The code first defines the cylindrical radius cyl_radius = r * sinvartheta_ks
For cylindrical radii within r_edge
(i.e., within the inner edge of the torus), the vector potential is identically zero Aphi = 0
.
Outside of r_edge
Aphi = pow(cyl_radius / r_edge, potential_r_pow) * exp(-cyl_radius / potential_falloff) + offset
where offset
is chosen to continuously match Aphi
around r_edge
.
When the potential_rho_pow
parameter is not zero, the vector potential everywhere is modified as
Aphi *= pow(rho/rho_max, potential_rho_pow);
Example parameters
The following set of parameters seems to launch a reasonable flow from the Chakrabarti initial condition that eventually becomes MAD. In my experience, it takes about 10,000 GM/c^3 for the normalized magnetic flux to saturate at the MAD value given the usual disk size parameters.
# chmad_vertical_2_80.athinput <problem> user_hist = true # enroll user-defined history function rho_min = 1.0e-5 # background on rho given by rho_min ... rho_pow = -1.5 # ... * r^rho_pow pgas_min = 0.333e-7 # background on p_gas given by pgas_min ... pgas_pow = -2.5 # ... * r^pgas_pow rho_max = 1.0 # if > 0, rescale rho to have this peak; rescale pres by same factor k_adi = 1.0 # adiabat K, p_gas = K * rho^Gamma r_edge = 15.0 # radius of inner edge of disk r_peak = 58.0 # radius of pressure maximum; use l instead if negative l = 0.0 # constant ang. mom. per unit mass u^t u_phi; only used if r_peak < 0 tilt_angle = 0.0 # angle (deg) to incl disk spin axis relative to BH spin in dir of x pert_amp = 2.0e-2 # perturbation amplitude mad = true # vector potential for magnetic field (SANE or MAD config.) currently unused for vertical fields. vertical_field = true # turn on vertical field functionality potential_rho_pow = 0.0 # modifies behavior when non-zero (default=0; see the rest of this PR) chakrabarti_torus = true # use chakrabarti initial condition for fluid potential_beta_min = 100.0 # ratio of gas to magnetic pressure at maxima (diff locations) potential_falloff = 80.0 # falloff for exponential in vector potential potential_r_pow = 2.0 # vector potential proportional to this power of radius
Known issues to address before merging
-
The tilted torus machinery should be checked. The implementation has been cribbed from the original vector potential implementation, which defines ks
andbl
angles, applies appropriate coordinate transforms so thatsin_vartheta_bl
andsin_vartheta_ks
are their "effective" versions, i.e., for a coordinate system that is aligned with the (potentially) tilted torus. TheLogHAux(...)
function operates onsin_vartheta_bl
as in the original, but I derive a cylindrical radius fromsin_vartheta_ks
. At the end of the day this is just a choice, but it may be worth unifying choices. -
New output has been added during problem generation. The code that finds the "outer edge" of the torus in the pgen file writes "Found outer edge: ###" to the console. This output may need to be removed to be consistent with code and output style choices. -
New parameters I: The code introduces several new parameters for the vector potential including is_vertical_field
andpotential_rho_pow
. The former switches the vertical magnetic field on/off . As of this writing, whenis_vertical_field
is true, the code ignoresis_mad
oris_sane
, but since there could be a future where the vertical field could be configured to MAD/SANE flows, I have not made the flags all mutually exclusive. This is ultimately a design choice. -
New parameters II: The code also introduces the new parameter potential_rho_pow
. When this parameter is nonzero (default = 0), the vector potential is zeroed outside of the torus (based onLogHAux(...)
) and Aphi is rescaled bypow(normalized_rho, potential_rho_pow)
everywhere within the disk. The motivation for this parameter is to describe the vector potential for an easy "enclosed field" geometry. Whether or not this feature "works as desired" for obvious parameter values is not yet clear.