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


Python Solver.solver方法代码示例

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


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

示例1:

# 需要导入模块: import Solver [as 别名]
# 或者: from Solver import solver [as 别名]
basePath = 'sweep'
aoaRange = [-6,-4,-2,0,2,4,6,8,10]

for aoa in aoaRange:
    ## Case setup will configure a directory for an OpenFoam run
    case = Utilities.caseSetup(folderPath='%s/test_%s'%(basePath,aoa), geometryPath='../test_dir/benchmarkAircraft.stl')


    ## This manages the STL file. This includes the option to scale and rotate the geometry.
    model = stlTools.SolidSTL(case.stlPath)
    ## Rotate the geometry to the correct aoa for the simulation
    model.setaoa(aoa, units='degrees')
    ## Save the Modified geometry to disk
    model.saveSTL(case.stlPath)


    ## Meshing will execute blockMeshDict and snappyHexMesh to create the mesh for simulation
    mesh = Meshing.mesher(case.dir, model)
    ## Run blockMesh to generate the simulation domain
    mesh.blockMesh()
    ## Used snappyHexMesh to refine the domain and subtract out regions around the geometry
    mesh.snappyHexMesh()
    ## Display the mesh in a Paraview preview window
    if preview:
        mesh.previewMesh()


    solver = Solver.solver(case.dir)
    if preview:
        ## Call the mesh function again, but Paraview will find the solver results in the case directory
        mesh.previewMesh()
开发者ID:TristanZS,项目名称:droneCFD,代码行数:33,代码来源:aoa_sweep.py


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