def main_standalone( argc, argv ):
 
    args = ref.setRootCase( argc, argv )
    
    runTime = man.createTime( args )

    mesh = man.createMesh( runTime )
    
    pimple = man.pimpleControl(mesh)
    
    pThermo, p, h, psi, rho, U, phi, rhoMax, rhoMin, turbulence, dpdt, K = createFields( runTime, mesh, pimple )
    
    mrfZones, pZones, pressureImplicitPorosity = createZones( mesh, U )
  
    cumulativeContErr = ref.initContinuityErrs()
  
    ref.ext_Info()<< "\nStarting time loop\n" << ref.nl;

    while runTime.run():
    
        adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls( runTime )
        CoNum, meanCoNum = ref.compressibleCourantNo( mesh, phi, rho, runTime )

        runTime = ref.setDeltaT( runTime, adjustTimeStep, maxCo, maxDeltaT, CoNum )
        runTime.increment()

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

        ref.rhoEqn( rho, phi )

        # --- Pressure-velocity PIMPLE corrector loop
        while pimple.loop():

            UEqn = fun_Ueqn( pimple, rho, p, U, phi, turbulence, mrfZones, pZones )
      
            fun_hEqn(pThermo, rho, p, h, phi, turbulence, dpdt, K )

            # --- PISO loop
            while (pimple.correct()):
                cumulativeContErr = fun_pEqn( mesh, runTime, pimple, pThermo, rho, p, h, psi, U, phi, mrfZones,
                                              turbulence, UEqn, dpdt, K, cumulativeContErr, rhoMax, rhoMin )
                pass
            
            if pimple.turbCorr():
                turbulence.correct()
                pass
            
            pass
        
        runTime.write()
            
        ref.ext_Info()<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" \
                      << "  ClockTime = " << runTime.elapsedClockTime() << " s" \
                      << ref.nl << ref.nl
        pass

    ref.ext_Info()<< "End\n" << ref.nl
        
    import os
    return os.EX_OK
Exemple #2
0
def main_standalone(argc, argv):

    args = ref.setRootCase(argc, argv)

    runTime = man.createTime(args)

    mesh = man.createMesh(runTime)

    pThermo, p, e, psi, rho, U, phi, turbulence = createFields(runTime, mesh)

    cumulativeContErr = ref.initContinuityErrs()

    ref.ext_Info() << "\nStarting time loop\n" << ref.nl

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

        piso, nCorr, nNonOrthCorr, momentumPredictor, transonic, nOuterCorr = ref.readPISOControls(
            mesh)

        CoNum, meanCoNum = ref.compressibleCourantNo(mesh, phi, rho, runTime)

        ref.rhoEqn(rho, phi)

        UEqn = fun_Ueqn(rho, U, phi, turbulence, p)

        fun_eEqn(rho, e, phi, turbulence, p, pThermo)

        for corr in range(nCorr):
            cumulativeContErr = fun_pEqn(mesh, runTime, pThermo, rho, p, psi,
                                         U, phi, turbulence, UEqn,
                                         cumulativeContErr, nNonOrthCorr)
            pass

        turbulence.correct()

        rho << pThermo.rho()

        runTime.write()

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

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

    import os
    return os.EX_OK
Exemple #3
0
def main_standalone( argc, argv ):

    args = ref.setRootCase( argc, argv )

    runTime = man.createTime( args )

    mesh = man.createMesh( runTime )
    
    pThermo, p, e, psi, rho, U, phi, turbulence = createFields( runTime, mesh )

    cumulativeContErr = ref.initContinuityErrs()
    
    ref.ext_Info() << "\nStarting time loop\n" << ref.nl

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

        piso, nCorr, nNonOrthCorr, momentumPredictor, transonic, nOuterCorr = ref.readPISOControls( mesh )
        
        CoNum, meanCoNum = ref.compressibleCourantNo( mesh, phi, rho, runTime )
        
        ref.rhoEqn( rho, phi );
        
        UEqn = fun_Ueqn( rho, U, phi, turbulence, p )

        fun_eEqn( rho, e, phi, turbulence, p, pThermo )

        for corr in range( nCorr ) :
            cumulativeContErr = fun_pEqn( mesh, runTime, pThermo, rho, p, psi, U, phi, turbulence, UEqn, cumulativeContErr, nNonOrthCorr )
            pass

        turbulence.correct()

        rho << pThermo.rho()

        runTime.write()

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

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

    import os
    return os.EX_OK
