2854 Commits

Author SHA1 Message Date
95d117cd1a EVOLUTION: Quit update_variables() in case of problems.
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>
2022-02-19 13:39:58 -03:00
a4890bb240 EQUATIONS: Rewrite slightly correct_unphysical_states().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-19 13:34:31 -03:00
571e352e5b EVOLUTION: Remove unused variable from check_variables().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-19 13:12:30 -03:00
9aa74d2343 EVOLUTION: Rewrite update_variables().
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>
2022-02-19 13:07:17 -03:00
ef1dff58f7 BLOCKS: Add field %physical to data block structure.
This field should be set to .true. if all block cells are physical,
otherwise it should be set to .false..

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-19 12:54:57 -03:00
1e1c39da1a EQUATIONS: Process all cells in update_primitive_variables().
If cons2prim() returns status indicating the existence of non-physical
cell, just update the subroutine status and continue with the variable
conversion.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-19 12:52:04 -03:00
06103eca50 EQUATIONS: Rewrite cons2prim() subroutines.
Do not quit immediately if a negative density or pressure is
encountered. Just mark the status flag non-zero and continue. The
non-physical cell can be corrected later.

Also, if the compilation flag DEBUG is present, print the conservative
variables for the non-physical cell.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-19 12:46:46 -03:00
2db9062683 MESH: Avoid very large MPI tags.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-15 19:21:20 -03:00
dbb4ad6c55 AMUN: Fix compilation for Intel compiler.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-14 18:48:10 -03:00
a3a140b572 BLOCKS, BOUNDARIES, EVOLUTION: Fix block variable update.
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>
2022-02-11 22:37:46 -03:00
6f23ae962e BOUNDARIES: Prepare primitive variables for specific boundaries.
The specific boundaries (open, outflow, reflective, custom, etc.) work
on the primitive variables. Since the boundaries are updated using the
conservative variables, we have to update the primitive variables in the
block to which the specific boundary is applied. Then, the conservative
variables are update at the ghost zone where the specific boundary
condition was applied.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-09 19:25:18 -03:00
47ebb9703c BOUNDARIES: Process boundary prolongation from minlev to maxlev.
Since the update of boundaries using prolongation depends on the
neighboring cells, make sure it is applied for blocks at the same level,
from the minimum to maximum level.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-09 16:49:26 -03:00
6ba8d5d34f SOURCES: Reduce the number of arguments to update_sources().
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>
2022-02-09 16:25:07 -03:00
d74cc0b6af BOUNDARIES: Fix boundaries_face_prolong() to include the internal edge.
Four child blocks at higher levels do not have internal edge neighbors.
Therefore, the face prolongation from the lower level neighbor of these
four blocks has to include the internal edges.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-09 16:00:04 -03:00
87daca8d55 BOUNDARIES: Fix boundaries_edge_prolong() to include the internal corner.
Two child blocks at higher levels do not have internal corner neighbor.
Therefore, the edge prolongation from the lower level neighbor of these
two blocks has to include the internal corner.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-09 15:59:29 -03:00
eea8c036b4 EVOLUTION: It is sufficient to update primitive variables once.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-08 18:33:18 -03:00
be47092f3c BOUNDARIES: Work with the conservative variables for the boundary update.
In this way the restricted or prolongated boundaries preserve the
conserved variables.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-08 17:45:26 -03:00
d188045d96 BOUNDARIES: Reorganize the specific boundaries.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-08 17:13:05 -03:00
de587766b6 BOUNDARIES: Correct fluxes dimension by dimension in boundary_fluxes().
This solver the problem of updating the fluxes in an inconsistent way
for the same run with a different number of MPI processes.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-08 16:15:51 -03:00
43499e930f BOUNDARIES: Organize importing of variables from other modules.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-08 09:59:42 -03:00
76d768246d BOUNDARIES: Handle all direction at once in boundaries_face_prolong().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-07 15:37:23 -03:00
7e5d0a4a0d BOUNDARIES: Handle all direction at once in boundaries_face_restrict().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-07 15:25:21 -03:00
7eb4276751 BOUNDARIES: Handle all direction at once in boundaries_face_copy().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-07 15:11:51 -03:00
6cfa6d2f00 BOUNDARIES: Fix wrong check in boundaries_edge_prolong().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-07 15:07:47 -03:00
5194861d1a BOUNDARIES: Small changes in corner copy subroutines.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-07 13:14:26 -03:00
92a96a7e2f BOUNDARIES: Handle all direction at once in boundaries_edge_prolong().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-07 13:12:48 -03:00
1bb006f091 BOUNDARIES: Handle all direction at once in boundaries_edge_restrict().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-07 12:45:20 -03:00
8675bc2cf3 BOUNDARIES: Handle all direction at once in boundaries_edge_copy().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-07 12:11:23 -03:00
dc6bd31951 BOUNDARIES: Remove comments from prepare/release_exchange_array().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-05 23:20:21 -03:00
c268109465 BLOCKS, BOUNDARIES: Simplify the block_info structure.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-05 23:18:25 -03:00
db537fd635 BOUNDARIES: Remove comments from boundary_variables().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-05 18:48:18 -03:00
e4e784ba8f BOUNDARIES: Rewrite boundaries_specific().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-05 18:46:37 -03:00
70ce98b9fc BOUNDARIES: Rewrite boundaries_face_copy().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-05 18:37:26 -03:00
cdcf90ae30 BOUNDARIES: Rewrite boundaries_face_restrict().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-05 18:05:11 -03:00
65be245c97 BOUNDARIES: Rewrite boundaries_face_prolong().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-05 17:39:04 -03:00
4b72a50106 BOUNDARIES: Rewrite block_face_restrict().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-04 23:21:47 -03:00
df71b8e06e BOUNDARIES: Rewrite block_face_prolong().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-04 23:05:07 -03:00
f510a2ec15 EVOLUTION: Call variable conversion after the boundary update.
The variable conversion is done for the whole blocks, including ghost
zones.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-04 16:40:20 -03:00
9e327d76ca EQUATIONS: Add option ghosts to update_primitive_variables().
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>
2022-02-04 16:36:50 -03:00
2c0499a82e BOUNDARIES: Rewrite boundaries_edge_copy().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-03 22:25:20 -03:00
1f7c84d790 BOUNDARIES: Rewrite boundaries_edge_restrict().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-03 18:34:23 -03:00
ca9563e374 BOUNDARIES: Rewrite boundaries_edge_prolong().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-03 17:55:14 -03:00
653173496f BOUNDARIES: Rewrite boundaries_corner_copy().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-03 16:25:08 -03:00
5b77ce6173 BOUNDARIES: Rewrite boundaries_corner_restrict().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-03 16:02:46 -03:00
09619fc7c8 BOUNDARIES: Rewrite boundaries_corner_prolong().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-03 15:37:02 -03:00
8379192543 BOUNDARIES: Do not rename imported variables.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-03 15:03:44 -03:00
b4a1590dcf BOUNDARIES: Rewrite block_edge_prolong().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-03 13:59:15 -03:00
3de7250ff4 BOUNDARIES: Rewrite block_edge_restrict().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-03 12:45:53 -03:00
cb364e1207 BOUNDARIES: Use nghosts_double in block_corner_restrict().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-03 11:24:04 -03:00
9b030f0b13 BOUNDARIES: Rewrite block_corner_prolong().
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
2022-02-03 11:13:07 -03:00