for the cells having zero thickness

we use the cell center depth to do the equilibration
This commit is contained in:
Kai Bao 2022-09-23 09:37:32 +02:00
parent 7b5ef36cd1
commit 3bed5f41c1

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];