Пример #1
0
def main_standalone( argc, argv ):

    from Foam.OpenFOAM.include import setRootCase
    args = setRootCase( argc, argv )

    from Foam.OpenFOAM.include import createTime
    runTime = createTime( args )
    
    from regionProperties import regionProperties
    rp = regionProperties( runTime )
    
    from fluid import createFluidMeshes
    fluidRegions = createFluidMeshes( rp, runTime )

    from solid import createSolidMeshes,createSolidField
    solidRegions=createSolidMeshes( rp,runTime )

    from fluid import createFluidFields

    thermoFluid, rhoFluid, KFluid, UFluid, phiFluid, gFluid, turbulence, DpDtFluid, initialMassFluid = createFluidFields( fluidRegions, runTime )

    from solid import createSolidField
    rhos, cps, rhosCps, Ks, Ts = createSolidField( solidRegions, runTime )
    
    from fluid import initContinuityErrs
    cumulativeContErr = initContinuityErrs( fluidRegions.size() )
    
    from Foam.finiteVolume.cfdTools.general.include import readTimeControls
    adjustTimeStep, maxCo, maxDeltaT = readTimeControls( runTime )
    
    from Foam.OpenFOAM import ext_Info, nl

    if fluidRegions.size() :
        from fluid import compressubibleMultiRegionCourantNo
        CoNum = compressubibleMultiRegionCourantNo( fluidRegions, runTime, rhoFluid, phiFluid )
                
        from Foam.finiteVolume.cfdTools.general.include import setInitialDeltaT
        runTime = setInitialDeltaT( runTime, adjustTimeStep, maxCo, maxDeltaT, CoNum )
        pass
    
    while runTime.run() :
        adjustTimeStep, maxCo, maxDeltaT = readTimeControls(runTime)

        nOuterCorr = readPIMPLEControls( runTime )
        
        if fluidRegions.size() :
            from fluid import compressubibleMultiRegionCourantNo
            CoNum = compressubibleMultiRegionCourantNo( fluidRegions, runTime, rhoFluid, phiFluid )

            from Foam.finiteVolume.cfdTools.general.include import setDeltaT   
            runTime = setDeltaT( runTime, adjustTimeStep, maxCo, maxDeltaT, CoNum )
            pass
        
        runTime.increment()
        ext_Info()<< "Time = " << runTime.timeName() << nl << nl      
                
        if nOuterCorr != 1 :
            for i in range( fluidRegions.size() ):
                from fluid import setRegionFluidFields
                mesh, thermo, rho, K, U, phi, g, turb, DpDt, p, psi, h, massIni = \
                      setRegionFluidFields( i, fluidRegions, thermoFluid, rhoFluid, KFluid, UFluid, \
                                            phiFluid, gFluid, turbulence, DpDtFluid, initialMassFluid )
                
                from fluid import storeOldFluidFields
                storeOldFluidFields( p, rho )
                pass
            pass
        
        # --- PIMPLE loop
        for oCorr in range( nOuterCorr ):
            for i in range( fluidRegions.size() ):
                ext_Info() << "\nSolving for fluid region " << fluidRegions[ i ].name() << nl

                from fluid import setRegionFluidFields
                mesh, thermo, rho, K, U, phi, g, turb, DpDt, p, psi, h, massIni = \
                      setRegionFluidFields( i, fluidRegions, thermoFluid, rhoFluid, KFluid, UFluid, \
                                            phiFluid, gFluid, turbulence, DpDtFluid, initialMassFluid )
                
                from fluid import readFluidMultiRegionPIMPLEControls
                pimple, nCorr, nNonOrthCorr, momentumPredictor = readFluidMultiRegionPIMPLEControls( mesh ) 
                
                from fluid import solveFluid
                cumulativeContErr = solveFluid( i, mesh, thermo, thermoFluid, rho, K, U, phi, g, h, turb, DpDt, p, psi, \
                                                massIni, oCorr, nCorr, nOuterCorr, nNonOrthCorr, momentumPredictor, cumulativeContErr )
                
                pass
                
            for i in range( solidRegions.size() ):
               ext_Info() << "\nSolving for solid region " << solidRegions[ i ].name() << nl
               
               from solid import setRegionSolidFields
               mesh, rho, cp, K, T = setRegionSolidFields( i, solidRegions, rhos, cps, Ks, Ts )
               
               from solid import readSolidMultiRegionPIMPLEControls
               pimple, nNonOrthCorr = readSolidMultiRegionPIMPLEControls( mesh )
               
               from solid import solveSolid
               solveSolid( mesh, rho, cp, K, T, nNonOrthCorr )
               pass                
            pass
        pass
        runTime.write()

        ext_Info()<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" \
            << "  ClockTime = " << runTime.elapsedClockTime() << " s" \
            << nl << nl    

    ext_Info() << "End\n"
    
    import os
    return os.EX_OK
