144 Commits

Author SHA1 Message Date
2dc4d3ca17 EVOLUTION: Make the arrays allocatable in initialize_time_step().
Two arrays used in the initial time step estimation, sc and df, are
allocated only if the integration methods support the estimation of
error.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-11 18:09:30 -03:00
731d4e1c32 INTEGRALS: Do not store errors if the integration is not embedded.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 22:45:57 -03:00
7578206f83 EVOLUTION: Treat any unphysical state properly in RK4.10 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 10:01:34 -03:00
1d22adb2fa EVOLUTION: Treat any unphysical state properly in RK3.5 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:51:06 -03:00
c42310b3cb EVOLUTION: Treat any unphysical state properly in RK3.4 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:37:21 -03:00
9d3123eeed EVOLUTION: Treat any unphysical state properly in RK3 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:31:30 -03:00
3ffbf1a3c2 EVOLUTION: Treat any unphysical state properly in RK2 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:25:31 -03:00
d6b4b70aab EVOLUTION: Treat any unphysical state properly in EULER method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:18:19 -03:00
3117c19a75 EVOLUTION: Improve initial time step estimation.
In case the estimation returns an unphysical state, its time step is
reduced and the estimation is repeated. If it fails for 10 consecutive
times, the estimation is abandoned and the CFL time step is used.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-10 09:04:05 -03:00
a9cf789833 EVOLUTION: Rewrite SSPRK2(1)m method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 22:16:40 -03:00
a87bcce907 EVOLUTION: Reorganize methods.
Put first non-embedded and then embedded methods.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 16:16:26 -03:00
6dcd400219 EVOLUTION: Treat any unphysical state properly in SSPRK3(2)4 method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 16:09:32 -03:00
a52da2830d EVOLUTION: Treat any unphysical state properly in SSPRK3(2)n² method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 16:05:22 -03:00
380e4c8d7e EVOLUTION: Synchronize status among processes in update_variables().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 15:59:34 -03:00
89bc706673 EVOLUTION: Treat any unphysical state properly in 3S*+ method.
If any unphysical cell is detected, the integration is immediately
reverted and resumed with a time step reduced by a factor or four.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 15:37:47 -03:00
17f867cb08 EQUATIONS: Add status flag to update_primitive_variables().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 12:51:23 -03:00
86cf55e836 EVOLUTION: Add status flag to update_variables().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-11-09 12:32:49 -03:00
6362fe13ad EVOLUTION: Fix partial times and timesteps in 3S*+ methods.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-23 20:52:03 -03:00
44ea63bc3d EVOLUTION: Implement optimized embedded methods by Ranocha et al.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-20 18:08:54 -03:00
27041d0feb DRIVER, EVOLUTION, IO: Rewrite handling precise snapshots.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-19 14:03:57 -03:00
55b0d24b77 EVOLUTION: Rework slightly the way new time step is calculated.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-19 13:28:25 -03:00
c604467a5c DRIVER: Use the initialize_time_step() instead of new_time_step().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-19 13:15:04 -03:00
d501b19041 EVOLUTION: Implement estimation of the initial time step.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-19 13:11:41 -03:00
6ca36c93e3 DRIVER, EVOLUTION: Move dtnext to evolution module.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-18 11:33:14 -03:00
0c8d8fac9c EVOLUTION: Rewrite SSPRK4(2)M integration method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-16 19:03:25 -03:00
418a580888 EVOLUTION: Print 'err/tol' not the error during the integration.
This is more meaninful, since it shows the ratio of the maximum error to
the tolerance atol + rtol * max(U).

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-15 15:29:42 -03:00
155b5d7575 EVOLUTION: Implement L2 and maximum norms for error calculation.
Alow the user to choose between these two norms.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-15 13:51:25 -03:00
271af020df EVOLUTION: Implement 3rd order embedded SSP3(2)4 with error control.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-10-15 12:15:14 -03:00
61ed993821 EVOLUTION: Fix decay rate of ψ field.
This scalar potential tracks the development of div(B). Its decay
depends on the cell size, so make it calculated per refinement level.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-09-20 08:44:38 -03:00
7713df3ebf EVOLUTION: Add dth to track hydrodynamic timestep.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-08-17 11:23:36 -03:00
a0b6e60d7e EVOLUTION: Simplify conditions for the new time step.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-19 15:12:08 -03:00
b2a7bd08b6 EVOLUTION: Consider dte only for methods with error control.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-19 13:16:31 -03:00
8ec801228c EVOLUTION: Fix formatting once again.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-19 13:03:40 -03:00
d8bd7eb800 EVOLUTION: Fix formatting.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-19 13:02:14 -03:00
30215029d4 EVOLUTION: Be explicit about the method with error control.
Do not show the parameters controlling the integration errors if the
method do not control this error.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-19 12:58:57 -03:00
580e1b832e BOUNDARIES: Rewrite bondary_fluxes() to update dU.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-11 01:26:15 -03:00
2509cf3d5a BLOCKS, EVOLUTION: Add block interface fluxes and update them.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-10 19:25:44 -03:00
0a03dd6f2f EVOLUTION: Separate dU update from the intermitate state update.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-10 18:52:55 -03:00
8c46b83626 EVOLUTION: Call update_flux() in update_increment().
Remove update_fluxes().

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-10 18:26:52 -03:00
c4a0d1df09 BLOCKS, EVOLUTION: Make dU to be blocks field and use it.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-10 17:51:28 -03:00
3d45fcca34 BLOCKS: Use %uu instead of %u0, %u1, and %u2.
Block field %uu addopts its size according to the used integration
methods. Use it for all operation insteado of fields %u0, %u1, and %u2.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-10 14:05:00 -03:00
b5540ed58d EVOLUTION: Add variable for required number of registers.
The number of registers indicates how many memory copies of the
conserved variables are required to perform the integration using a
selected method.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-07-10 12:24:20 -03:00
3cbb8da21e EVOLUTION: Add missing update_variables() in SSPRK(m,2).
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-02-05 16:16:26 -03:00
18a25d3775 EVOLUTION: Make sure the system is always consistent for SSPRK(m,3).
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-02-05 16:15:43 -03:00
3d16d5c13d Update copyrights.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2021-02-04 17:35:04 -03:00
37fdafd28d EVOLUTION: Fix unphysical cells after applying shapes.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-11-26 10:50:49 -03:00
deede9452d EVOLUTION: Determine the relative maximum error.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-09-16 06:40:50 -03:00
36b10a40d7 EVOLUTION: Add limiting factors and correct exponents in error control.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-09-15 22:59:20 -03:00
415d081e42 EVOLUTION: Get umax from the block interiors only.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-09-15 20:05:05 -03:00
d82eb99a8a EVOLUTION: Fix variables which may not be initialized.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2020-09-01 18:12:37 -03:00