Provides simple magnetohydrodynamic (MHD) initial data for testing, as well as functionality for imposing beta equilibrium on initial hydrodynamic data and computing the initial entropy. The test data includes all five Balsara tests, equilibrium, sound-wave perturbations, and a shock tube. While some initial data requires EOS information provided by GRHayLib, the primitive data can be consumed with matching EOS and normalization conventions. Entropy representation requires the explicit agreement below.
This thorn provides a variety of initial data setups for testing GRMHD evolution codes. For 1D, this includes all five Balsara tests, equilibrium initial data, a sound wave, and a shock tube. For 3D, we provide isotropic gas and constant-density sphere initial data. We also provide the option to impose beta-equilibrium on provided initial data.
The initial data is separated into magnetic and hydrodynamic parts, so the magnetic initial data can be turned off if desired. All settings use the HydroBase variables for compatibility with other thorns. Magnetic initialization writes both Avec and Bvec; Aphi is not set. Both magnetic selectors must name GRHayLID when this operation is enabled. Native tests require Cartesian coordinates and an identity spatial metric supplied by ADMBase. Curved metrics are rejected. For the normalized Balsara data imported into IllinoisGRMHD, set IllinoisGRMHD::rescale_magnetics=no.
The parameters are mostly self-explanatory or just extensions of HydroBase keywords. The param.ccl is divided into sections based on which tests the parameters are for, but we explain them here. The type of test is controlled by initial_hydro from HydroBase. All the options for these parameters are explicitly listed by the autogenerated parameter documentation below.
Note that neither beta equilibrium nor entropy calculation are tied to initial_hydro, so they can be used even if the actual initial data is set by another thorn. Beta equilibrium is controlled by the impose_beta_equilibrium parameter, and entropy calculation is controlled by HydroBase::initial_entropy=GRHayLID. External producers must initialize the required fields in HydroBase_Initial; allocation alone is insufficient. Beta allocates Ye and temperature even when their selectors are none and intentionally replaces them after that group.
Some initial data is only valid for tabulated or hybrid EOS, and these check the EOS parameter from GRHayLib. If it is set incorrectly, the run will end with an error message stating the incompatibility. They will also check if HydroBase parameters are set in a compatible fashion (such as HydroBase::initial_temperature) and will also error out if these are set incorrectly.
This option is used for all the 1D tests we provide. The initial_data_1D parameter chooses the specific test and defaults to the Balsara1 test. For shocks and waves, the shock_direction parameter changes the direction of the shock, and the discontinuity_position parameter changes the location of the shock front. For the sound wave test, the amplitude can be set with wave_amplitude. It must be finite and in \([0,1)\). This setup perturbs the longitudinal velocity sinusoidally on \(\rho =P=1\); it is not a pure traveling acoustic eigenmode. Hybrid internal energy uses the cold-plus-thermal relation, and pressures below the cold curve are rejected.
This option sets the hydrodynamic variables to an isotropic gas using the tabulated equation of state and does not work with other EOS settings. It does not set magnetic quantities. The thorn checks to ensure parameters are set correctly in GRHayLiband HydroBaseso that the initial data works, and the run will end with an error message if the core parameters are misconfigured.
Specifically, the thorn checks the following parameters:
| Thorn & Parameter | Correct Setting |
| GRHayLib::EOS_type | ”Tabulated” |
| HydroBase::initial_Y_e | ”GRHayLID” |
| HydroBase::initial_temperature | ”GRHayLID” |
This option sets the hydrodynamic variables to a sphere of constant density using the tabulated equation of state and does not work with other EOS settings. It does not set magnetic quantities. The thorn checks to ensure parameters are set correctly in GRHayLiband HydroBaseso that the initial data works, and the run will end with an error message if the core parameters are misconfigured.
Specifically, the thorn checks the following parameters:
| Thorn & Parameter | Correct Setting |
| GRHayLib::EOS_type | ”Tabulated” |
| HydroBase::initial_Y_e | ”GRHayLID” |
| HydroBase::initial_temperature | ”GRHayLID” |
Beta equilibrium solves \(\mu _e-\mu _n+\mu _p=0\) at the final density and requested temperature using base chemical potentials. The residual must satisfy beq_residual_tolerance in MeV (default \(10^{-8}\)). The search includes exact node roots and rejects missing brackets. It selects the first root in increasing Ye within the effective EOS bounds. This avoids reliance on a potentially shifted table munu field; table conventions and physical provenance still require separate validation. Atmosphere points (\(\rho \leq 1.01\rho _{\rm atm}\)) receive a complete atmosphere reset including density, and are deliberately exempt from equilibrium.
Tabulated entropy replaces pressure and specific internal energy as well as entropy. Without beta, it also clamps density, Ye, and temperature to effective bounds. With beta enabled, these three inputs are preserved and incompatible states are rejected. Every EOS return and output is checked before publication.
Simple and Hybrid entropy uses the native GRHayL proxy \(P/\rho ^{\Gamma _{\rm piece}-1}\), not physical specific entropy in \(k_b\)/baryon. Set allow_native_entropy_proxy=yes only when every entropy consumer agrees with that representation. The default rejects that route; use Tabulated EOS for physical table entropy. Native proxy inputs require positive finite density and nonnegative finite pressure. Vacuum and nonfinite states are rejected before evaluation.
The sphere checks finite, strictly subluminal Cartesian velocity. Native tests check the identity spatial metric. The thorn requires Cactus REAL_PRECISION=8, and does not produce HydroBase::w_lorentz; consumers must provide and order their own metric-consistent Lorentz-factor initializer.
| allow_native_entropy_proxy | Scope: restricted | BOOLEAN |
| Description: Permit native Simple/Hybrid proxy in HydroBase entropy; only for compatible
GRHayL consumers
| ||
| Default: no | ||
| beq_residual_tolerance | Scope: restricted | REAL |
| Description: Absolute tolerance in MeV for mu_e-mu_n+mu_p at the final beta state
| ||
| Range | Default: 1.0e-8 | |
| 0:* | Must be finite and strictly positive (checked at initialization)
| |
| beq_temperature | Scope: restricted | REAL |
| Description: Temperature used to impose beta-equilibrium
| ||
| Range | Default: -1 | |
| 0:* | Non-negative values
| |
| -1 | Forbidden value
| |
| constantdensitysphere_rho_exterior | Scope: restricted | REAL |
| Description: Exterior density in geometrized units
| ||
| Range | Default: -1 | |
| 0:* | Non-negative values
| |
| -1 | Forbidden value
| |
| constantdensitysphere_rho_interior | Scope: restricted | REAL |
| Description: Interior density in geometrized units
| ||
| Range | Default: -1 | |
| 0:* | Non-negative values
| |
| -1 | Forbidden value
| |
| constantdensitysphere_sphere_radius | Scope: restricted | REAL |
| Description: Sphere radius in geometrized units
| ||
| Range | Default: -1 | |
| 0:* | Non-negative values
| |
| -1 | Forbidden value
| |
| constantdensitysphere_t_exterior | Scope: restricted | REAL |
| Description: Exterior temperature in MeV
| ||
| Range | Default: -1 | |
| 0:* | Non-negative values
| |
| -1 | Forbidden value
| |
| constantdensitysphere_t_interior | Scope: restricted | REAL |
| Description: Interior temperature in MeV
| ||
| Range | Default: -1 | |
| 0:* | Non-negative values
| |
| -1 | Forbidden value
| |
| constantdensitysphere_vx_interior | Scope: restricted | REAL |
| Description: Interior x-velocity
| ||
| Range | Default: (none) | |
| *:* | Anything goes
| |
| constantdensitysphere_vy_interior | Scope: restricted | REAL |
| Description: Interior y-velocity
| ||
| Range | Default: (none) | |
| *:* | Anything goes
| |
| constantdensitysphere_vz_interior | Scope: restricted | REAL |
| Description: Interior z-velocity
| ||
| Range | Default: (none) | |
| *:* | Anything goes
| |
| constantdensitysphere_y_e_exterior | Scope: restricted | REAL |
| Description: Exterior electron fraction (dimensionless)
| ||
| Range | Default: -1 | |
| 0:* | Non-negative values
| |
| -1 | Forbidden value
| |
| constantdensitysphere_y_e_interior | Scope: restricted | REAL |
| Description: Interior electron fraction (dimensionless)
| ||
| Range | Default: -1 | |
| 0:* | Non-negative values
| |
| -1 | Forbidden value
| |
| discontinuity_position | Scope: restricted | REAL |
| Description: Set location of the shock discontinuity
| ||
| Range | Default: 0.0 | |
| *:* | ||
| impose_beta_equilibrium | Scope: restricted | BOOLEAN |
| Description: Impose beta-equilibrium on initial data
| ||
| Default: no | ||
| initial_data_1d | Scope: restricted | KEYWORD |
| Description: Set initial data type for 1D tests
| ||
| Range | Default: Balsara1 | |
| equilibrium | initial data for the equilibrium test
| |
| sound wave | initial data for the sound wave test
| |
| shock tube | initial data for the shock tube test
| |
| Balsara1 | initial data for the Balsara1 test
| |
| Balsara2 | initial data for the Balsara2 test
| |
| Balsara3 | initial data for the Balsara3 test
| |
| Balsara4 | initial data for the Balsara4 test
| |
| Balsara5 | initial data for the Balsara5 test
| |
| initialize_magnetic_quantities | Scope: restricted | BOOLEAN |
| Description: Initialize both Avec and Bvec for HydroTest1D
| ||
| Default: yes | ||
| isotropicgas_rho | Scope: restricted | REAL |
| Description: Gas density in geometrized units
| ||
| Range | Default: -1 | |
| 0:* | Non-negative values
| |
| -1 | Forbidden value
| |
| isotropicgas_temperature | Scope: restricted | REAL |
| Description: Gas temperature in MeV
| ||
| Range | Default: -1 | |
| 0:* | Non-negative values
| |
| -1 | Forbidden value
| |
| isotropicgas_y_e | Scope: restricted | REAL |
| Description: Gas electron fraction (dimensionless)
| ||
| Range | Default: -1 | |
| 0:* | Non-negative values
| |
| -1 | Forbidden value
| |
| shock_direction | Scope: restricted | KEYWORD |
| Description: Set direction for shock in test data
| ||
| Range | Default: x | |
| x | Test data will have discontinuities along x direction
| |
| y | Test data will have discontinuities along y direction
| |
| z | Test data will have discontinuities along z direction
| |
| stagger_a_fields | Scope: restricted | BOOLEAN |
| Description: Sets whether Avec is staggered to +1/2 (following IllinoisGRMHD convention)
| ||
| Default: yes | ||
| wave_amplitude | Scope: restricted | REAL |
| Description: Wave amplitude for sound wave initial data
| ||
| Range | Default: 1.0e-3 | |
| 0.0:1.0 | Runtime check requires amplitude strictly below one
| |
| initial_avec | Scope: shared from HYDROBASE | KEYWORD |
| Extends ranges:
| ||
| GRHayLID | Initial vector potential set by GRHayLID
| |
| initial_bvec | Scope: shared from HYDROBASE | KEYWORD |
| Extends ranges:
| ||
| GRHayLID | Initial magnetic fields set by GRHayLID
| |
| initial_entropy | Scope: shared from HYDROBASE | KEYWORD |
| Extends ranges:
| ||
| GRHayLID | Initial entropy set by GRHayLID
| |
| initial_hydro | Scope: shared from HYDROBASE | KEYWORD |
| Extends ranges:
| ||
| HydroTest1D
| Initial data set by 1D test; see initial_data_1D parameter for
options
| |
| IsotropicGas | Initial data set to isotropic gas
| |
| see [1] below | Initial data set to constant density sphere
| |
[1]
ConstantDensitySphere
| initial_temperature | Scope: shared from HYDROBASE | KEYWORD |
| Extends ranges:
| ||
| GRHayLID | Initial temperature set by GRHayLID
| |
| initial_y_e | Scope: shared from HYDROBASE | KEYWORD |
| Extends ranges:
| ||
| GRHayLID | Initial Y_e set by GRHayLID
| |
Implements:
grhaylid
Inherits:
grhaylib
grid
hydrobase
admbase
Uses header:
GRHayLib.h
This section lists all the variables which are assigned storage by thorn GRHayLET/GRHayLID. Storage can either last for the duration of the run (Always means that if this thorn is activated storage will be assigned, Conditional means that if this thorn is activated storage will be assigned for the duration of the run if some condition is met), or can be turned on for the duration of a schedule function.
| Conditional: | |
| HydroBase::Y_e[1] HydroBase::temperature[1] | |
CCTK_PARAMCHECK
grhaylid_paramcheck
validate grhaylid producer, selector, eos, and representation contracts
| Language: | c | |
| Type: | function | |
HydroBase_Initial (conditional)
grhaylid_1d_tests_hydro_data
set initial hydrodynamic data for 1d test
| Language: | c | |
| Reads: | grid::coordinates | |
| admbase::metric | ||
| Type: | function | |
| Writes: | hydrobase::rho(everywhere) | |
| hydrobase::press(everywhere) | ||
| hydrobase::eps(everywhere) | ||
| hydrobase::vel(everywhere) | ||
HydroBase_Initial (conditional)
grhaylid_1d_tests_magnetic_data
set initial magnetic data for 1d test
| After: | grhaylid_1d_tests_hydro_data | |
| Language: | c | |
| Reads: | grid::coordinates | |
| admbase::metric | ||
| Type: | function | |
| Writes: | hydrobase::avec(everywhere) | |
| hydrobase::bvec(everywhere) | ||
HydroBase_Initial (conditional)
grhaylid_isotropicgas
set three-dimensional isotropic gas initial data
| Language: | c | |
| Reads: | grid::coordinates | |
| admbase::metric | ||
| Type: | function | |
| Writes: | hydrobase::rho(everywhere) | |
| hydrobase::press(everywhere) | ||
| hydrobase::eps(everywhere) | ||
| hydrobase::vel(everywhere) | ||
| hydrobase::y_e(everywhere) | ||
| hydrobase::temperature(everywhere) | ||
HydroBase_Initial (conditional)
grhaylid_constantdensitysphere
set three-dimensional constant-density sphere initial data
| Language: | c | |
| Reads: | grid::coordinates | |
| admbase::metric | ||
| Type: | function | |
| Writes: | hydrobase::rho(everywhere) | |
| hydrobase::press(everywhere) | ||
| hydrobase::eps(everywhere) | ||
| hydrobase::vel(everywhere) | ||
| hydrobase::y_e(everywhere) | ||
| hydrobase::temperature(everywhere) | ||
CCTK_INITIAL (conditional)
grhaylid_betaequilibrium
set beta-equilibrium primitives with a complete atmosphere density reset
| After: | hydrobase_initial | |
| Before: | hydrobase_prim2coninitial | |
| Language: | c | |
| Reads: | hydrobase::rho | |
| Type: | function | |
| Writes: | hydrobase::rho(everywhere) | |
| hydrobase::press(everywhere) | ||
| hydrobase::eps(everywhere) | ||
| hydrobase::y_e(everywhere) | ||
| hydrobase::temperature(everywhere) | ||
CCTK_INITIAL (conditional)
grhaylid_compute_entropy_hybrid
computes entropy from density and pressure using simple/hybrid native proxy
| After: | hydrobase_initial | |
| impose_beta_equilibrium | ||
| Before: | hydrobase_prim2coninitial | |
| Language: | c | |
| Reads: | hydrobase::rho | |
| hydrobase::press | ||
| Type: | function | |
| Writes: | hydrobase::entropy(everywhere) | |
CCTK_INITIAL (conditional)
grhaylid_compute_entropy_tabulated
computes entropy from density, y_e, and temperature using tabulated eos
| After: | hydrobase_initial | |
| impose_beta_equilibrium | ||
| Before: | hydrobase_prim2coninitial | |
| Language: | c | |
| Reads: | hydrobase::rho | |
| hydrobase::y_e | ||
| hydrobase::temperature | ||
| Type: | function | |
| Writes: | hydrobase::rho(everywhere) | |
| hydrobase::press(everywhere) | ||
| hydrobase::eps(everywhere) | ||
| hydrobase::entropy(everywhere) | ||
| hydrobase::y_e(everywhere) | ||
| hydrobase::temperature(everywhere) | ||
| Alias Name: | Function Name: |
| GRHayLID_BetaEquilibrium | impose_beta_equilibrium |