Пример #2
0
def main_standalone( argc, argv ):

    from Foam.OpenFOAM.include import setRootCase
    args = setRootCase( argc, argv )

    from Foam.OpenFOAM.include import createTime
    runTime = createTime( args )    
    
    from regionProperties import regionProperties
    rp = regionProperties( runTime )

    from fluid import createFluidMeshes
    fluidRegions = createFluidMeshes( rp, runTime )
    
    from solid import createSolidMeshes
    solidRegions = createSolidMeshes( rp, runTime )
    
    from fluid import createFluidFields
    pdf, thermof, rhof, Kf, Uf, phif, turb, DpDtf, ghf, initialMassf, pRef = createFluidFields( fluidRegions, runTime, rp )
    
    from solid import createSolidField
    rhos, cps, rhosCps, Ks, Ts = createSolidField( solidRegions, runTime )
    
    from Foam.finiteVolume.cfdTools.general.include import initContinuityErrs
    cumulativeContErr = initContinuityErrs()

    from Foam.finiteVolume.cfdTools.general.include import readTimeControls
    adjustTimeStep, maxCo, maxDeltaT = readTimeControls( runTime )
    
    if fluidRegions.size() :
       from fluid import compressubibleMultiRegionCourantNo
       CoNum = compressubibleMultiRegionCourantNo( fluidRegions, runTime, rhof, phif )
                
       from fluid import setInitialDeltaT
       runTime = setInitialDeltaT( runTime, adjustTimeStep, maxCo, maxDeltaT, CoNum )
       pass
    
    from Foam.OpenFOAM import ext_Info, nl
    
    while runTime.run():
       from Foam.finiteVolume.cfdTools.general.include import readTimeControls
       adjustTimeStep, maxCo, maxDeltaT = readTimeControls( runTime )
       
       if fluidRegions.size() :
          from fluid import compressubibleMultiRegionCourantNo
          CoNum = compressubibleMultiRegionCourantNo( fluidRegions, runTime, rhof, phif )

          from Foam.finiteVolume.cfdTools.general.include import setDeltaT   
          runTime = setDeltaT( runTime, adjustTimeStep, maxCo, maxDeltaT, CoNum )
          pass
       
       runTime.increment()
       ext_Info()<< "Time = " << runTime.timeName() << nl << nl
       
       for i in range( fluidRegions.size() ):
           ext_Info() << "\nSolving for fluid region " << fluidRegions[ i ].name() << nl
           
           from fluid import readFluidMultiRegionPISOControls
           piso, nCorr, nNonOrthCorr, momentumPredictor, transonic, nOuterCorr = readFluidMultiRegionPISOControls( fluidRegions[ i ] )

           from fluid import solveFluid
           cumulativeContErr = solveFluid( i, fluidRegions, pdf, thermof, rhof, Kf, Uf, phif, turb, DpDtf, ghf, initialMassf, pRef,\
                                           nCorr, nNonOrthCorr, momentumPredictor, transonic, nOuterCorr, cumulativeContErr )
           
           pass
        
       for i in range( solidRegions.size() ):
           ext_Info() << "\nSolving for solid region " << solidRegions[ i ].name() << nl
           
           from solid import readSolidMultiRegionPISOControls
           piso, nNonOrthCorr = readSolidMultiRegionPISOControls( solidRegions[ i ] )
               
           from solid import solveSolid
           solveSolid( i, rhosCps,  Ks, Ts, nNonOrthCorr )
           pass
       
       runTime.write();

       ext_Info() << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" \
            << "  ClockTime = " << runTime.elapsedClockTime() << " s" \
            << nl << nl
       

    ext_Info() << "End\n"
    pass

       
    import os
    return os.EX_OK
