本文整理汇总了Python中PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory.makeFile方法的典型用法代码示例。如果您正苦于以下问题:Python SolutionDirectory.makeFile方法的具体用法?Python SolutionDirectory.makeFile怎么用?Python SolutionDirectory.makeFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory
的用法示例。
在下文中一共展示了SolutionDirectory.makeFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import makeFile [as 别名]
pCmd="calcPressureDifference"
mCmd="calcMassFlow"
dire=SolutionDirectory(case,archive="InletVariation")
dire.clearResults()
dire.addBackup("PyFoamSolve.logfile")
dire.addBackup("PyFoamSolve.analyzed")
dire.addBackup("Pressure.analyzed")
dire.addBackup("MassFlow.analyzed")
sol=SolutionFile(dire.initialDir(),"U")
maximum=1.
nr=10
f=dire.makeFile("InflowVariationResults")
for i in range(nr+1):
# Set the boundary condition at the inlet
val=(maximum*i)/nr
print "Inlet velocity:",val
sol.replaceBoundary("inlet","(%f 0 0)" %(val))
# Run the solver
run=ConvergenceRunner(BoundingLogAnalyzer(),argv=[solver,"-case",case],silent=True)
run.start()
print "Last Time = ",dire.getLast()
# Get the pressure difference (Using an external utility)
pUtil=UtilityRunner(argv=[pCmd,"-case",case],silent=True,logname="Pressure")