Merge pull request #4127 from GitPaean/equilibration_for_zero_volume_cells

for the cells having zero thickness we use the cell center depth to do the equilibration
This commit is contained in:
Bård Skaflestad
2022-09-23 10:58:48 +02:00
committed by GitHub

View File

@@ -1864,8 +1864,18 @@ equilibrateHorizontal(const CellRange& cells,
totfrac += frac;
}
saturations /= totfrac;
pressures /= totfrac;
if (totfrac > 0.) {
saturations /= totfrac;
pressures /= totfrac;
} else {
// Fall back to centre point method for zero-thickness cells.
const auto pos = CellPos {
cell, cellCenterDepth_[cell]
};
saturations = psat.deriveSaturations(pos, eqreg, ptable);
pressures = psat.correctedPhasePressures();
}
const auto temp = this->temperature_[cell];
const auto cz = cellCenterDepth_[cell];