Пример #3
0
def main_standalone( argc, argv ):

    args = ref.setRootCase( argc, argv )

    runTime = man.createTime( args )
    
    rp = ref.compressible.regionProperties( runTime )
    
    from fluid import createFluidMeshes
    fluidRegions = createFluidMeshes( rp, runTime )
    
    from solid import createSolidMeshes,createSolidField
    solidRegions = createSolidMeshes( rp,runTime )
    

    from fluid import createFluidFields
    thermoFluid, rhoFluid, kappaFluid, UFluid, phiFluid, gFluid, turbulence, KFluid, \
                 dpdtFluid, initialMassFluid, ghFluid, ghfFluid, p_rghFluid, radiation = createFluidFields( fluidRegions, runTime )

    from solid import createSolidField
    thermos = createSolidField( solidRegions, runTime )
    
    from fluid import initContinuityErrs
    cumulativeContErr = initContinuityErrs( fluidRegions )
    
    adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls( runTime )
    
    from solid import readSolidTimeControls
    maxDi= readSolidTimeControls( runTime )
    
    from fluid import compressubibleMultiRegionCourantNo
    CoNum = compressubibleMultiRegionCourantNo( fluidRegions, runTime, rhoFluid, phiFluid )
    
    from solid import solidRegionDiffusionNo
    DiNum = solidRegionDiffusionNo( solidRegions, runTime, thermos )
    
    runTime, CoNum, DiNum = setInitialMultiRegionDeltaT( adjustTimeStep, runTime, CoNum, DiNum, maxCo, maxDi, maxDeltaT )

    while runTime.run() :
        adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls(runTime)
        
        maxDi= readSolidTimeControls( runTime )
        
        nOuterCorr = readPIMPLEControls( runTime )
        
        CoNum = compressubibleMultiRegionCourantNo( fluidRegions, runTime, rhoFluid, phiFluid )

        DiNum = solidRegionDiffusionNo( solidRegions, runTime, thermos )
           
        runTime, CoNum, DiNum = setMultiRegionDeltaT( adjustTimeStep, runTime, CoNum, DiNum, maxCo, maxDi, maxDeltaT )
                
        runTime.increment()
        
        ref.ext_Info()<< "Time = " << runTime.timeName() << ref.nl << ref.nl
                
        if nOuterCorr != 1 :
            for i in range( fluidRegions.__len__() ):
                from fluid import setRegionFluidFields
                mesh, thermo, rho, kappa, K, U, phi, turb, dpdt, p, psi, h, initialMass, p_rgh, gh, ghf, rad = \
                                     setRegionFluidFields( i, fluidRegions, thermoFluid, rhoFluid, kappaFluid, UFluid, \
                                                           phiFluid, turbulence, KFluid, dpdtFluid, initialMassFluid, ghFluid, ghfFluid, p_rghFluid, radiation )
                
                from fluid import storeOldFluidFields
                storeOldFluidFields( p, rho )
                pass
            pass
        
        # --- PIMPLE loop
        for oCorr in range( nOuterCorr ):
            finalIter = ( oCorr == nOuterCorr-1 )
            for i in range( fluidRegions.__len__() ):
                ref.ext_Info() << "\nSolving for fluid region " << fluidRegions[ i ].name() << ref.nl

                from fluid import setRegionFluidFields
                mesh, thermo, rho, kappa, K, U, phi, turb, dpdt, p, psi, h, initialMass, p_rgh, gh, ghf, rad = \
                      setRegionFluidFields( i, fluidRegions, thermoFluid, rhoFluid, kappaFluid, UFluid, \
                                            phiFluid, turbulence, KFluid, dpdtFluid, initialMassFluid, ghFluid, ghfFluid, p_rghFluid, radiation )
                
                from fluid import readFluidMultiRegionPIMPLEControls
                pimple, nCorr, nNonOrthCorr, momentumPredictor = readFluidMultiRegionPIMPLEControls( mesh ) 
                
                from fluid import solveFluid
                cumulativeContErr = solveFluid( i, mesh, thermo, rad, thermoFluid, rho, kappa, K, U, phi, h, turb, dpdt, p, psi, initialMass, p_rgh, gh, \
                                                ghf, oCorr, nCorr, nOuterCorr, nNonOrthCorr, momentumPredictor, cumulativeContErr, finalIter )
                
                pass
                
            for i in range( solidRegions.__len__() ):
               ref.ext_Info() << "\nSolving for solid region " << solidRegions[ i ].name() << ref.nl
               
               from solid import setRegionSolidFields
               mesh, thermo, rho, cp, tkappa, kappa = setRegionSolidFields( i, solidRegions, thermos )
               
               from solid import readSolidMultiRegionPIMPLEControls
               pimple, nNonOrthCorr = readSolidMultiRegionPIMPLEControls( mesh )
               
               from solid import solveSolid
               solveSolid( mesh, thermo, rho, cp, tkappa, kappa, nNonOrthCorr, finalIter )
               pass                
            pass
        pass
        runTime.write()

        ref.ext_Info()<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" \
            << "  ClockTime = " << runTime.elapsedClockTime() << " s" \
            << ref.nl << ref.nl    

    ref.ext_Info() << "End\n"
    
    import os
    return os.EX_OK
