def test_empty(): """Empty object should give empty strings (and logged errors)""" wog = WaterOilGas() assert wog.SWOF() == "" assert wog.SGOF() == "" assert wog.SOF3() == "" assert wog.SLGOF() == "" assert wog.SWFN() == "" assert wog.SGFN() == ""
def test_wateroilgas_simple(): """Test that default curves will give valid include strings""" wog = WaterOilGas() # Add default curves: wog.wateroil.add_corey_water() wog.wateroil.add_corey_oil() wog.gasoil.add_corey_gas() wog.gasoil.add_corey_oil() with pytest.raises(AssertionError): # Testing test code: sat_table_str_ok("") sat_table_str_ok(wog.SWOF()) sat_table_str_ok(wog.SGOF()) sat_table_str_ok(wog.SLGOF()) sat_table_str_ok(wog.SOF3()) sat_table_str_ok(wog.SGFN()) sat_table_str_ok(wog.SWFN())
def test_slgof(swl, sorg, sgcr): """Test dumping SLGOF records""" wog = WaterOilGas(swl=swl, sorg=sorg, sgcr=sgcr, h=0.05) wog.wateroil.add_corey_water() wog.wateroil.add_corey_oil() wog.gasoil.add_corey_gas(krgmax=1) wog.gasoil.add_corey_oil() assert wog.selfcheck() slgof = wog.gasoil.slgof_df() assert "SL" in slgof assert "KRG" in slgof assert "KROG" in slgof assert not slgof.empty check_table(slgof) sat_table_str_ok(wog.SLGOF()) # Requirements from E100 manual: assert np.isclose(slgof["SL"].values[0], wog.gasoil.swl + wog.gasoil.sorg) assert np.isclose(slgof["KRG"].values[-1], 0) assert np.isclose(slgof["KROG"].values[0], 0)