本文整理汇总了Python中ert.ecl.EclSum.writer方法的典型用法代码示例。如果您正苦于以下问题:Python EclSum.writer方法的具体用法?Python EclSum.writer怎么用?Python EclSum.writer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ert.ecl.EclSum
的用法示例。
在下文中一共展示了EclSum.writer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_creation
# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import writer [as 别名]
def test_creation(self):
ecl_sum = EclSum.writer("TEST", datetime(2010, 1, 1), 10, 10, 10)
ecl_sum.addVariable("FOPT")
ecl_sum.addVariable("FOPR")
smspec = ecl_sum.cNamespace().get_smspec(ecl_sum)
test_data = [(1, 0, 10), (1, 1, 20), (1, 2, 30), (2, 0, 40)]
for report_step, mini_step, sim_days in test_data:
ecl_sum_tstep = EclSumTStep(report_step, mini_step, sim_days, smspec)
self.assertEqual(ecl_sum_tstep.getSimDays(), sim_days)
self.assertEqual(ecl_sum_tstep.getReport(), report_step)
self.assertEqual(ecl_sum_tstep.getMiniStep(), mini_step)
self.assertTrue("FOPT" in ecl_sum_tstep)
self.assertTrue("FOPR" in ecl_sum_tstep)
self.assertFalse("WWCT" in ecl_sum_tstep)
random_float = random.random()
ecl_sum_tstep["FOPT"] = random_float
ecl_sum_tstep["FOPR"] = random_float + 1
self.assertAlmostEqual(random_float, ecl_sum_tstep["FOPT"], places=5)
self.assertAlmostEqual(random_float + 1, ecl_sum_tstep["FOPR"], places=5)
with self.assertRaises(KeyError):
ecl_sum_tstep["FROPR"] = 2
with self.assertRaises(KeyError):
value = ecl_sum_tstep["FROPR"]
示例2: test_writer
# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import writer [as 别名]
def test_writer(self):
writer = EclSum.writer("CASE", datetime.date(2000, 1, 1), 10, 10, 5)
self.assertIsInstance(self.ecl_sum, EclSum)
writer.addVariable("FOPT")
self.assertTrue(writer.has_key("FOPT"))
writer.addTStep(1, 100)
示例3: createEclSum
# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import writer [as 别名]
def createEclSum( case , keys , start = datetime.date(2010 , 1, 1) , sim_length_days = 5 * 365 , num_report_step = 5, num_mini_step = 10, dims = (20,10,5) , func_table = {}):
ecl_sum = EclSum.writer(case , start , dims[0] , dims[1] , dims[2])
var_list = []
for (kw,wgname,num) in keys:
var_list.append( ecl_sum.addVariable( kw , wgname = wgname , num = num) )
report_step_length = sim_length_days / num_report_step
mini_step_length = report_step_length / num_mini_step
for report_step in range(num_report_step):
for mini_step in range(num_mini_step):
days = report_step * report_step_length + mini_step * mini_step_length
t_step = ecl_sum.addTStep( report_step + 1 , sim_days = days )
for var in var_list:
key = var.getKey1( )
if key in func_table:
t_step[key] = func( days )
else:
t_step[key] = mock_func( ecl_sum , key , days)
return ecl_sum
示例4: runSimulator
# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import writer [as 别名]
def runSimulator(simulator, history_simulator, time_step_count):
""" @rtype: EclSum """
ecl_sum = EclSum.writer("SNAKE_OIL_FIELD", datetime(2010, 1, 1), 10, 10, 10)
ecl_sum.addVariable('FOPT', unit="SM3")
ecl_sum.addVariable('FOPR', unit="SM3/DAY")
ecl_sum.addVariable('FGPT', unit="SM3")
ecl_sum.addVariable('FGPR', unit="SM3/DAY")
ecl_sum.addVariable('FWPT', unit="SM3")
ecl_sum.addVariable('FWPR', unit="SM3/DAY")
ecl_sum.addVariable('FGOR', unit="SM3/SM3")
ecl_sum.addVariable('FWCT', unit="SM3/SM3")
ecl_sum.addVariable('FOIP', unit="SM3")
ecl_sum.addVariable('FGIP', unit="SM3")
ecl_sum.addVariable('FWIP', unit="SM3")
ecl_sum.addVariable('FOPTH', unit="SM3")
ecl_sum.addVariable('FOPRH', unit="SM3/DAY")
ecl_sum.addVariable('FGPTH', unit="SM3")
ecl_sum.addVariable('FGPRH', unit="SM3/DAY")
ecl_sum.addVariable('FWPTH', unit="SM3")
ecl_sum.addVariable('FWPRH', unit="SM3/DAY")
ecl_sum.addVariable('FGORH', unit="SM3/SM3")
ecl_sum.addVariable('FWCTH', unit="SM3/SM3")
ecl_sum.addVariable('FOIPH', unit="SM3")
ecl_sum.addVariable('FGIPH', unit="SM3")
ecl_sum.addVariable('FWIPH', unit="SM3")
ecl_sum.addVariable('WOPR', wgname='OP1', unit="SM3/DAY")
ecl_sum.addVariable('WOPR', wgname='OP2', unit="SM3/DAY")
ecl_sum.addVariable('WWPR', wgname='OP1', unit="SM3/DAY")
ecl_sum.addVariable('WWPR', wgname='OP2', unit="SM3/DAY")
ecl_sum.addVariable('WGPR', wgname='OP1', unit="SM3/DAY")
ecl_sum.addVariable('WGPR', wgname='OP2', unit="SM3/DAY")
ecl_sum.addVariable('WGOR', wgname='OP1', unit="SM3/SM3")
ecl_sum.addVariable('WGOR', wgname='OP2', unit="SM3/SM3")
ecl_sum.addVariable('WWCT', wgname='OP1', unit="SM3/SM3")
ecl_sum.addVariable('WWCT', wgname='OP2', unit="SM3/SM3")
ecl_sum.addVariable('WOPRH', wgname='OP1', unit="SM3/DAY")
ecl_sum.addVariable('WOPRH', wgname='OP2', unit="SM3/DAY")
ecl_sum.addVariable('WWPRH', wgname='OP1', unit="SM3/DAY")
ecl_sum.addVariable('WWPRH', wgname='OP2', unit="SM3/DAY")
ecl_sum.addVariable('WGPRH', wgname='OP1', unit="SM3/DAY")
ecl_sum.addVariable('WGPRH', wgname='OP2', unit="SM3/DAY")
ecl_sum.addVariable('WGORH', wgname='OP1', unit="SM3/SM3")
ecl_sum.addVariable('WGORH', wgname='OP2', unit="SM3/SM3")
ecl_sum.addVariable('WWCTH', wgname='OP1', unit="SM3/SM3")
ecl_sum.addVariable('WWCTH', wgname='OP2', unit="SM3/SM3")
ecl_sum.addVariable('BPR', num=globalIndex(5, 5, 5), unit="BARSA")
ecl_sum.addVariable('BPR', num=globalIndex(1, 3, 8), unit="BARSA")
time_map = []
mini_step_count = 10
total_step_count = time_step_count * mini_step_count
for report_step in range(time_step_count):
for mini_step in range(mini_step_count):
t_step = ecl_sum.addTStep(report_step + 1, sim_days=report_step * mini_step_count + mini_step)
time_map.append(t_step.getSimTime().datetime().strftime("%d/%m/%Y"))
simulator.step(scale=1.0 / total_step_count)
history_simulator.step(scale=1.0 / total_step_count)
t_step['FOPR'] = simulator.fopr()
t_step['FOPT'] = simulator.fopt()
t_step['FGPR'] = simulator.fgpr()
t_step['FGPT'] = simulator.fgpt()
t_step['FWPR'] = simulator.fwpr()
t_step['FWPT'] = simulator.fwpt()
t_step['FGOR'] = simulator.fgor()
t_step['FWCT'] = simulator.fwct()
t_step['FOIP'] = simulator.foip()
t_step['FGIP'] = simulator.fgip()
t_step['FWIP'] = simulator.fwip()
t_step['WOPR:OP1'] = simulator.opr('OP1')
t_step['WOPR:OP2'] = simulator.opr('OP2')
t_step['WGPR:OP1'] = simulator.gpr('OP1')
t_step['WGPR:OP2'] = simulator.gpr('OP2')
t_step['WWPR:OP1'] = simulator.wpr('OP1')
t_step['WWPR:OP2'] = simulator.wpr('OP2')
t_step['WGOR:OP1'] = simulator.gor('OP1')
t_step['WGOR:OP2'] = simulator.gor('OP2')
t_step['WWCT:OP1'] = simulator.wct('OP1')
t_step['WWCT:OP2'] = simulator.wct('OP2')
t_step['BPR:5,5,5'] = simulator.bpr('5,5,5')
t_step['BPR:1,3,8'] = simulator.bpr('1,3,8')
t_step['FOPRH'] = history_simulator.fopr()
#.........这里部分代码省略.........
示例5: runSimulator
# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import writer [as 别名]
def runSimulator(simulator, history_simulator, time_step_count):
""" @rtype: EclSum """
ecl_sum = EclSum.writer("SNAKE_OIL_FIELD", datetime(2010, 1, 1), 10, 10, 10)
ecl_sum.addVariable("FOPT")
ecl_sum.addVariable("FOPR")
ecl_sum.addVariable("FGPT")
ecl_sum.addVariable("FGPR")
ecl_sum.addVariable("FWPT")
ecl_sum.addVariable("FWPR")
ecl_sum.addVariable("FGOR")
ecl_sum.addVariable("FWCT")
ecl_sum.addVariable("FOPTH")
ecl_sum.addVariable("FOPRH")
ecl_sum.addVariable("FGPTH")
ecl_sum.addVariable("FGPRH")
ecl_sum.addVariable("FWPTH")
ecl_sum.addVariable("FWPRH")
ecl_sum.addVariable("FGORH")
ecl_sum.addVariable("FWCTH")
ecl_sum.addVariable("WOPR", wgname="OP1")
ecl_sum.addVariable("WOPR", wgname="OP2")
ecl_sum.addVariable("WWPR", wgname="OP1")
ecl_sum.addVariable("WWPR", wgname="OP2")
ecl_sum.addVariable("WGPR", wgname="OP1")
ecl_sum.addVariable("WGPR", wgname="OP2")
ecl_sum.addVariable("WGOR", wgname="OP1")
ecl_sum.addVariable("WGOR", wgname="OP2")
ecl_sum.addVariable("WWCT", wgname="OP1")
ecl_sum.addVariable("WWCT", wgname="OP2")
ecl_sum.addVariable("WOPRH", wgname="OP1")
ecl_sum.addVariable("WOPRH", wgname="OP2")
ecl_sum.addVariable("WWPRH", wgname="OP1")
ecl_sum.addVariable("WWPRH", wgname="OP2")
ecl_sum.addVariable("WGPRH", wgname="OP1")
ecl_sum.addVariable("WGPRH", wgname="OP2")
ecl_sum.addVariable("WGORH", wgname="OP1")
ecl_sum.addVariable("WGORH", wgname="OP2")
ecl_sum.addVariable("WWCTH", wgname="OP1")
ecl_sum.addVariable("WWCTH", wgname="OP2")
ecl_sum.addVariable("BPR", num=globalIndex(5, 5, 5))
ecl_sum.addVariable("BPR", num=globalIndex(1, 3, 8))
time_map = []
mini_step_count = 10
total_step_count = time_step_count * mini_step_count
for report_step in range(time_step_count):
for mini_step in range(mini_step_count):
t_step = ecl_sum.addTStep(report_step + 1, sim_days=report_step * mini_step_count + mini_step)
time_map.append(t_step.getSimTime().datetime().strftime("%d/%m/%Y"))
simulator.step(scale=1.0 / total_step_count)
history_simulator.step(scale=1.0 / total_step_count)
t_step["FOPR"] = simulator.fopr()
t_step["FOPT"] = simulator.fopt()
t_step["FGPR"] = simulator.fgpr()
t_step["FGPT"] = simulator.fgpt()
t_step["FWPR"] = simulator.fwpr()
t_step["FWPT"] = simulator.fwpt()
t_step["FGOR"] = simulator.fgor()
t_step["FWCT"] = simulator.fwct()
t_step["WOPR:OP1"] = simulator.opr("OP1")
t_step["WOPR:OP2"] = simulator.opr("OP2")
t_step["WGPR:OP1"] = simulator.gpr("OP1")
t_step["WGPR:OP2"] = simulator.gpr("OP2")
t_step["WWPR:OP1"] = simulator.wpr("OP1")
t_step["WWPR:OP2"] = simulator.wpr("OP2")
t_step["WGOR:OP1"] = simulator.gor("OP1")
t_step["WGOR:OP2"] = simulator.gor("OP2")
t_step["WWCT:OP1"] = simulator.wct("OP1")
t_step["WWCT:OP2"] = simulator.wct("OP2")
t_step["BPR:5,5,5"] = simulator.bpr("5,5,5")
t_step["BPR:1,3,8"] = simulator.bpr("1,3,8")
t_step["FOPRH"] = history_simulator.fopr()
t_step["FOPTH"] = history_simulator.fopt()
t_step["FGPRH"] = history_simulator.fgpr()
t_step["FGPTH"] = history_simulator.fgpt()
t_step["FWPRH"] = history_simulator.fwpr()
t_step["FWPTH"] = history_simulator.fwpt()
t_step["FGORH"] = history_simulator.fgor()
t_step["FWCTH"] = history_simulator.fwct()
t_step["WOPRH:OP1"] = history_simulator.opr("OP1")
t_step["WOPRH:OP2"] = history_simulator.opr("OP2")
t_step["WGPRH:OP1"] = history_simulator.gpr("OP1")
#.........这里部分代码省略.........
示例6: globalIndex
# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import writer [as 别名]
def globalIndex(i, j, k, nx=10, ny=10, nz=10):
return i + nx * (j - 1) + nx * ny * (k - 1)
def plotVector(title, vectors):
# plt.figure()
for index, vector in enumerate(vectors):
plt.plot(vector, label="R: %d" % index)
# plt.legend()
plt.title(title)
if __name__ == '__main__':
realizations = []
for realization in range(10):
ecl_sum = EclSum.writer("MERGEL", datetime(2010, 1, 1), 10, 10, 10)
ecl_sum.addVariable("FOPT")
ecl_sum.addVariable("FOPR")
ecl_sum.addVariable("FGPT")
ecl_sum.addVariable("FGPR")
ecl_sum.addVariable("FWPT")
ecl_sum.addVariable("FWPR")
ecl_sum.addVariable("FGOR")
ecl_sum.addVariable("FWCT")
ecl_sum.addVariable("WOPR", wgname="OP1")
ecl_sum.addVariable("WOPR", wgname="OP2")
ecl_sum.addVariable("WWPR", wgname="OP1")
ecl_sum.addVariable("WWPR", wgname="OP2")
ecl_sum.addVariable("WGPR", wgname="OP1")
ecl_sum.addVariable("WGPR", wgname="OP2")