本文整理汇总了Python中ecl.grid.EclGrid.cell_volume方法的典型用法代码示例。如果您正苦于以下问题:Python EclGrid.cell_volume方法的具体用法?Python EclGrid.cell_volume怎么用?Python EclGrid.cell_volume使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ecl.grid.EclGrid
的用法示例。
在下文中一共展示了EclGrid.cell_volume方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_output_units
# 需要导入模块: from ecl.grid import EclGrid [as 别名]
# 或者: from ecl.grid.EclGrid import cell_volume [as 别名]
def test_output_units(self):
n = 10
a = 1
grid = GridGen.createRectangular( (n,n,n), (a,a,a))
with TestAreaContext("python/ecl_grid/units"):
grid.save_EGRID( "CASE.EGRID" , output_unit = EclUnitTypeEnum.ECL_FIELD_UNITS )
f = EclFile("CASE.EGRID")
g = f["GRIDUNIT"][0]
self.assertEqual( g[0].strip( ) , "FEET" )
g2 = EclGrid("CASE.EGRID")
self.assertFloatEqual( g2.cell_volume( global_index = 0 ) , 3.28084*3.28084*3.28084)
grid.save_EGRID( "CASE.EGRID" )
f = EclFile("CASE.EGRID")
g = f["GRIDUNIT"][0]
self.assertEqual( g[0].strip( ) , "METRES" )
grid.save_EGRID( "CASE.EGRID" , output_unit = EclUnitTypeEnum.ECL_LAB_UNITS)
f = EclFile("CASE.EGRID")
g = f["GRIDUNIT"][0]
self.assertEqual( g[0].strip() , "CM" )
g2 = EclGrid("CASE.EGRID")
self.assertFloatEqual( g2.cell_volume( global_index = 0 ) , 100*100*100 )
示例2: test_volume_kw
# 需要导入模块: from ecl.grid import EclGrid [as 别名]
# 或者: from ecl.grid.EclGrid import cell_volume [as 别名]
def test_volume_kw(self):
grid = EclGrid(self.egrid_file())
vol = grid.createVolumeKeyword( )
self.assertEqual( len(vol) , grid.getNumActive())
for active_index , volume in enumerate(vol):
self.assertEqual( volume , grid.cell_volume( active_index = active_index ))
vol = grid.createVolumeKeyword( active_size = False )
self.assertEqual( len(vol) , grid.getGlobalSize())
for global_index , volume in enumerate(vol):
self.assertEqual( volume , grid.cell_volume( global_index = global_index ))