EVOLUTION: Fix unphysical cells after mesh update.

Unphysical cells can appear due to various reasons, e.g conservative to
primitive variable conversion in recently created block after mesh
refinements. Such unphysical cells can be immediately propagated to
neighbor blocks through boundary update, blocks which have not been
marked as recently updated. In such situation, the unphysical cells are
not corrected in these neighbors.

This change fixes this by marking all neighbors of blocks created in the
mesh update to be verified for unphysical cells too.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2018-08-07 14:13:34 -03:00
parent cd4474ad23
commit 5964d50720
2 changed files with 20 additions and 3 deletions

View File

@ -343,7 +343,7 @@ module blocks
public :: set_last_id, get_last_id, get_mblocks, get_dblocks, get_nleafs
public :: set_blocks_update
public :: change_blocks_process
public :: set_neighbors_refine
public :: set_neighbors_refine, set_neighbors_update
public :: metablock_set_id, metablock_set_process, metablock_set_level
public :: metablock_set_configuration, metablock_set_refinement
public :: metablock_set_position, metablock_set_coordinates

View File

@ -1988,6 +1988,7 @@ module evolution
! include external procedures
!
use blocks , only : set_neighbors_update
use boundaries , only : boundary_variables
use equations , only : update_primitive_variables
use equations , only : fix_unphysical_cells, correct_unphysical_states
@ -2037,12 +2038,28 @@ module evolution
! correct unphysical states if detected
!
if (fix_unphysical_cells) then
! if an unphysical cell appeared in a block while updating its primitive
! variables it could be propagated to its neighbors through boundary update;
! mark all neighbors of such a block to be verified and corrected for
! unphysical cells too
!
pmeta => list_meta
do while (associated(pmeta))
if (pmeta%update) call set_neighbors_update(pmeta)
pmeta => pmeta%next
end do
! verify and correct, if necessary, unphysical cells in recently updated blocks
!
pdata => list_data
do while (associated(pdata))
pmeta => pdata%meta
if (pmeta%update) call correct_unphysical_states(pmeta%id &
, pdata%q, pdata%u)
if (pmeta%update) &
call correct_unphysical_states(pmeta%id, pdata%q, pdata%u)
pdata => pdata%next
end do