EVOLUTION: Ensure stable initial time step for embedded methods

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>
This commit is contained in:
Grzegorz Kowal 2024-06-01 23:36:28 -03:00
parent 470bd03a93
commit 6d20a66b8b

View File

@ -1283,9 +1283,9 @@ module evolution
d(1:2) = sqrt(fnorm * d(1:2))
if (minval(d(1:2)) >= 1.0d-05) then
h0 = 1.0d-02 * d(1) / d(2)
h0 = min(dt, 1.0d-02 * d(1) / d(2))
else
h0 = 1.0d-06
h0 = dt
end if
m = 10
@ -1354,7 +1354,7 @@ module evolution
if (h1 > 1.0d-15) then
h1 = (1.0d-02 / h1)**(1.0d+00 / 3.0d+00)
else
h1 = max(1.0d-06, 1.0d-03 * h0)
h1 = max(dt, 1.0d-03 * h0)
end if
dte = min(1.0d+02 * h0, h1)