本文整理汇总了Python中ert.ecl.EclSum.blockedProduction方法的典型用法代码示例。如果您正苦于以下问题:Python EclSum.blockedProduction方法的具体用法?Python EclSum.blockedProduction怎么用?Python EclSum.blockedProduction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ert.ecl.EclSum
的用法示例。
在下文中一共展示了EclSum.blockedProduction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_regularProduction
# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import blockedProduction [as 别名]
def test_regularProduction(self):
sum = EclSum(self.case)
with self.assertRaises(TypeError):
trange = TimeVector.createRegular( sum.start_time , sum.end_time , "1M" )
prod = sum.blockedProduction("FOPR" , trange)
with self.assertRaises(KeyError):
trange = TimeVector.createRegular( sum.start_time , sum.end_time , "1M" )
prod = sum.blockedProduction("NoNotThis" , trange)
trange = sum.timeRange(interval = "2Y")
self.assertTrue( trange[0] == datetime.date( 2000 , 1 , 1 ))
self.assertTrue( trange[-1] == datetime.date( 2006 , 1 , 1 ))
trange = sum.timeRange(interval = "5Y")
self.assertTrue( trange[0] == datetime.date( 2000 , 1 , 1 ))
self.assertTrue( trange[-1] == datetime.date( 2005 , 1 , 1 ))
trange = sum.timeRange(interval = "6M")
wprod1 = sum.blockedProduction("WOPT:OP_1" , trange)
wprod2 = sum.blockedProduction("WOPT:OP_2" , trange)
wprod3 = sum.blockedProduction("WOPT:OP_3" , trange)
wprod4 = sum.blockedProduction("WOPT:OP_4" , trange)
wprod5 = sum.blockedProduction("WOPT:OP_5" , trange)
fprod = sum.blockedProduction("FOPT" , trange)
gprod = sum.blockedProduction("GOPT:OP" , trange)
wprod = wprod1 + wprod2 + wprod3 + wprod4 + wprod5
for (w,f,g) in zip(wprod, fprod,gprod):
self.assertFloatEqual( w , f )
self.assertFloatEqual( w , g )
示例2: test_eval
# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import blockedProduction [as 别名]
def test_eval(self):
npv = EclNPV(self.case)
npv.compile("[FOPT]")
npv1 = npv.evalNPV()
npv2 = 0
sum = EclSum(self.case)
trange = sum.timeRange()
fopr = sum.blockedProduction("FOPT" , trange)
for v in fopr:
npv2 += v
self.assertAlmostEqual( npv1 , npv2 )
npv.compile("[FOPT] - 0.5*[FOPT] - 0.5*[FOPT]")
npv1 = npv.evalNPV()
self.assertTrue( abs(npv1) < 1e-2 )
npv.compile("[WOPT:OP_1] - 0.5*[WOPT:OP_1] - 0.5*[WOPT:OP_1]")
npv1 = npv.evalNPV()
self.assertTrue( abs(npv1) < 1e-2 )
示例3: EclSum
# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import blockedProduction [as 别名]
"2014-12-01": 59.29,
"2015-01-01": 47.22,
"2015-02-01": 50.58,
"2015-03-01": 47.82,
"2015-04-01": 54.45,
"2015-05-01": 59.27,
"2015-06-01": 59.82,
"2015-07-01": 50.90,
"2015-08-01": 42.87,
"2015-09-01": 45.48}
if __name__ == '__main__':
ecl_sum = EclSum("SNAKE_OIL_FIELD")
start_time = ecl_sum.getStartTime()
date_ranges = ecl_sum.timeRange(start_time, interval="1M")
production_sums = ecl_sum.blockedProduction("FOPT", date_ranges)
npv = 0.0
for index in range(0, len(date_ranges) - 1):
date = date_ranges[index + 1] # end of period
production_sum = production_sums[index]
oil_price = OIL_PRICES[date.date().strftime("%Y-%m-%d")]
production_value = oil_price * production_sum
npv += production_value
with open("snake_oil_npv.txt", "w") as output_file:
output_file.write("NPV %s\n" % npv)
if npv < 80000: