mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Python: add poropermx test
This commit is contained in:
parent
464f3b9d83
commit
91bbbdbe74
@ -21,3 +21,35 @@ def test_10k(rips_instance, initializeTest):
|
||||
assert(mysum == pytest.approx(621.768, abs=0.001))
|
||||
assert(average != pytest.approx(0.0158893, abs=0.0000001))
|
||||
assert(average == pytest.approx(0.0558893, abs=0.0000001))
|
||||
|
||||
|
||||
def createResult(poroChunks, permxChunks):
|
||||
for (poroChunk, permxChunk) in zip(poroChunks, permxChunks):
|
||||
resultChunk = []
|
||||
for (poro, permx) in zip(poroChunk.values, permxChunk.values):
|
||||
resultChunk.append(poro * permx)
|
||||
yield resultChunk
|
||||
|
||||
def checkResults(poroChunks, permxChunks, poroPermXChunks):
|
||||
for (poroChunk, permxChunk, poroPermXChunk) in zip(poroChunks, permxChunks, poroPermXChunks):
|
||||
for (poro, permx, poropermx) in zip(poroChunk.values, permxChunk.values, poroPermXChunk.values):
|
||||
recalc = poro * permx
|
||||
assert(recalc == pytest.approx(poropermx, rel=1.0e-10))
|
||||
|
||||
def test_10k_PoroPermX(rips_instance, initializeTest):
|
||||
casePath = dataroot.PATH + "/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID"
|
||||
case = rips_instance.project.loadCase(path=casePath)
|
||||
|
||||
poroChunks = case.properties.activeCellProperty('STATIC_NATIVE', 'PORO', 0)
|
||||
permxChunks = case.properties.activeCellProperty('STATIC_NATIVE', 'PERMX', 0)
|
||||
|
||||
case.properties.setActiveCellPropertyAsync(createResult(poroChunks, permxChunks), 'GENERATED', 'POROPERMXAS', 0)
|
||||
|
||||
poroChunks = case.properties.activeCellProperty('STATIC_NATIVE', 'PORO', 0)
|
||||
permxChunks = case.properties.activeCellProperty('STATIC_NATIVE', 'PERMX', 0)
|
||||
poroPermXChunks = case.properties.activeCellProperty('GENERATED', 'POROPERMXAS', 0)
|
||||
|
||||
checkResults(poroChunks, permxChunks, poroPermXChunks)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user