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


Python SolutionDirectory.lastToArchive方法代码示例

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


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

示例1: difference

# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import lastToArchive [as 别名]
    
    print "Last Time = ",dire.getLast()

    # Get the pressure difference (Using an external utility)
    pUtil=UtilityRunner(argv=[pCmd,"-case",case],silent=True,logname="Pressure")
    pUtil.add("deltaP","Pressure at .* Difference .*\] (.+)")
    pUtil.start()

    deltaP=pUtil.get("deltaP")[0]

    # Get the mass flow
    mUtil=UtilityRunner(argv=[mCmd,"-case",case,"-latestTime"],silent=True,logname="MassFlow")
    mUtil.add("mass","Flux at (.+?) .*\] (.+)",idNr=1)
    mUtil.start()

    massFlow=mUtil.get("mass",ID="outlet")[0]

    # Archive the results
    dire.lastToArchive("vel=%g" % (val))

    # Clear results
    dire.clearResults()

    # Output current stuff
    print "Vel: ",val,"DeltaP: ",deltaP,"Mass Flow:",massFlow
    f.writeLine( (val,deltaP,massFlow) )
    
sol.purgeFile()

    
开发者ID:LeeRuns,项目名称:PyFoam,代码行数:30,代码来源:doInletVariation.py

示例2: range

# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import lastToArchive [as 别名]
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()
    print " Reconstruct Par"
    reconstruct = BasicRunner(argv=["reconstructPar"],silent=True)
    reconstruct.start()
    end = time.clock()
    print " Save Data"
    print " Run finalized. Ellapsed time: {:f}s".format(end-start)
    caseDir.lastToArchive("vel={:f}alpha={:f}".format(vel,alpha))
开发者ID:schmidi093,项目名称:RTVC,代码行数:32,代码来源:runPolarStudy.py

示例3:

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

from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory

dName=sys.argv[1]

sd=SolutionDirectory(dName)

sd.lastToArchive("test")
sd.clearResults()

开发者ID:LeeRuns,项目名称:PyFoam,代码行数:12,代码来源:testSolutionDir.py


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