To prevent solution instability caused by sudden increases in the
timestep, such as when the maximum refinement level decreases, a new
parameter 'dt_jump_factor' has been introduced. This parameter controls
the allowable increase in the timestep.
By default, 'dt_jump_factor' is set to 1.05, permitting a maximum
increase of 5% from the previous timestep.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Restricted initial time steps to values smaller than the CFL time step
to ensure numerical stability. This prevents instability issues that
may arise from excessively large initial steps.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The methods by Ranocha et al. (2021) are error-controlled embedded RK
methods, therefore the CFL value should be set explicitely for these
methods.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This flag indicates whether the energy injection was performed. If not,
there is no need for the variable update.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
It seems that the selective block update, i.e., update of the blocks
which have been (de)refined only, is not perfect. It violates the
numerical conservation somehow, and requires more investigation.
In order to fix this, perform the update of all data blocks, no matter
if they were refined or not. This makes some blocks to be updated twice,
but resolves the problem of variable conservation.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
For of all, update_shape now works with the conservative variables.
It is called in three points:
1) Just after the integration update or when the block were (de)refined.
2) Afted the boundary update.
3) If the unphysical cell correction is on, it is applied to blocks
which contain unphysical cells after they are corrected.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
In the case of embedded integration method, the time step resulting from
the error could drop to very small values. In such situation, the next
time step is taken to a maximum value between the time step due to error
and the stability time step multiplied by the safe factor. By default
this factor is set to 0.01.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The period is controlled by two parameters:
'injection_time_start' - the beginning of the injection period,
'injection_time_stop' - the end of the injection period.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The possible failure could take place in the boundary update or
conversion to the conservative variables. In case of a failure, jump
directly to the end part of subroutine in which the %boundary flag is
cleared.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
After the boundary update, all respective blocks modified by the mesh or
boundary update are required to update their primitive variables. If a
data block contains a non-physical cell, it is corrected by
correct_unphysical_states(), if fix_unphysical_cells is switched on.
As the last steps, the shapes are updated if they are switched on.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
When the block has been (de)refined, its field %update is set in order
to update its primitive variables. However, the block which are
neighbors of the (de)refined blocks, since their boundaries are updated
too, were not selected for the primitive variable update.
Fix this by adding a new meta block field %boundary, which indicates
that a block boundary has been updated, and update the corresponding
data block primitive variables either if the %update or %boundary flags
are set.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Pointer pdata already has a reference to the increment array dU(), so
remove the redundant argument du.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This is a logical flag controling if the conversion should be done for
the whole block, including the ghost zones, or just the interior part.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
There is no need for the maximum characteristic speed. The divergence
correcting speed cglm is calculated using the maximum eigenvalue and
physical velocity.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
First of all, the estimation is of the third order, so use the cubic
square in the calculation of h1. Secondly, fix the normalization factor
fnorm. Finally, use only the variables corresponding to the fluxes in
the increment norms sc(..) and df(..).
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The estimation of the initial time step requires the advance of the
system by one step. This, however, alters the primitive variables of
data blocks. Restore the primitive variables to the initial state, once
the initial time step has been estimated, in order to solve this
inconsistency.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>