diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/0/U b/tutorials/incompressible/pimpleDyMFoam/movingCone/0/U similarity index 100% rename from tutorials/incompressible/icoDyMFoam/movingCone/0/U rename to tutorials/incompressible/pimpleDyMFoam/movingCone/0/U diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/0/cellMotionUx b/tutorials/incompressible/pimpleDyMFoam/movingCone/0/cellMotionUx similarity index 100% rename from tutorials/incompressible/icoDyMFoam/movingCone/0/cellMotionUx rename to tutorials/incompressible/pimpleDyMFoam/movingCone/0/cellMotionUx diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/0/p b/tutorials/incompressible/pimpleDyMFoam/movingCone/0/p similarity index 100% rename from tutorials/incompressible/icoDyMFoam/movingCone/0/p rename to tutorials/incompressible/pimpleDyMFoam/movingCone/0/p diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/0/pointMotionUx b/tutorials/incompressible/pimpleDyMFoam/movingCone/0/pointMotionUx similarity index 100% rename from tutorials/incompressible/icoDyMFoam/movingCone/0/pointMotionUx rename to tutorials/incompressible/pimpleDyMFoam/movingCone/0/pointMotionUx diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/constant/dynamicMeshDict b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/dynamicMeshDict similarity index 100% rename from tutorials/incompressible/icoDyMFoam/movingCone/constant/dynamicMeshDict rename to tutorials/incompressible/pimpleDyMFoam/movingCone/constant/dynamicMeshDict diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/constant/polyMesh/blockMeshDict b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/incompressible/icoDyMFoam/movingCone/constant/polyMesh/blockMeshDict rename to tutorials/incompressible/pimpleDyMFoam/movingCone/constant/polyMesh/blockMeshDict diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/constant/polyMesh/boundary b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/polyMesh/boundary similarity index 90% rename from tutorials/incompressible/icoDyMFoam/movingCone/constant/polyMesh/boundary rename to tutorials/incompressible/pimpleDyMFoam/movingCone/constant/polyMesh/boundary index f272243696f77ea97ab257b511f8b47b629f5a39..bf656b10e3727c479de4ca77f5329ad458abc5f8 100644 --- a/tutorials/incompressible/icoDyMFoam/movingCone/constant/polyMesh/boundary +++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/polyMesh/boundary @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,6 +10,7 @@ FoamFile version 2.0; format binary; class polyBoundaryMesh; + location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/transportProperties b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..aad34b40df2a22407d363cccfba0f552c4bf276f --- /dev/null +++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/transportProperties @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1e-05; + +CrossPowerLawCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + m m [ 0 0 1 0 0 0 0 ] 1; + n n [ 0 0 0 0 0 0 0 ] 1; +} + +BirdCarreauCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + k k [ 0 0 1 0 0 0 0 ] 0; + n n [ 0 0 0 0 0 0 0 ] 1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/constant/transportProperties b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/turbulenceProperties similarity index 88% rename from tutorials/incompressible/icoDyMFoam/movingCone/constant/transportProperties rename to tutorials/incompressible/pimpleDyMFoam/movingCone/constant/turbulenceProperties index cdd96395a8385c09fe14e0c096b36a989e336286..886d34bdef135c39216d342240a96bf0530bdd62 100644 --- a/tutorials/incompressible/icoDyMFoam/movingCone/constant/transportProperties +++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/constant/turbulenceProperties @@ -8,14 +8,14 @@ FoamFile { version 2.0; - format binary; + format ascii; class dictionary; location "constant"; - object transportProperties; + object turbulenceProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -nu nu [ 0 2 -1 0 0 0 0 ] 1e-05; +simulationType laminar; // ************************************************************************* // diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/system/controlDict b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/controlDict similarity index 100% rename from tutorials/incompressible/icoDyMFoam/movingCone/system/controlDict rename to tutorials/incompressible/pimpleDyMFoam/movingCone/system/controlDict diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/system/fvSchemes b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSchemes similarity index 94% rename from tutorials/incompressible/icoDyMFoam/movingCone/system/fvSchemes rename to tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSchemes index 092fc762b36de918a2941636793aeb51262721b5..c7c76eb965b2020fe51f9d6272970adfeefc5083 100644 --- a/tutorials/incompressible/icoDyMFoam/movingCone/system/fvSchemes +++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSchemes @@ -30,6 +30,7 @@ divSchemes { default none; div(phi,U) Gauss linear; + div((nuEff*dev(grad(U).T()))) Gauss linear; } laplacianSchemes @@ -39,6 +40,7 @@ laplacianSchemes laplacian(rAU,pcorr) Gauss linear corrected; laplacian(rAU,p) Gauss linear corrected; laplacian(diffusivity,cellMotionU) Gauss linear uncorrected; + laplacian(nuEff,U) Gauss linear uncorrected; } interpolationSchemes diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/system/fvSolution b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution similarity index 100% rename from tutorials/incompressible/icoDyMFoam/movingCone/system/fvSolution rename to tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution diff --git a/tutorials/incompressible/icoDyMFoam/movingCone/system/tetFemSolution b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/tetFemSolution similarity index 100% rename from tutorials/incompressible/icoDyMFoam/movingCone/system/tetFemSolution rename to tutorials/incompressible/pimpleDyMFoam/movingCone/system/tetFemSolution diff --git a/tutorials/incompressible/simpleSRFFoam/mixer/0/epsilon b/tutorials/incompressible/simpleSRFFoam/mixer/0/epsilon index b2de5276310cb7914161c561001c1d902ec74a58..680983af0a0ed390102e4645be6637d58cadd982 100644 --- a/tutorials/incompressible/simpleSRFFoam/mixer/0/epsilon +++ b/tutorials/incompressible/simpleSRFFoam/mixer/0/epsilon @@ -33,12 +33,16 @@ boundaryField innerWall { - type zeroGradient; + type epsilonWallFunction; + U Urel; + value uniform 14.855; } outerWall { - type zeroGradient; + type epsilonWallFunction; + U Urel; + value uniform 14.855; } cyclic diff --git a/tutorials/incompressible/simpleSRFFoam/mixer/0/k b/tutorials/incompressible/simpleSRFFoam/mixer/0/k index 0b8345b26efe221193356ed67d8afbc933859af6..59c1b73fc341de0269e7d827e7bd10d725220416 100644 --- a/tutorials/incompressible/simpleSRFFoam/mixer/0/k +++ b/tutorials/incompressible/simpleSRFFoam/mixer/0/k @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,6 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -25,26 +26,26 @@ boundaryField type fixedValue; value uniform 0.375; } - outlet { type zeroGradient; } - innerWall { - type zeroGradient; + type kQRWallFunction; + value uniform 0.375; } - outerWall { - type zeroGradient; + type kQRWallFunction; + value uniform 0.375; } - cyclic { type cyclic; + value uniform 0.375; } } + // ************************************************************************* // diff --git a/tutorials/incompressible/simpleSRFFoam/mixer/0/nut b/tutorials/incompressible/simpleSRFFoam/mixer/0/nut new file mode 100644 index 0000000000000000000000000000000000000000..3bc0c6bc016011212012aa19733d3783dd8c68a7 --- /dev/null +++ b/tutorials/incompressible/simpleSRFFoam/mixer/0/nut @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } + innerWall + { + type nutWallFunction; + U Urel; + value uniform 0; + } + outerWall + { + type nutWallFunction; + U Urel; + value uniform 0; + } + cyclic + { + type cyclic; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleSRFFoam/mixer/0/omega b/tutorials/incompressible/simpleSRFFoam/mixer/0/omega index c5c54bbe2d523fdbdfa1c687648166cdd6d46449..ac3556f3d243ac5a792a165830d5460fae4f4434 100644 --- a/tutorials/incompressible/simpleSRFFoam/mixer/0/omega +++ b/tutorials/incompressible/simpleSRFFoam/mixer/0/omega @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.5 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,6 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object omega; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -25,26 +26,28 @@ boundaryField type fixedValue; value uniform 3.5; } - outlet { type zeroGradient; } - innerWall { - type zeroGradient; + type omegaWallFunction; + U Urel; + value uniform 3.5; } - outerWall { - type zeroGradient; + type omegaWallFunction; + U Urel; + value uniform 3.5; } - cyclic { type cyclic; + value uniform 3.5; } } + // ************************************************************************* // diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/Make/options b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/Make/options index 8a31f7e5abb705153daf5f003b320fbee11cdf32..cc3cd5e731e99caa395cc3bd58b9f23b9bb0a210 100644 --- a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/Make/options +++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/Make/options @@ -1,7 +1,9 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/RAS \ - -I$(LIB_SRC)/transportModels + -I$(LIB_SRC)/turbulenceModels \ + -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel EXE_LIBS = \ -lincompressibleRASModels \ diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/UEqn.H b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/UEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..72f3ea654393f94a1a1d554e1b35ab6a000f0059 --- /dev/null +++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/UEqn.H @@ -0,0 +1,16 @@ + // Momentum predictor + tmp<fvVectorMatrix> UrelEqn + ( + fvm::div(phi, Urel) + + turbulence->divDevReff(Urel) + + SRF->Su() + ); + + UrelEqn().relax(); + + eqnResidual = solve + ( + UrelEqn() == -fvc::grad(p) + ).initialResidual(); + + maxResidual = max(eqnResidual, maxResidual); diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/convergenceCheck.H b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/convergenceCheck.H new file mode 100644 index 0000000000000000000000000000000000000000..8958063193af348a058fd8f3baecb2547c00da3c --- /dev/null +++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/convergenceCheck.H @@ -0,0 +1,9 @@ +// check convergence + +if (maxResidual < convergenceCriterion) +{ + Info<< "reached convergence criterion: " << convergenceCriterion << endl; + runTime.writeAndEnd(); + Info<< "latestTime = " << runTime.timeName() << endl; +} + diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/initConvergenceCheck.H b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/initConvergenceCheck.H new file mode 100644 index 0000000000000000000000000000000000000000..b56197f22a50cfd07b04fc14d40b9a5454da8c5b --- /dev/null +++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/initConvergenceCheck.H @@ -0,0 +1,7 @@ +// initialize values for convergence checks + + scalar eqnResidual = 1, maxResidual = 0; + scalar convergenceCriterion = 0; + + simple.readIfPresent("convergence", convergenceCriterion); + diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/pEqn.H b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/pEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..b2bc37fd5db808c1ef3c13fd9350958c28b9bba2 --- /dev/null +++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/pEqn.H @@ -0,0 +1,34 @@ +{ + p.boundaryField().updateCoeffs(); + volScalarField AUrel = UrelEqn().A(); + Urel = UrelEqn().H()/AUrel; + UrelEqn.clear(); + phi = fvc::interpolate(Urel) & mesh.Sf(); + adjustPhi(phi, Urel, p); + + // Non-orthogonal pressure corrector loop + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvm::laplacian(1.0/AUrel, p) == fvc::div(phi) + ); + + pEqn.setReference(pRefCell, pRefValue); + pEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi -= pEqn.flux(); + } + } + +# include "continuityErrs.H" + + // Explicitly relax pressure for momentum corrector + p.relax(); + + // Momentum corrector + Urel -= fvc::grad(p)/AUrel; + Urel.correctBoundaryConditions(); +} diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C index 9098e63bc59cacd6605d7ba14f578d4e8b54c98d..f0ce70e69350084925f7061e4d78d663a9f44155 100644 --- a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C +++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C @@ -32,8 +32,8 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" -#include "incompressible/RASModel/RASModel.H" +#include "singlePhaseTransportModel.H" +#include "RASModel.H" #include "SRFModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,7 +42,6 @@ int main(int argc, char *argv[]) { # include "setRootCase.H" - # include "createTime.H" # include "createMesh.H" # include "createFields.H" @@ -59,55 +58,14 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; # include "readSIMPLEControls.H" +# include "initConvergenceCheck.H" p.storePrevIter(); // Pressure-velocity SIMPLE corrector { - // Momentum predictor - tmp<fvVectorMatrix> UrelEqn - ( - fvm::div(phi, Urel) - + turbulence->divDevReff(Urel) - + SRF->Su() - ); - - UrelEqn().relax(); - - solve(UrelEqn() == -fvc::grad(p)); - - p.boundaryField().updateCoeffs(); - volScalarField AUrel = UrelEqn().A(); - Urel = UrelEqn().H()/AUrel; - UrelEqn.clear(); - phi = fvc::interpolate(Urel) & mesh.Sf(); - adjustPhi(phi, Urel, p); - - // Non-orthogonal pressure corrector loop - for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) - { - fvScalarMatrix pEqn - ( - fvm::laplacian(1.0/AUrel, p) == fvc::div(phi) - ); - - pEqn.setReference(pRefCell, pRefValue); - pEqn.solve(); - - if (nonOrth == nNonOrthCorr) - { - phi -= pEqn.flux(); - } - } - -# include "continuityErrs.H" - - // Explicitly relax pressure for momentum corrector - p.relax(); - - // Momentum corrector - Urel -= fvc::grad(p)/AUrel; - Urel.correctBoundaryConditions(); +# include "UEqn.H" +# include "pEqn.H" } turbulence->correct(); @@ -134,6 +92,8 @@ int main(int argc, char *argv[]) Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; + +# include "convergenceCheck.H" } Info<< "End\n" << endl;