Give more control over the unphysical cell correction by allowing to
specify the minimum number of physical cells to perform averaging
(parameter "npavg") and the maximum distance to be considered from the
corrected cell (parameter "ngavg").
These two parameters allow to avoid averaging of extended unphysical
regions from two physical points.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If there are no enough physical neighbors, the cell cannot be corrected
and the code simply stops. Allow the code to continue the execution in
such a case by simply correcting the unphysical cells by replacing the
negative values of positive variables with a lower bounds, dmin and
pmin, for density and pressure, respectively.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
In case an interpolated cell, which should be positive, is zero or negative,
and the sum of derivatives is zero as well, the correction of
derivatives can enter into an infinite loop. It shouldn't normally
happen, since such a situation is unphysical.
Avoid the infinite loop and print a warning about encountered problems.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
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>
File 'makedeps' is now generated automatically if it does not exist or
any of source files has been modified.
Improve the cleaning of compilation files. Only files created during the
compilation are removed. Also if the OBJDIR is empty, it is removed as
well.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
Get rid of 'grep' and use only 'awk', 'sort' and 'uniq'. All should be
available in any linux system.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
If we increase the number of MPI processes during the restart, the seed
values are read from the last available restart file. Therefore, if we
have completely random seed numbers, the extra processes will have the
same seed value.
Detect this case and generate new random seeds if necessary.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
The array of seed numbers makes sense only when OpenMP is used. With
MPI on, the length of seed vector on each MPI process is equal to the
number of OpenMP threads. For no OpenMP, only one seed number per MPI
process is used.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>