Пример #4
0
def main_standalone(argc, argv):

    from Foam.OpenFOAM.include import setRootCase
    args = setRootCase(argc, argv)

    from Foam.OpenFOAM.include import createTime
    runTime = createTime(args)

    from regionProperties import regionProperties
    rp = regionProperties(runTime)

    from fluid import createFluidMeshes
    fluidRegions = createFluidMeshes(rp, runTime)

    from solid import createSolidMeshes
    solidRegions = createSolidMeshes(rp, runTime)

    from fluid import createFluidFields
    pdf, thermof, rhof, Kf, Uf, phif, turb, DpDtf, ghf, initialMassf, pRef = createFluidFields(
        fluidRegions, runTime, rp)

    from solid import createSolidField
    rhos, cps, rhosCps, Ks, Ts = createSolidField(solidRegions, runTime)

    from Foam.finiteVolume.cfdTools.general.include import initContinuityErrs
    cumulativeContErr = initContinuityErrs()

    from Foam.finiteVolume.cfdTools.general.include import readTimeControls
    adjustTimeStep, maxCo, maxDeltaT = readTimeControls(runTime)

    if fluidRegions.size():
        from fluid import compressubibleMultiRegionCourantNo
        CoNum = compressubibleMultiRegionCourantNo(fluidRegions, runTime, rhof,
                                                   phif)

        from fluid import setInitialDeltaT
        runTime = setInitialDeltaT(runTime, adjustTimeStep, maxCo, maxDeltaT,
                                   CoNum)
        pass

    from Foam.OpenFOAM import ext_Info, nl

    while runTime.run():
        from Foam.finiteVolume.cfdTools.general.include import readTimeControls
        adjustTimeStep, maxCo, maxDeltaT = readTimeControls(runTime)

        if fluidRegions.size():
            from fluid import compressubibleMultiRegionCourantNo
            CoNum = compressubibleMultiRegionCourantNo(fluidRegions, runTime,
                                                       rhof, phif)

            from Foam.finiteVolume.cfdTools.general.include import setDeltaT
            runTime = setDeltaT(runTime, adjustTimeStep, maxCo, maxDeltaT,
                                CoNum)
            pass

        runTime.increment()
        ext_Info() << "Time = " << runTime.timeName() << nl << nl

        for i in range(fluidRegions.size()):
            ext_Info(
            ) << "\nSolving for fluid region " << fluidRegions[i].name() << nl

            from fluid import readFluidMultiRegionPISOControls
            piso, nCorr, nNonOrthCorr, momentumPredictor, transonic, nOuterCorr = readFluidMultiRegionPISOControls(
                fluidRegions[i])

            from fluid import solveFluid
            cumulativeContErr = solveFluid( i, fluidRegions, pdf, thermof, rhof, Kf, Uf, phif, turb, DpDtf, ghf, initialMassf, pRef,\
                                            nCorr, nNonOrthCorr, momentumPredictor, transonic, nOuterCorr, cumulativeContErr )

            pass

        for i in range(solidRegions.size()):
            ext_Info(
            ) << "\nSolving for solid region " << solidRegions[i].name() << nl

            from solid import readSolidMultiRegionPISOControls
            piso, nNonOrthCorr = readSolidMultiRegionPISOControls(
                solidRegions[i])

            from solid import solveSolid
            solveSolid(i, rhosCps, Ks, Ts, nNonOrthCorr)
            pass

        runTime.write()

        ext_Info() << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" \
             << "  ClockTime = " << runTime.elapsedClockTime() << " s" \
             << nl << nl

    ext_Info() << "End\n"
    pass

    import os
    return os.EX_OK
