Ejemplo n.º 1
0
def readControls(runTime, mesh, pimple):
    adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls(runTime)

    pimpleDict = pimple.dict()

    correctPhi = pimpleDict.lookupOrDefault(ref.word("correctPhi"),
                                            ref.Switch(False))

    checkMeshCourantNo = pimpleDict.lookupOrDefault(
        ref.word("checkMeshCourantNo"), ref.Switch(False))

    return adjustTimeStep, maxCo, maxDeltaT, pimpleDict, correctPhi, checkMeshCourantNo
Ejemplo n.º 2
0
def createZones(mesh, U):
    mrfZones = man.MRFZones(mesh)
    mrfZones.correctBoundaryVelocity(U)

    pZones = man.porousZones(mesh)
    pressureImplicitPorosity = ref.Switch(False)

    return mrfZones, pZones, pressureImplicitPorosity
Ejemplo n.º 3
0
def readFluidMultiRegionPIMPLEControls( mesh ) :
    
    pimple = mesh.solutionDict().subDict( ref.word( "PIMPLE" ) )
    nCorr = pimple.lookupOrDefault( ref.word( "nCorrectors" ), 1);
    nNonOrthCorr = pimple.lookupOrDefault( ref.word( "nNonOrthogonalCorrectors" ), 0 )
    momentumPredictor =pimple.lookupOrDefault( ref.word( "momentumPredictor" ), ref.Switch( True ) )
    
    return pimple, nCorr, nNonOrthCorr, momentumPredictor
def readTimeControls_020000(runTime):
    adjustTimeStep = runTime.controlDict().lookupOrDefault(
        ref.word("adjustTimeStep"), ref.Switch(False))

    maxCo = runTime.controlDict().lookupOrDefault(ref.word("maxCo"), 1.0)

    maxDeltaT = runTime.controlDict().lookupOrDefault(ref.word("maxDeltaT"),
                                                      ref.GREAT)

    return adjustTimeStep, maxCo, maxDeltaT
Ejemplo n.º 5
0
def createPorousZones( mesh, simple ):

     pZones = man.porousZones( mesh )
     pressureImplicitPorosity = ref.Switch( False )

     # nUCorrectors used for pressureImplicitPorosity
     nUCorr = 0
     
     if pZones.size():
         # nUCorrectors for pressureImplicitPorosity
         nUCorr = simple.dict().lookupOrDefault( ref.word( "nUCorrectors" ), 0 )

         if nUCorr > 0:
             pressureImplicitPorosity = ref.Switch( True );
             ref.ext_Info() << "Using pressure implicit porosity" << ref.nl
             pass
         else:
             ref.ext_Info() << "Using pressure explicit porosity" << ref.nl
             pass
     
     return pZones, pressureImplicitPorosity, nUCorr
Ejemplo n.º 6
0
def readGravitationalAcceleration(runTime, mesh):
    ref.ext_Info() << "\nReading gravitationalProperties" << ref.nl

    gravitationalProperties = man.IOdictionary(
        man.IOobject(ref.word("gravitationalProperties"),
                     ref.fileName(runTime.constant()), mesh,
                     ref.IOobject.MUST_READ_IF_MODIFIED,
                     ref.IOobject.NO_WRITE))

    g = ref.dimensionedVector(gravitationalProperties.lookup(ref.word("g")))
    rotating = ref.Switch(gravitationalProperties.lookup(ref.word("rotating")))

    if rotating:
        Omega = ref.dimensionedVector(
            gravitationalProperties.lookup(ref.word("Omega")))
    else:
        Omega = ref.dimensionedVector(ref.word("Omega"), -ref.dimTime,
                                      ref.vector(0, 0, 0))

    magg = g.mag()
    gHat = g / magg

    return gravitationalProperties, g, rotating, Omega, magg, gHat