本文整理汇总了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()