Exemple #1
0
    mc = Manipulations(basePath=basePath)
    mc.generatorNewName('solved', baseNewName=basePath)
    newName = mc.getName('newName')
    mc.createNewPath(dirmame=os.getcwd(), newCaseName=newName)
    newPath = mc.getPath('newPath')
    mc.dublicateCase(basePath=basePath, newPath=newPath, mode='rewrite')

    sc = SetSystem(pathCase=newPath)
    sc.setControlDict(controlDict)

    meshClass = Mesh(pathCase=newPath)
    meshClass.setBlockMesh(meshList)
    meshClass.runBlockMesh()

    ic = IntiailValue(pathCase=newPath)
    newDict = ic.calcInitVal(A, B, Uin, nu)
    ic.setVarAllFiels(constDictVar, newDict)

    cc = SetConstantParam(pathCase=newPath)
    cc.setTransportProp(tranPropDict)
    cc.setTurbModel(typeTurbModel='kEpsilon')

    rc = Runner()
    rc.setCores()
    rc.setPathCase(newPath)
    rc.setNameSolver(solverName='pimpleFoam')
    rc.setModeRunner(mode='common')
    rc.setPyFoamSettings(pyFoam=False)
    rc.runCase()
Exemple #2
0
import os, sys
libpath = '/home/ivan/mySolvers/RunnerForCases/'
sys.path.append(libpath)

from Modules.Manipulations import Manipulations
from Modules.RunApplication import Runner

basePath = '2D_TMFHartmann'

if __name__ == "__main__":

    mc = Manipulations(basePath=basePath)
    mc.generatorNewName('solved', baseNewName=basePath)
    newName = mc.getName('newName')
    mc.createNewPath(dirmame=os.getcwd(), newCaseName=newName)
    newPath = mc.getPath('newPath')
    mc.dublicateCase(basePath=basePath, newPath=newPath, mode='rewrite')

    rc = Runner()
    rc.setCores(numCoreOF=4, numCoreElmer=4)
    rc.setPathCase(newPath)
    rc.setNameSolver(solverName='mhdVxBPhasePimpleFoam')
    rc.setModeRunner(mode='EOF')
    rc.setPyFoamSettings(pyFoam=False)
    rc.runCase(decompose=True)
Exemple #3
0
def step3(oldpath):
    generalPath = os.getcwd()
    mc = Manipulations(basePath=basePathStep2)
    mc.generatorNewName('parabolic', 'solved', 'mapped', baseNewName='step2')
    newName = mc.getName('newName')
    mc.createNewPath(dirmame=os.getcwd(), newCaseName=newName)
    runPath = mc.getPath('newPath')
    mc.dublicateCase(basePath=basePathStep2, newPath=runPath, mode='rewrite')

    sc = SetSystem(pathCase=runPath)
    sc.setControlDict(controlDict)

    initialClass = IntiailValue(pathCase=runPath)
    initialClass.copyBC(oldpath,
                        runPath,
                        nameBCsource='outlet',
                        nameBCdist='inlet',
                        mapTimeStep=stopTime)
    initialClass.setMappSet(sourcePath=oldpath,
                            distPath=runPath,
                            source='0',
                            dist='0')
    initialClass.setMappValues()

    cpClass = SetConstantParam(pathCase=runPath)
    cpClass.setTurbModel(turbType)
    cpClass.setTransportProp(tranPropDict)

    meshClass = Mesh(pathCase=runPath)
    meshClass.setBlockMesh(meshList)
    meshClass.runBlockMesh()

    rc = Runner(pathCase=runPath)
    rc.setCoresOF(coreOF=coreOF)
    rc.setNameSolver(solverName=solverName)
    rc.setModeRunner(mode=mode)
    rc.setPyFoamSettings(pyFoam=False)
    rc.setDecomposeParDict(coreOF, nameVar='core_OF')
    rc.runCase()
    os.chdir(generalPath)
    return os.path.abspath(runPath)
Exemple #4
0
from data import *

if __name__ == "__main__":

    mc = Manipulations(basePath=basePath)
    mc.generatorNewName('solved', baseNewName=basePath)
    newName = mc.getName('newName')
    mc.createNewPath(dirmame=os.getcwd(), newCaseName=newName)
    runPath = mc.getPath('newPath')
    mc.dublicateCase(basePath=basePath, newPath=runPath, mode='rewrite')

    sc = SetSystem(pathCase=runPath)
    sc.setControlDict(controlDict)

    Mesh().runBlockMesh(pathCase=runPath)

    ic = IntiailValue(pathCase=runPath)
    ic.setVarAllFiels(constDictVar)

    cc = SetConstantParam(pathCase=runPath)
    cc.setTransportProp(tranPropDict)  # write viscosity in transportProperies

    rc = Runner()
    rc.setPathCase(runPath)
    rc.setCoresOF(coreOF=coreOF)
    rc.setNameSolver(solverName=solverName)
    rc.setModeRunner(mode='parallel')
    rc.setPyFoamSettings(pyFoam=False)
    rc.setDecomposeParDict(coreOF, nameVar='core_OF')
    rc.runCase()
Exemple #5
0
def step1():
    generalPath = os.getcwd()
    mc = Manipulations(basePath=basePathStep1)
    mc.generatorNewName('parabolic', 'solved', baseNewName='step1')
    newName = mc.getName('newName')
    mc.createNewPath(dirmame=os.getcwd(), newCaseName=newName)
    runPath = mc.getPath('newPath')
    mc.dublicateCase(basePath=basePathStep1, newPath=runPath, mode='rewrite')

    sc = SetSystem(pathCase=runPath)
    sc.setControlDict(controlDict)

    initialClass = IntiailValue(pathCase=runPath)
    initialDictCalculated = initialClass.calcInitVal(A, B, Uin, nu)
    initialClass.setVarAllFiels(initialDictConst, initialDictCalculated)

    cpClass = SetConstantParam(pathCase=runPath)
    cpClass.setTurbModel(turbType)
    cpClass.setTransportProp(tranPropDict)

    meshClass = Mesh(pathCase=runPath)
    meshClass.setBlockMesh(meshList)
    meshClass.runBlockMesh()

    rc = Runner(pathCase=runPath)
    rc.setCoresOF(coreOF=coreOF)
    rc.setNameSolver(solverName=solverName)
    rc.setModeRunner(mode=mode)
    rc.setPyFoamSettings(pyFoam=False)
    rc.setDecomposeParDict(coreOF, nameVar='core_OF')
    rc.runCase()

    os.chdir(generalPath)
    return os.path.abspath(runPath)