From 02703cf065be8669a48bad3ca10062e50c6fa041 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Jun 2013 12:30:45 +0100 Subject: [PATCH 01/15] ENH: Removed unused #include files --- .../standardPhaseChange/standardPhaseChange.C | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C index 4a08755ee3..8b0a0c5f16 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,8 +26,6 @@ License #include "standardPhaseChange.H" #include "addToRunTimeSelectionTable.H" #include "thermoSingleLayer.H" -#include "specie.H" -#include "heatTransferModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From 8af8a6eecc1d5a0b37908d00cba0111dead10da1 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Jun 2013 12:31:17 +0100 Subject: [PATCH 02/15] ENH: Upadted model variable names to use : syntax --- .../submodels/kinematic/filmTurbulenceModel/laminar/laminar.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/laminar/laminar.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/laminar/laminar.C index 108109702b..bc4bf5ee88 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/laminar/laminar.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmTurbulenceModel/laminar/laminar.C @@ -76,7 +76,7 @@ tmp laminar::Us() const ( IOobject ( - typeName + ".Us", + typeName + ":Us", owner_.regionMesh().time().timeName(), owner_.regionMesh(), IOobject::NO_READ, @@ -104,7 +104,7 @@ tmp laminar::mut() const ( IOobject ( - typeName + ".mut", + typeName + ":mut", owner_.regionMesh().time().timeName(), owner_.regionMesh(), IOobject::NO_READ, From 84569f0f12c48a259b205afb5372e9f59d78b9fe Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 11 Jun 2013 10:43:45 +0100 Subject: [PATCH 03/15] BUG: Updated accumulations in wall functions --- .../epsilonWallFunctionFvPatchScalarField.C | 4 ++-- .../omegaWallFunction/omegaWallFunctionFvPatchScalarField.C | 4 ++-- .../omegaWallFunction/omegaWallFunctionFvPatchScalarField.C | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 5e78e48c97..1b3e4ce3d1 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -237,9 +237,9 @@ void epsilonWallFunctionFvPatchScalarField::calculate scalar w = cornerWeights[faceI]; - epsilon[cellI] = w*Cmu75*pow(k[cellI], 1.5)/(kappa_*y[faceI]); + epsilon[cellI] += w*Cmu75*pow(k[cellI], 1.5)/(kappa_*y[faceI]); - G[cellI] = + G[cellI] += w *(mutw[faceI] + muw[faceI]) *magGradUw[faceI] diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index fff165e15e..929ca24598 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -244,9 +244,9 @@ void omegaWallFunctionFvPatchScalarField::calculate scalar omegaLog = sqrt(k[cellI])/(Cmu25*kappa_*y[faceI]); - omega[cellI] = w*sqrt(sqr(omegaVis) + sqr(omegaLog)); + omega[cellI] += w*sqrt(sqr(omegaVis) + sqr(omegaLog)); - G[cellI] = + G[cellI] += w *(mutw[faceI] + muw[faceI]) *magGradUw[faceI] diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 554c18542d..6b8504a4e9 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -242,9 +242,9 @@ void omegaWallFunctionFvPatchScalarField::calculate scalar omegaLog = sqrt(k[cellI])/(Cmu25*kappa_*y[faceI]); - omega[cellI] = w*sqrt(sqr(omegaVis) + sqr(omegaLog)); + omega[cellI] += w*sqrt(sqr(omegaVis) + sqr(omegaLog)); - G[cellI] = + G[cellI] += w *(nutw[faceI] + nuw[faceI]) *magGradUw[faceI] From 2411c340b09ad1113007bca8188dd7ada8f95c14 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 11 Jun 2013 10:44:18 +0100 Subject: [PATCH 04/15] ENH: porosityModels - now derived from regIOobject instead of meshObject --- .../porosityModel/porosityModel/porosityModel.C | 12 +++++++++++- .../porosityModel/porosityModel/porosityModel.H | 3 +-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C index 738f87d0a8..81d722a57b 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C @@ -88,7 +88,17 @@ Foam::porosityModel::porosityModel const word& cellZoneName ) : - MeshObject(mesh), + regIOobject + ( + IOobject + ( + name, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ) + ), name_(name), mesh_(mesh), dict_(dict), diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H index 36a5a9eafb..06df0bfdae 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H @@ -36,7 +36,6 @@ SourceFiles #ifndef porosityModel_H #define porosityModel_H -#include "MeshObject.H" #include "fvMesh.H" #include "dictionary.H" #include "fvMatricesFwd.H" @@ -56,7 +55,7 @@ namespace Foam class porosityModel : - public MeshObject + public regIOobject { private: From c19187c7557b6c3c63ec694eb6ad8ee6d2423053 Mon Sep 17 00:00:00 2001 From: laurence Date: Tue, 11 Jun 2013 10:45:00 +0100 Subject: [PATCH 05/15] STYLE: Correct typo --- src/OpenFOAM/memory/autoPtr/autoPtr.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/memory/autoPtr/autoPtr.H b/src/OpenFOAM/memory/autoPtr/autoPtr.H index 0d5944128e..c3ea064fb1 100644 --- a/src/OpenFOAM/memory/autoPtr/autoPtr.H +++ b/src/OpenFOAM/memory/autoPtr/autoPtr.H @@ -63,11 +63,11 @@ public: //- Store object pointer inline explicit autoPtr(T* = 0); - //- Construct as copy by transfering pointer to this autoPtr and + //- Construct as copy by transferring pointer to this autoPtr and // setting the arguments pointer to NULL inline autoPtr(const autoPtr&); - //- Construct either by transfering pointer or cloning. Should + //- Construct either by transferring pointer or cloning. Should // only be called with type that supports cloning. inline autoPtr(const autoPtr&, const bool reUse); From febb41f6470770f97281f503a91fa5c56bd73d52 Mon Sep 17 00:00:00 2001 From: laurence Date: Tue, 11 Jun 2013 11:09:03 +0100 Subject: [PATCH 06/15] STYLE: Add printVertexInfo option to default foamyHexMesh dict --- etc/caseDicts/foamyHexMeshDict | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/caseDicts/foamyHexMeshDict b/etc/caseDicts/foamyHexMeshDict index d6f87bf6a3..cd0c9367a3 100644 --- a/etc/caseDicts/foamyHexMeshDict +++ b/etc/caseDicts/foamyHexMeshDict @@ -78,6 +78,7 @@ motionControl objOutput no; timeChecks no; + printVertexInfo off; maxLoadUnbalance 0.2; From c29b9fc023a3b803c4b8267c30246f55c8e5b551 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 11 Jun 2013 11:17:08 +0100 Subject: [PATCH 07/15] ENH: Updated wall function update when applying external weights (e.g. ACMI) --- .../epsilonWallFunctionFvPatchScalarField.C | 3 +++ .../omegaWallFunction/omegaWallFunctionFvPatchScalarField.C | 3 +++ .../epsilonWallFunctionFvPatchScalarField.C | 3 +++ .../omegaWallFunction/omegaWallFunctionFvPatchScalarField.C | 3 +++ 4 files changed, 12 insertions(+) diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 1b3e4ce3d1..3f1ab4a2c2 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -464,6 +464,8 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs FieldType& epsilon = const_cast(dimensionedInternalField()); + scalarField& epsilonf = *this; + // only set the values if the weights are < 1 - tolerance forAll(weights, faceI) { @@ -475,6 +477,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI]; epsilon[cellI] = w*epsilon[cellI] + (1.0 - w)*epsilon0[cellI]; + epsilonf[faceI] = epsilon[cellI]; } } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 929ca24598..2f4e11dc20 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -481,6 +481,8 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs FieldType& omega = const_cast(dimensionedInternalField()); + scalarField& omegaf = *this; + // only set the values if the weights are < 1 - tolerance forAll(weights, faceI) { @@ -492,6 +494,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI]; omega[cellI] = w*omega[cellI] + (1.0 - w)*omega0[cellI]; + omegaf[faceI] = omega[cellI]; } } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 7fb6fcfb96..dc08123d26 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -464,6 +464,8 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs FieldType& epsilon = const_cast(dimensionedInternalField()); + scalarField& epsilonf = *this; + // only set the values if the weights are < 1 - tolerance forAll(weights, faceI) { @@ -475,6 +477,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI]; epsilon[cellI] = w*epsilon[cellI] + (1.0 - w)*epsilon0[cellI]; + epsilonf[faceI] = epsilon[cellI]; } } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 6b8504a4e9..69f8ffd170 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -479,6 +479,8 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs FieldType& omega = const_cast(dimensionedInternalField()); + scalarField& omegaf = *this; + // only set the values if the weights are < 1 - tolerance forAll(weights, faceI) { @@ -490,6 +492,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs G[cellI] = w*G[cellI] + (1.0 - w)*G0[cellI]; omega[cellI] = w*omega[cellI] + (1.0 - w)*omega0[cellI]; + omegaf[faceI] = omega[cellI]; } } From eb7456eee579983029aa6881fd412ab01365e160 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 11 Jun 2013 11:17:46 +0100 Subject: [PATCH 08/15] 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 365e64d1b1..ca2936633a 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 65c92dab51..76b0ef0168 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 07f46ec998..92768088b9 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 65dda0653e..6168082e1d 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 6905967f04..6a6311e47c 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 a0c5d24b2b..c495e58285 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 cbe464fc02..dd516edf2f 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 4fc37efd28..b0d2f98aeb 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); From e66cd871b5fc19e88b3a4442115b30fdaeaa2b84 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 11 Jun 2013 12:58:19 +0100 Subject: [PATCH 09/15] wmake: add "dwim" target dwim (do what I mean): search up directories tree for Make sub-directory and build the target specified in Make/files --- wmake/wmake | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/wmake/wmake b/wmake/wmake index ebcd38cb6e..b9977fa7e1 100755 --- a/wmake/wmake +++ b/wmake/wmake @@ -50,6 +50,7 @@ The 'target' is a Makefile target: e.g., Make/linux64GccDPOpt/fvMesh.o or a special target: + dwim search up directories tree for Make sub-directory and build all all subdirectories, uses any Allwmake files if they exist exe build statically linked executable lib build statically linked archive lib (.a) @@ -136,7 +137,7 @@ fi #------------------------------------------------------------------------------ -# check arguments and change to the directory in which to run wmake +# Check arguments and change to the directory in which to run wmake #------------------------------------------------------------------------------ unset dir makeType @@ -167,6 +168,51 @@ then fi +#------------------------------------------------------------------------------ +# Search up directories tree for the Make sub-directory and build there +#------------------------------------------------------------------------------ + +unset dir +MakeDir=Make + +expandpath() +{ + dir=`dirname $1` + cwd=$PWD + cd $dir + exPath=$PWD + cd $cwd +} + +find_target() +{ + expandpath $1 + + if [ "$exPath" = "$WM_PROJECT_DIR" -o "$exPath" = "$HOME" -o "$exPath" = "/" ]; then + echo "$Script error: could not find Make directory" + elif [ -d "$1/Make" ]; then + echo Target $1 + dir=$1 + else + find_target "$1/.." + fi +} + +if [ "$makeType" = dwim ] +then + find_target . + makeType= + + if [ "$dir" ] + then + cd $dir 2>/dev/null || { + echo "$Script error: could not change to directory '$dir'" 1>&2 + exit 1 + } + fi +fi + + #------------------------------------------------------------------------------ # Recurse the application directories tree #------------------------------------------------------------------------------ @@ -254,8 +300,9 @@ $make -s -f $WM_DIR/Makefile MAKE_DIR=$MakeDir INCLUDE_DEPS=$OBJECTS_DIR/dontInc rc=$? [ $rc -eq 0 ] || exit $rc + #------------------------------------------------------------------------------ -# make the object files and link +# Make the object files and link #------------------------------------------------------------------------------ cmd="$make -f $WM_DIR/Makefile MAKE_DIR=$MakeDir INCLUDE_DEPS=$OBJECTS_DIR/includeDeps $makeType" From 77ecd66a3deac31123531c64539b5079138b61bc Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 11 Jun 2013 13:07:44 +0100 Subject: [PATCH 10/15] Pe: Correct expressions for laminar flow (incompressible and compressible) --- .../postProcessing/velocityField/Pe/Pe.C | 38 +++++++------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/applications/utilities/postProcessing/velocityField/Pe/Pe.C b/applications/utilities/postProcessing/velocityField/Pe/Pe.C index 0c4f61729c..544a116921 100644 --- a/applications/utilities/postProcessing/velocityField/Pe/Pe.C +++ b/applications/utilities/postProcessing/velocityField/Pe/Pe.C @@ -130,7 +130,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) mesh.magSf() * mesh.surfaceInterpolation::deltaCoeffs() * fvc::interpolate(RASModel->nuEff()) - ) + ) ) ); } @@ -192,8 +192,12 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) mesh, IOobject::NO_READ ), - mesh.surfaceInterpolation::deltaCoeffs() - * (mag(phi)/mesh.magSf())*(runTime.deltaT()/nu) + mag(phi) + /( + mesh.magSf() + * mesh.surfaceInterpolation::deltaCoeffs() + * nu + ) ) ); } @@ -317,8 +321,12 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) mesh, IOobject::NO_READ ), - mesh.surfaceInterpolation::deltaCoeffs() - * (mag(phi)/(mesh.magSf()))*(runTime.deltaT()/mu) + mag(phi) + /( + mesh.magSf() + * mesh.surfaceInterpolation::deltaCoeffs() + * mu + ) ) ); } @@ -330,26 +338,6 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) << abort(FatalError); } - - // can also check how many cells exceed a particular Pe limit - /* - { - label count = 0; - label PeLimit = 200; - forAll(PePtr(), i) - { - if (PePtr()[i] > PeLimit) - { - count++; - } - - } - - Info<< "Fraction > " << PeLimit << " = " - << scalar(count)/Pe.size() << endl; - } - */ - Info<< "Pe max : " << max(PePtr()).value() << endl; if (writeResults) From e6f58fa7b9fdb7a9638a7acfbbb8fb1761843b57 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 11 Jun 2013 13:16:44 +0100 Subject: [PATCH 11/15] ENH: Added missing typedef --- src/OpenFOAM/fields/Fields/Field/Field.C | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OpenFOAM/fields/Fields/Field/Field.C b/src/OpenFOAM/fields/Fields/Field/Field.C index 334eba8e41..7460dba215 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.C +++ b/src/OpenFOAM/fields/Fields/Field/Field.C @@ -677,6 +677,7 @@ template template void Foam::Field::operator=(const VectorSpace& vs) { + typedef VectorSpace VSType; TFOR_ALL_F_OP_S(Type, *this, =, VSType, vs) } From 3d2a4ece300ef779779575e3c1ec2b7e43bd7979 Mon Sep 17 00:00:00 2001 From: laurence Date: Tue, 11 Jun 2013 14:30:20 +0100 Subject: [PATCH 12/15] ENH: foamyHexMesh: Split location of infinite cells and processor boundary cells --- .../DelaunayMesh/DistributedDelaunayMesh.C | 73 ++++++++++++------- 1 file changed, 48 insertions(+), 25 deletions(-) diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C index 277ed8caf2..2370c16ba3 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/DelaunayMesh/DistributedDelaunayMesh.C @@ -254,31 +254,47 @@ void Foam::DistributedDelaunayMesh::findProcessorBoundaryCells /Pstream::nProcs() ); + std::list infinite_cells; + Triangulation::incident_cells + ( + Triangulation::infinite_vertex(), + std::back_inserter(infinite_cells) + ); + for ( - All_cells_iterator cit = Triangulation::all_cells_begin(); - cit != Triangulation::all_cells_end(); + typename std::list::iterator vcit = infinite_cells.begin(); + vcit != infinite_cells.end(); + ++vcit + ) + { + Cell_handle cit = *vcit; + + // Index of infinite vertex in this cell. + int i = cit->index(Triangulation::infinite_vertex()); + + Cell_handle c = cit->neighbor(i); + + if (c->unassigned()) + { + c->cellIndex() = this->getNewCellIndex(); + + if (checkProcBoundaryCell(c, circumsphereOverlaps)) + { + cellToCheck.insert(c->cellIndex()); + } + } + } + + + for + ( + Finite_cells_iterator cit = Triangulation::finite_cells_begin(); + cit != Triangulation::finite_cells_end(); ++cit ) { - if (Triangulation::is_infinite(cit)) - { - // Index of infinite vertex in this cell. - int i = cit->index(Triangulation::infinite_vertex()); - - Cell_handle c = cit->neighbor(i); - - if (c->unassigned()) - { - c->cellIndex() = this->getNewCellIndex(); - - if (checkProcBoundaryCell(c, circumsphereOverlaps)) - { - cellToCheck.insert(c->cellIndex()); - } - } - } - else if (cit->parallelDualVertex()) + if (cit->parallelDualVertex()) { if (cit->unassigned()) { @@ -315,12 +331,20 @@ void Foam::DistributedDelaunayMesh::findProcessorBoundaryCells continue; } - checkProcBoundaryCell + if ( - citNeighbor, - circumsphereOverlaps - ); + checkProcBoundaryCell + ( + citNeighbor, + circumsphereOverlaps + ) + ) + { + cellToCheck.insert(citNeighbor->cellIndex()); + } } + + cellToCheck.unset(cit->cellIndex()); } } } @@ -521,7 +545,6 @@ Foam::label Foam::DistributedDelaunayMesh::referVertices << originalParallelVertices[vI].procIndex() << " " << originalParallelVertices[vI].index() << endl; } - } } } From f2daad4806e435b23d2bf93356b4cccf93a870f9 Mon Sep 17 00:00:00 2001 From: Henry Date: Tue, 11 Jun 2013 20:10:42 +0100 Subject: [PATCH 13/15] Field: Removed unnecessary typedef which causes gcc-4.8 and latest clang to spew-out hundreds of warning messages --- src/OpenFOAM/fields/Fields/Field/Field.C | 1 - 1 file changed, 1 deletion(-) diff --git a/src/OpenFOAM/fields/Fields/Field/Field.C b/src/OpenFOAM/fields/Fields/Field/Field.C index 7460dba215..334eba8e41 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.C +++ b/src/OpenFOAM/fields/Fields/Field/Field.C @@ -677,7 +677,6 @@ template template void Foam::Field::operator=(const VectorSpace& vs) { - typedef VectorSpace VSType; TFOR_ALL_F_OP_S(Type, *this, =, VSType, vs) } From 58aa5560aa564f557b0422fb46604b6553b2dbe3 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 12 Jun 2013 08:25:47 +0100 Subject: [PATCH 14/15] wallFunctions: corrected fvPatchField to fvPatchScalarField for the return reference --- .../epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C | 2 +- .../omegaWallFunction/omegaWallFunctionFvPatchScalarField.C | 2 +- .../epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C | 2 +- .../omegaWallFunction/omegaWallFunctionFvPatchScalarField.C | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 3f1ab4a2c2..90915d25eb 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -141,7 +141,7 @@ void epsilonWallFunctionFvPatchScalarField::createAveragingWeights() forAll(epsilonPatches, i) { label patchI = epsilonPatches[i]; - const fvPatchField& wf = weights.boundaryField()[patchI]; + const fvPatchScalarField& wf = weights.boundaryField()[patchI]; cornerWeights_[patchI] = 1.0/wf.patchInternalField(); } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 2f4e11dc20..d0d9865c5c 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -143,7 +143,7 @@ void omegaWallFunctionFvPatchScalarField::createAveragingWeights() forAll(omegaPatches, i) { label patchI = omegaPatches[i]; - const fvPatchField& wf = weights.boundaryField()[patchI]; + const fvPatchScalarField& wf = weights.boundaryField()[patchI]; cornerWeights_[patchI] = 1.0/wf.patchInternalField(); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index dc08123d26..da2913f304 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -141,7 +141,7 @@ void epsilonWallFunctionFvPatchScalarField::createAveragingWeights() forAll(epsilonPatches, i) { label patchI = epsilonPatches[i]; - const fvPatchField& wf = weights.boundaryField()[patchI]; + const fvPatchScalarField& wf = weights.boundaryField()[patchI]; cornerWeights_[patchI] = 1.0/wf.patchInternalField(); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 69f8ffd170..9aec38bc38 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -143,7 +143,7 @@ void omegaWallFunctionFvPatchScalarField::createAveragingWeights() forAll(omegaPatches, i) { label patchI = omegaPatches[i]; - const fvPatchField& wf = weights.boundaryField()[patchI]; + const fvPatchScalarField& wf = weights.boundaryField()[patchI]; cornerWeights_[patchI] = 1.0/wf.patchInternalField(); } From 77d8b45dedfce3e4c882f7242fa118a7204bce1c Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 12 Jun 2013 09:38:13 +0100 Subject: [PATCH 15/15] BUG: chemFoam - reverted change to pressure indexing --- .../solvers/combustion/chemFoam/readInitialConditions.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/solvers/combustion/chemFoam/readInitialConditions.H b/applications/solvers/combustion/chemFoam/readInitialConditions.H index b25fd944c5..8e340a7e16 100644 --- a/applications/solvers/combustion/chemFoam/readInitialConditions.H +++ b/applications/solvers/combustion/chemFoam/readInitialConditions.H @@ -87,7 +87,7 @@ forAll(Y, i) { Y[i] = Y0[i]; - h0 += Y0[i]*specieData[i].Hs(p[i], T0); + h0 += Y0[i]*specieData[i].Hs(p[0], T0); } thermo.he() = dimensionedScalar("h", dimEnergy/dimMass, h0);