Files
ResInsight/ApplicationCode/GrpcInterface/Python/rips/PythonExamples/SoilPorvSync.py
Gaute Lindkvist 824ec5cef6 Python: Rename example directory to PythonExamples
* This is so that when we add the folder to the Script Path it will look more sensible to the user.
2019-08-19 08:46:09 +02:00

22 lines
640 B
Python

import rips
import time
resInsight = rips.Instance.find()
start = time.time()
case = resInsight.project.case(id=0)
porvResults = case.properties.activeCellProperty('STATIC_NATIVE', 'PORV', 0)
timeStepInfo = case.timeSteps()
for i in range (0, len(timeStepInfo)):
soilResults = case.properties.activeCellProperty('DYNAMIC_NATIVE', 'SOIL', i)
results = []
for (soil, porv) in zip(soilResults, porvResults):
results.append(soil * porv)
case.properties.setActiveCellProperty(results, 'GENERATED', 'SOILPORVSync', i)
end = time.time()
print("Time elapsed: ", end - start)
print("Transferred all results back")