Пример #5
0
def main_standalone(argc, argv):

    args = ref.setRootCase(argc, argv)

    runTime = man.createTime(args)

    rp = ref.compressible.regionProperties(runTime)

    from fluid import createFluidMeshes
    fluidRegions = createFluidMeshes(rp, runTime)

    from solid import createSolidMeshes, createSolidField
    solidRegions = createSolidMeshes(rp, runTime)

    from fluid import createFluidFields
    thermoFluid, rhoFluid, kappaFluid, UFluid, phiFluid, gFluid, turbulence, KFluid, \
                 dpdtFluid, initialMassFluid, ghFluid, ghfFluid, p_rghFluid, radiation = createFluidFields( fluidRegions, runTime )

    from solid import createSolidField
    thermos = createSolidField(solidRegions, runTime)

    from fluid import initContinuityErrs
    cumulativeContErr = initContinuityErrs(fluidRegions)

    adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls(runTime)

    from solid import readSolidTimeControls
    maxDi = readSolidTimeControls(runTime)

    from fluid import compressubibleMultiRegionCourantNo
    CoNum = compressubibleMultiRegionCourantNo(fluidRegions, runTime, rhoFluid,
                                               phiFluid)

    from solid import solidRegionDiffusionNo
    DiNum = solidRegionDiffusionNo(solidRegions, runTime, thermos)

    runTime, CoNum, DiNum = setInitialMultiRegionDeltaT(
        adjustTimeStep, runTime, CoNum, DiNum, maxCo, maxDi, maxDeltaT)

    while runTime.run():
        adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls(runTime)

        maxDi = readSolidTimeControls(runTime)

        nOuterCorr = readPIMPLEControls(runTime)

        CoNum = compressubibleMultiRegionCourantNo(fluidRegions, runTime,
                                                   rhoFluid, phiFluid)

        DiNum = solidRegionDiffusionNo(solidRegions, runTime, thermos)

        runTime, CoNum, DiNum = setMultiRegionDeltaT(adjustTimeStep, runTime,
                                                     CoNum, DiNum, maxCo,
                                                     maxDi, maxDeltaT)

        runTime.increment()

        ref.ext_Info() << "Time = " << runTime.timeName() << ref.nl << ref.nl

        if nOuterCorr != 1:
            for i in range(fluidRegions.__len__()):
                from fluid import setRegionFluidFields
                mesh, thermo, rho, kappa, K, U, phi, turb, dpdt, p, psi, h, initialMass, p_rgh, gh, ghf, rad = \
                                     setRegionFluidFields( i, fluidRegions, thermoFluid, rhoFluid, kappaFluid, UFluid, \
                                                           phiFluid, turbulence, KFluid, dpdtFluid, initialMassFluid, ghFluid, ghfFluid, p_rghFluid, radiation )

                from fluid import storeOldFluidFields
                storeOldFluidFields(p, rho)
                pass
            pass

        # --- PIMPLE loop
        for oCorr in range(nOuterCorr):
            finalIter = (oCorr == nOuterCorr - 1)
            for i in range(fluidRegions.__len__()):
                ref.ext_Info(
                ) << "\nSolving for fluid region " << fluidRegions[i].name(
                ) << ref.nl

                from fluid import setRegionFluidFields
                mesh, thermo, rho, kappa, K, U, phi, turb, dpdt, p, psi, h, initialMass, p_rgh, gh, ghf, rad = \
                      setRegionFluidFields( i, fluidRegions, thermoFluid, rhoFluid, kappaFluid, UFluid, \
                                            phiFluid, turbulence, KFluid, dpdtFluid, initialMassFluid, ghFluid, ghfFluid, p_rghFluid, radiation )

                from fluid import readFluidMultiRegionPIMPLEControls
                pimple, nCorr, nNonOrthCorr, momentumPredictor = readFluidMultiRegionPIMPLEControls(
                    mesh)

                from fluid import solveFluid
                cumulativeContErr = solveFluid( i, mesh, thermo, rad, thermoFluid, rho, kappa, K, U, phi, h, turb, dpdt, p, psi, initialMass, p_rgh, gh, \
                                                ghf, oCorr, nCorr, nOuterCorr, nNonOrthCorr, momentumPredictor, cumulativeContErr, finalIter )

                pass

            for i in range(solidRegions.__len__()):
                ref.ext_Info(
                ) << "\nSolving for solid region " << solidRegions[i].name(
                ) << ref.nl

                from solid import setRegionSolidFields
                mesh, thermo, rho, cp, tkappa, kappa = setRegionSolidFields(
                    i, solidRegions, thermos)

                from solid import readSolidMultiRegionPIMPLEControls
                pimple, nNonOrthCorr = readSolidMultiRegionPIMPLEControls(mesh)

                from solid import solveSolid
                solveSolid(mesh, thermo, rho, cp, tkappa, kappa, nNonOrthCorr,
                           finalIter)
                pass
            pass
        pass
        runTime.write()

        ref.ext_Info()<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" \
            << "  ClockTime = " << runTime.elapsedClockTime() << " s" \
            << ref.nl << ref.nl

    ref.ext_Info() << "End\n"

    import os
    return os.EX_OK
