From 5dd41640e71af6bdd5256937e82d7901fc7a7a93 Mon Sep 17 00:00:00 2001 From: Chrysea <48130546+Chrysea@users.noreply.github.com> Date: Fri, 30 May 2025 14:53:21 +0200 Subject: [PATCH] Update ObjFunClass.py Updated objective function evaluation to correspond with the changes made to ObjFunCase.py --- .../CO2JointOpt2w/PythonFile/ObjFunClass.py | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/examples/Flow/CO2JointOpt2w/PythonFile/ObjFunClass.py b/examples/Flow/CO2JointOpt2w/PythonFile/ObjFunClass.py index 09646f53..f662b173 100644 --- a/examples/Flow/CO2JointOpt2w/PythonFile/ObjFunClass.py +++ b/examples/Flow/CO2JointOpt2w/PythonFile/ObjFunClass.py @@ -74,22 +74,22 @@ def NPVcompro(self): self.NPVdislist = [] for i in range(0, len(self.npvcomdata)): - NPVpro = '{}_{}_{}'.format(self.npvcomdata[i]['wellname'].lower(), \ - self.npvcomdata[i]['fluidtype'].lower(), \ - self.npvcomdata[i]['flowtype'][:4].lower()) - if self.npvcomdata[i]['datatype'][0].upper() == 'W': - NPVprokey = '{}{}{}T:{}'.format(self.npvcomdata[i]['datatype'][0].upper(), \ - self.npvcomdata[i]['fluidtype'][0].upper(), \ - self.npvcomdata[i]['flowtype'][0].upper(), \ - self.npvcomdata[i]['wellname']) + NPVpro = '{}_{}_{}'.format(self.npvcomdata[i].wellname, \ + self.npvcomdata[i].fluidtype.lower(), \ + self.npvcomdata[i].flowtype[:4].lower()) + if self.npvcomdata[i].datatype[0].upper() == 'W': + NPVprokey = '{}{}{}T:{}'.format(self.npvcomdata[i].datatype[0].upper(), \ + self.npvcomdata[i].fluidtype[0].upper(), \ + self.npvcomdata[i].flowtype[0].upper(), \ + self.npvcomdata[i].wellname) else: - NPVprokey = '{}{}{}T'.format(self.npvcomdata[i]['datatype'][0].upper(), \ - self.npvcomdata[i]['fluidtype'][0].upper(), \ - self.npvcomdata[i]['flowtype'][0].upper()) + NPVprokey = '{}{}{}T'.format(self.npvcomdata[i].datatype[0].upper(), \ + self.npvcomdata[i].fluidtype[0].upper(), \ + self.npvcomdata[i].flowtype[0].upper()) - NPVint = '1{}'.format(self.npvcomdata[i]['interval'][0].upper()) - NPVflupri = self.npvcomdata[i]['fluidprice'] - NPVdis = self.npvcomdata[i]['discountfactor'] + NPVint = '1{}'.format(self.npvcomdata[i].interval[0].upper()) + NPVflupri = self.npvcomdata[i].fluidprice + NPVdis = self.npvcomdata[i].discountfactor self.NPVprolist.append(NPVpro) self.NPVprokeylist.append(NPVprokey) @@ -140,6 +140,3 @@ class WelCosCla(ObjFunCla): def __init__(self, simsummary, npvcomponent, wellsimdata, wellcostdata, initaldata): super().__init__(simsummary, npvcomponent, wellsimdata, wellcostdata, initaldata) pass - - -