Exemple #4
0
def main_standalone(argc, argv):

    args = ref.setRootCase(argc, argv)

    runTime = man.createTime(args)

    mesh = man.createMesh(runTime)

    thermodynamicProperties, rho0, p0, psi, rhoO = readThermodynamicProperties(
        runTime, mesh)

    transportProperties, mu = readTransportProperties(runTime, mesh)

    p, U, rho, phi = createFields(runTime, mesh, rhoO, psi)

    cumulativeContErr = ref.initContinuityErrs()

    #// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    ref.ext_Info() << "\nStarting time loop\n" << ref.nl

    while runTime.loop():

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

        piso, nCorr, nNonOrthCorr, momentumPredictor, transonic, nOuterCorr = ref.readPISOControls(
            mesh)

        CoNum, meanCoNum = ref.compressibleCourantNo(mesh, phi, rho, runTime)

        ref.rhoEqn(rho, phi)

        UEqn = man.fvm.ddt(rho, U) + man.fvm.div(phi, U) - man.fvm.laplacian(
            mu, U)

        ref.solve(UEqn == -man.fvc.grad(p))

        # --- PISO loop
        for corr in range(nCorr):

            rAU = 1.0 / UEqn.A()
            U << rAU * UEqn.H()

            phid = ref.surfaceScalarField(
                ref.word("phid"),
                psi * ((ref.fvc.interpolate(U) & mesh.Sf()) +
                       ref.fvc.ddtPhiCorr(rAU, rho(), U(), phi())))

            phi << (rhoO / psi) * phid
            pEqn = ref.fvm.ddt(psi, p()) + ref.fvc.div(phi()) + ref.fvm.div(
                phid, p()) - ref.fvm.laplacian(rho() * rAU, p())

            pEqn.solve()

            phi += pEqn.flux()

            cumulativeContErr = compressibleContinuityErrs(
                rho, phi, p, rho0, p0, psi, cumulativeContErr)

            U -= rAU * ref.fvc.grad(p)
            U.correctBoundaryConditions()
            pass
        rho << rhoO + psi * p

        runTime.write()

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

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

    import os
    return os.EX_OK
Exemple #5
0
def main_standalone(argc, argv):

    args = ref.setRootCase(argc, argv)

    runTime = man.createTime(args)

    mesh = man.createMesh(runTime)

    pimple = man.pimpleControl(mesh)

    maxDeltaT, rDeltaT = setInitialrDeltaT(runTime, mesh, pimple)

    pThermo, p, h, psi, rho, U, phi, rhoMax, rhoMin, turbulence, dpdt, K = createFields(
        runTime, mesh, pimple)

    mrfZones, pZones, pressureImplicitPorosity = createZones(mesh, U)

    cumulativeContErr = ref.initContinuityErrs()

    ref.ext_Info() << "\nStarting time loop\n" << ref.nl

    while runTime.run():

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

        CoNum, meanCoNum = ref.compressibleCourantNo(mesh, phi, rho, runTime)

        runTime = ref.setDeltaT(runTime, adjustTimeStep, maxCo, maxDeltaT,
                                CoNum)
        runTime.increment()

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

        setrDeltaT(runTime, mesh, pimple, phi, psi, U, rho, rDeltaT, maxDeltaT)

        ref.rhoEqn(rho, phi)

        # --- Pressure-velocity PIMPLE corrector loop
        while pimple.loop():

            turbulence.correct()

            UEqn = fun_Ueqn(pimple, rho, p, U, phi, turbulence, mrfZones,
                            pZones)

            fun_hEqn(pThermo, rho, p, h, phi, turbulence, dpdt, K)

            # --- PISO loop
            while (pimple.correct()):
                cumulativeContErr = fun_pEqn(mesh, runTime, pimple, pThermo,
                                             rho, p, h, psi, U, phi, mrfZones,
                                             turbulence, UEqn, dpdt, K,
                                             cumulativeContErr, rhoMax, rhoMin)
                pass

            pass

        runTime.write()

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

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

    import os
    return os.EX_OK
