def test_interpolation_deprecated(param_wo, param_go): """Testing deprecated functionality. Remove this test function when SCALrecommendation class is updated""" rec = SCALrecommendation( LOW_SAMPLE_LET, BASE_SAMPLE_LET, HIGH_SAMPLE_LET, "foo", h=0.1 ) rec.add_simple_J() # Add default pc curve assert rec.type == WaterOilGas try: interpolant = rec.interpolate(param_wo, param_go, h=0.1) except AssertionError: return check_table(interpolant.wateroil.table) check_table(interpolant.gasoil.table) assert len(interpolant.gasoil.SGOF()) > 100 assert len(interpolant.gasoil.SGFN()) > 100 assert len(interpolant.wateroil.SWFN()) > 100 assert len(interpolant.SOF3()) > 100 assert len(interpolant.wateroil.SWOF()) > 100 if not interpolant.threephaseconsistency(): print(interpolant.wateroil.SWOF()) print(interpolant.gasoil.SGOF()) assert interpolant.threephaseconsistency()
def test_deprecated_kroend(): """Testing that the deprecated scalrecommendation can take both kroend and krogend/krowend""" low_krowend = dict(LOW_SAMPLE_LET) low_krowend["krowend"] = low_krowend["kroend"] del low_krowend["kroend"] base_krowend = dict(BASE_SAMPLE_LET) base_krowend["krowend"] = base_krowend["kroend"] del base_krowend["kroend"] high_krowend = dict(HIGH_SAMPLE_LET) high_krowend["krowend"] = high_krowend["kroend"] del high_krowend["kroend"] rec = SCALrecommendation(low_krowend, base_krowend, high_krowend, "foo", h=0.1) rec.add_simple_J() # Add default pc curve interpolant = rec.interpolate(0.1, 0, h=0.1) check_table(interpolant.wateroil.table) print(interpolant.SWOF())
def interpolatetest(): rec = SCALrecommendation(lowsample(), basesample(), highsample(), "foo", h=0.05) rec.add_simple_J() # Add default pc curve # print rec.low.wateroil.table interpolant = rec.interpolate(0.3, parameter2=-0.9, h=0.05) print(interpolant.wateroil.SWOF()) print(interpolant.gasoil.SGOF()) print("Consistency check: ", end=" ") print(interpolant.threephaseconsistency())
def test_interpolation(param_wo, param_go): rec = SCALrecommendation(low_sample_let, base_sample_let, high_sample_let, "foo", h=0.1) rec.add_simple_J() # Add default pc curve try: interpolant = rec.interpolate(param_wo, param_go, h=0.1) except AssertionError: return check_table_wo(interpolant.wateroil.table) check_table_go(interpolant.gasoil.table) assert len(interpolant.gasoil.SGOF()) > 100 assert len(interpolant.gasoil.SGFN()) > 100 assert len(interpolant.wateroil.SWFN()) > 100 assert len(interpolant.SOF3()) > 100 assert len(interpolant.wateroil.SWOF()) > 100 assert interpolant.threephaseconsistency() == ""