From 3bed5f41c1275cf1bf386ba0cbef7834a801af80 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Fri, 23 Sep 2022 09:37:32 +0200 Subject: [PATCH] for the cells having zero thickness we use the cell center depth to do the equilibration --- ebos/equil/initstateequil.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ebos/equil/initstateequil.cc b/ebos/equil/initstateequil.cc index 6d2701f26..adc7bf058 100644 --- a/ebos/equil/initstateequil.cc +++ b/ebos/equil/initstateequil.cc @@ -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];