def main_standalone(argc, argv):
    args = ref.setRootCase(argc, argv)

    runTime = man.createTime(args)

    mesh = man.createMesh(runTime)

    g = ref.readGravitationalAcceleration(runTime, mesh)

    thermo, p, rho, h, psi, U, phi, turbulence, gh, ghf, p_rgh, dpdt, K = createFields(
        runTime, mesh, g)

    cumulativeContErr = ref.initContinuityErrs()

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

    CoNum, meanCoNum = ref.compressibleCourantNo(mesh, phi, rho, runTime)

    runTime = ref.setInitialDeltaT(runTime, adjustTimeStep, maxCo, CoNum)

    pimple = man.pimpleControl(mesh)

    # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    ref.ext_Info() << "\nStarting time loop\n" << ref.nl

    while runTime.run():

        adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls(runTime)
        CoNum, meanCoNum = ref.compressibleCourantNo(mesh, phi, rho, runTime)

        runTime = ref.setDeltaT(runTime, adjustTimeStep, maxCo, maxDeltaT,
                                CoNum)
        runTime.increment()

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

        ref.rhoEqn(rho, phi)

        # --- Pressure-velocity PIMPLE corrector loop
        while pimple.loop():

            UEqn = fun_Ueqn(pimple, mesh, rho, U, phi, turbulence, ghf, p_rgh,
                            K)
            fun_hEqn(thermo, rho, p, h, phi, turbulence, dpdt, K)

            # --- Pressure corrector loop
            while pimple.correct():
                cumulativeContErr = fun_pEqn(mesh, runTime, pimple, thermo,
                                             rho, p, h, psi, U, phi,
                                             turbulence, gh, ghf, p_rgh, UEqn,
                                             dpdt, K, cumulativeContErr)
                pass
            if pimple.turbCorr():
                turbulence.correct()
                pass

            pass
        rho << thermo.rho()

        runTime.write()

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

    import os
    return os.EX_OK
def main_standalone(argc, argv):
    args = ref.setRootCase(argc, argv)

    runTime = man.createTime(args)

    mesh = man.createMesh(runTime)

    g = ref.readGravitationalAcceleration(runTime, mesh)

    thermo, p, rho, h, psi, U, phi, turbulence, gh, ghf, p_rgh, DpDt = createFields(runTime, mesh, g)

    cumulativeContErr = ref.initContinuityErrs()

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

    CoNum, meanCoNum = ref.compressibleCourantNo(mesh, phi, rho, runTime)

    runTime = ref.setInitialDeltaT(runTime, adjustTimeStep, maxCo, CoNum)

    pimple = man.pimpleControl(mesh)

    # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    ref.ext_Info() << "\nStarting time loop\n" << ref.nl

    while runTime.run():

        adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls(runTime)
        CoNum, meanCoNum = ref.compressibleCourantNo(mesh, phi, rho, runTime)

        runTime = ref.setDeltaT(runTime, adjustTimeStep, maxCo, maxDeltaT, CoNum)
        runTime.increment()

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

        ref.rhoEqn(rho, phi)

        # --- Pressure-velocity PIMPLE corrector loop
        pimple.start()
        while pimple.loop():
            if pimple.nOuterCorr() != 1:
                p_rgh.storePrevIter()
                pass

            UEqn = fun_Ueqn(pimple, mesh, rho, U, phi, turbulence, ghf, p_rgh)
            fun_hEqn(thermo, rho, p, h, phi, turbulence, DpDt)

            # --- PISO loop
            for corr in range(pimple.nCorr()):
                cumulativeContErr = fun_pEqn(
                    mesh,
                    runTime,
                    pimple,
                    thermo,
                    rho,
                    p,
                    h,
                    psi,
                    U,
                    phi,
                    turbulence,
                    gh,
                    ghf,
                    p_rgh,
                    UEqn,
                    DpDt,
                    cumulativeContErr,
                    corr,
                )
                pass
            if pimple.turbCorr():
                turbulence.correct()
                pass

            pimple.increment()
            pass
        rho << thermo.rho()

        runTime.write()

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

    import os

    return os.EX_OK
