# Elimination of Bad Volume

- The volume is negative, or less than a minimum volume
- The mass or the energy of the volume is negative

For both cases, the bad volume is merged with its neighbors. This merge is iterative as the neighbors could also be a bad volume.

- The mean volume,
$\overline{V}$
of all the active volume is calculated and a
first minimum volume is a fraction of this one:
(1) $${V}_{\mathrm{min}1}=\overline{V}\cdot {C}_{gmerg}$$Where, ${C}_{gmerg}$ is the "Factor for global merging" user-defined in /MONVOL/FVMBAG1.

The flag ${I}_{gmerg}$ determines if the mean volume to use is the current mean volume ( ${I}_{gmerg}$ =1) or the initial mean volume calculated at the first cycle.

- The mean volume,
${\overline{V}}_{n}$
of all the neighbors of the current one is
calculated. A second minimum volume is a fraction of the previous one:
(2) $${V}_{\mathrm{min}2}={\overline{V}}_{n}\cdot {C}_{nmerg}$$Where, ${C}_{nmerg}$ is the "Factor for neighborhood merging" user-defined in /MONVOL/FVMBAG1.

Finally, the volume minimum used is:(3) $${V}_{\mathrm{min}}=\mathrm{min}\left({V}_{\mathrm{min}1},{V}_{\mathrm{min}2}\right)$$