Пример #6
0
def main_standalone(argc, argv):

    from Foam.OpenFOAM.include import setRootCase
    args = setRootCase(argc, argv)

    from Foam.OpenFOAM.include import createTime
    runTime = createTime(args)

    from regionProperties import regionProperties
    rp = regionProperties(runTime)

    from fluid import createFluidMeshes
    fluidRegions = createFluidMeshes(rp, runTime)

    from solid import createSolidMeshes, createSolidField
    solidRegions = createSolidMeshes(rp, runTime)

    from fluid import createFluidFields

    thermoFluid, rhoFluid, KFluid, UFluid, phiFluid, gFluid, turbulence, DpDtFluid, initialMassFluid = createFluidFields(
        fluidRegions, runTime)

    from solid import createSolidField
    rhos, cps, rhosCps, Ks, Ts = createSolidField(solidRegions, runTime)

    from fluid import initContinuityErrs
    cumulativeContErr = initContinuityErrs(fluidRegions.size())

    from Foam.finiteVolume.cfdTools.general.include import readTimeControls
    adjustTimeStep, maxCo, maxDeltaT = readTimeControls(runTime)

    from Foam.OpenFOAM import ext_Info, nl

    if fluidRegions.size():
        from fluid import compressubibleMultiRegionCourantNo
        CoNum = compressubibleMultiRegionCourantNo(fluidRegions, runTime,
                                                   rhoFluid, phiFluid)

        from Foam.finiteVolume.cfdTools.general.include import setInitialDeltaT
        runTime = setInitialDeltaT(runTime, adjustTimeStep, maxCo, maxDeltaT,
                                   CoNum)
        pass

    while runTime.run():
        adjustTimeStep, maxCo, maxDeltaT = readTimeControls(runTime)

        nOuterCorr = readPIMPLEControls(runTime)

        if fluidRegions.size():
            from fluid import compressubibleMultiRegionCourantNo
            CoNum = compressubibleMultiRegionCourantNo(fluidRegions, runTime,
                                                       rhoFluid, phiFluid)

            from Foam.finiteVolume.cfdTools.general.include import setDeltaT
            runTime = setDeltaT(runTime, adjustTimeStep, maxCo, maxDeltaT,
                                CoNum)
            pass

        runTime.increment()
        ext_Info() << "Time = " << runTime.timeName() << nl << nl

        if nOuterCorr != 1:
            for i in range(fluidRegions.size()):
                from fluid import setRegionFluidFields
                mesh, thermo, rho, K, U, phi, g, turb, DpDt, p, psi, h, massIni = \
                      setRegionFluidFields( i, fluidRegions, thermoFluid, rhoFluid, KFluid, UFluid, \
                                            phiFluid, gFluid, turbulence, DpDtFluid, initialMassFluid )

                from fluid import storeOldFluidFields
                storeOldFluidFields(p, rho)
                pass
            pass

        # --- PIMPLE loop
        for oCorr in range(nOuterCorr):
            for i in range(fluidRegions.size()):
                ext_Info() << "\nSolving for fluid region " << fluidRegions[
                    i].name() << nl

                from fluid import setRegionFluidFields
                mesh, thermo, rho, K, U, phi, g, turb, DpDt, p, psi, h, massIni = \
                      setRegionFluidFields( i, fluidRegions, thermoFluid, rhoFluid, KFluid, UFluid, \
                                            phiFluid, gFluid, turbulence, DpDtFluid, initialMassFluid )

                from fluid import readFluidMultiRegionPIMPLEControls
                pimple, nCorr, nNonOrthCorr, momentumPredictor = readFluidMultiRegionPIMPLEControls(
                    mesh)

                from fluid import solveFluid
                cumulativeContErr = solveFluid( i, mesh, thermo, thermoFluid, rho, K, U, phi, g, h, turb, DpDt, p, psi, \
                                                massIni, oCorr, nCorr, nOuterCorr, nNonOrthCorr, momentumPredictor, cumulativeContErr )

                pass

            for i in range(solidRegions.size()):
                ext_Info() << "\nSolving for solid region " << solidRegions[
                    i].name() << nl

                from solid import setRegionSolidFields
                mesh, rho, cp, K, T = setRegionSolidFields(
                    i, solidRegions, rhos, cps, Ks, Ts)

                from solid import readSolidMultiRegionPIMPLEControls
                pimple, nNonOrthCorr = readSolidMultiRegionPIMPLEControls(mesh)

                from solid import solveSolid
                solveSolid(mesh, rho, cp, K, T, nNonOrthCorr)
                pass
            pass
        pass
        runTime.write()

        ext_Info()<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" \
            << "  ClockTime = " << runTime.elapsedClockTime() << " s" \
            << nl << nl

    ext_Info() << "End\n"

    import os
    return os.EX_OK