Exemple #8
0
def main_standalone( argc, argv ):
 
    args = ref.setRootCase( argc, argv )
    
    runTime = man.createTime( args )

    mesh = man.createMesh( runTime )
    
    pThermo, p, h, psi, rho, U, phi, rhoMax, rhoMin, turbulence, DpDt = createFields( runTime, mesh )
  
    cumulativeContErr = ref.initContinuityErrs()
  
    pimple = man.pimpleControl(mesh)

    ref.ext_Info()<< "\nStarting time loop\n" << ref.nl;

    while runTime.run():
    
        adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls( runTime )
        CoNum, meanCoNum = ref.compressibleCourantNo( mesh, phi, rho, runTime )

        runTime = ref.setDeltaT( runTime, adjustTimeStep, maxCo, maxDeltaT, CoNum )
        runTime.increment()

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

        ref.rhoEqn( rho, phi )

        # --- Pressure-velocity PIMPLE corrector loop
        pimple.start()
        while pimple.loop():
            if pimple.nOuterCorr() != 1:
                p.storePrevIter()
                rho.storePrevIter()
                pass
            
            UEqn, rAU = fun_Ueqn( pimple, rho, p, U, phi, turbulence )
      
            fun_hEqn( pThermo, rho, p, h, phi, turbulence, DpDt )

            # --- PISO loop
            for corr in range( pimple.nCorr() ):
                cumulativeContErr = fun_pEqn( mesh, runTime, pimple, pThermo, rho, p, h, psi, U, phi, 
                                              turbulence, UEqn, rAU, DpDt, cumulativeContErr, corr, rhoMax, rhoMin )
                pass
            
            if pimple.turbCorr():
                turbulence.correct()
                pass
            
            pimple.increment()
            pass
        
        runTime.write()
            
        ref.ext_Info()<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" \
                      << "  ClockTime = " << runTime.elapsedClockTime() << " s" \
                      << ref.nl << ref.nl
        pass

    ref.ext_Info()<< "End\n" << ref.nl
        
    import os
    return os.EX_OK
def main_standalone( argc, argv ):

    args = ref.setRootCase( argc, argv )
   
    runTime = man.createTime( args )
    
    mesh = man.createMesh( runTime )
  
    thermodynamicProperties, rho0, p0, psi, rhoO =  readThermodynamicProperties( runTime, mesh )
    
    transportProperties, mu = readTransportProperties( runTime, mesh )
    
    p, U, rho, phi = createFields( runTime, mesh, rhoO, psi )
  
    cumulativeContErr = ref.initContinuityErrs()
  
    #// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    ref.ext_Info()<< "\nStarting time loop\n" << ref.nl

    while runTime.loop():
 
        ref.ext_Info()<< "Time = " << runTime.timeName() << ref.nl << ref.nl
       
        piso, nCorr, nNonOrthCorr, momentumPredictor, transonic, nOuterCorr = ref.readPISOControls( mesh )

        CoNum, meanCoNum = ref.compressibleCourantNo( mesh, phi, rho, runTime )

        ref.rhoEqn( rho, phi )

        UEqn = man.fvm.ddt( rho, U ) + man.fvm.div( phi, U ) - man.fvm.laplacian( mu, U )
        
        ref.solve( UEqn == -man.fvc.grad( p ) )

        # --- PISO loop
        for corr in range( nCorr ):
               
            rAU = 1.0 / UEqn.A()
            U << rAU * UEqn.H()

            phid = ref.surfaceScalarField( ref.word( "phid" ), 
                                           psi * ( ( ref.fvc.interpolate( U ) & mesh.Sf() ) + ref.fvc.ddtPhiCorr( rAU, rho(), U(), phi() ) ) )

            phi << ( rhoO / psi ) * phid
            pEqn = ref.fvm.ddt( psi, p() ) + ref.fvc.div( phi() ) + ref.fvm.div( phid, p() ) - ref.fvm.laplacian( rho() * rAU, p() )
 
            pEqn.solve()

            phi += pEqn.flux()
        
            cumulativeContErr = compressibleContinuityErrs( rho, phi,p, rho0, p0, psi, cumulativeContErr )
        
            U -= rAU * ref.fvc.grad( p )
            U.correctBoundaryConditions()
            pass
        rho << rhoO + psi * p

        runTime.write()

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

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