From a6989ead4abf04bbd1d6d29d5fad136b6eeb6f22 Mon Sep 17 00:00:00 2001 From: Chrysea <48130546+Chrysea@users.noreply.github.com> Date: Fri, 30 May 2025 14:51:09 +0200 Subject: [PATCH] Update ObjFunCase.py Changed the structure of NPVEntry to a struct and NPVcomponent to a tuple. This allows for the optimisation of only one well. --- .../CO2JointOpt2w/PythonFile/ObjFunCase.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/examples/Flow/CO2JointOpt2w/PythonFile/ObjFunCase.py b/examples/Flow/CO2JointOpt2w/PythonFile/ObjFunCase.py index 07d54992..9b6a260f 100644 --- a/examples/Flow/CO2JointOpt2w/PythonFile/ObjFunCase.py +++ b/examples/Flow/CO2JointOpt2w/PythonFile/ObjFunCase.py @@ -1,16 +1,28 @@ import sys from ObjFunClass import ObjFunCla,NPVCla +from dataclasses import dataclass + + +@dataclass(frozen=True) +class NPVEntry: + datatype: str + wellname: str + fluidtype: str + flowtype: str + interval: str + fluidprice: float + discountfactor: float + optimal_model_dir = sys.argv[1] py_result_dir = sys.argv[2] unsmary_dir = '{}/CO2OPT2W'.format(optimal_model_dir) -NPVcomponent = ({'datatype': 'Field', 'wellname': 'INJ1', 'fluidtype': 'Gas', 'flowtype': 'Injection', \ - 'interval': 'yearly', 'fluidprice': 15, 'discountfactor': 0.08}, - {'datatype': 'Field', 'wellname': 'PROD1', 'fluidtype': 'Oil', 'flowtype': 'Production', \ - 'interval': 'yearly', 'fluidprice': -10, 'discountfactor': 0.08}, \ - {'datatype': 'Field', 'wellname': 'PROD1', 'fluidtype': 'Gas', 'flowtype': 'Production', \ - 'interval': 'yearly', 'fluidprice': -500, 'discountfactor': 0.08}) +NPVcomponent = ( + NPVEntry('Field', 'INJ1', 'Gas', 'Injection', 'yearly', 15, 0.08), + NPVEntry('Field', 'PROD1', 'Oil', 'Production', 'yearly', -10, 0.08), + NPVEntry('Field', 'PROD1', 'Gas', 'Production', 'yearly', -500, 0.08) +) thipar = foupar = fifpar = 0