Subtract the cell value from the stencil and add it back after the
interpolated values once the interpolation is done. This significantly
decreases the interpolation errors in uniform areas where the variables
are different from zero.
Check the monotonicity by comparing to eps and not to zero. This does
not force the interpolation to go back to the TVD one if the difference
between the interpolated value and cell centered one is of the order of
numerical error.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
For a given wave number, the perturbation consists of nper perturbation
components with a random direction and phase.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If the parallel component of magnetic field is too small, the
intermediate states might produce numerical instabilities, since they
are obtained by the division by a small factor.
In order to remove this situation, we apply full HLLD solver for strong
enough Alfvén wave. If it is weak, the HLLC solver is applied.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If the parallel component of magnetic field is too small, the
intermediate states might produce numerical instabilities, since they
are obtained by the division by a small factor.
In order to remove this situation, we apply full HLLD solver for strong
enough Alfvén wave. If it is weak, the HLL solver is applied.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If the parallel component of magnetic field is too small, the
intermediate states might produce numerical instabilities, since they
are obtained by the division by a small factor.
In order to remove this situation, we apply full HLLD solver for strong
enough Alfvén wave. If it is weak, the HLL solver is applied.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
For one of the degenerate situations the state vector was not
calculated. This introduced numerical instabilities. This change fixes
it.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
We should take half of the TVD limited derivatives in order to compare
properly with the high order interpolated derivative. Fix it.
Also, TVD limit both states if the high order interpolation of any of
them overshoot.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
In the sum of the J² we used Fortran subroutine sum() and the sum was
done along the 2nd index. However, the interpretation of this index is
uncertain when the first array rank is 1.
Therefore, instead of using subroutine sum(), the calculation is done
directly.
After this change there are no strange effects appearing on the
boundaries of the blocks.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This perturbation is similar to the magnetic field one, but
applied to the velocity field.
Also allow the user to choose the perturbation type through the
parameter 'perturbation'.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
A new parameter 'zeta' was introduced to control the type of the
equilibrium. If zeta = 0.0 the total pressure equlilbrium is set, while
when zeta = 1.0 the force free magnetic equilibrium is set.
Also, instead of tanh(y) profile, the proper integral log(cosh(y)) is
used to define the discontinuous (reconnecting) magnetic field
component.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This additional multi-dimensional limiting can be applied to any
reconstruction method. It is controlled by the parameter 'mlp_limiting'
by setting 'on' or 'off'.
The implementation is based on Gerlinger (2012).
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>