def main_standalone(argc, argv): args = ref.setRootCase(argc, argv) runTime = man.createTime(args) mesh = man.createDynamicFvMesh(runTime) cumulativeContErr = ref.initContinuityErrs() p_rgh, p, alpha1, U, phi, rho1, rho2, rho, rhoPhi, twoPhaseProperties, pRefCell, pRefValue, interface, turbulence, g, gh, ghf = _createFields( runTime, mesh ) adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls(runTime) pimple = man.pimpleControl(mesh) phiAbs = ref.surfaceScalarField(ref.word("phiAbs"), phi) ref.fvc.makeAbsolute(phiAbs, U) cumulativeContErr = fun_correctPhi( runTime, mesh, phi, phiAbs, p, p_rgh, rho, U, cumulativeContErr, pimple, pRefCell, pRefValue ) CoNum, meanCoNum = ref.CourantNo(mesh, phi, runTime) runTime = ref.setInitialDeltaT(runTime, adjustTimeStep, maxCo, CoNum) ref.ext_Info() << "\nStarting time loop\n" << ref.nl while runTime.run(): adjustTimeStep, maxCo, maxDeltaT, correctPhi, checkMeshCourantNo = readControls(runTime, mesh, pimple) maxAlphaCo, alphaCoNum, meanAlphaCoNum = alphaCourantNo(runTime, mesh, alpha1, phi) CoNum, meanCoNum = ref.CourantNo(mesh, phi, runTime) runTime = setDeltaT(runTime, adjustTimeStep, maxCo, CoNum, maxAlphaCo, alphaCoNum, maxDeltaT) runTime.increment() ref.ext_Info() << "Time = " << runTime.timeName() << ref.nl << ref.nl timeBeforeMeshUpdate = runTime.elapsedCpuTime() fun_Urel(mesh, U) if mesh.changing(): ref.ext_Info() << "Execution time for mesh.update() = " << runTime.elapsedCpuTime() - timeBeforeMeshUpdate << " s" << ref.nl gh << (g & mesh.C()) ghf << (g & mesh.Cf()) pass if mesh.changing() and correctPhi: cumulativeContErr = fun_correctPhi( runTime, mesh(), phi, phiAbs, p, p_rgh, rho, U, cumulativeContErr, pimple, pRefCell, pRefValue ) pass if mesh.changing() and checkMeshCourantNo: meshCoNum, meanMeshCoNum = ref.meshCourantNo(runTime, mesh(), phi) pass twoPhaseProperties.correct() alphaEqnSubCycle(runTime, pimple, mesh, phi, alpha1, rho, rhoPhi, rho1, rho2, interface) # --- Pressure-velocity PIMPLE corrector loop while pimple.loop(): UEqn = _UEqn( mesh(), alpha1, U, p, p_rgh, ghf, rho, rhoPhi, turbulence, g, twoPhaseProperties, interface, pimple ) # --- PISO loop while pimple.correct(): cumulativeContErr = _pEqn( runTime, mesh, UEqn, U, p, p_rgh, gh, ghf, phi, phiAbs, alpha1, rho, g, interface, pimple, pRefCell, pRefValue, cumulativeContErr, ) 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
def main_standalone(argc, argv): args = ref.setRootCase(argc, argv) runTime = man.createTime(args) mesh = man.createMesh(runTime) pimple = man.pimpleControl(mesh) cumulativeContErr = ref.initContinuityErrs() p_rgh, p, alpha1, U, phi, rho1, rho2, rho, rhoPhi, twoPhaseProperties, pRefCell, \ pRefValue, interface, turbulence, g, gh, ghf = _createFields( runTime, mesh ) adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls(runTime) cumulativeContErr = correctPhi(runTime, mesh, phi, p, p_rgh, rho, U, cumulativeContErr, pimple, pRefCell, pRefValue) CoNum, meanCoNum = ref.CourantNo(mesh, phi, runTime) runTime = ref.setInitialDeltaT(runTime, adjustTimeStep, maxCo, CoNum) ref.ext_Info() << "\nStarting time loop\n" << ref.nl while runTime.run(): adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls(runTime) CoNum, meanCoNum = ref.CourantNo(mesh, phi, runTime) maxAlphaCo, alphaCoNum, meanAlphaCoNum = alphaCourantNo( runTime, mesh, alpha1, phi) runTime = setDeltaT(runTime, adjustTimeStep, maxCo, CoNum, maxAlphaCo, alphaCoNum, maxDeltaT) runTime.increment() ref.ext_Info() << "Time = " << runTime.timeName() << ref.nl << ref.nl twoPhaseProperties.correct() alphaEqnSubCycle(runTime, pimple, mesh, phi, alpha1, rho, rhoPhi, rho1, rho2, interface) while pimple.loop(): UEqn = _UEqn(mesh, alpha1, U, p, p_rgh, ghf, rho, rhoPhi, turbulence, g, twoPhaseProperties, interface, pimple) # --- PISO loop while pimple.correct(): cumulativeContErr = _pEqn(runTime, mesh, UEqn, U, p, p_rgh, gh, ghf, phi, alpha1, rho, g, interface, pimple, pRefCell, pRefValue, cumulativeContErr) 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
def main_standalone( argc, argv ): args = ref.setRootCase( argc, argv ) runTime = man.createTime( args ) mesh = man.createMesh( runTime ) pimple = man.pimpleControl( mesh ) cumulativeContErr = ref.initContinuityErrs() p_rgh, p, alpha1, U, phi, rho1, rho2, rho, rhoPhi, twoPhaseProperties, pRefCell, \ pRefValue, interface, turbulence, g, gh, ghf = _createFields( runTime, mesh ) adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls( runTime ) cumulativeContErr = correctPhi( runTime, mesh, phi, p, p_rgh, rho, U, cumulativeContErr, pimple, pRefCell, pRefValue) CoNum, meanCoNum = ref.CourantNo( mesh, phi, runTime ) runTime = ref.setInitialDeltaT( runTime, adjustTimeStep, maxCo, CoNum ) ref.ext_Info() << "\nStarting time loop\n" << ref.nl while runTime.run() : adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls( runTime ) CoNum, meanCoNum = ref.CourantNo( mesh, phi, runTime ) maxAlphaCo, alphaCoNum, meanAlphaCoNum = alphaCourantNo( runTime, mesh, alpha1, phi ) runTime = setDeltaT( runTime, adjustTimeStep, maxCo, CoNum, maxAlphaCo, alphaCoNum, maxDeltaT ) runTime.increment() ref.ext_Info() << "Time = " << runTime.timeName() << ref.nl << ref.nl twoPhaseProperties.correct() alphaEqnSubCycle( runTime, pimple, mesh, phi, alpha1, rho, rhoPhi, rho1, rho2, interface ) while pimple.loop(): UEqn = _UEqn( mesh, alpha1, U, p, p_rgh, ghf, rho, rhoPhi, turbulence, g, twoPhaseProperties, interface, pimple ) # --- PISO loop while pimple.correct(): cumulativeContErr = _pEqn( runTime, mesh, UEqn, U, p, p_rgh, gh, ghf, phi, alpha1, rho, g, interface, pimple, pRefCell, pRefValue, cumulativeContErr ) 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
def main_standalone(argc, argv): args = ref.setRootCase(argc, argv) runTime = man.createTime(args) mesh = man.createMesh(runTime) g = man.readGravitationalAcceleration(runTime, mesh) pimple = ref.pimpleControl(mesh) adjustTimeStep, maxCo, maxDeltaT, nAlphaCorr, nAlphaSubCycles = read_controls( args, runTime, pimple) cumulativeContErr = ref.initContinuityErrs() p_rgh, alpha1, alpha2, U, phi, twoPhaseProperties, rho10, rho20, psi1, psi2, pMin, \ gh, ghf, p, rho1, rho2, rho, rhoPhi, dgdt, interface, turbulence = _createFields( runTime, mesh, g ) CoNum, meanCoNum = ref.CourantNo(mesh, phi, runTime) runTime = ref.setInitialDeltaT(runTime, adjustTimeStep, maxCo, CoNum) # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # ref.ext_Info() << "\nStarting time loop\n" << ref.nl while runTime.run(): adjustTimeStep, maxCo, maxDeltaT, nAlphaCorr, nAlphaSubCycles = read_controls( args, runTime, pimple) CoNum, meanCoNum = ref.CourantNo(mesh, phi, runTime) runTime = ref.setDeltaT(runTime, adjustTimeStep, maxCo, maxDeltaT, CoNum) runTime.increment() ref.ext_Info() << "Time = " << runTime.timeName() << ref.nl << ref.nl # --- Outer-corrector loop pimple.start() while pimple.loop(): alphaEqnsSubCycle(runTime, pimple, mesh, phi, alpha1, alpha2, rho, rho1, rho2, rhoPhi, dgdt, interface) ref.solve(ref.fvm.ddt(rho) + ref.fvc.div(rhoPhi)) UEqn = fun_UEqn(mesh, alpha1, U, p, p_rgh, ghf, rho, rhoPhi, turbulence, g, twoPhaseProperties, interface, pimple) # --- PISO loop for corr in range(pimple.nCorr()): fun_pEqn( runTime, mesh, pimple, UEqn, p, p_rgh, phi, U, rho, rho1, rho2, rho10, rho20, gh, ghf, dgdt, pMin, \ psi1, psi2, alpha1, alpha2, interface, corr ) pass if pimple.turbCorr(): turbulence.correct() pass pimple.increment() pass rho << alpha1 * rho1 + alpha2 * rho2 runTime.write() ref.ext_Info() << "ExecutionTime = " << runTime.elapsedCpuTime( ) << " s\n\n" << 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 = readGravitationalAcceleration( runTime, mesh ); T, p_rgh, U, phi, laminarTransport, turbulence, rhok, \ kappat, gh, ghf, p, pRefCell, pRefValue, beta, TRef, Pr, Prt = createFields( runTime, mesh, g ) cumulativeContErr = ref.initContinuityErrs() adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls( runTime ) CoNum, meanCoNum = ref.CourantNo( mesh, phi, runTime ) runTime = ref.setInitialDeltaT( runTime, adjustTimeStep, maxCo, CoNum ) pimple = man.pimpleControl( mesh ) # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # ref.ext_Info() << "\nStarting time loop\n" << ref.nl while runTime.loop(): ref.ext_Info() << "Time = " << runTime.timeName() << ref.nl << ref.nl adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls( runTime ) CoNum, meanCoNum = ref.CourantNo( mesh, phi, runTime ) runTime = ref.setDeltaT( runTime, adjustTimeStep, maxCo, maxDeltaT, CoNum ) # Pressure-velocity PIMPLE corrector loop while pimple.loop(): UEqn = fun_UEqn( mesh, pimple, U, phi, turbulence, p, rhok, p_rgh, ghf ) fun_TEqn( phi, turbulence, kappat, T, rhok, beta, TRef, Prt, Pr ) # --- Pressure corrector loop while pimple.correct(): cumulativeContErr = fun_pEqn( mesh, runTime, pimple, p, rhok, U, phi, turbulence, gh, ghf, p_rgh, UEqn, pRefCell, pRefValue, cumulativeContErr ) 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 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 = man.readGravitationalAcceleration( runTime, mesh) pimple = ref.pimpleControl( mesh ) adjustTimeStep, maxCo, maxDeltaT, nAlphaCorr, nAlphaSubCycles = read_controls( args, runTime, pimple ) cumulativeContErr = ref.initContinuityErrs() p_rgh, alpha1, alpha2, U, phi, twoPhaseProperties, rho10, rho20, psi1, psi2, pMin, \ gh, ghf, p, rho1, rho2, rho, rhoPhi, dgdt, interface, turbulence = _createFields( runTime, mesh, g ) CoNum, meanCoNum = ref.CourantNo( mesh, phi, runTime ) runTime = ref.setInitialDeltaT( runTime, adjustTimeStep, maxCo, CoNum ) # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # ref.ext_Info() << "\nStarting time loop\n" << ref.nl while runTime.run(): adjustTimeStep, maxCo, maxDeltaT, nAlphaCorr, nAlphaSubCycles = read_controls( args, runTime, pimple ) CoNum, meanCoNum = ref.CourantNo( mesh, phi, runTime ) runTime = ref.setDeltaT( runTime, adjustTimeStep, maxCo, maxDeltaT, CoNum ) runTime.increment() ref.ext_Info() << "Time = " << runTime.timeName() << ref.nl << ref.nl # --- Outer-corrector loop while pimple.loop(): alphaEqnsSubCycle( runTime, pimple, mesh, phi, alpha1, alpha2, rho, rho1, rho2, rhoPhi, dgdt, interface ) ref.solve( ref.fvm.ddt( rho ) + ref.fvc.div( rhoPhi ) ) UEqn = fun_UEqn( mesh, alpha1, U, p, p_rgh, ghf, rho, rhoPhi, turbulence, g, twoPhaseProperties, interface, pimple ) # --- Pressure corrector loop while pimple.correct(): fun_pEqn( runTime, mesh, pimple, UEqn, p, p_rgh, phi, U, rho, rho1, rho2, rho10, rho20, gh, ghf, dgdt, pMin, \ psi1, psi2, alpha1, alpha2, interface ) pass if pimple.turbCorr(): turbulence.correct() pass pass rho << alpha1 * rho1 + alpha2 * rho2 runTime.write() ref.ext_Info() << "ExecutionTime = " << runTime.elapsedCpuTime() << " s\n\n" << 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 = 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
def main_standalone( argc, argv ): args = ref.setRootCase( argc, argv ) runTime = man.createTime( args ) mesh = man.createMesh( runTime ) g = man.readGravitationalAcceleration( runTime, mesh ) cumulativeContErr = ref.initContinuityErrs() p_rgh, alpha1, U, phi, twoPhaseProperties, rho1, rho2, Dab, \ alphatab, rho, rhoPhi, turbulence, gh, ghf, p, pRefCell, pRefValue = _createFields( runTime, mesh, g ) adjustTimeStep, maxCo, maxDeltaT = ref.readTimeControls( runTime ) CoNum, meanCoNum = ref.CourantNo( mesh, phi, 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.CourantNo( mesh, phi, runTime ) runTime = ref.setDeltaT( runTime, adjustTimeStep, maxCo, maxDeltaT, CoNum ) runTime.increment() ref.ext_Info() << "Time = " << runTime.timeName() << ref.nl << ref.nl # --- Pressure-velocity PIMPLE corrector loop pimple.start() while pimple.loop(): twoPhaseProperties.correct() alphaEqn( mesh, phi, alpha1, alphatab, Dab, rhoPhi, rho, rho1, rho2, turbulence ) UEqn = fun_UEqn( mesh, U, p_rgh, ghf, rho, rhoPhi, turbulence, twoPhaseProperties, pimple ) # --- PISO loop for corr in range( pimple.nCorr() ): cumulativeContErr = fun_pEqn( runTime, mesh, UEqn, U, p, p_rgh, gh, ghf, phi, rho, pimple, \ corr, pRefCell, pRefValue, cumulativeContErr ) 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