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


Python SolutionDirectory.clearOther方法代码示例

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


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

示例1: range

# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import clearOther [as 别名]
valueList = []

for i in range(len(vRange)):
    for j in range(len(alphaRange)):
        valueList.append({'velocity':vRange[i],'alpha':alphaRange[j]})

valueList.append({'velocity':10,'alpha':4})
valueList.append({'velocity':5,'alpha':10})
valueList.append({'velocity':7.5,'alpha':10})
print valueList

for k in range(6,len(valueList)):
    vel = valueList[k]['velocity']
    alpha = valueList[k]['alpha']
    caseDir.clear(functionObjectData=True)
    caseDir.clearOther()
    caseDir.clearPattern("postProcessing")
    caseDir.clearResults(functionObjectData=True)
    velocity = [0,math.sin(alpha*math.pi/180)*vel,-math.cos(alpha*math.pi/180)*vel]
    print "Simulation {:d} from {:d}: velocity = {:f} alpha = {:f}".format(k,len(valueList),vel,alpha)
    parameters['flowVelocity'] = "({:f} {:f} {:f})".format(velocity[0],velocity[1],velocity[2])
    parameters['magUInf'] = "{:f}".format(vel)
    parameters.writeFile()
    decompose = BasicRunner(argv=["decomposePar"],silent=True)
    print " Decompose Dictionary"
    start = time.clock()
    decompose.start()
    print " Run SimpleFoam"
    run = AnalyzedRunner(StandardLogAnalyzer(),argv=["mpirun -np 4","simpleFoam","-parallel"],silent=True)
    run.start()
    run.picklePlots()
开发者ID:schmidi093,项目名称:RTVC,代码行数:33,代码来源:runPolarStudy.py


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