From a815e6c23e0aa5bbec4baeb4d301acb97abf239c Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 24 Mar 2011 14:32:19 +0000 Subject: [PATCH 01/18] ENH: Updated coalChemistryFoam re: finalIter --- applications/solvers/lagrangian/coalChemistryFoam/UEqn.H | 2 +- applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H index a6d7127800..d58b74ab9c 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H @@ -13,5 +13,5 @@ if (momentumPredictor) { - solve(UEqn == -fvc::grad(p), mesh.solver(U.select(finalIter))); + solve(UEqn == -fvc::grad(p)); } diff --git a/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H index 2dcb13c79f..e6901a9c6f 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H @@ -15,7 +15,7 @@ hsEqn.relax(); - hsEqn.solve(mesh.solver(hs.select(finalIter))); + hsEqn.solve(); thermo.correct(); From ecca911e408205512c86ba705197d64dc0c9adb6 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 24 Mar 2011 14:35:56 +0000 Subject: [PATCH 02/18] ENH: Updated pEqn for porousExplicitSourceReactingParcelFoam --- .../pEqn.H | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H index e173fa858b..27921d6396 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H @@ -40,14 +40,17 @@ - fvm::laplacian(rho*rAU, p) ); - if (corr == nCorr-1 && nonOrth == nNonOrthCorr) - { - pEqn.solve(mesh.solver("pFinal")); - } - else - { - pEqn.solve(); - } + pEqn.solve + ( + mesh.solver + ( + p.select + ( + corr == nCorr-1 + && nonOrth == nNonOrthCorr + ) + ) + ); if (nonOrth == nNonOrthCorr) { From 6f47073d34059bf1b20ae050e056550d1f2bf995 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 24 Mar 2011 14:39:41 +0000 Subject: [PATCH 03/18] ENH: Removed unnecessary ()'s --- .../solvers/compressible/rhoPimpleFoam/pEqn.H | 16 ++++++---------- .../solvers/incompressible/pimpleFoam/pEqn.H | 8 +++----- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index 29ceb721c7..08ce8f140b 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -37,11 +37,9 @@ if (transonic) ( p.select ( - ( - finalIter - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) + finalIter + && corr == nCorr-1 + && nonOrth == nNonOrthCorr ) ) ); @@ -77,11 +75,9 @@ else ( p.select ( - ( - finalIter - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) + finalIter + && corr == nCorr-1 + && nonOrth == nNonOrthCorr ) ) ); diff --git a/applications/solvers/incompressible/pimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pEqn.H index acd86ed4b0..b2e29e4407 100644 --- a/applications/solvers/incompressible/pimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pEqn.H @@ -27,11 +27,9 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) ( p.select ( - ( - finalIter - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) + finalIter + && corr == nCorr-1 + && nonOrth == nNonOrthCorr ) ) ); From 2c074892b0dbc66f8f61fe791750f331d6ea2673 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 24 Mar 2011 14:58:03 +0000 Subject: [PATCH 04/18] ENH: reactingParcelFoam: moved hs out of PISO loop and added pFinal --- .../lagrangian/reactingParcelFoam/pEqn.H | 29 +++++++++++++++++-- .../reactingParcelFoam/reactingParcelFoam.C | 25 +++++++++++----- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index 560fbc9895..3c65ca9fb9 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H @@ -26,7 +26,18 @@ if (transonic) parcels.Srho() ); - pEqn.solve(); + pEqn.solve + ( + mesh.solver + ( + p.select + ( + finalIter + && corr == nCorr-1 + && nonOrth == nNonOrthCorr + ) + ) + ); if (nonOrth == nNonOrthCorr) { @@ -54,7 +65,18 @@ else parcels.Srho() ); - pEqn.solve(); + pEqn.solve + ( + mesh.solver + ( + p.select + ( + finalIter + && corr == nCorr-1 + && nonOrth == nNonOrthCorr + ) + ) + ); if (nonOrth == nNonOrthCorr) { @@ -66,7 +88,10 @@ else #include "rhoEqn.H" #include "compressibleContinuityErrs.H" +rho = thermo.rho(); + U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); + DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index 38a1bf908e..b0a82278f0 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,23 +78,32 @@ int main(int argc, char *argv[]) #include "rhoEqn.H" // --- PIMPLE loop - for (int ocorr=1; ocorr<=nOuterCorr; ocorr++) + for (int oCorr=0; oCorrcorrect(); + + if (finalIter) + { + mesh.data::remove("finalIteration"); + } } - turbulence->correct(); - - rho = thermo.rho(); - if (runTime.write()) { chemistry.dQ()().write(); From 1dce642fe23944c514a99d84d9b8bafee133d399 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 24 Mar 2011 15:02:37 +0000 Subject: [PATCH 05/18] ENH: Removed more ()'s --- .../solvers/lagrangian/coalChemistryFoam/pEqn.H | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H index 861e69bc84..80b73d8956 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H @@ -32,11 +32,9 @@ if (transonic) ( p.select ( - ( - finalIter - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) + finalIter + && corr == nCorr-1 + && nonOrth == nNonOrthCorr ) ) ); @@ -73,11 +71,9 @@ else ( p.select ( - ( - finalIter - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) + finalIter + && corr == nCorr-1 + && nonOrth == nNonOrthCorr ) ) ); From 3d1fc441c2cfdec3025232e5b5c6f25d0465b3aa Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 24 Mar 2011 15:08:10 +0000 Subject: [PATCH 06/18] ENH: moved rho update --- applications/solvers/lagrangian/reactingParcelFoam/pEqn.H | 2 -- .../solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index 3c65ca9fb9..5599e861bb 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H @@ -88,8 +88,6 @@ else #include "rhoEqn.H" #include "compressibleContinuityErrs.H" -rho = thermo.rho(); - U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index b0a82278f0..fb89974a62 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -98,6 +98,8 @@ int main(int argc, char *argv[]) turbulence->correct(); + rho = thermo.rho(); + if (finalIter) { mesh.data::remove("finalIteration"); From 17c3983f558f5472c0a85b89cd76eb784e7f5595 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 25 Mar 2011 12:13:58 +0000 Subject: [PATCH 07/18] ENH: Updated LTSReactingParcelFoam solver --- .../LTSReactingParcelFoam.C | 28 +++- .../lagrangian/LTSReactingParcelFoam/YEqn.H | 2 - .../LTSReactingParcelFoam/createFields.H | 8 +- .../lagrangian/LTSReactingParcelFoam/pEqn.H | 15 +- .../readAdditionalSolutionControls.H | 6 +- .../LTSReactingParcelFoam/setPressureWork.H | 15 +- .../LTSReactingParcelFoam/timeScales.H | 154 ++---------------- .../cfdTools/general/include/addFinalIter.H | 5 + .../general/include/removeFinalIter.H | 4 + 9 files changed, 74 insertions(+), 163 deletions(-) create mode 100644 src/finiteVolume/cfdTools/general/include/addFinalIter.H create mode 100644 src/finiteVolume/cfdTools/general/include/removeFinalIter.H diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C index 1160760bb6..dc1c09e744 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readPISOControls.H" + #include "readPIMPLEControls.H" #include "readChemistryProperties.H" #include "readAdditionalSolutionControls.H" #include "readTimeControls.H" @@ -86,17 +86,27 @@ int main(int argc, char *argv[]) #include "timeScales.H" #include "rhoEqn.H" - #include "UEqn.H" - #include "YEqn.H" - #include "hsEqn.H" - // --- PISO loop - for (int corr=0; corrcorrect(); + turbulence->correct(); + + #include "UEqn.H" + #include "YEqn.H" + #include "hsEqn.H" + + // --- PISO loop + for (int corr=0; corr > mvConvection ( fv::convectionScheme::New @@ -10,7 +9,6 @@ tmp > mvConvection ) ); - if (solveSpecies) { label inertIndex = -1; diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H index 5ca55b84f6..cc3c74a535 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H @@ -73,12 +73,12 @@ dimensionedScalar rhoMax ( - mesh.solutionDict().subDict("PISO").lookup("rhoMax") + mesh.solutionDict().subDict("PIMPLE").lookup("rhoMax") ); dimensionedScalar rhoMin ( - mesh.solutionDict().subDict("PISO").lookup("rhoMin") + mesh.solutionDict().subDict("PIMPLE").lookup("rhoMin") ); Info<< "Creating turbulence model\n" << endl; @@ -116,11 +116,11 @@ dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0) ); - volScalarField invTauFlow + volScalarField invTau ( IOobject ( - "invTauFlow", + "invTau", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H index 9fb91f1d36..3e58534ea0 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H @@ -40,7 +40,20 @@ - fvm::laplacian(rho*rAU, p) ); - pEqn.solve(); + pEqn.solve + ( + mesh.solver + ( + p.select + ( + ( + finalIter + && corr == nCorr-1 + && nonOrth == nNonOrthCorr + ) + ) + ) + ); if (nonOrth == nNonOrthCorr) { diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/readAdditionalSolutionControls.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/readAdditionalSolutionControls.H index f0763d8421..8136af1ad3 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/readAdditionalSolutionControls.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/readAdditionalSolutionControls.H @@ -1,7 +1,9 @@ dictionary additional = mesh.solutionDict().subDict("additional"); -bool eWork = additional.lookupOrDefault("eWork", true); -bool hWork = additional.lookupOrDefault("hWork", true); +// pressure work term for enthalpy equation +bool pressureWork = additional.lookupOrDefault("pressureWork", true); +bool pressureWorkTimeDerivative = + additional.lookupOrDefault("pressureWorkTimeDerivative", true); // flag to activate solve transport for each specie (Y vector) bool solveSpecies = additional.lookupOrDefault("solveSpecies", true); diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/setPressureWork.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/setPressureWork.H index 69d9a21731..c5dd4b7451 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/setPressureWork.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/setPressureWork.H @@ -1,10 +1,13 @@ DpDt == dimensionedScalar("zero", DpDt.dimensions(), 0.0); -if (eWork) +if (pressureWork) { - DpDt += -p*fvc::div(phi/fvc::interpolate(rho)); -} -if (hWork) -{ - DpDt += fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p)); + surfaceScalarField phiU("phiU", phi/fvc::interpolate(rho)); + + DpDt += fvc::div(phiU*fvc::interpolate(p)) - p*fvc::div(phiU); + + if (pressureWorkTimeDerivative) + { + DpDt += fvc::ddt(p); + } } diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/timeScales.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/timeScales.H index b44271ab8c..2f8e036554 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/timeScales.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/timeScales.H @@ -28,129 +28,40 @@ Info<< "Time scales min/max:" << endl; { // Cache old time scale field - tmp tinvTauFlow0 + tmp tinvTau0 ( new volScalarField ( IOobject ( - "invTauFlow0", + "invTau0", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE, false ), - invTauFlow + invTau ) ); - const volScalarField& invTauFlow0 = tinvTauFlow0(); + const volScalarField& invTau0 = tinvTau0(); // Flow time scale // ~~~~~~~~~~~~~~~ { - invTauFlow = + invTau = fvc::surfaceSum ( mag(phi)*mesh.deltaCoeffs()/(maxCo*mesh.magSf()) ) /rho; - invTauFlow.max(1.0/maxDeltaT); + invTau.max(1.0/maxDeltaT); Info<< " Flow = " - << gMin(1/invTauFlow.internalField()) << ", " - << gMax(1/invTauFlow.internalField()) << endl; - } - - - // Mass source time scale - // ~~~~~~~~~~~~~~~~~~~~~~ - - { - scalarField tau - ( - runTime.deltaTValue()*mag(parcels.Srho() + massSource.SuTot()) - ); - - tau = alphaTauRho*rho/(tau + ROOTVSMALL); - - Info<< " Density = " - << min(maxDeltaT, gMin(tau)) << ", " - << min(maxDeltaT, gMax(tau)) << endl; - - invTauFlow.internalField() = max(invTauFlow.internalField(), 1/tau); - } - - - // Momentum source time scale - // ~~~~~~~~~~~~~~~~~~~~~~~~~~ - - { -/* - // Method 1 - mag(U) limit using 'small' nominal velocity - scalarField tau - ( - runTime.deltaTValue() - *mag - ( - rho.dimensionedInternalField()*g - + parcels.UTrans()/(mesh.V()*runTime.deltaT()) - + momentumSource.Su() - ) - /rho - ); - - const scalar nomMagU(dimensionedScalar("1", dimVelocity, 1)); - tau = alphaTauU*(nomMagU + mag(U))/(tau + ROOTVSMALL); -*/ -/* - // Method 2 - based on fluxes and Co-like limit - volVectorField UEqnRhs - ( - IOobject - ( - "UEqnRhs", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - mesh, - dimensionedVector("zero", dimDensity*dimAcceleration, vector::zero), - zeroGradientFvPatchVectorField::typeName - ); - - UEqnRhs.internalField() = - rho.dimensionedInternalField()*g - + parcels.UTrans()/(mesh.V()*runTime.deltaT()) - + momentumSource.Su(); - - surfaceScalarField phiSU - ( - "phiSU", - fvc::interpolate(runTime.deltaT()*UEqnRhs) & mesh.Sf() - ); - - scalarField tau - ( - alphaTauU*rho - /fvc::surfaceSum - ( - mag(phi + phiSU)*mesh.deltaCoeffs()/mesh.magSf() - + dimensionedScalar("SMALL", dimDensity/dimTime, ROOTVSMALL) - ) - ); - -*/ -/* - Info<< " Momentum = " << min(maxDeltaT, gMin(tau)) << ", " - << min(maxDeltaT, gMax(tau)) << endl; - - invTauFlow.internalField() = max(invTauFlow.internalField(), 1/tau); -*/ + << gMin(1/invTau.internalField()) << ", " + << gMax(1/invTau.internalField()) << endl; } @@ -176,42 +87,7 @@ Info<< "Time scales min/max:" << endl; Info<< " Temperature = " << min(maxDeltaT, gMin(tau)) << ", " << min(maxDeltaT, gMax(tau)) << endl; - invTauFlow.internalField() = max(invTauFlow.internalField(), 1/tau); - } - - - // Specie source time scale - // ~~~~~~~~~~~~~~~~~~~~~~~~ - - { - scalarField tau(mesh.nCells(), ROOTVGREAT); - forAll(Y, fieldI) - { - const volScalarField& Yi = Y[fieldI]; - const scalarField deltaYi - ( - runTime.deltaTValue() - *mag - ( - kappa*chemistry.RR(fieldI)() - + massSource.Su(fieldI) - + parcels.Srho(fieldI) - ) - /rho - ); - tau = - min - ( - tau, - alphaTauSpecie - /(deltaYi/(Yi + specieMaxUnbound) + ROOTVSMALL) - ); - } - - Info<< " Specie = " << min(maxDeltaT, gMin(tau)) << ", " - << min(maxDeltaT, gMax(tau)) << endl; - - invTauFlow.internalField() = max(invTauFlow.internalField(), 1/tau); + invTau.internalField() = max(invTau.internalField(), 1/tau); } @@ -219,21 +95,21 @@ Info<< "Time scales min/max:" << endl; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // - reduce as much as required for flow, but limit source contributions const dimensionedScalar deltaTRamp("deltaTRamp", dimless, 1/(1 + 0.2)); - invTauFlow = max(invTauFlow, invTauFlow0*deltaTRamp); - tinvTauFlow0.clear(); + invTau = max(invTau, invTau0*deltaTRamp); + tinvTau0.clear(); // Limit the largest time scale // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - invTauFlow.max(1/maxDeltaT); + invTau.max(1/maxDeltaT); // Spatially smooth the time scale field // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - fvc::smooth(invTauFlow, alphaTauSmooth); + fvc::smooth(invTau, alphaTauSmooth); - Info<< " Overall = " << min(1/invTauFlow).value() - << ", " << max(1/invTauFlow).value() << nl << endl; + Info<< " Overall = " << min(1/invTau).value() + << ", " << max(1/invTau).value() << nl << endl; } diff --git a/src/finiteVolume/cfdTools/general/include/addFinalIter.H b/src/finiteVolume/cfdTools/general/include/addFinalIter.H new file mode 100644 index 0000000000..5e4cac2d7b --- /dev/null +++ b/src/finiteVolume/cfdTools/general/include/addFinalIter.H @@ -0,0 +1,5 @@ +if (finalIter) +{ + mesh.data::add("finalIteration", true); +} + diff --git a/src/finiteVolume/cfdTools/general/include/removeFinalIter.H b/src/finiteVolume/cfdTools/general/include/removeFinalIter.H new file mode 100644 index 0000000000..db56e97557 --- /dev/null +++ b/src/finiteVolume/cfdTools/general/include/removeFinalIter.H @@ -0,0 +1,4 @@ +if (finalIter) +{ + mesh.data::remove("finalIteration"); +} From a4e25e515510fae512115996dc3c390ca8bb7c32 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 25 Mar 2011 14:25:06 +0000 Subject: [PATCH 08/18] rhoLTSPimpleFoam: New solver and test case. Supports local time-stepping for steady solution. --- .../compressible/rhoPimpleFoam/Allwmake | 1 + .../rhoPimpleFoam/rhoLTSPimpleFoam/Make/files | 3 + .../rhoLTSPimpleFoam/Make/options | 15 ++ .../rhoLTSPimpleFoam/rhoLTSPimpleFoam.C | 117 +++++++++++++ .../rhoLTSPimpleFoam/setInitialrDeltaT.H | 19 ++ .../rhoLTSPimpleFoam/setrDeltaT.H | 79 +++++++++ .../rhoLTSPimpleFoam/angledDuct/0/T | 54 ++++++ .../rhoLTSPimpleFoam/angledDuct/0/U | 57 ++++++ .../rhoLTSPimpleFoam/angledDuct/0/alphat | 57 ++++++ .../rhoLTSPimpleFoam/angledDuct/0/epsilon | 59 +++++++ .../rhoLTSPimpleFoam/angledDuct/0/k | 59 +++++++ .../rhoLTSPimpleFoam/angledDuct/0/mut | 57 ++++++ .../rhoLTSPimpleFoam/angledDuct/0/p | 51 ++++++ .../rhoLTSPimpleFoam/angledDuct/Allrun | 9 + .../angledDuct/constant/RASProperties | 25 +++ .../constant/polyMesh/blockMeshDict.m4 | 165 ++++++++++++++++++ .../angledDuct/constant/polyMesh/boundary | 58 ++++++ .../angledDuct/constant/porousZones | 36 ++++ .../constant/thermophysicalProperties | 31 ++++ .../angledDuct/constant/turbulenceProperties | 21 +++ .../angledDuct/system/controlDict | 49 ++++++ .../angledDuct/system/fvSchemes | 76 ++++++++ .../angledDuct/system/fvSolution | 68 ++++++++ 23 files changed, 1166 insertions(+) create mode 100644 applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/files create mode 100644 applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/options create mode 100644 applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/rhoLTSPimpleFoam.C create mode 100644 applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setInitialrDeltaT.H create mode 100644 applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setrDeltaT.H create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p create mode 100755 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/Allrun create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/RASProperties create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/porousZones create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/thermophysicalProperties create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/turbulenceProperties create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/controlDict create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSchemes create mode 100644 tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSolution diff --git a/applications/solvers/compressible/rhoPimpleFoam/Allwmake b/applications/solvers/compressible/rhoPimpleFoam/Allwmake index 29bc918085..e47a184d7a 100755 --- a/applications/solvers/compressible/rhoPimpleFoam/Allwmake +++ b/applications/solvers/compressible/rhoPimpleFoam/Allwmake @@ -3,6 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory set -x wmake +wmake rhoLTSPimpleFoam wmake rhoPorousMRFPimpleFoam # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/files b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/files new file mode 100644 index 0000000000..ff61e6022f --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/files @@ -0,0 +1,3 @@ +rhoLTSPimpleFoam.C + +EXE = $(FOAM_APPBIN)/rhoLTSPimpleFoam diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/options b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/options new file mode 100644 index 0000000000..d16a0ee1d8 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/Make/options @@ -0,0 +1,15 @@ +EXE_INC = \ + -I.. \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ + -I$(LIB_SRC)/finiteVolume/cfdTools \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lbasicThermophysicalModels \ + -lspecie \ + -lcompressibleTurbulenceModel \ + -lcompressibleRASModels \ + -lcompressibleLESModels \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/rhoLTSPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/rhoLTSPimpleFoam.C new file mode 100644 index 0000000000..20870bc650 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/rhoLTSPimpleFoam.C @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + rhoLTSPimpleFoam + +Description + Transient solver for laminar or turbulent flow of compressible fluids + for HVAC and similar applications. + + Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and + pseudo-transient simulations with support for local time-stepping for + efficient steady-state solution. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "basicPsiThermo.H" +#include "turbulenceModel.H" +#include "fvcSmooth.H" +#include "bound.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readPIMPLEControls.H" + #include "setInitialrDeltaT.H" + #include "createFields.H" + #include "initContinuityErrs.H" + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readTimeControls.H" + #include "readPIMPLEControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + #include "setrDeltaT.H" + + #include "rhoEqn.H" + + // --- Pressure-velocity PIMPLE corrector loop + for (int oCorr=0; oCorrcorrect(); + + if (finalIter) + { + mesh.data::remove("finalIteration"); + } + } + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setInitialrDeltaT.H b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setInitialrDeltaT.H new file mode 100644 index 0000000000..6a397be9c2 --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setInitialrDeltaT.H @@ -0,0 +1,19 @@ +scalar maxDeltaT +( + pimple.lookupOrDefault("maxDeltaT", GREAT) +); + +volScalarField rDeltaT +( + IOobject + ( + "rDeltaT", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT), + zeroGradientFvPatchScalarField::typeName +); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setrDeltaT.H b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setrDeltaT.H new file mode 100644 index 0000000000..42fbe7e76b --- /dev/null +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/setrDeltaT.H @@ -0,0 +1,79 @@ +{ + scalar maxCo + ( + pimple.lookupOrDefault("maxCo", 0.8) + ); + + scalar rDeltaTSmoothingCoeff + ( + pimple.lookupOrDefault("rDeltaTSmoothingCoeff", 0.02) + ); + + scalar rDeltaTDampingCoeff + ( + pimple.lookupOrDefault("rDeltaTDampingCoeff", 1.0) + ); + + scalar maxDeltaT + ( + pimple.lookupOrDefault("maxDeltaT", GREAT) + ); + + volScalarField rDeltaT0 = rDeltaT; + + // Set the reciprocal time-step from the local Courant number + rDeltaT.dimensionedInternalField() = max + ( + 1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT), + fvc::surfaceSum(mag(phi))().dimensionedInternalField() + /((2*maxCo)*mesh.V()*rho.dimensionedInternalField()) + ); + + if (transonic) + { + surfaceScalarField phid + ( + "phid", + fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf()) + ); + + rDeltaT.dimensionedInternalField() = max + ( + rDeltaT.dimensionedInternalField(), + fvc::surfaceSum(mag(phid))().dimensionedInternalField() + /((2*maxCo)*mesh.V()*psi.dimensionedInternalField()) + ); + } + + // Update tho boundary values of the reciprocal time-step + rDeltaT.correctBoundaryConditions(); + + Info<< "Flow time scale min/max = " + << gMin(1/rDeltaT.internalField()) + << ", " << gMax(1/rDeltaT.internalField()) << endl; + + if (rDeltaTSmoothingCoeff < 1.0) + { + fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff); + } + + Info<< "Smoothed flow time scale min/max = " + << gMin(1/rDeltaT.internalField()) + << ", " << gMax(1/rDeltaT.internalField()) << endl; + + // Limit rate of change of time scale + // - reduce as much as required + // - only increase at a fraction of old time scale + if + ( + rDeltaTDampingCoeff < 1.0 + && runTime.timeIndex() > runTime.startTimeIndex() + 1 + ) + { + rDeltaT = rDeltaT0*max(rDeltaT/rDeltaT0, 1.0 - rDeltaTDampingCoeff); + + Info<< "Damped flow time scale min/max = " + << gMin(1/rDeltaT.internalField()) + << ", " << gMax(1/rDeltaT.internalField()) << endl; + } +} diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T new file mode 100644 index 0000000000..04da8a4eb2 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 293; + +boundaryField +{ + + front + { + type zeroGradient; + } + back + { + type zeroGradient; + } + wall + { + type zeroGradient; + } + porosityWall + { + type zeroGradient; + } + + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type inletOutlet; + value $internalField; + inletValue $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U new file mode 100644 index 0000000000..a6d6006af9 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + front + { + type fixedValue; + value uniform (0 0 0); + } + back + { + type fixedValue; + value uniform (0 0 0); + } + wall + { + type fixedValue; + value uniform (0 0 0); + } + porosityWall + { + type slip; + value uniform (0 0 0); + } + inlet + { + type flowRateInletVelocity; + flowRate 0.1; + value uniform (0 0 0); + } + outlet + { + type fluxCorrectedVelocity; //inletOutlet; + value uniform (0 0 0); + inletValue uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat new file mode 100644 index 0000000000..440c84f8ff --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + front + { + type alphatWallFunction; + value uniform 0; + } + back + { + type alphatWallFunction; + value uniform 0; + } + wall + { + type alphatWallFunction; + value uniform 0; + } + porosityWall + { + type alphatWallFunction; + value uniform 0; + } + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon new file mode 100644 index 0000000000..d81f1db665 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 200; + +boundaryField +{ + front + { + type compressible::epsilonWallFunction; + value uniform 200; + } + back + { + type compressible::epsilonWallFunction; + value uniform 200; + } + wall + { + type compressible::epsilonWallFunction; + value uniform 200; + } + porosityWall + { + type compressible::epsilonWallFunction; + value uniform 200; + } + inlet + { + type compressible::turbulentMixingLengthDissipationRateInlet; + mixingLength 0.005; + value uniform 200; + } + outlet + { + type inletOutlet; + inletValue uniform 200; + value uniform 200; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k new file mode 100644 index 0000000000..1d958cfff9 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 1; + +boundaryField +{ + front + { + type compressible::kqRWallFunction; + value uniform 1; + } + back + { + type compressible::kqRWallFunction; + value uniform 1; + } + wall + { + type compressible::kqRWallFunction; + value uniform 1; + } + porosityWall + { + type compressible::kqRWallFunction; + value uniform 1; + } + inlet + { + type turbulentIntensityKineticEnergyInlet; + intensity 0.05; + value uniform 1; + } + outlet + { + type inletOutlet; + inletValue uniform 1; + value uniform 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut new file mode 100644 index 0000000000..0e11f50c54 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object mut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + front + { + type mutkWallFunction; + value uniform 0; + } + back + { + type mutkWallFunction; + value uniform 0; + } + wall + { + type mutkWallFunction; + value uniform 0; + } + porosityWall + { + type mutkWallFunction; + value uniform 0; + } + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p new file mode 100644 index 0000000000..2e94ff795e --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1.0e5; + +boundaryField +{ + front + { + type zeroGradient; + } + back + { + type zeroGradient; + } + wall + { + type zeroGradient; + } + porosityWall + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + outlet + { + type fixedValue; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/Allrun b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/Allrun new file mode 100755 index 0000000000..d72de07446 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/Allrun @@ -0,0 +1,9 @@ +cd ${0%/*} || exit 1 # run from this directory + +m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh +runApplication `getApplication` diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/RASProperties b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/RASProperties new file mode 100644 index 0000000000..67d4d8212c --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/RASProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 new file mode 100644 index 0000000000..fb67da75da --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 @@ -0,0 +1,165 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + `format' ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// block definition for a porosity with an angled inlet/outlet +// the porosity is not aligned with the main axes +// +dnl> ----------------------------------------------------------------- +dnl> +dnl> +changecom(//)changequote([,]) dnl> +define(calc, [esyscmd(perl -e 'print ($1)')]) dnl> +define(VCOUNT, 0) dnl> +define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) dnl> +dnl> +define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl> +define(quad2D, ($1f $1b $2b $2f)) dnl> +define(frontQuad, ($1f $2f $3f $4f)) dnl> +define(backQuad, ($4b $3b $2b $1b)) dnl> +dnl> +dnl> +dnl> ----------------------------------------------------------------- +dnl> +define(ncells, 20) dnl> +define(ninlet, 15) dnl> +define(nporo, 20) dnl> +define(noutlet, 20) dnl> +dnl> +define(x0,0) dnl> +define(y0,0) dnl> +define(y0,0) dnl> +define(Cos,0.7071067812) dnl> == cos(45) +define(Sin,0.7071067812) dnl> == sin(45) +dnl> +define(width,50) dnl> +define(zBack,calc(-width/2)) dnl> +define(zFront,calc(width/2)) dnl> +define(leninlet,150)dnl> +define(lenporo,100)dnl> +define(lenoutlet,100)dnl> +dnl> +define(xhyp,calc(Sin*width)) dnl> +define(yhyp,calc(Cos*width)) dnl> +define(xinlet,leninlet)dnl> +define(xporo,calc(Cos*lenporo)) dnl> +define(yporo,calc(Sin*lenporo)) dnl> +define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl> +define(youtlet,calc(yporo + Sin*lenoutlet)) dnl> +dnl> + +convertToMeters 0.001; + +vertices +( + // inlet region + ( -xinlet y0 zBack ) vlabel(in1b) + ( -xinlet yhyp zBack ) vlabel(in2b) + ( -xinlet y0 zFront ) vlabel(in1f) + ( -xinlet yhyp zFront ) vlabel(in2f) + + // join inlet->outlet + ( x0 y0 zBack ) vlabel(join1b) + ( -xhyp yhyp zBack ) vlabel(join2b) + ( x0 y0 zFront ) vlabel(join1f) + ( -xhyp yhyp zFront ) vlabel(join2f) + + // porosity ends ->outlet + ( xporo yporo zBack ) vlabel(poro1b) + ( calc(xporo - xhyp) calc(yporo + yhyp) zBack ) vlabel(poro2b) + ( xporo yporo zFront ) vlabel(poro1f) + ( calc(xporo - xhyp) calc(yporo + yhyp) zFront ) vlabel(poro2f) + + // outlet + ( xoutlet youtlet zBack ) vlabel(out1b) + ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b) + ( xoutlet youtlet zFront ) vlabel(out1f) + ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f) +); + +blocks +( + // inlet block + hex2D(in1, join1, join2, in2) + inlet ( ninlet ncells ncells ) simpleGrading (1 1 1) + + // porosity block + hex2D(join1, poro1, poro2, join2) + porosity ( nporo ncells ncells ) simpleGrading (1 1 1) + + // outlet block + hex2D(poro1, out1, out2, poro2) + outlet ( noutlet ncells ncells ) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + // is there no way of defining all my 'defaultFaces' to be 'wall'? + wall front + ( + // inlet block + frontQuad(in1, join1, join2, in2) + // outlet block + frontQuad(poro1, out1, out2, poro2) + ) + + wall back + ( + // inlet block + backQuad(in1, join1, join2, in2) + // outlet block + backQuad(poro1, out1, out2, poro2) + ) + + wall wall + ( + // inlet block + quad2D(in1, join1) + quad2D(join2, in2) + // outlet block + quad2D(poro1, out1) + quad2D(out2, poro2) + ) + + wall porosityWall + ( + // porosity block + frontQuad(join1, poro1, poro2, join2) + // porosity block + backQuad(join1, poro1, poro2, join2) + // porosity block + quad2D(join1, poro1) + quad2D(poro2, join2) + ) + + patch inlet + ( + quad2D(in2, in1) + ) + + patch outlet + ( + quad2D(out2, out1) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary new file mode 100644 index 0000000000..dc9ecffb7b --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +6 +( + front + { + type wall; + nFaces 700; + startFace 63400; + } + back + { + type wall; + nFaces 700; + startFace 64100; + } + wall + { + type wall; + nFaces 1400; + startFace 64800; + } + porosityWall + { + type wall; + nFaces 1600; + startFace 66200; + } + inlet + { + type patch; + nFaces 400; + startFace 67800; + } + outlet + { + type patch; + nFaces 400; + startFace 68200; + } +) + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/porousZones b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/porousZones new file mode 100644 index 0000000000..02c2bd82cb --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/porousZones @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object porousZones; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +1 +( + porosity + { + coordinateSystem + { + e1 (0.70710678 0.70710678 0); + e2 (0 0 1); + } + + Darcy + { + d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000); + f f [0 -1 0 0 0 0 0] (0 0 0); + } + } +) + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/thermophysicalProperties b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/thermophysicalProperties new file mode 100644 index 0000000000..686497a1c7 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/thermophysicalProperties @@ -0,0 +1,31 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType hPsiThermo>>>>; + +mixture +{ + nMoles 1; + molWeight 28.9; + Cp 1007; + Hf 0; + As 1.4792e-06; + Ts 116; +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/turbulenceProperties b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/turbulenceProperties new file mode 100644 index 0000000000..3e945495c5 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/controlDict b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/controlDict new file mode 100644 index 0000000000..ad6e941334 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/controlDict @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application rhoLTSPimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 500; + +deltaT 1; + +writeControl adjustableRunTime; + +writeInterval 50; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSchemes b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSchemes new file mode 100644 index 0000000000..e2381721e8 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSchemes @@ -0,0 +1,76 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default localEuler rDeltaT; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phid,p) Gauss upwind; + div(phiU,p) Gauss linear; + div(phi,h) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(phi,R) Gauss upwind; + div(phi,omega) Gauss upwind; + div((rho*R)) Gauss linear; + div(R) Gauss linear; + div(U) Gauss linear; + div((muEff*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(muEff,U) Gauss linear corrected; + laplacian(mut,U) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian(DomegaEff,omega) Gauss linear corrected; + laplacian((rho*(1|A(U))),p) Gauss linear corrected; + laplacian(alphaEff,h) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSolution b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSolution new file mode 100644 index 0000000000..7367176b72 --- /dev/null +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/system/fvSolution @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0.1; + } + + pFinal + { + $p; + tolerance 1e-06; + relTol 0.1; + } + + "(rho|U|h|k|epsilon|omega)" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + "(rho|U|h|k|epsilon|omega)Final" + { + $U; + tolerance 1e-05; + relTol 0.1; + } + +} + +PIMPLE +{ + momentumPredictor yes; + nOuterCorrectors 1; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + rhoMin rhoMin [ 1 -3 0 0 0 ] 0.5; + rhoMax rhoMax [ 1 -3 0 0 0 ] 2.0; + + maxCo 0.8; + rDeltaTSmoothingCoeff 0.02; + rDeltaTDampingCoeff 1; + maxDeltaT 1; +} + + +// ************************************************************************* // From 3bb159794fe54ce6dcbf080038ef2922be44b771 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 25 Mar 2011 14:33:48 +0000 Subject: [PATCH 09/18] BUG: Hadn't updated heat transfer calc for derived particles --- .../ReactingMultiphaseParcel/ReactingMultiphaseParcel.C | 6 +++--- .../parcels/Templates/ReactingParcel/ReactingParcel.C | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 336b3ef705..6ee0d77474 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -332,7 +332,7 @@ void Foam::ReactingMultiphaseParcel::calc // ~~~~~~~~~~~~~ // Calculate new particle temperature - scalar Cuh = 0.0; + scalar Sph = 0.0; scalar T1 = this->calcHeatTransfer ( @@ -349,7 +349,7 @@ void Foam::ReactingMultiphaseParcel::calc NCpW, Sh, dhsTrans, - Cuh + Sph ); @@ -423,7 +423,7 @@ void Foam::ReactingMultiphaseParcel::calc td.cloud().hsTrans()[cellI] += np0*dhsTrans; // Update sensible enthalpy coefficient - td.cloud().hsCoeff()[cellI] += np0*Cuh*this->areaS(); + td.cloud().hsCoeff()[cellI] += np0*Sph; } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 11e61d8581..56f24c97f1 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -342,7 +342,7 @@ void Foam::ReactingParcel::calc // ~~~~~~~~~~~~~ // Calculate new particle temperature - scalar Cuh = 0.0; + scalar Sph = 0.0; scalar T1 = this->calcHeatTransfer ( @@ -359,7 +359,7 @@ void Foam::ReactingParcel::calc NCpW, Sh, dhsTrans, - Cuh + Sph ); @@ -410,7 +410,7 @@ void Foam::ReactingParcel::calc td.cloud().hsTrans()[cellI] += np0*dhsTrans; // Update sensible enthalpy coefficient - td.cloud().hsCoeff()[cellI] += np0*Cuh*this->areaS(); + td.cloud().hsCoeff()[cellI] += np0*Sph; } From 28cd7fc92fd90c9aaf53cefaae569812333faee9 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 25 Mar 2011 14:35:50 +0000 Subject: [PATCH 10/18] ENH: Updated LTSReactingParcelFoam tutorials --- .../counterFlowFlame2D/system/controlDict | 2 - .../counterFlowFlame2D/system/fvSchemes | 2 +- .../counterFlowFlame2D/system/fvSolution | 29 +++++++- .../constant/reactingCloud1Properties | 2 +- .../verticalChannel/system/controlDict | 12 ++-- .../verticalChannel/system/fvSchemes | 2 +- .../verticalChannel/system/fvSolution | 68 ++++++++++--------- 7 files changed, 68 insertions(+), 49 deletions(-) diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/controlDict b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/controlDict index d1fc63c252..3719b30a03 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/controlDict +++ b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/controlDict @@ -51,8 +51,6 @@ maxCo 0.5; maxDeltaT 1; -alphaTauSpecie 1e10; - alphaTauTemp 0.005; // ************************************************************************* // diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSchemes b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSchemes index 45f26de8bb..3f08dd0d6e 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSchemes +++ b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSchemes @@ -17,7 +17,7 @@ FoamFile ddtSchemes { - default localEuler invTauFlow; + default localEuler invTau; } gradSchemes diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSolution b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSolution index 31c2340be4..e5a074276a 100755 --- a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSolution +++ b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSolution @@ -24,6 +24,13 @@ solvers tolerance 0; relTol 0.1; } + rhoFinal + { + solver PCG; + preconditioner DIC; + tolerance 1e-4; + relTol 0; + } p { solver GAMG; @@ -44,6 +51,14 @@ solvers maxIter 50; }; + pFinal + { + $p; + + tolerance 1e-4; + relTol 0; + }; + "(U|Yi|hs|k|epsilon)" { solver smoothSolver; @@ -51,9 +66,17 @@ solvers tolerance 0; relTol 0.1; } + + "(U|Yi|hs|k|epsilon)Final" + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-4; + relTol 0; + } } -PISO +PIMPLE { nCorrectors 2; nNonOrthogonalCorrectors 0; @@ -64,8 +87,8 @@ PISO additional { - eWork true; - hWork true; + pressureWork true; + pressureWorkTimeDerivative true; solveSpecies true; } diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties index b415ea939b..2215e348f7 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties @@ -122,7 +122,7 @@ subModels massFlowRate 0.8e-03; parcelBasisType mass; patchName inletCentral; - parcelsPerSecond 400; + parcelsPerSecond 100; duration 1; // NOTE: set to 1 for steady state U0 (0 40 0); flowRateProfile constant 1; diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/controlDict b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/controlDict index 7bf404c0a6..8569d05e8d 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/controlDict +++ b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/controlDict @@ -45,17 +45,13 @@ timePrecision 6; runTimeModifiable yes; -maxCo 5; +maxCo 5; -alphaTauSmooth 1e10; +alphaTauSmooth 1; -alphaTauTemp 1e10; +alphaTauTemp 1; -alphaTauRho 1e10; - -alphaTauSpecie 1e10; - -maxDeltaT 1e10; +maxDeltaT 1; functions { diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSchemes b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSchemes index da93c451d2..0a99ca6ddf 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSchemes +++ b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSchemes @@ -17,7 +17,7 @@ FoamFile ddtSchemes { - default localEuler invTauFlow; + default localEuler invTau; } gradSchemes diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSolution b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSolution index 1d4e95dae0..7184f4b370 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSolution +++ b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSolution @@ -1,14 +1,14 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | +| \\ / O peration | Version: 1.6 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; - format ascii; + format binary; class dictionary; location "system"; object fvSolution; @@ -17,11 +17,21 @@ FoamFile solvers { + "(rho|.*Final)" + { + solver PCG; + preconditioner DIC; + tolerance 0; + relTol 0.1; + } + +// "(p|.*Final)" p { solver GAMG; + tolerance 0; - relTol 0.1; + relTol 0.05; smoother DICGaussSeidel; nPreSweeps 0; @@ -33,47 +43,39 @@ solvers agglomerator faceAreaPair; mergeLevels 1; - maxIter 20; + maxIter 50; }; - "(rho|G)" + + pFinal { - solver PCG; - preconditioner DIC; - tolerance 0; - relTol 0.1; - maxIter 20; - }; - "(Yi|hs)" + $p; + tolerance 1e-4; + } + + "(U|Yi|hs|k|omega|.*Final)" { - solver smoothSolver; - smoother GaussSeidel; - tolerance 0; - relTol 0.1; - maxIter 20; - }; - "(U|k|omega)" - { - solver smoothSolver; - smoother GaussSeidel; - tolerance 0; - relTol 0.1; - maxIter 20; - }; + solver smoothSolver; + smoother GaussSeidel; + tolerance 0; + relTol 0.1; + maxIter 20; + } } -PISO +PIMPLE { - nCorrectors 2; - nNonOrthogonalCorrectors 0; // 10; + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 0; momentumPredictor yes; - rhoMin rhoMin [ 1 -3 0 0 0 ] 0; // 0.5; - rhoMax rhoMax [ 1 -3 0 0 0 ] 100; // 1.5; + rhoMin rhoMin [1 -3 0 0 0] 0.1; + rhoMax rhoMax [1 -3 0 0 0] 1.5; } additional { - eWork true; - hWork true; + pressureWork true; + pressureWorkTimeDerivative false; // true; solveSpecies true; } From 83ae9d9f2472570cd30bc4237b36112c89e8ad95 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 25 Mar 2011 14:37:41 +0000 Subject: [PATCH 11/18] ENH: Removed unnecesaary ()'s --- .../solvers/lagrangian/LTSReactingParcelFoam/pEqn.H | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H index 3e58534ea0..c25c63df0b 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H @@ -46,11 +46,9 @@ ( p.select ( - ( - finalIter - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) + finalIter + && corr == nCorr-1 + && nonOrth == nNonOrthCorr ) ) ); From 6d5dee15c8c6f082784f1769aa1b623209e936ab Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 25 Mar 2011 14:43:59 +0000 Subject: [PATCH 12/18] ENH: Updated porousExplicitSource...Foam solver --- .../YEqn.H | 1 + .../hsEqn.H | 19 +++++++++---------- .../readAdditionalSolutionControls.H | 10 +++++++--- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H index e9d540f3a9..53c6b25d81 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H @@ -11,6 +11,7 @@ tmp > mvConvection ); +if (solveSpecies) { label inertIndex = -1; volScalarField Yt(0.0*Y[0]); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H index f448144f16..58e0b69943 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H @@ -16,17 +16,16 @@ ) ); - if (dpdt) + if (pressureWork) { - pWork() += fvc::ddt(p); - } - if (eWork) - { - pWork() = -p*fvc::div(phi/fvc::interpolate(rho)); - } - if (hWork) - { - pWork() += fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p)); + surfaceScalarField phiU("phiU", phi/fvc::interpolate(rho)); + + pWork() += fvc::div(phiU*fvc::interpolate(p)) - p*fvc::div(phiU); + + if (pressureWorkTimeDerivative) + { + pWork() += fvc::ddt(p); + } } { diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readAdditionalSolutionControls.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readAdditionalSolutionControls.H index 340623fbfd..8136af1ad3 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readAdditionalSolutionControls.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readAdditionalSolutionControls.H @@ -1,5 +1,9 @@ dictionary additional = mesh.solutionDict().subDict("additional"); -bool dpdt = additional.lookupOrDefault("dpdt", true); -bool eWork = additional.lookupOrDefault("eWork", true); -bool hWork = additional.lookupOrDefault("hWork", true); +// pressure work term for enthalpy equation +bool pressureWork = additional.lookupOrDefault("pressureWork", true); +bool pressureWorkTimeDerivative = + additional.lookupOrDefault("pressureWorkTimeDerivative", true); + +// flag to activate solve transport for each specie (Y vector) +bool solveSpecies = additional.lookupOrDefault("solveSpecies", true); From ec5fb1ca6836a1f66ef0eeda10033701033bcfe3 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 25 Mar 2011 14:44:21 +0000 Subject: [PATCH 13/18] ENH: Tutorial updates --- .../filter/system/fvSolution | 5 ++--- .../parcelInBox/system/fvSolution | 5 ++--- .../verticalChannel/system/fvSolution | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSolution b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSolution index 020074f5d9..32e542337a 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSolution +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/fvSolution @@ -74,9 +74,8 @@ PISO additional { - dpdt true; - hWork true; - eWork true; + pressureWork true; + pressureWorkTimeDerivative true; } relaxationFactors diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/system/fvSolution b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/system/fvSolution index 5151a8d8f9..af936fdba1 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/system/fvSolution +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/system/fvSolution @@ -74,9 +74,8 @@ PISO additional { - dpdt false; - eWork true; - hWork true; + pressureWork true; + pressureWorkTimeDerivative true; } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSolution b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSolution index 59f4754694..199f651417 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSolution +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/system/fvSolution @@ -82,9 +82,8 @@ SIMPLE additional { - dpdt false; - eWork true; - hWork true; + pressureWork false; + pressureWorkTimeDerivative false; } From 04bb783b932f440a8ec1298284124cee432bd87a Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 25 Mar 2011 15:31:13 +0000 Subject: [PATCH 14/18] LTSReactingParcelFoam/counterFlowFlame2D tutorial: corrected application name --- .../LTSReactingParcelFoam/counterFlowFlame2D/system/controlDict | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/controlDict b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/controlDict index 3719b30a03..19b0815773 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/controlDict +++ b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application reactingFoam; +application LTSReactingParcelFoam; startFrom latestTime; From 5b4cd73e551b56196c411a15356fe9746363489c Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 26 Mar 2011 21:48:15 +0000 Subject: [PATCH 15/18] PIMPLE: Rationalised loop structure Automated the caching of "finalIteration". --- .../solvers/combustion/fireFoam/fireFoam.C | 22 ++- .../solvers/combustion/fireFoam/pEqn.H | 2 +- .../solvers/combustion/rhoReactingFoam/pEqn.H | 12 +- .../rhoReactingFoam/rhoReactingFoam.C | 20 ++- .../solvers/compressible/rhoPimpleFoam/pEqn.H | 4 +- .../rhoLTSPimpleFoam/rhoLTSPimpleFoam.C | 23 ++-- .../rhoPimpleFoam/rhoPimpleFoam.C | 19 +-- .../rhoPorousMRFPimpleFoam/pEqn.H | 4 +- .../rhoPorousMRFPimpleFoam.C | 19 +-- .../buoyantBoussinesqPimpleFoam/TEqn.H | 2 +- .../buoyantBoussinesqPimpleFoam/UEqn.H | 3 +- .../buoyantBoussinesqPimpleFoam.C | 19 +-- .../buoyantBoussinesqPimpleFoam/pEqn.H | 2 +- .../heatTransfer/buoyantPimpleFoam/UEqn.H | 3 +- .../buoyantPimpleFoam/buoyantPimpleFoam.C | 19 +-- .../heatTransfer/buoyantPimpleFoam/hEqn.H | 2 +- .../heatTransfer/buoyantPimpleFoam/pEqn.H | 2 +- .../solvers/incompressible/pimpleFoam/pEqn.H | 2 +- .../pimpleFoam/pimpleDyMFoam/pEqn.H | 2 +- .../pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C | 21 ++- .../incompressible/pimpleFoam/pimpleFoam.C | 19 +-- .../LTSReactingParcelFoam.C | 15 +- .../lagrangian/LTSReactingParcelFoam/pEqn.H | 2 +- .../coalChemistryFoam/coalChemistryFoam.C | 21 ++- .../lagrangian/coalChemistryFoam/pEqn.H | 4 +- .../lagrangian/reactingParcelFoam/pEqn.H | 4 +- .../reactingParcelFoam/reactingParcelFoam.C | 21 ++- .../interPhaseChangeFoam.C | 10 +- .../multiphase/interPhaseChangeFoam/pEqn.H | 2 +- .../multiphase/twoLiquidMixingFoam/pEqn.H | 2 +- .../twoLiquidMixingFoam/twoLiquidMixingFoam.C | 19 +-- .../cfdTools/general/include/addFinalIter.H | 5 - .../general/include/removeFinalIter.H | 4 - .../cfdTools/general/pimpleLoop/pimpleLoop.H | 128 ++++++++++++++++++ 34 files changed, 260 insertions(+), 198 deletions(-) delete mode 100644 src/finiteVolume/cfdTools/general/include/addFinalIter.H delete mode 100644 src/finiteVolume/cfdTools/general/include/removeFinalIter.H create mode 100644 src/finiteVolume/cfdTools/general/pimpleLoop/pimpleLoop.H diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index 6240cadb0e..2d814226da 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.C @@ -33,8 +33,8 @@ Description #include "hsCombustionThermo.H" #include "turbulenceModel.H" #include "combustionModel.H" - #include "radiationModel.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,7 +57,7 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readPISOControls.H" + #include "readPIMPLEControls.H" #include "readTimeControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" @@ -68,14 +68,13 @@ int main(int argc, char *argv[]) #include "rhoEqn.H" // --- Pressure-velocity PIMPLE corrector loop - for (int oCorr=0; oCorrcorrect(); diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index e0d120e9e3..74b3cdc958 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -33,7 +33,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) p_rgh.select ( ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) diff --git a/applications/solvers/combustion/rhoReactingFoam/pEqn.H b/applications/solvers/combustion/rhoReactingFoam/pEqn.H index ee03ece751..21f5ec080b 100644 --- a/applications/solvers/combustion/rhoReactingFoam/pEqn.H +++ b/applications/solvers/combustion/rhoReactingFoam/pEqn.H @@ -45,9 +45,9 @@ p.select ( ( - finalIter - && corr == nCorr-1 - && nonOrth == nNonOrthCorr + pimpleCorr.finalIter() + && corr == nCorr-1 + && nonOrth == nNonOrthCorr ) ) ) @@ -89,9 +89,9 @@ p.select ( ( - finalIter - && corr == nCorr-1 - && nonOrth == nNonOrthCorr + pimpleCorr.finalIter() + && corr == nCorr-1 + && nonOrth == nNonOrthCorr ) ) ) diff --git a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C index 7b160ec666..6c7f8a8cb5 100644 --- a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C +++ b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C @@ -36,6 +36,7 @@ Description #include "rhoChemistryModel.H" #include "chemistrySolver.H" #include "multivariateScheme.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -69,14 +70,14 @@ int main(int argc, char *argv[]) #include "chemistry.H" #include "rhoEqn.H" - for (label oCorr=1; oCorr <= nOuterCorr; oCorr++) + // --- Pressure-velocity PIMPLE corrector loop + for + ( + pimpleLoop pimpleCorr(mesh, nOuterCorr); + pimpleCorr.loop(); + pimpleCorr++ + ) { - bool finalIter = oCorr == nOuterCorr-1; - if (finalIter) - { - mesh.data::add("finalIteration", true); - } - #include "UEqn.H" #include "YEqn.H" #include "hsEqn.H" @@ -86,11 +87,6 @@ int main(int argc, char *argv[]) { #include "pEqn.H" } - - if (finalIter) - { - mesh.data::remove("finalIteration"); - } } turbulence->correct(); diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index 08ce8f140b..4029b8fc8d 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -37,7 +37,7 @@ if (transonic) ( p.select ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) @@ -75,7 +75,7 @@ else ( p.select ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/rhoLTSPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/rhoLTSPimpleFoam.C index 20870bc650..06bcced406 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/rhoLTSPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoLTSPimpleFoam/rhoLTSPimpleFoam.C @@ -38,6 +38,7 @@ Description #include "basicPsiThermo.H" #include "turbulenceModel.H" #include "fvcSmooth.H" +#include "pimpleLoop.H" #include "bound.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -70,20 +71,21 @@ int main(int argc, char *argv[]) #include "rhoEqn.H" // --- Pressure-velocity PIMPLE corrector loop - for (int oCorr=0; oCorrcorrect(); + #include "UEqn.H" #include "hEqn.H" @@ -92,13 +94,6 @@ int main(int argc, char *argv[]) { #include "pEqn.H" } - - turbulence->correct(); - - if (finalIter) - { - mesh.data::remove("finalIteration"); - } } runTime.write(); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index b91675f761..f399ae40cb 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -37,6 +37,7 @@ Description #include "basicPsiThermo.H" #include "turbulenceModel.H" #include "bound.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -64,14 +65,13 @@ int main(int argc, char *argv[]) #include "rhoEqn.H" // --- Pressure-velocity PIMPLE corrector loop - for (int oCorr=0; oCorrcorrect(); - - if (finalIter) - { - mesh.data::remove("finalIteration"); - } } runTime.write(); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H index b24e0a8d5d..9eee6f7cfa 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H @@ -40,7 +40,7 @@ if (transonic) p.select ( ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) @@ -81,7 +81,7 @@ else p.select ( ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C index a410cf5248..94e3f67e59 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C @@ -39,6 +39,7 @@ Description #include "bound.H" #include "MRFZones.H" #include "porousZones.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -69,14 +70,13 @@ int main(int argc, char *argv[]) #include "rhoEqn.H" // --- Pressure-velocity PIMPLE corrector loop - for (int oCorr=0; oCorrcorrect(); - - if (finalIter) - { - mesh.data::remove("finalIteration"); - } } runTime.write(); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H index 9a835792a4..dbfc61739f 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H @@ -12,7 +12,7 @@ ); TEqn.relax(); - TEqn.solve(mesh.solver(T.select(finalIter))); + TEqn.solve(); rhok = 1.0 - beta*(T - TRef); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H index 20a05e5cd4..df6f90ac02 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H @@ -21,7 +21,6 @@ - ghf*fvc::snGrad(rhok) - fvc::snGrad(p_rgh) )*mesh.magSf() - ), - mesh.solver(U.select(finalIter)) + ) ); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C index 54519906a4..6a57e839c5 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C @@ -48,6 +48,7 @@ Description #include "fvCFD.H" #include "singlePhaseTransportModel.H" #include "RASModel.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -77,14 +78,13 @@ int main(int argc, char *argv[]) #include "setDeltaT.H" // --- Pressure-velocity PIMPLE corrector loop - for (int oCorr=0; oCorrcorrect(); - - if (finalIter) - { - mesh.data::remove("finalIteration"); - } } runTime.write(); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H index 897ce2a097..363ac11fb1 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H @@ -26,7 +26,7 @@ p_rgh.select ( ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H index 8c6a3f7671..c8b9f13180 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H @@ -21,7 +21,6 @@ - ghf*fvc::snGrad(rho) - fvc::snGrad(p_rgh) )*mesh.magSf() - ), - mesh.solver(U.select(finalIter)) + ) ); } diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C index 167ca4e741..6f947b5e25 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C @@ -37,6 +37,7 @@ Description #include "basicRhoThermo.H" #include "turbulenceModel.H" #include "fixedGradientFvPatchFields.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -70,14 +71,13 @@ int main(int argc, char *argv[]) #include "rhoEqn.H" // --- Pressure-velocity PIMPLE corrector loop - for (int oCorr=0; oCorrcorrect(); rho = thermo.rho(); - - if (finalIter) - { - mesh.data::remove("finalIteration"); - } } runTime.write(); diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H index 94537508b3..3125cc3ffa 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H @@ -9,7 +9,7 @@ ); hEqn.relax(); - hEqn.solve(mesh.solver(h.select(finalIter))); + hEqn.solve(); thermo.correct(); } diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index c6d1ad5e3c..343ff2b800 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -40,7 +40,7 @@ p_rgh.select ( ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) diff --git a/applications/solvers/incompressible/pimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pEqn.H index b2e29e4407..8326f35a6b 100644 --- a/applications/solvers/incompressible/pimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pEqn.H @@ -27,7 +27,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) ( p.select ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H index 74045cabb7..88a0056e77 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H @@ -30,7 +30,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) p.select ( ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C index 011c0a3f23..b606af5c79 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C @@ -36,6 +36,7 @@ Description #include "singlePhaseTransportModel.H" #include "turbulenceModel.H" #include "dynamicFvMesh.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -83,15 +84,14 @@ int main(int argc, char *argv[]) #include "meshCourantNo.H" } - // --- PIMPLE loop - for (int oCorr=0; oCorrcorrect(); - - if (finalIter) - { - mesh.data::remove("finalIteration"); - } } runTime.write(); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C index 75552ba411..af5a929e33 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C @@ -35,6 +35,7 @@ Description #include "fvCFD.H" #include "singlePhaseTransportModel.H" #include "turbulenceModel.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,14 +61,13 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; // --- Pressure-velocity PIMPLE corrector loop - for (int oCorr=0; oCorrcorrect(); - - if (finalIter) - { - mesh.data::remove("finalIteration"); - } } runTime.write(); diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C index dc1c09e744..4e47de7572 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C @@ -46,6 +46,7 @@ Description #include "timeActivatedExplicitSource.H" #include "SLGThermo.H" #include "fvcSmooth.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -87,12 +88,14 @@ int main(int argc, char *argv[]) #include "rhoEqn.H" - // --- PIMPLE loop - for (int oCorr=0; oCorrcorrect(); #include "UEqn.H" @@ -104,8 +107,6 @@ int main(int argc, char *argv[]) { #include "pEqn.H" } - - #include "removeFinalIter.H" } if (runTime.write()) diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H index c25c63df0b..edfb943848 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H @@ -46,7 +46,7 @@ ( p.select ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) diff --git a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C index f32be6214b..56eca74811 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C @@ -45,6 +45,7 @@ Description #include "timeActivatedExplicitSource.H" #include "radiationModel.H" #include "SLGThermo.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -89,15 +90,14 @@ int main(int argc, char *argv[]) #include "chemistry.H" #include "rhoEqn.H" - // --- PIMPLE loop - for (int oCorr=0; oCorrcorrect(); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H index 80b73d8956..0e5cb3e1fe 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H @@ -32,7 +32,7 @@ if (transonic) ( p.select ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) @@ -71,7 +71,7 @@ else ( p.select ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index 5599e861bb..15999a1798 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H @@ -32,7 +32,7 @@ if (transonic) ( p.select ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) @@ -71,7 +71,7 @@ else ( p.select ( - finalIter + pimpleCorr.finalIter() && corr == nCorr-1 && nonOrth == nNonOrthCorr ) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index fb89974a62..f938d0f22b 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -38,6 +38,7 @@ Description #include "chemistrySolver.H" #include "radiationModel.H" #include "SLGThermo.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -77,15 +78,14 @@ int main(int argc, char *argv[]) #include "chemistry.H" #include "rhoEqn.H" - // --- PIMPLE loop - for (int oCorr=0; oCorrcorrect(); rho = thermo.rho(); - - if (finalIter) - { - mesh.data::remove("finalIteration"); - } } if (runTime.write()) diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C index e4fdb00535..949be33c58 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C @@ -46,6 +46,7 @@ Description #include "interfaceProperties.H" #include "phaseChangeTwoPhaseMixture.H" #include "turbulenceModel.H" +#include "pimpleLoop.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -83,10 +84,13 @@ int main(int argc, char *argv[]) turbulence->correct(); // --- Pressure-velocity PIMPLE corrector loop - for (int oCorr=0; oCorrcorrect(); - - if (finalIter) - { - mesh.data::remove("finalIteration"); - } } runTime.write(); diff --git a/src/finiteVolume/cfdTools/general/include/addFinalIter.H b/src/finiteVolume/cfdTools/general/include/addFinalIter.H deleted file mode 100644 index 5e4cac2d7b..0000000000 --- a/src/finiteVolume/cfdTools/general/include/addFinalIter.H +++ /dev/null @@ -1,5 +0,0 @@ -if (finalIter) -{ - mesh.data::add("finalIteration", true); -} - diff --git a/src/finiteVolume/cfdTools/general/include/removeFinalIter.H b/src/finiteVolume/cfdTools/general/include/removeFinalIter.H deleted file mode 100644 index db56e97557..0000000000 --- a/src/finiteVolume/cfdTools/general/include/removeFinalIter.H +++ /dev/null @@ -1,4 +0,0 @@ -if (finalIter) -{ - mesh.data::remove("finalIteration"); -} diff --git a/src/finiteVolume/cfdTools/general/pimpleLoop/pimpleLoop.H b/src/finiteVolume/cfdTools/general/pimpleLoop/pimpleLoop.H new file mode 100644 index 0000000000..94e179f16f --- /dev/null +++ b/src/finiteVolume/cfdTools/general/pimpleLoop/pimpleLoop.H @@ -0,0 +1,128 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::pimpleLoop + +Description + PIMPLE loop class to formalise the iteration and automate the handling + of the "finalIteration" mesh data entry. + +\*---------------------------------------------------------------------------*/ + +#ifndef pimpleLoop_H +#define pimpleLoop_H + +#include "fvMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class pimpleLoop Declaration +\*---------------------------------------------------------------------------*/ + +class pimpleLoop +{ + // Private data + + //- Reference to the mesh + fvMesh& mesh_; + + //- Number of PIMPLE correctors + const int nCorr_; + + //- Current PIMPLE corrector + int corr_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + pimpleLoop(const pimpleLoop&); + + //- Disallow default bitwise assignment + void operator=(const pimpleLoop&); + + +public: + + // Constructors + + //- Construct from components + pimpleLoop(fvMesh& mesh, const int nCorr) + : + mesh_(mesh), + nCorr_(nCorr), + corr_(0) + {} + + + //- Destructor + ~pimpleLoop() + {} + + + // Member Functions + + bool loop() + { + if (finalIter()) + { + mesh_.data::add("finalIteration", true); + } + + return corr_ < nCorr_; + } + + bool finalIter() const + { + return corr_ == nCorr_-1; + } + + + // Member Operators + + void operator++(int) + { + if (finalIter()) + { + mesh_.data::remove("finalIteration"); + } + + corr_++; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From 1528f30f3356d5a400815f2b8caa19aed5aa48e8 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 26 Mar 2011 21:48:40 +0000 Subject: [PATCH 16/18] LTSInterFoam: Improved default settings --- .../solvers/multiphase/interFoam/LTSInterFoam/setrDeltaT.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/setrDeltaT.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/setrDeltaT.H index 7dc0779969..3a4e6385ec 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/setrDeltaT.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/setrDeltaT.H @@ -11,7 +11,7 @@ scalar rDeltaTSmoothingCoeff ( - piso.lookupOrDefault("rDeltaTSmoothingCoeff", 0.1) + piso.lookupOrDefault("rDeltaTSmoothingCoeff", 0.02) ); label nAlphaSpreadIter From 5ec353c85c2efcd48e8fa472a6e573cf0150782f Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 26 Mar 2011 21:49:23 +0000 Subject: [PATCH 17/18] tutorials: Updated PIMPLE settings and corrected application --- .../combustion/fireFoam/les/smallPoolFire2D/system/fvSolution | 2 +- .../combustion/fireFoam/les/smallPoolFire3D/system/fvSolution | 2 +- tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U | 2 +- .../reactingParcelFilmFoam/evaporationTest/system/controlDict | 2 +- .../reactingParcelFilmFoam/hotBoxes/system/controlDict | 2 +- .../reactingParcelFilmFoam/multipleBoxes/system/controlDict | 2 +- .../reactingParcelFilmFoam/panel/system/controlDict | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSolution b/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSolution index 8c855503fc..10c1c27de7 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSolution +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/system/fvSolution @@ -92,7 +92,7 @@ solvers } -PISO +PIMPLE { momentumPredictor yes; nOuterCorrectors 1; diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/system/fvSolution b/tutorials/combustion/fireFoam/les/smallPoolFire3D/system/fvSolution index e34b7b6a61..ef95fada40 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire3D/system/fvSolution +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/system/fvSolution @@ -83,7 +83,7 @@ solvers } -PISO +PIMPLE { momentumPredictor no; nOuterCorrectors 1; diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U index a6d6006af9..df58bc8772 100644 --- a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U @@ -16,7 +16,7 @@ FoamFile dimensions [0 1 -1 0 0 0 0]; -internalField uniform (0 0 0); +internalField uniform (47.8 0 0); boundaryField { diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/controlDict b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/controlDict index 9399c56688..1a4c4e485e 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/controlDict +++ b/tutorials/lagrangian/reactingParcelFilmFoam/evaporationTest/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application reactingParcelFoam; +application reactingParcelFilmFoam; startFrom latestTime; diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/controlDict b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/controlDict index c8a7d46f1c..5d5a7c9bb1 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/controlDict +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application reactingParcelFoam; +application reactingParcelFilmFoam; startFrom latestTime; // startTime; diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/system/controlDict b/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/system/controlDict index e5a3ee428a..7700c982d1 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/system/controlDict +++ b/tutorials/lagrangian/reactingParcelFilmFoam/multipleBoxes/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application reactingParcelFoam; +application reactingParcelFilmFoam; startFrom startTime; diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/controlDict b/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/controlDict index 340bc1845e..4b43c3aedc 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/controlDict +++ b/tutorials/lagrangian/reactingParcelFilmFoam/panel/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application reactingParcelFoam; +application reactingParcelFilmFoam; startFrom startTime; @@ -23,7 +23,7 @@ startTime 0; stopAt endTime; -endTime 5.0; +endTime 5.0; deltaT 1e-04; From 3bffa0e552fc998d322117985228d28dde206b24 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 28 Mar 2011 10:31:24 +0100 Subject: [PATCH 18/18] ENH: (re-)added under-relaxation to pEqn in LTSReactingParcelFoam solver --- .../lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C | 5 +++++ applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C index dc1c09e744..9cb7908a14 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C @@ -93,6 +93,11 @@ int main(int argc, char *argv[]) bool finalIter = oCorr == nOuterCorr-1; #include "addFinalIter.H" + if (nOuterCorr != 1) + { + p.storePrevIter(); + } + turbulence->correct(); #include "UEqn.H" diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H index c25c63df0b..97ba0c5c78 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H @@ -59,7 +59,7 @@ } } - Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl; + p.relax(); // Second part of thermodynamic density update thermo.rho() += psi*p; @@ -75,4 +75,6 @@ rho = min(rho, rhoMax); #include "setPressureWork.H" + + Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl; }