Wiki

Clone wiki

KROME / consistentAdvection

back to index

Consistent species advection

When KROME is coupled to 3D hydro codes, the advection of chemical species could drive to inconsistencies.
To this aim it is important to have a re-normalization strategy that reduces this effect.
KROME is capable of renormalizing the total number of nuclei for each atom type, in order to avoid mass loss.
Note that option -conserveLin should be turned on.
Then you need to add two functions to your code:

(1) KROME needs to know what is the expected total number of nuclei for each atom type.
This is automatically done by the function

ref(:) = krome_conserveLinGetRef_x(x(:))
that gives you a reference array of double of size krome_natoms.
Here x(:) is a double array of size krome_nmols that contains the mass fractions of all the species.
Call this subroutine during the initialization of your code.

(2) after having advected the species each cell needs to call

call krome_conserveLin_x(x(:),ref(:))
where x(:) is an input/output array that renormalize your mass fractions to the correct value, and ref(:) is the array defined in the step 1.

More details in Grassi+2017, appendix E.
Note that this strategy is not unique!
There are several strategies for doing consistent advection, please refer to appendix E.


More information about consistent advection

The advection of chemical abundances in Eularian grid codes is done by employing passive scalars. Mass conservation gives the advection equation: d(rho)/dt + div (rho u) = 0, similarly conservation of a species with X relative mass abundance gives: d(rho X)/dt + div (rho X u) = 0.

If rho and rho X are chosen as the primary variables, most properly formulated Eularian grid codes will respect the conservation properties globally, and both Sum(rho) and Sum(rho X) are conserved globally in the box.

But apart from the global conservation of individual species, in addition locally the relative mass abundances have to sum to 1:

Sum_{in a cell} X = 1

In a finite difference code, where the derivatives are linear operators of the grid point values, through the linearity it is conserved naturally, as long as any mass diffusion terms are applied consistently to the chemical species.

In a finite volume code the situation is more complicated. The individual fluxes in a finite volume code are typically reconstructed in a two step procedure:

  • First the state in a cell next to the cell interface is found through a slope limited interpolation technique.
  • Then, using the states at each side of the interface, the local Riemann problem is solved to obtain the fluxes.

The problem with this procedure is that a slope limited interpolation is not linear in the grid point values, and therefore

Sum_{at the interface} X = 1

may not hold.

A simple fix is to renormalize the resulting chemical abundance after each flux updates. While it is very simple to implement in any code, it is a zeroth order renormalization directly in the primitive quantities, and is not recommended.

A better approach was proposed by Plewa and Müller [1], where instead the renormalization of the species is done at the cell interface. This requires the user of KROME to identify where the slope interpolation is performed, and immediately afterwards apply the renormalization.

A similar caveat applies in the case of any other interpolation operation in the code. If it is non-linear, as is the case for a slope-limited operator, a consistency check has to be added. As an example, this could be the case when creating new grid cells in adaptive mesh refinement codes.

[1] http://adsabs.harvard.edu/abs/1999A&A...342..179P

Updated