From f58f6966e18f0cccec7193b316848c7156ecd60b Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 3 Sep 2013 12:17:10 +0100 Subject: [PATCH 01/23] BUG: Corrected doxygen tag usage --- .../oscillatingFixedValueFvPatchField.H | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H index da45cdcb85..949d481cea 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingFixedValueFvPatchField.H @@ -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 @@ -31,9 +31,9 @@ Description This boundary condition provides an oscillating condition in terms of amplitude and frequency. - /f[ + \f[ x_p = (1 + a sin(\pi f t))x_{ref} + x_o - /f] + \f] where From 11f8a670bf877c19f4d426ff78332aefb4ab54f1 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 3 Sep 2013 12:18:47 +0100 Subject: [PATCH 02/23] STYLE: Corrected spelling --- applications/solvers/heatTransfer/thermoFoam/thermoFoam.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C b/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C index f5f88232d2..f765ca86e8 100644 --- a/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C +++ b/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C @@ -25,7 +25,7 @@ Application thermoFoam Description - Evolves the thermodynamics on a forzen flow field + Evolves the thermodynamics on a frozen flow field \*---------------------------------------------------------------------------*/ From dcc33e748645c91af6fc40388c54155eac7d09db Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 3 Sep 2013 16:43:41 +0100 Subject: [PATCH 03/23] ENH: radiationModel - Added error message is request for inactive sub-model --- .../radiationModel/radiationModel/radiationModel.C | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C index 48cd417860..66cdfb99ad 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C @@ -250,6 +250,17 @@ Foam::tmp Foam::radiation::radiationModel::ST const Foam::radiation::absorptionEmissionModel& Foam::radiation::radiationModel::absorptionEmission() const { + if (!absorptionEmission_.valid()) + { + FatalErrorIn + ( + "const Foam::radiation::absorptionEmissionModel&" + "Foam::radiation::radiationModel::absorptionEmission() const" + ) + << "Requested radiation absorptionEmission model, but model is " + << "not activate" << abort(FatalError); + } + return absorptionEmission_(); } From 38c6d88b9f66f423d0b74839e196f7a9002ed32f Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 3 Sep 2013 16:44:02 +0100 Subject: [PATCH 04/23] STYLE: Updated function comment --- .../radiationModel/radiationModel/radiationModel.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H index d4c39bd958..a62821586c 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H @@ -231,7 +231,7 @@ public: volScalarField& T ) const; - //- Access to absorptionEmissionModel + //- Access to absorptionEmission model const absorptionEmissionModel& absorptionEmission() const; }; From 16e00bda6d52d68882951f0daf2a677a9106e482 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 4 Sep 2013 09:27:41 +0100 Subject: [PATCH 05/23] ENH: Tutorial updates --- .../les/oppositeBurningPanels/constant/reactingCloud1Properties | 1 - .../les/smallPoolFire2D/constant/reactingCloud1Properties | 1 - .../les/smallPoolFire3D/constant/reactingCloud1Properties | 1 - 3 files changed, 3 deletions(-) diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/reactingCloud1Properties b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/reactingCloud1Properties index 9228607e91..87e8b7ae0d 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/reactingCloud1Properties +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/reactingCloud1Properties @@ -63,7 +63,6 @@ constantProperties epsilon0 1; f0 0.5; - Pr 0.7; constantVolume false; } diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/reactingCloud1Properties b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/reactingCloud1Properties index 9228607e91..87e8b7ae0d 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/reactingCloud1Properties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/reactingCloud1Properties @@ -63,7 +63,6 @@ constantProperties epsilon0 1; f0 0.5; - Pr 0.7; constantVolume false; } diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/reactingCloud1Properties b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/reactingCloud1Properties index 9228607e91..87e8b7ae0d 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/reactingCloud1Properties +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/reactingCloud1Properties @@ -63,7 +63,6 @@ constantProperties epsilon0 1; f0 0.5; - Pr 0.7; constantVolume false; } From f41faf5fcf2ceb0dc05d4b825b43518f30b1b0c9 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 4 Sep 2013 12:33:47 +0100 Subject: [PATCH 06/23] STYLE: autoSnapDriver: message indenting --- .../autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C index 822592771c..53e63e9e44 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C @@ -1835,7 +1835,8 @@ void Foam::autoSnapDriver::doSnap { WarningIn("autoSnapDriver::doSnap(..)") << "Did not succesfully snap mesh." - << " Continuing to snap to resolve easy surfaces but the" + << " Continuing to snap to resolve easy" << nl + << " surfaces but the" << " resulting mesh will not satisfy your quality" << " constraints" << nl << endl; //Info<< "Did not succesfully snap mesh. Giving up." From 03d6e6585adb966c419c3da9cd53f8eaa8b828b1 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 4 Sep 2013 12:34:08 +0100 Subject: [PATCH 07/23] BUG: autoLayerDriver: initialisation of face merge candidates --- .../autoHexMesh/autoHexMeshDriver/autoLayerDriver.C | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index 1d9ecc0bc7..cd0ebafc3a 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -2450,17 +2450,17 @@ void Foam::autoLayerDriver::mergePatchFacesUndo const dictionary& motionDict ) { - scalar minCos = - Foam::cos(degToRad(layerParams.featureAngle())); + // Clip to 45 degrees + scalar planarAngle = min(45.0, layerParams.featureAngle()); + scalar minCos = Foam::cos(degToRad(planarAngle)); - scalar concaveCos = - Foam::cos(degToRad(layerParams.concaveAngle())); + scalar concaveCos = Foam::cos(degToRad(layerParams.concaveAngle())); Info<< nl << "Merging all faces of a cell" << nl << "---------------------------" << nl << " - which are on the same patch" << nl - << " - which make an angle < " << layerParams.featureAngle() + << " - which make an angle < " << planarAngle << " degrees" << nl << " (cos:" << minCos << ')' << nl @@ -2478,7 +2478,7 @@ void Foam::autoLayerDriver::mergePatchFacesUndo concaveCos, meshRefiner_.meshedPatches(), motionDict, - labelList(mesh.nFaces() -1) + labelList(mesh.nFaces(), -1) ); nChanged += meshRefiner_.mergeEdgesUndo(minCos, motionDict); From 714799612e19c9cb16f6519988f4ed00d121d9eb Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 4 Sep 2013 16:23:49 +0100 Subject: [PATCH 08/23] ENH: surfaceFeatureExtract: skip non-dictionary entries. --- .../surfaceFeatureExtract/surfaceFeatureExtract.C | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C index 407828e038..a20e5da42b 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C +++ b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C @@ -952,8 +952,20 @@ int main(int argc, char *argv[]) forAllConstIter(dictionary, dict, iter) { + if (!iter().isDict()) + { + continue; + } + const dictionary& surfaceDict = iter().dict(); + if (surfaceDict.found("extractionMethod")) + { + continue; + } + + const word extractionMethod = surfaceDict.lookup("extractionMethod"); + const fileName surfFileName = iter().keyword(); const fileName sFeatFileName = surfFileName.lessExt().name(); @@ -971,8 +983,6 @@ int main(int argc, char *argv[]) const Switch closeness = surfaceDict.lookupOrDefault("closeness", "off"); - const word extractionMethod = surfaceDict.lookup("extractionMethod"); - Info<< nl << "Feature line extraction is only valid on closed manifold " << "surfaces." << endl; From 71528efa1346570cd0843d8877de3d9c1a3bffb9 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 5 Sep 2013 09:50:44 +0100 Subject: [PATCH 09/23] BUG: surfaceFeatureExtract: checking for valid dictionary --- .../surface/surfaceFeatureExtract/surfaceFeatureExtract.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C index a20e5da42b..58f321297b 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C +++ b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C @@ -959,7 +959,7 @@ int main(int argc, char *argv[]) const dictionary& surfaceDict = iter().dict(); - if (surfaceDict.found("extractionMethod")) + if (!surfaceDict.found("extractionMethod")) { continue; } From c40460644fb3ac375f3b790a5a322ed8e030de90 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 5 Sep 2013 09:52:34 +0100 Subject: [PATCH 10/23] ENH: snappyHexMesh: move writeLevel into snappyHexMeshDict --- .../mesh/generation/snappyHexMesh/snappyHexMesh.C | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 4bef61c5e4..e280fdd1b9 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -614,11 +614,6 @@ int main(int argc, char *argv[]) "boundBox", "simplify the surface using snappyHexMesh starting from a boundBox" ); - Foam::argList::addBoolOption - ( - "writeLevel", - "write pointLevel and cellLevel postprocessing files" - ); Foam::argList::addOption ( "patches", @@ -640,7 +635,6 @@ int main(int argc, char *argv[]) const bool overwrite = args.optionFound("overwrite"); const bool checkGeometry = args.optionFound("checkGeometry"); const bool surfaceSimplify = args.optionFound("surfaceSimplify"); - const bool writeLevel = args.optionFound("writeLevel"); autoPtr meshPtr; @@ -852,6 +846,8 @@ int main(int argc, char *argv[]) autoLayerDriver::debug = debug; } + const bool writeLevel = meshDict.lookupOrDefault("writeLevel", false); + // Read geometry // ~~~~~~~~~~~~~ From 185eded8d29f2a268940128a11cae69d71a9b781 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 5 Sep 2013 12:11:15 +0100 Subject: [PATCH 11/23] ENH: doxygenXmlParser - replaced recursion --- .../doxygenXmlParser/doxygenXmlParser.C | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C index ac9c639c49..b3cc2da3e6 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/doxygenXmlParser/doxygenXmlParser.C @@ -213,25 +213,21 @@ void Foam::doxygenXmlParser::skipForward ) const { // recurse to move forward in 'is' until come across - - // fast-forward until we reach a '<' - char c; - while (is.get(c) && c != '<') - {} - string entryName = ""; - while (is.get(c) && c != '>') - { - entryName = entryName + c; - } + char c; - if (entryName == blockName) + while (is.good() && (entryName != blockName)) { - return; - } - else - { - skipForward(is, blockName); + entryName = ""; + + // fast-forward until we reach a '<' + while (is.get(c) && c != '<') + {} + + while (is.get(c) && c != '>') + { + entryName = entryName + c; + } } } From bbf1ac73833caad68a8040f436333aad65b2645b Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 5 Sep 2013 13:39:58 +0100 Subject: [PATCH 12/23] ENH: fvPatchField: move mapping of exposed faces to fvPatchField. --- .../fvPatchFields/fvPatchField/fvPatchField.C | 44 +++- .../fvMeshSubset/fvMeshSubsetInterpolate.C | 196 +++++++++++------- 2 files changed, 161 insertions(+), 79 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index 7fd83f41b1..3059eb5eea 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -79,7 +79,49 @@ Foam::fvPatchField::fvPatchField updated_(false), manipulatedMatrix_(false), patchType_(ptf.patchType_) -{} +{ + // For unmapped faces set to internal field value (zero-gradient) + if (&iF && iF.size()) + { + Field& f = *this; + + if + ( + mapper.direct() + && &mapper.directAddressing() + && mapper.directAddressing().size() + ) + { + Field pif(this->patchInternalField()); + + const labelList& mapAddressing = mapper.directAddressing(); + + forAll(mapAddressing, i) + { + if (mapAddressing[i] < 0) + { + f[i] = pif[i]; + } + } + } + else if (!mapper.direct() && mapper.addressing().size()) + { + Field pif(this->patchInternalField()); + + const labelListList& mapAddressing = mapper.addressing(); + + forAll(mapAddressing, i) + { + const labelList& localAddrs = mapAddressing[i]; + + if (!localAddrs.size()) + { + f[i] = pif[i]; + } + } + } + } +} template diff --git a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.C b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.C index 7ee0d53577..b389c5afce 100644 --- a/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.C +++ b/src/finiteVolume/fvMesh/fvMeshSubset/fvMeshSubsetInterpolate.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 @@ -45,16 +45,13 @@ tmp > fvMeshSubset::interpolate const labelList& faceMap ) { - // Create and map the internal-field values - Field internalField(vf.internalField(), cellMap); - - // Create and map the patch field values + // 1. Create the complete field with dummy patch fields PtrList > patchFields(patchMap.size()); forAll(patchFields, patchI) { // Set the first one by hand as it corresponds to the - // exposed internal faces. Additional interpolation can be put here + // exposed internal faces. Additional interpolation can be put here // as necessary. if (patchMap[patchI] == -1) { @@ -69,6 +66,49 @@ tmp > fvMeshSubset::interpolate ); } else + { + patchFields.set + ( + patchI, + new calculatedFvPatchField + ( + sMesh.boundary()[patchI], + DimensionedField::null() + ) + ); + } + } + + tmp > tresF + ( + new GeometricField + ( + IOobject + ( + "subset"+vf.name(), + sMesh.time().timeName(), + sMesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + sMesh, + vf.dimensions(), + Field(vf.internalField(), cellMap), + patchFields + ) + ); + GeometricField& resF = tresF(); + + + // 2. Change the fvPatchFields to the correct type using a mapper + // constructor (with reference to the now correct internal field) + + typename GeometricField:: + GeometricBoundaryField& bf = resF.boundaryField(); + + forAll(bf, patchI) + { + if (patchMap[patchI] != -1) { // Construct addressing const fvPatch& subPatch = sMesh.boundary()[patchI]; @@ -88,49 +128,26 @@ tmp > fvMeshSubset::interpolate } else { - // Mapped from internal face. Do what? Map from element - // 0 for now. - directAddressing[i] = 0; + // Mapped from internal face. Do what? Leave up to + // fvPatchField + directAddressing[i] = -1; } } - patchFields.set + bf.set ( patchI, fvPatchField::New ( vf.boundaryField()[patchMap[patchI]], - sMesh.boundary()[patchI], - DimensionedField::null(), + subPatch, + resF.dimensionedInternalField(), patchFieldSubset(directAddressing) ) ); - - // What to do with exposed internal faces if put into this patch? } } - - // Create the complete field from the pieces - tmp > tresF - ( - new GeometricField - ( - IOobject - ( - "subset"+vf.name(), - sMesh.time().timeName(), - sMesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - sMesh, - vf.dimensions(), - internalField, - patchFields - ) - ); - return tresF; } @@ -161,24 +178,13 @@ tmp > fvMeshSubset::interpolate const labelList& faceMap ) { - // Create and map the internal-field values - Field internalField - ( - vf.internalField(), - SubList