def crosspoint(self): """Calculate the sw value where krg == krw. Accuracy of this crosspoint depends on the resolution chosen when initializing the saturation range (it uses linear interpolation to solve for the zero) Returns: float: the gas saturation where krw == krg, for relperm linearly interpolated in water saturation. """ if not {"sw", "krw"}.issubset(self.wateroil.table.columns): logger.warning("Can't compute crosspoint when krw is not present") return None if not {"sl", "krg"}.issubset(self.gasoil.table.columns): logger.warning("Can't compute crosspoint when krg is not present") return None dframe = pd.concat( [ self.wateroil.table[["sw", "krw"]], self.gasoil.table[["sl", "krg"]] ], sort=False, ) # The "sl" column in the GasOil object corresponds exactly to "sw" in WaterOil # but since they are floating point, we do not want to "merge" dataframes on it, # rather concatenate and let linear interpolation fill in values. dframe["sw"].fillna(value=0, inplace=True) dframe["sl"].fillna(value=0, inplace=True) dframe["sat"] = dframe["sl"] + dframe["sw"] dframe = (dframe.set_index("sat").sort_index().interpolate( method="slinear").dropna().reset_index()) return crosspoint(dframe, "sat", "krw", "krg")
def crosspoint(self): """Locate and return the saturation point where krw = krow Accuracy of this crosspoint depends on the resolution chosen when initializing the saturation range Returns: float: the water saturation where krw == krow, for relperm linearly interpolated in water saturation. """ return crosspoint(self.table, "sw", "krw", "krow")
def crosspoint(self) -> float: """Locate and return the saturation point where krg = krog Accuracy of this crosspoint depends on the resolution chosen when initializing the saturation range (it uses linear interpolation to solve for the zero) Returns: The gas saturation where krg == krog, for relperm linearly interpolated in gas saturation. """ return crosspoint(self.table, "SG", "KRG", "KROG")