本文整理匯總了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()