当前位置: 首页>>代码示例>>Python>>正文


Python Mesh.makeSurfaces方法代码示例

本文整理汇总了Python中Mesh.makeSurfaces方法的典型用法代码示例。如果您正苦于以下问题:Python Mesh.makeSurfaces方法的具体用法?Python Mesh.makeSurfaces怎么用?Python Mesh.makeSurfaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mesh的用法示例。


在下文中一共展示了Mesh.makeSurfaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: import Mesh [as 别名]
# 或者: from Mesh import makeSurfaces [as 别名]
def main():
    
    start = time.time()

    # set default values
    tol = 1.e-8
    cell_size    = 10.0
    solve_method = 'NEM4'
    iterations = 100

    # create mesh
    mesh = Mesh([cell_size,cell_size], [cell_size])
    
    # create fuel
    fuel = Material(2, 'fuel')
    fuel.setSigmaA([0.005, 0.10])
    fuel.setD([1.5, 0.40])
    fuel.setNuSigmaF([0.005, 0.15])
    fuel.setChi([1.0, 0.0])
    fuel.setSigmaS(np.array([[0.0, 0.02],[0.0, 0.0]]))
    
    # create fuel
    moderator = Material(2, 'moderator')
    moderator.setSigmaA([0.0, 0.01])
    moderator.setD([1.5, 0.20])
    moderator.setSigmaS(np.array([[0.0, 0.025],[0.0, 0.0]]))
    
    if solve_method == 'NEM4':
        order = 4
    else:
        order = 2
  
    # add materials to cells
    mesh.cells[0].setMaterial(fuel, order)
    mesh.cells[1].setMaterial(moderator, order)
#     mesh = mesh.refineMesh(.1)
    mesh.makeSurfaces()
    
    # plot the mesh
    pttr.plotMesh(mesh)
    
    # create solver
    solver = Solver(mesh, solve_method)   

    # solve the matrix problem to get flux profile and keff
    solver.solve(tol, iterations)
         
    # plot the flux    
    pttr.plotFlux(solver)
    pttr.plotCellFlux(solver)
    pttr.plotCurrent(solver)

    stop = time.time()
    
    print 'Ran time ' + str(stop-start)[0:5] + ' seconds'

    print '----------------------------------------------------------------------'
开发者ID:samuelshaner,项目名称:Nomads,代码行数:59,代码来源:Nomads.py

示例2: Material

# 需要导入模块: import Mesh [as 别名]
# 或者: from Mesh import makeSurfaces [as 别名]
fuel.setSigmaS(np.array([[0.0, 0.02], [0.0, 0.0]]))

# create fuel
moderator = Material(2, "moderator")
moderator.setSigmaA([0.0, 0.01])
moderator.setD([1.5, 0.20])
moderator.setSigmaS(np.array([[0.0, 0.025], [0.0, 0.0]]))

if solve_method == "NEM4":
    order = 4
else:
    order = 2

mesh.cells[0].setMaterial(fuel, order)
mesh.cells[1].setMaterial(moderator, order)
mesh.makeSurfaces()

# plot the mesh
pttr.plotMesh(mesh)

# create solver
solver = Solver(mesh, solve_method)

# solve the matrix problem to get flux profile and keff

if solve_method == "NEM4" or solve_method == "NEM2":
    for iteration in range(iterations):

        print "CMFD outer iteration " + str(iteration)

        solver.computeDs()
开发者ID:samuelshaner,项目名称:Nomads,代码行数:33,代码来源:run_script.py


注:本文中的Mesh.makeSurfaces方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。