From 027c3ba0fc3c56f1c232ee964dd8303f80c678b6 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Wed, 19 Jun 2024 00:33:53 +0200 Subject: [PATCH] using one day time step for SPE1CASE1a/SPE1CASE1.DATA to avoid time stepping change causes test failures for the python tests --- python/test/test_basic.py | 8 +++++--- python/test/test_fluidstate_variables.py | 20 ++++++++++---------- python/test/test_primary_variables.py | 2 +- python/test_data/SPE1CASE1a/SPE1CASE1.DATA | 6 +++++- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/python/test/test_basic.py b/python/test/test_basic.py index 78c0c55ac..0a417679b 100755 --- a/python/test/test_basic.py +++ b/python/test/test_basic.py @@ -54,9 +54,11 @@ class TestBasic(unittest.TestCase): sim.step_init() sim.step() dt = sim.get_dt() - # NOTE: The timestep should be 1 month = 31 days - # = 31 * 24 * 60 * 60 seconds = 2678400 seconds - self.assertAlmostEqual(dt, 2678400.0, places=7, msg='value of timestep') + # NOTE: the timestep size is reduced to 1 day to avoid regression failures + # due to changes in time stepping. + # NOTE: The timestep should be 1 day + # = 24 * 60 * 60 seconds = 86400 seconds + self.assertAlmostEqual(dt, 86400., places=7, msg='value of timestep') vol = sim.get_cell_volumes() self.assertEqual(len(vol), 300, 'length of volume vector') # NOTE: The volume should be 1000 ft x 1000 ft x 20 ft * 0.3 (porosity) diff --git a/python/test/test_fluidstate_variables.py b/python/test/test_fluidstate_variables.py index 5212126f6..d03449eed 100644 --- a/python/test/test_fluidstate_variables.py +++ b/python/test/test_fluidstate_variables.py @@ -20,26 +20,26 @@ class TestBasic(unittest.TestCase): sim.step_init() sim.step() oil_pressure = sim.get_fluidstate_variable(name='po') - self.assertAlmostEqual(oil_pressure[0], 41729978.837, places=2, msg='value of oil pressure') + self.assertAlmostEqual(oil_pressure[0], 35795160.67, places=2, msg='value of oil pressure') gas_pressure = sim.get_fluidstate_variable(name='pg') - self.assertAlmostEqual(gas_pressure[0], 41729978.837, places=2, msg='value of gas pressure') + self.assertAlmostEqual(gas_pressure[0], 35795160.67, places=2, msg='value of gas pressure') water_pressure = sim.get_fluidstate_variable(name='pw') - self.assertAlmostEqual(water_pressure[0], 41729978.837, places=2, msg='value of water pressure') + self.assertAlmostEqual(water_pressure[0], 35795160.67, places=2, msg='value of water pressure') rho_w = sim.get_fluidstate_variable(name='rho_w') - self.assertAlmostEqual(rho_w[0], 1001.7549054, places=6, msg='value of water density') + self.assertAlmostEqual(rho_w[0], 998.9822355, places=6, msg='value of water density') rho_g = sim.get_fluidstate_variable(name='rho_g') - self.assertAlmostEqual(rho_g[0], 275.72397867, places=7, msg='value of gas density') + self.assertAlmostEqual(rho_g[0], 241.36955087, places=7, msg='value of gas density') rho_o = sim.get_fluidstate_variable(name='rho_o') - self.assertAlmostEqual(rho_o[0], 639.64061021, places=7, msg='value of oil density') + self.assertAlmostEqual(rho_o[0], 631.78611238, places=7, msg='value of oil density') Rs = sim.get_fluidstate_variable(name='Rs') - self.assertAlmostEqual(Rs[0], 226.196660482, places=7, msg='value of solution gas-oil ratio') + self.assertAlmostEqual(Rs[0], 226.19666048, places=7, msg='value of solution gas-oil ratio') Rv = sim.get_fluidstate_variable(name='Rv') self.assertAlmostEqual(Rv[0], 0.0, places=7, msg='value of volatile gas-oil ratio') Sw = sim.get_fluidstate_variable(name='Sw') - self.assertAlmostEqual(Sw[0], 0.11905577997, places=10, msg='value of water saturation') + self.assertAlmostEqual(Sw[0], 0.11969486712, places=10, msg='value of water saturation') So = sim.get_fluidstate_variable(name='So') - self.assertAlmostEqual(So[0], 0.56951652831, places=10, msg='value of oil saturation') + self.assertAlmostEqual(So[0], 0.825166164326, places=10, msg='value of oil saturation') Sg = sim.get_fluidstate_variable(name='Sg') - self.assertAlmostEqual(Sg[0], 0.31142769170, places=10, msg='value of gas saturation') + self.assertAlmostEqual(Sg[0], 0.055138968544, places=10, msg='value of gas saturation') T = sim.get_fluidstate_variable(name='T') self.assertAlmostEqual(T[0], 288.705, places=3, msg='value of temperature') diff --git a/python/test/test_primary_variables.py b/python/test/test_primary_variables.py index 4e160c423..ce8b51eaf 100644 --- a/python/test/test_primary_variables.py +++ b/python/test/test_primary_variables.py @@ -20,7 +20,7 @@ class TestBasic(unittest.TestCase): sim.step_init() sim.step() pressure = sim.get_primary_variable(variable='pressure') - self.assertAlmostEqual(pressure[0], 41729978.837, places=2, msg='value of pressure') + self.assertAlmostEqual(pressure[0], 35795160.67, places=2, msg='value of pressure') pressure_meaning = sim.get_primary_variable_meaning( variable='pressure') pressure_meaning_map = sim.get_primary_variable_meaning_map( diff --git a/python/test_data/SPE1CASE1a/SPE1CASE1.DATA b/python/test_data/SPE1CASE1a/SPE1CASE1.DATA index 19b65bd6c..5dee091a6 100644 --- a/python/test_data/SPE1CASE1a/SPE1CASE1.DATA +++ b/python/test_data/SPE1CASE1a/SPE1CASE1.DATA @@ -421,8 +421,12 @@ WCONINJE -- pressure in the PVT table=9014.7psia (default is 100 000psia) TSTEP +--Advance the simulater once a day for TEN days: +--Relatively small time steps are used to avoid regression failures +--due to time stepping change +10*1 / --Advance the simulater once a month for TEN years: -31 28 31 30 31 30 31 31 30 31 30 31 / +--31 28 31 30 31 30 31 31 30 31 30 31 / --31 28 31 30 31 30 31 31 30 31 30 31 --31 28 31 30 31 30 31 31 30 31 30 31 --31 28 31 30 31 30 31 31 30 31 30 31