From eb7456eee579983029aa6881fd412ab01365e160 Mon Sep 17 00:00:00 2001 From: andy <andy> Date: Tue, 11 Jun 2013 11:17:46 +0100 Subject: [PATCH] ENH: Added fvOptions support to buoyantBoussinesq heat transfer solvers --- .../heatTransfer/buoyantBoussinesqPimpleFoam/Make/options | 5 +++++ .../heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H | 6 ++++++ .../heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H | 6 ++++++ .../buoyantBoussinesqPimpleFoam.C | 4 +++- .../heatTransfer/buoyantBoussinesqSimpleFoam/Make/options | 5 +++++ .../heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H | 7 +++++++ .../heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H | 8 +++++++- .../buoyantBoussinesqSimpleFoam.C | 2 ++ 8 files changed, 41 insertions(+), 2 deletions(-) diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options index 365e64d1b13..ca2936633a8 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options @@ -1,5 +1,8 @@ EXE_INC = \ -I../buoyantBoussinesqSimpleFoam \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/fvOptions/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \ @@ -9,6 +12,8 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lfvOptions \ + -lsampling \ -lmeshTools \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H index 65c92dab513..76b0ef0168e 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H @@ -11,12 +11,18 @@ - fvm::laplacian(alphaEff, T) == radiation->ST(rhoCpRef, T) + + fvOptions(T) ); TEqn.relax(); + + fvOptions.constrain(TEqn); + TEqn.solve(); radiation->correct(); + fvOptions.correct(T); + rhok = 1.0 - beta*(T - TRef); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H index 07f46ec9982..92768088b95 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H @@ -5,10 +5,14 @@ fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) + == + fvOptions(U) ); UEqn.relax(); + fvOptions.constrain(UEqn); + if (pimple.momentumPredictor()) { solve @@ -23,4 +27,6 @@ )*mesh.magSf() ) ); + + fvOptions.correct(U); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C index 65dda0653e0..6168082e1de 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C @@ -48,8 +48,9 @@ Description #include "fvCFD.H" #include "singlePhaseTransportModel.H" #include "RASModel.H" -#include "pimpleControl.H" #include "radiationModel.H" +#include "fvIOoptionList.H" +#include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -61,6 +62,7 @@ int main(int argc, char *argv[]) #include "readGravitationalAcceleration.H" #include "createFields.H" #include "createIncompressibleRadiationModel.H" + #include "createFvOptions.H" #include "initContinuityErrs.H" #include "readTimeControls.H" #include "CourantNo.H" diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options index 6905967f04a..6a6311e47cd 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options @@ -1,5 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/fvOptions/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \ -I$(LIB_SRC)/transportModels \ @@ -7,7 +10,9 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lsampling \ -lmeshTools \ + -lfvOptions \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleTransportModels diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H index a0c5d24b2bf..c495e58285a 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/TEqn.H @@ -8,10 +8,17 @@ ( fvm::div(phi, T) - fvm::laplacian(alphaEff, T) + == + fvOptions(T) ); TEqn.relax(); + + fvOptions.constrain(TEqn); + TEqn.solve(); + fvOptions.correct(T); + rhok = 1.0 - beta*(T - TRef); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H index cbe464fc023..dd516edf2f8 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/UEqn.H @@ -4,16 +4,20 @@ ( fvm::div(phi, U) + turbulence->divDevReff(U) + == + fvOptions(U) ); UEqn().relax(); + fvOptions.constrain(UEqn()); + if (simple.momentumPredictor()) { solve ( UEqn() - == + == fvc::reconstruct ( ( @@ -22,4 +26,6 @@ )*mesh.magSf() ) ); + + fvOptions.correct(U); } diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C index 4fc37efd28d..b0d2f98aebf 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C @@ -48,6 +48,7 @@ Description #include "fvCFD.H" #include "singlePhaseTransportModel.H" #include "RASModel.H" +#include "fvIOoptionList.H" #include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -59,6 +60,7 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "readGravitationalAcceleration.H" #include "createFields.H" + #include "createFvOptions.H" #include "initContinuityErrs.H" simpleControl simple(mesh); -- GitLab