-
Notifications
You must be signed in to change notification settings - Fork 2
Conserved and primitive variables: Conversion and inversion
Conserved variables are first discussed in this section. For the equations of ideal GRMHD the conserved variables vector is,
.
In addition to these, fluid codes define an additional vector of variables called primitives (P). These variables have the following advantages,
- Facilitate computing the interface states via reconstruction and consequently the fluxes.
- Facilitate computing the fluid source terms (since it involves computing the components of the stress-energy tensor)
- Can be physically better understood.
The primitive variables vector is,
.
where . vi is defined here. This was done to increase numerical stability.
The conserved variables are analytic functions of the primitives and can be computed exactly. This is done in two steps,
- The fluid four velocity (uµ) and magnetic induction vector (bµ) are computed from the primitives.
,
,
,
,
where Equations (1) and (2) are true because the fluid four velocity is measured w.r.t. a normal observer. Equation (3) is from the definition of bµ, while Equation (4) can be derived from , which is true in the ideal MHD limit. The function get_state_vec
found in phys.c computes the four vectors.
- The components of the stress-energy tensor are calculated from the primitives and the four vectors. The conserved variables are evaluated from these.
The matter conserved variables are nonlinear functions of the corresponding primitives which have no known analytic inverse expressions. A 1DW scheme (Mignone & McKinney (2007) and Noble et al. (2006)) is used
to numerically compute the matter primitives. The magnetic field primitives are equal to the corresponding conserved variables up to a factor of . iharm
inverts the conserved variables twice during a single time step: (i) following the update to U in advance_fluid
having computed fluxes and source terms (ii) following the application of fluid floors in fixup_floor
.
The inversion scheme is not guaranteed to successfully converge to reasonable values for the primitives in a finite number of iterations. iharm
fixes the 'bad' values of the inverted primitives by interpolating from nearby zones (fixup_utoprim
).