From e601911fa0bcc460febfaf4c064dc944f44c2df4 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Oct 2012 14:22:58 +0100 Subject: [PATCH 01/14] BUG: basicSymmetry: added to runtime selection tables --- src/finiteVolume/Make/files | 1 - .../basicSymmetry/basicSymmetryFvPatchField.H | 4 -- .../basicSymmetryFvPatchFields.C | 44 ------------------- 3 files changed, 49 deletions(-) delete mode 100644 src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchFields.C diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 6e19f299f0..58c0b57673 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -84,7 +84,6 @@ fvPatchFields = fields/fvPatchFields $(fvPatchFields)/fvPatchField/fvPatchFields.C basicFvPatchFields = $(fvPatchFields)/basic -$(basicFvPatchFields)/basicSymmetry/basicSymmetryFvPatchFields.C $(basicFvPatchFields)/basicSymmetry/basicSymmetryFvPatchScalarField.C $(basicFvPatchFields)/calculated/calculatedFvPatchFields.C $(basicFvPatchFields)/coupled/coupledFvPatchFields.C diff --git a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H index 2e19ff1d2c..6a178ecc47 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H @@ -58,10 +58,6 @@ class basicSymmetryFvPatchField public: - //- Runtime type information - TypeName(symmetryFvPatch::typeName_()); - - // Constructors //- Construct from patch and internal field diff --git a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchFields.C deleted file mode 100644 index 9401581934..0000000000 --- a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchFields.C +++ /dev/null @@ -1,44 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#include "basicSymmetryFvPatchFields.H" -#include "fvPatchFields.H" -#include "volMesh.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -makePatchFields(basicSymmetry); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // From 5f61a90e15dc4e91d8b62b0c5bd58dbc0e910cc0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Oct 2012 14:23:39 +0100 Subject: [PATCH 02/14] BUG: MUSCL: variants added to runtime selection tables under same name as normal muscl --- .../surfaceInterpolation/limitedSchemes/MUSCL/MUSCL.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/MUSCL/MUSCL.C b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/MUSCL/MUSCL.C index 2b23afdabd..f58b91238e 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/MUSCL/MUSCL.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/MUSCL/MUSCL.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,6 +54,7 @@ namespace Foam scalar ) +/* makeLimitedSurfaceInterpolationTypeScheme ( MUSCL, @@ -71,6 +72,7 @@ namespace Foam rhoMagSqr, vector ) +*/ } // ************************************************************************* // From a9226bb5055adc399b9d38edc51cbfb7265fbf3c Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Oct 2012 14:24:27 +0100 Subject: [PATCH 03/14] STYLE: basicSymmetry: updated date --- .../basic/basicSymmetry/basicSymmetryFvPatchField.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H index 6a178ecc47..c6caad802e 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License From 8d4b3253dbb9bef9e12aa2b399ac18bfc92a4904 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Oct 2012 14:25:08 +0100 Subject: [PATCH 04/14] ENH: runTimeSelection: added error printing for multiple entries --- .../construction/runTimeSelectionTables.H | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H index 4576661137..b49ab8ccb9 100644 --- a/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H +++ b/src/OpenFOAM/db/runTimeSelection/construction/runTimeSelectionTables.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -82,7 +82,13 @@ Description ) \ { \ construct##argNames##ConstructorTables(); \ - argNames##ConstructorTablePtr_->insert(lookup, New); \ + if (!argNames##ConstructorTablePtr_->insert(lookup, New)) \ + { \ + std::cerr<< "Duplicate entry " << lookup \ + << " in runtime selection table " << #baseType \ + << std::endl; \ + error::safePrintStack(std::cerr); \ + } \ } \ \ ~add##argNames##ConstructorToTable() \ @@ -167,11 +173,20 @@ Description ) \ { \ construct##argNames##ConstructorTables(); \ - argNames##ConstructorTablePtr_->insert \ + if \ ( \ - lookup, \ - New##baseType \ - ); \ + !argNames##ConstructorTablePtr_->insert \ + ( \ + lookup, \ + New##baseType \ + ) \ + ) \ + { \ + std::cerr<< "Duplicate entry " << lookup \ + << " in runtime selection table " << #baseType \ + << std::endl; \ + error::safePrintStack(std::cerr); \ + } \ } \ \ ~add##argNames##ConstructorToTable() \ From c6fa69d3dbc4d201d35b8ac3b81b2ee49c4c90b3 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Oct 2012 14:27:28 +0100 Subject: [PATCH 05/14] COMP: autoSnapDriverFeature: unused variables --- .../autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C index 7124875465..828ee0e710 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriverFeature.C @@ -1323,7 +1323,7 @@ Foam::labelPair Foam::autoSnapDriver::findNearFeaturePoint patchConstraints[oldPointI] = pointConstraint(); label edgeFeatI; - const pointIndexHit nearInfo = findNearFeatureEdge + findNearFeatureEdge ( pp, snapDist, @@ -1919,7 +1919,7 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges // the old point to attract to nearest edge // instead. label edgeFeatI; - const pointIndexHit nearInfo = findNearFeatureEdge + findNearFeatureEdge ( pp, snapDist, @@ -1950,7 +1950,7 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges // << endl; label featI; - const pointIndexHit nearInfo = findNearFeatureEdge + findNearFeatureEdge ( pp, snapDist, From 297c6c721d16b49e9cf125c517193e50aef7f12e Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Oct 2012 15:03:41 +0100 Subject: [PATCH 06/14] COMP: wallHeatFlux: removed extraneous libraries --- .../utilities/miscellaneous/foamDebugSwitches/Make/options | 1 - .../utilities/postProcessing/wall/wallHeatFlux/Make/options | 1 - 2 files changed, 2 deletions(-) diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options index 43615129c9..6fe40ed9f1 100644 --- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options +++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options @@ -56,7 +56,6 @@ EXE_LIBS = \ -lsolidMixtureProperties \ -lsolidParticle \ -lsolidProperties \ - -lsolid \ -lspecie \ -lsurfaceFilmModels \ -lsurfMesh \ diff --git a/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options b/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options index 38f94e13c7..444af26ce0 100644 --- a/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options +++ b/applications/utilities/postProcessing/wall/wallHeatFlux/Make/options @@ -13,6 +13,5 @@ EXE_LIBS = \ -lfiniteVolume \ -lgenericPatchFields \ -lspecie \ - -lsolid \ -lfluidThermophysicalModels \ -lsolidThermo From 3e39c926698d3a2ca3e1e1a5344d926e22b63c08 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Oct 2012 17:36:59 +0100 Subject: [PATCH 07/14] STYLE: laminar: incorrect comment --- .../compressible/turbulenceModel/laminar/laminar.C | 2 +- .../compressible/turbulenceModel/laminar/laminar.H | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C index 4424aaa88f..aa56d7cfdd 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C +++ b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C @@ -234,7 +234,7 @@ bool laminar::read() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace incompressible +} // End namespace compressible } // End namespace Foam // ************************************************************************* // diff --git a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H index 3b7802b6c5..bead5d06de 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H +++ b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H @@ -164,7 +164,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace incompressible +} // End namespace compressible } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From def233075fd1cd62bdb0478bacd9b048f82d7583 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Oct 2012 17:37:32 +0100 Subject: [PATCH 08/14] STYLE:LRR: correct error message --- src/turbulenceModels/compressible/RAS/LRR/LRR.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.C b/src/turbulenceModels/compressible/RAS/LRR/LRR.C index 175cb8b463..e115680164 100644 --- a/src/turbulenceModels/compressible/RAS/LRR/LRR.C +++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.C @@ -224,7 +224,8 @@ LRR::LRR ( "LRR::LRR" "( const volScalarField&, const volVectorField&" - ", const surfaceScalarField&, incompressibleTransportModel&)" + ", const surfaceScalarField&, fluidThermo&, const word&" + ", const word&)" ) << "couplingFactor = " << couplingFactor_ << " is not in range 0 - 1" << nl << exit(FatalError); From 7f8b070c6bbdff7a127e45fc9dfe2cc1f41a722f Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 4 Oct 2012 17:43:24 +0100 Subject: [PATCH 09/14] ENH: LESdelta: split LESdelta runtime-selection into generic ones and compressible/incompressible --- .../LES/LESdeltas/LESdelta/LESdelta.C | 51 +++++++- .../LES/LESdeltas/LESdelta/LESdelta.H | 12 +- .../compressible/LES/LESModel/LESModel.H | 4 +- .../compressible/LES/Make/files | 1 + .../compressibleLESdelta.C | 66 +++++++++++ .../compressibleLESdelta.H | 109 ++++++++++++++++++ .../LES/vanDriestDelta/vanDriestDelta.H | 6 +- .../incompressible/LES/LESModel/LESModel.H | 4 +- .../incompressible/LES/Make/files | 1 + .../IDDESDelta/IDDESDelta.H | 6 +- .../SpalartAllmarasIDDES.H | 4 +- .../incompressibleLESdelta.C | 66 +++++++++++ .../incompressibleLESdelta.H | 109 ++++++++++++++++++ .../LES/vanDriestDelta/vanDriestDelta.H | 6 +- 14 files changed, 427 insertions(+), 18 deletions(-) create mode 100644 src/turbulenceModels/compressible/LES/compressibleLESdelta/compressibleLESdelta.C create mode 100644 src/turbulenceModels/compressible/LES/compressibleLESdelta/compressibleLESdelta.H create mode 100644 src/turbulenceModels/incompressible/LES/incompressibleLESdelta/incompressibleLESdelta.C create mode 100644 src/turbulenceModels/incompressible/LES/incompressibleLESdelta/incompressibleLESdelta.H diff --git a/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C b/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C index c329bcc692..5a8ff1c3fb 100644 --- a/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C +++ b/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,6 +67,8 @@ Foam::autoPtr Foam::LESdelta::New { const word deltaType(dict.lookup("delta")); + Info<< "Selecting LES delta type " << deltaType << endl; + dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(deltaType); @@ -86,4 +88,51 @@ Foam::autoPtr Foam::LESdelta::New } +Foam::autoPtr Foam::LESdelta::New +( + const word& name, + const fvMesh& mesh, + const dictionary& dict, + const dictionaryConstructorTable& additionalConstructors +) +{ + const word deltaType(dict.lookup("delta")); + + Info<< "Selecting LES delta type " << deltaType << endl; + + // First on additional ones + dictionaryConstructorTable::const_iterator cstrIter = + additionalConstructors.find(deltaType); + + if (cstrIter != additionalConstructors.end()) + { + return autoPtr(cstrIter()(name, mesh, dict)); + } + else + { + dictionaryConstructorTable::const_iterator cstrIter = + dictionaryConstructorTablePtr_->find(deltaType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "LESdelta::New(const fvMesh&, const dictionary&)" + ) << "Unknown LESdelta type " + << deltaType << nl << nl + << "Valid LESdelta types are :" << endl + << additionalConstructors.sortedToc() + << " and " + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + return autoPtr(); + } + else + { + return autoPtr(cstrIter()(name, mesh, dict)); + } + } +} + + // ************************************************************************* // diff --git a/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H b/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H index 9cd15b507b..c84ae74c3b 100644 --- a/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H +++ b/src/turbulenceModels/LES/LESdeltas/LESdelta/LESdelta.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,6 @@ Description SourceFiles LESdelta.C - newDelta.C \*---------------------------------------------------------------------------*/ @@ -111,6 +110,15 @@ public: const dictionary& ); + //- Return a reference to the selected LES delta + static autoPtr New + ( + const word& name, + const fvMesh&, + const dictionary&, + const dictionaryConstructorTable& + ); + //- Destructor virtual ~LESdelta() diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H index f33a1681dc..b7d3c45c0c 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H @@ -51,7 +51,7 @@ SourceFiles #define compressibleLESModel_H #include "compressible/turbulenceModel/turbulenceModel.H" -#include "LESdelta.H" +#include "compressibleLESdelta.H" #include "fvm.H" #include "fvc.H" #include "fvMatrices.H" @@ -86,7 +86,7 @@ protected: dimensionedScalar kMin_; - autoPtr delta_; + autoPtr delta_; // Protected Member Functions diff --git a/src/turbulenceModels/compressible/LES/Make/files b/src/turbulenceModels/compressible/LES/Make/files index 1ed6bd6b4b..58e7485772 100644 --- a/src/turbulenceModels/compressible/LES/Make/files +++ b/src/turbulenceModels/compressible/LES/Make/files @@ -10,6 +10,7 @@ homogeneousDynOneEqEddy/homogeneousDynOneEqEddy.C DeardorffDiffStress/DeardorffDiffStress.C SpalartAllmaras/SpalartAllmaras.C +compressibleLESdelta/compressibleLESdelta.C vanDriestDelta/vanDriestDelta.C LIB = $(FOAM_LIBBIN)/libcompressibleLESModels diff --git a/src/turbulenceModels/compressible/LES/compressibleLESdelta/compressibleLESdelta.C b/src/turbulenceModels/compressible/LES/compressibleLESdelta/compressibleLESdelta.C new file mode 100644 index 0000000000..4b8fbbc44a --- /dev/null +++ b/src/turbulenceModels/compressible/LES/compressibleLESdelta/compressibleLESdelta.C @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#include "compressibleLESdelta.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineRunTimeSelectionTable(LESdelta, dictionary); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +LESdelta::LESdelta(const word& name, const fvMesh& mesh) +: + foamLESdelta(name, mesh) +{} + + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr LESdelta::New +( + const word& name, + const fvMesh& mesh, + const dictionary& dict +) +{ + return foamLESdelta::New(name, mesh, dict, *dictionaryConstructorTablePtr_); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/compressibleLESdelta/compressibleLESdelta.H b/src/turbulenceModels/compressible/LES/compressibleLESdelta/compressibleLESdelta.H new file mode 100644 index 0000000000..56d1437cc2 --- /dev/null +++ b/src/turbulenceModels/compressible/LES/compressibleLESdelta/compressibleLESdelta.H @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\/ 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::compressible::LESdelta + +Description + Abstract base class for compressible LES deltas + +SourceFiles + compressibleLESdelta.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleLESdelta_H +#define compressibleLESdelta_H + +#include "LESdelta.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// To avoid macro problems typedef scoped class +typedef Foam::LESdelta foamLESdelta; + +namespace compressible +{ + +/*---------------------------------------------------------------------------*\ + Class LESdelta Declaration +\*---------------------------------------------------------------------------*/ + +class LESdelta +: + public foamLESdelta +{ + +public: + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + foamLESdelta, + dictionary, + ( + const word& name, + const fvMesh& mesh, + const dictionary& LESdeltaDict + ), + (name, mesh, LESdeltaDict) + ); + + // Constructors + + //- Construct from name and mesh + LESdelta(const word& name, const fvMesh& mesh); + + + // Selectors + + //- Return a reference to the selected LES delta + static autoPtr New + ( + const word& name, + const fvMesh& mesh, + const dictionary& dict + ); + + + //- Destructor + virtual ~LESdelta() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/vanDriestDelta/vanDriestDelta.H b/src/turbulenceModels/compressible/LES/vanDriestDelta/vanDriestDelta.H index cc8158cb07..88e26c7554 100644 --- a/src/turbulenceModels/compressible/LES/vanDriestDelta/vanDriestDelta.H +++ b/src/turbulenceModels/compressible/LES/vanDriestDelta/vanDriestDelta.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,7 +35,7 @@ SourceFiles #ifndef vanDriestDelta_H #define vanDriestDelta_H -#include "LESdelta.H" +#include "compressibleLESdelta.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,7 +56,7 @@ class vanDriestDelta { // Private data - autoPtr geometricDelta_; + autoPtr geometricDelta_; scalar kappa_; scalar Aplus_; scalar Cdelta_; diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H index 3a9af24df8..090644855f 100644 --- a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H @@ -51,7 +51,7 @@ SourceFiles #define incompressibleLESModel_H #include "incompressible/turbulenceModel/turbulenceModel.H" -#include "LESdelta.H" +#include "incompressibleLESdelta.H" #include "fvm.H" #include "fvc.H" #include "fvMatrices.H" @@ -86,7 +86,7 @@ protected: dimensionedScalar kMin_; - autoPtr delta_; + autoPtr delta_; // Protected Member Functions diff --git a/src/turbulenceModels/incompressible/LES/Make/files b/src/turbulenceModels/incompressible/LES/Make/files index c41aefe994..6d4e3cb4d7 100644 --- a/src/turbulenceModels/incompressible/LES/Make/files +++ b/src/turbulenceModels/incompressible/LES/Make/files @@ -1,3 +1,4 @@ +incompressibleLESdelta/incompressibleLESdelta.C vanDriestDelta/vanDriestDelta.C LESModel/LESModel.C diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.H b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.H index 4c8302de7d..0274a192f9 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.H +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,7 @@ SourceFiles #ifndef IDDESDeltaDelta_H #define IDDESDeltaDelta_H -#include "LESdelta.H" +#include "incompressibleLESdelta.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,7 +54,7 @@ class IDDESDelta { // Private data - autoPtr hmax_; + autoPtr hmax_; scalar deltaCoeff_; scalar cw_; diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.H b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.H index fc31252782..c2565efb50 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.H +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/SpalartAllmarasIDDES.H @@ -61,8 +61,8 @@ class SpalartAllmarasIDDES // Model constants - autoPtr hmax_; - autoPtr IDDESDelta_; + autoPtr hmax_; + autoPtr IDDESDelta_; dimensionedScalar fwStar_; dimensionedScalar cl_; dimensionedScalar ct_; diff --git a/src/turbulenceModels/incompressible/LES/incompressibleLESdelta/incompressibleLESdelta.C b/src/turbulenceModels/incompressible/LES/incompressibleLESdelta/incompressibleLESdelta.C new file mode 100644 index 0000000000..daa17b6406 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/incompressibleLESdelta/incompressibleLESdelta.C @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#include "incompressibleLESdelta.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace incompressible +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineRunTimeSelectionTable(LESdelta, dictionary); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +LESdelta::LESdelta(const word& name, const fvMesh& mesh) +: + foamLESdelta(name, mesh) +{} + + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr LESdelta::New +( + const word& name, + const fvMesh& mesh, + const dictionary& dict +) +{ + return foamLESdelta::New(name, mesh, dict, *dictionaryConstructorTablePtr_); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/incompressibleLESdelta/incompressibleLESdelta.H b/src/turbulenceModels/incompressible/LES/incompressibleLESdelta/incompressibleLESdelta.H new file mode 100644 index 0000000000..ca1d5240f3 --- /dev/null +++ b/src/turbulenceModels/incompressible/LES/incompressibleLESdelta/incompressibleLESdelta.H @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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::incompressible::LESdelta + +Description + Abstract base class for incompressible LES deltas + +SourceFiles + incompressibleLESdelta.C + +\*---------------------------------------------------------------------------*/ + +#ifndef incompressibleLESdelta_H +#define incompressibleLESdelta_H + +#include "LESdelta.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// To avoid macro problems typedef scoped class +typedef Foam::LESdelta foamLESdelta; + +namespace incompressible +{ + +/*---------------------------------------------------------------------------*\ + Class LESdelta Declaration +\*---------------------------------------------------------------------------*/ + +class LESdelta +: + public foamLESdelta +{ + +public: + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + foamLESdelta, + dictionary, + ( + const word& name, + const fvMesh& mesh, + const dictionary& LESdeltaDict + ), + (name, mesh, LESdeltaDict) + ); + + // Constructors + + //- Construct from name and mesh + LESdelta(const word& name, const fvMesh& mesh); + + + // Selectors + + //- Return a reference to the selected LES delta + static autoPtr New + ( + const word& name, + const fvMesh& mesh, + const dictionary& dict + ); + + + //- Destructor + virtual ~LESdelta() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace incompressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.H b/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.H index 2e465b8851..217f86e9de 100644 --- a/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.H +++ b/src/turbulenceModels/incompressible/LES/vanDriestDelta/vanDriestDelta.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,7 +35,7 @@ SourceFiles #ifndef vanDriestDelta_H #define vanDriestDelta_H -#include "LESdelta.H" +#include "incompressibleLESdelta.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,7 +56,7 @@ class vanDriestDelta { // Private data - autoPtr geometricDelta_; + autoPtr geometricDelta_; scalar kappa_; scalar Aplus_; scalar Cdelta_; From e9e09f11dc863f8d27f5a2fbcf1dc2a9dea2dbe0 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 4 Oct 2012 18:10:15 +0100 Subject: [PATCH 10/14] rhoCentralFoam: Corrected output of maxwellSlipUFvPatchVectorField BC --- .../rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index c65d8618f1..875e42683e 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -195,10 +195,8 @@ void maxwellSlipUFvPatchVectorField::write(Ostream& os) const << thermalCreep_ << token::END_STATEMENT << nl; os.writeKeyword("curvature") << curvature_ << token::END_STATEMENT << nl; - os.writeKeyword("refValue") - << refValue() << token::END_STATEMENT << nl; - os.writeKeyword("valueFraction") - << valueFraction() << token::END_STATEMENT << nl; + refValue().writeEntry("refValue", os); + valueFraction().writeEntry("valueFraction", os); writeEntry("value", os); } From c6eea6990fed7afc82b42f368902898e6dde1ecb Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 4 Oct 2012 18:10:26 +0100 Subject: [PATCH 11/14] specieThermo: Add guard in K(T) to protect against 0 moles in composition --- .../specie/thermo/thermo/thermoI.H | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/thermophysicalModels/specie/thermo/thermo/thermoI.H b/src/thermophysicalModels/specie/thermo/thermo/thermoI.H index b8642e960b..21a58ec779 100644 --- a/src/thermophysicalModels/specie/thermo/thermo/thermoI.H +++ b/src/thermophysicalModels/specie/thermo/thermo/thermoI.H @@ -298,15 +298,22 @@ template class Type> inline Foam::scalar Foam::species::thermo::K(const scalar p, const scalar T) const { - scalar arg = -this->nMoles()*this->g(p, T)/(this->RR*T); - - if (arg < 600.0) + if (equal(this->nMoles(), SMALL)) { - return ::exp(arg); + return 1.0; } else { - return VGREAT; + scalar arg = -this->nMoles()*this->g(p, T)/(this->RR*T); + + if (arg < 600.0) + { + return exp(arg); + } + else + { + return VGREAT; + } } } From 8cba140e1761aa3c969eab27cf9c1d2e3789561d Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 5 Oct 2012 11:11:54 +0100 Subject: [PATCH 12/14] ENH: regionSplit: make MeshObject --- src/meshTools/regionSplit/regionSplit.C | 50 ++++++++++++------------- src/meshTools/regionSplit/regionSplit.H | 9 +++-- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/meshTools/regionSplit/regionSplit.C b/src/meshTools/regionSplit/regionSplit.C index 77e1ca4346..70b0759c71 100644 --- a/src/meshTools/regionSplit/regionSplit.C +++ b/src/meshTools/regionSplit/regionSplit.C @@ -69,7 +69,7 @@ void Foam::regionSplit::transferCoupledFaceRegion "regionSplit::transferCoupledFaceRegion" "(const label, const label, labelList&, labelList&) const" ) << "Problem : coupled face " << faceI - << " on patch " << mesh_.boundaryMesh().whichPatch(faceI) + << " on patch " << mesh().boundaryMesh().whichPatch(faceI) << " has region " << faceRegion[faceI] << " but coupled face " << otherFaceI << " has region " << faceRegion[otherFaceI] @@ -109,7 +109,7 @@ void Foam::regionSplit::fillSeedMask // Collect faces on seed cell - const cell& cFaces = mesh_.cells()[seedCellID]; + const cell& cFaces = mesh().cells()[seedCellID]; label nFaces = 0; @@ -144,7 +144,7 @@ void Foam::regionSplit::fillSeedMask { label faceI = changedFaces[i]; - label own = mesh_.faceOwner()[faceI]; + label own = mesh().faceOwner()[faceI]; if (cellRegion[own] == -1) { @@ -152,9 +152,9 @@ void Foam::regionSplit::fillSeedMask changedCells.append(own); } - if (mesh_.isInternalFace(faceI)) + if (mesh().isInternalFace(faceI)) { - label nei = mesh_.faceNeighbour()[faceI]; + label nei = mesh().faceNeighbour()[faceI]; if (cellRegion[nei] == -1) { @@ -178,7 +178,7 @@ void Foam::regionSplit::fillSeedMask { label cellI = changedCells[i]; - const cell& cFaces = mesh_.cells()[cellI]; + const cell& cFaces = mesh().cells()[cellI]; forAll(cFaces, cFaceI) { @@ -203,7 +203,7 @@ void Foam::regionSplit::fillSeedMask // Check for changes to any locally coupled face. // Global connections are done later. - const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + const polyBoundaryMesh& patches = mesh().boundaryMesh(); forAll(patches, patchI) { @@ -274,7 +274,7 @@ Foam::label Foam::regionSplit::calcLocalRegionSplit { // Check that blockedFace is synced. boolList syncBlockedFace(blockedFace); - syncTools::swapFaceList(mesh_, syncBlockedFace); + syncTools::swapFaceList(mesh(), syncBlockedFace); forAll(syncBlockedFace, faceI) { @@ -295,7 +295,7 @@ Foam::label Foam::regionSplit::calcLocalRegionSplit // Region per face. // -1 unassigned // -2 blocked - labelList faceRegion(mesh_.nFaces(), -1); + labelList faceRegion(mesh().nFaces(), -1); if (blockedFace.size()) { @@ -321,7 +321,7 @@ Foam::label Foam::regionSplit::calcLocalRegionSplit { // Find first unset cell - for (; unsetCellI < mesh_.nCells(); unsetCellI++) + for (; unsetCellI < mesh().nCells(); unsetCellI++) { if (cellRegion[unsetCellI] == -1) { @@ -329,7 +329,7 @@ Foam::label Foam::regionSplit::calcLocalRegionSplit } } - if (unsetCellI >= mesh_.nCells()) + if (unsetCellI >= mesh().nCells()) { break; } @@ -430,9 +430,9 @@ Foam::autoPtr Foam::regionSplit::calcRegionSplit } - const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + const polyBoundaryMesh& patches = mesh().boundaryMesh(); - labelList nbrRegion(mesh_.nFaces()-mesh_.nInternalFaces(), -1); + labelList nbrRegion(mesh().nFaces()-mesh().nInternalFaces(), -1); forAll(patches, patchI) { const polyPatch& pp = patches[patchI]; @@ -444,7 +444,7 @@ Foam::autoPtr Foam::regionSplit::calcRegionSplit ( nbrRegion, pp.size(), - pp.start()-mesh_.nInternalFaces() + pp.start()-mesh().nInternalFaces() ); forAll(patchCells, i) @@ -457,9 +457,9 @@ Foam::autoPtr Foam::regionSplit::calcRegionSplit } } } - syncTools::swapBoundaryFaceList(mesh_, nbrRegion); + syncTools::swapBoundaryFaceList(mesh(), nbrRegion); - Map