def main_standalone( argc, argv ):

    args = ref.setRootCase( argc, argv )

    runTime = man.createTime( args )
    
    rp = ref.compressible.regionProperties( runTime )
    
    from fluid import createFluidMeshes
    fluidRegions = createFluidMeshes( rp, runTime )
    
    from solid import createSolidMeshes,createSolidField
    solidRegions = createSolidMeshes( rp,runTime )
    
    from fluid import createFluidFields
    thermoFluid, rhoFluid, kappaFluid, UFluid, phiFluid, gFluid, turbulence, initialMassFluid, ghFluid, ghfFluid, \
                 p_rghFluid, radiation, pRefCellFluid, pRefValueFluid, rhoMax, rhoMin = createFluidFields( fluidRegions, runTime )

    from solid import createSolidField
    thermos = createSolidField( solidRegions, runTime )
    
    from fluid import initContinuityErrs
    cumulativeContErr = initContinuityErrs( fluidRegions )
    
    
    while runTime.loop() :
        ref.ext_Info()<< "Time = " << runTime.timeName() << ref.nl << ref.nl
                
        for i in range( fluidRegions.__len__() ):
            ref.ext_Info() << "\nSolving for fluid region " << fluidRegions[ i ].name() << ref.nl

            from fluid import setRegionFluidFields
            mesh, thermo, rho, kappa, U, phi, turb, p, psi, h, initialMass, p_rgh, gh, ghf, rad, pRefCell, pRefValue = \
                   setRegionFluidFields( i, fluidRegions, thermoFluid, rhoFluid, kappaFluid, UFluid, \
                                        phiFluid, turbulence, initialMassFluid, ghFluid, ghfFluid, p_rghFluid, radiation, pRefCellFluid, pRefValueFluid )
                
            from fluid import readFluidMultiRegionSIMPLEControls
            simple, nNonOrthCorr, momentumPredictor, transonic = readFluidMultiRegionSIMPLEControls( mesh ) 
                
            from fluid import solveFluid
            cumulativeContErr[ i ] = solveFluid( runTime, i, mesh, thermo, rad, thermoFluid, rho, kappa, U, phi, h, turb, p, psi, initialMass, p_rgh, gh, ghf, \
                                           simple, transonic, nNonOrthCorr, momentumPredictor, cumulativeContErr[ i ], rhoMax, rhoMin, pRefCell, pRefValue )
                
            pass
                
        for i in range( solidRegions.__len__() ):
            ref.ext_Info() << "\nSolving for solid region " << solidRegions[ i ].name() << ref.nl
               
            from solid import setRegionSolidFields
            mesh, thermo, rho, cp, kappa, T = setRegionSolidFields( i, solidRegions, thermos )

            from solid import readSolidMultiRegionSIMPLEControls
            simple, nNonOrthCorr = readSolidMultiRegionSIMPLEControls( mesh )
               
            from solid import solveSolid
            solveSolid( mesh, kappa, T, nNonOrthCorr )
            pass                
        runTime.write()

        ref.ext_Info()<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" \
                      << "  ClockTime = " << runTime.elapsedClockTime() << " s" \
                      << ref.nl << ref.nl    

    ref.ext_Info() << "End\n"
    
    import os
    return os.EX_OK