2959 Commits

Author SHA1 Message Date
0e703cf9b5 STATISTICS: Calculate pressure for the isothermal case.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-07-03 22:36:02 -03:00
b37f8997ea EVOLUTION: Introduce limiter for timestep jump.
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>
2024-07-01 20:06:24 -03:00
2496b8f8cc EVOLUTION: Prevent overflow in initial time step estimation
Ensure tolerance calculation uses already normalized variables to avoid
potential overflow.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-06-03 22:20:43 -03:00
6d20a66b8b 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>
2024-06-01 23:36:28 -03:00
470bd03a93 INTERPOLATIONS: Generalize and extend 5th order WENO schemes.
This commit separates the smoothness indicator and weight calculations
for 5th order WENO methods into different subroutines. This allows
modification of only the weight factor calculations for different WENO methods.
It extends the 5th order methods to include WENO5-JS, WENO5-Z+, WENO5-ZC,
WENO5-ZC+, WENO5-Z+M, and WENO5-AT.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-05-25 13:15:26 -03:00
bca8681d96 FORCING: Make injected energy update atomic.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-05-24 19:01:08 -03:00
3013d57f9f Revert "FORCING: Normalize the injection power by the volume size."
This reverts commit 9376e09fdf036a072f21b1ec27938eebd9f9845b.
2024-05-24 18:55:43 -03:00
9376e09fdf FORCING: Normalize the injection power by the volume size.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-05-24 18:47:08 -03:00
9ae03a4998 STATISTICS: Fix bug in integrating the injected energy and rate.
The injected energy and rate were added to the global array within the
loop over the blocks, essentially multiplying the energy by the number
of blocks for each process. This fix moves the injected energy
accounting out of the loop over the blocks.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-05-24 18:28:49 -03:00
403a1e2f3f INTERPOLATION: kappa parameter should be >= 1.
The kappa parameter is calculated from CFL value. It is a decreasing
value with increasing CFL. However, to maintain the precision of MP
limiter, it should be kept above 1. Therefore, instead of taking the min
values between the user defined kappa and the one calculated from the
CFL value, take its maximum.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-04-20 17:47:19 -03:00
ebd7f3ef59 PROBLEMS: Update the parameter file for the current sheet problem.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-03-08 22:54:02 -03:00
def5179c74 PROBLEMS: Rename and update the parameter file for the Kelvin-Helmholtz problem.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-03-07 17:26:02 -03:00
ff5cf0615c PROBLEMS: Add the parameter file for the Orszag-Tang problem.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-03-07 14:57:23 -03:00
40d8de12fa PROBLEMS: Update the parameter file for the tearing problem.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-03-07 11:01:47 -03:00
e76e875004 Update the copyright year to 2024.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-03-07 09:34:43 -03:00
fb25489487 SCHEMES: Fix ROE solvers for MHD.
The tearing test problem was numerically unstable in the adiabatic case.
Setting bty to 1 in the case of br beeing zero solved the issue. Make it
consistent for the isothermal ROE solver as well. Additionaly, one typo
was fixed in the calculation of the left eigenvectors.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2024-03-06 21:21:59 -03:00
78e3b72889 STATISTICS: Parallelize statistics calculation with OpenMP.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-31 17:45:17 -03:00
659449669b EVOLUTION: Fix wrong import in update_errors_lmax().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-28 11:52:22 -03:00
60d13dff6c EVOLUTION: Update subroutine to calculate errors using Lmax-norm.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-28 11:14:34 -03:00
213879c9c4 EVOLUTION: Update subroutine to calculate errors using L2-norm.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-28 10:56:11 -03:00
de49eeedaa EVOLUTION: Add subroutine to calculate errors using the L1-norm.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-28 10:49:24 -03:00
7c292e7095 EVOLUTION: Fix possible overflow in update_errors_l2().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-26 22:20:24 -03:00
7ab1348259 STATISTICS: Get 'statistics_interval' on all processes.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-23 12:13:13 -03:00
68449d0ccc IO: Add ACTION and STATUS flags to OPEN statements.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-20 18:33:58 -03:00
9455f9be9a IO: Use action='read' explicitely when opening a file for read-only.
Additionally, unify formatting of statements OPEN, READ, WRITE, CLOSE,
INQUIRE.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-19 15:55:33 -03:00
f0fbf04cb7 XML: Open a XML file as read-only in XMLParseFile().
Additionally, unify formatting of statements OPEN, READ, WRITE, CLOSE,
INQUIRE.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-19 15:47:21 -03:00
bdd09a044b PARAMETERS: Unify formatting of CLOSE statement too.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-19 15:39:44 -03:00
bb36b90171 IO: Access the metadata file as read-only while restoring parameters.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-19 15:38:40 -03:00
f31cb12545 PARAMS: Unify formatting of INQUIRE, READ, and WRITE statements.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-19 15:33:29 -03:00
b10e8d8db4 PARAMETERS: Access the parameter file as read-only.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-19 15:24:45 -03:00
0c8cab74a2 IO, PARAMETERS, SYSTEM: Better parameter restoring.
This commit implements a better way (less I/O operations) restoring of
the parameters during the job restart. Some parameters, such as the size
of the block, or the equation system, cannot be changed during the
restart. Such parameters need to be restored from the restart snapshots.
The new way restores these parameters on the MPI master process only,
updates their values if they were changed, and distributes them to other
MPI processes. This way the number of I/O operations is kept to the
minimum (only one process access one file).

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-18 09:30:07 -03:00
66f5fc5c58 PARAMETERS: Read parameters on master and distribute them.
This commit restores the previous way of processing the parameter file.
It is read and processed on the MPI master process, and then the list
of parameters is distributed to other MPI processes. This way only one
process accesses the parameter file, reducing the number of I/O
operations, which can be significant in the case of multiprocess MPI
jobs.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-17 21:47:38 -03:00
6847d1c994 PARAMETERS: Rewrite module with use of variable strings.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-17 18:09:12 -03:00
58b6a62ff8 IO: Fix wrong dimensions of corners() in store_metablocks_h5().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-12-14 16:57:35 -03:00
5333ebdf37 EVOLUTION: 3S*+ RK methods do not have extended CFL coefficients.
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>
2023-09-01 16:36:36 -03:00
62017bc5b3 EVOLUTION: Improve the conservation in SSPRK(10,4) method.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-30 17:37:09 -03:00
26022c4ce0 EVOLUTION, FORCING: Add injected flag to update_forcing().
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>
2023-08-29 17:43:03 -03:00
55b13fb895 EVOLUTION: Add missing variable update after adding turbulence forcing.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-29 17:09:48 -03:00
48f6618121 Revert "EVOLUTION: Update all blocks after the mesh update."
This reverts commit 8b36ce58e18bdc5af35c03571e77c5566efb2ae0.
2023-08-29 17:06:15 -03:00
dfe7310408 EVOLUTION: Improve the conservation in the SSPRK3 and SSPRK(4,3) methods.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-29 10:43:42 -03:00
91d3583a78 STATISTICS: Use Kahan summation for statistics integration.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-29 10:32:52 -03:00
8b36ce58e1 EVOLUTION: Update all blocks after the mesh update.
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>
2023-08-29 10:15:08 -03:00
39c3cdf7a4 EVOLUTION: Improve the conservation in the SSPRK3(2)4 method.
The 4th step produced errors large enought to give significant
conservation errors.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-28 17:53:59 -03:00
03e99457cc MAKE: Fix mkdeps.sh.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-14 16:42:37 -03:00
47b3b50ae0 IO: Improve description of subroutine write_binary_xml().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-14 13:05:24 -03:00
a71a1390ca IO: Formatting correction.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-14 12:49:42 -03:00
5574b6fcf1 IO: Rewrite storing of restart and regular XML snapshots.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-14 11:50:07 -03:00
b11a1fad58 XML: Add subroutines to initialize a new tree and add elements.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-14 10:13:40 -03:00
8ac5e49def IO: Enable compression when storing XML restart snapshot.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-12 07:08:48 -03:00
c015d5849a IO: Add missing item_size for 'complex64' in read_binary_xml().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2023-08-11 19:54:29 -03:00