2019-05-30 11:52:38 -05:00
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
sys.path.insert(1, os.path.join(sys.path[0], '../api'))
|
|
|
|
import ResInsight
|
|
|
|
|
2019-06-03 07:33:16 -05:00
|
|
|
resInsight = ResInsight.Instance.find()
|
|
|
|
case = resInsight.case(id=0)
|
2019-05-30 11:52:38 -05:00
|
|
|
|
2019-06-03 07:33:16 -05:00
|
|
|
porvChunks = case.properties.activeCellProperty('STATIC_NATIVE', 'PORV', 0)
|
2019-05-30 11:52:38 -05:00
|
|
|
porvResults = []
|
|
|
|
for porvChunk in porvChunks:
|
|
|
|
for porv in porvChunk.values:
|
|
|
|
porvResults.append(porv)
|
|
|
|
|
2019-06-03 07:33:16 -05:00
|
|
|
timeStepInfo = case.timeSteps()
|
2019-05-30 11:52:38 -05:00
|
|
|
|
2019-06-03 07:33:16 -05:00
|
|
|
for i in range (0, len(timeStepInfo.dates)):
|
|
|
|
soilChunks = case.properties.activeCellProperty('DYNAMIC_NATIVE', 'SOIL', i)
|
2019-05-30 11:52:38 -05:00
|
|
|
soilResults = []
|
|
|
|
for soilChunk in soilChunks:
|
|
|
|
for soil in soilChunk.values:
|
|
|
|
soilResults.append(soil)
|
|
|
|
results = []
|
|
|
|
for (soil, porv) in zip(soilResults, porvResults):
|
|
|
|
results.append(soil * porv)
|
|
|
|
|
2019-06-03 07:33:16 -05:00
|
|
|
case.properties.setActiveCellProperty(results, 'GENERATED', 'SOILPORVSync', i)
|
2019-05-30 11:52:38 -05:00
|
|
|
print("Transferred all results back")
|