From 6f2e475ba7cf2f2345f32519b2a124d513305704 Mon Sep 17 00:00:00 2001 From: Sergio Ferraris Date: Tue, 9 Apr 2013 09:45:38 +0100 Subject: [PATCH 01/14] BUG: Adding entry to the table for solidChemistryModels and correcting chemistryThermo entry in chemistryProperties for pyrolisis --- .../basicSolidChemistryModelNew.C | 8 +++++--- .../constant/panelRegion/chemistryProperties | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C index adf318299f..523fff0305 100644 --- a/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C +++ b/src/thermophysicalModels/solidChemistryModel/basicSolidChemistryModel/basicSolidChemistryModelNew.C @@ -53,11 +53,12 @@ New Info<< "Selecting chemistry type " << chemistryTypeDict << endl; - const int nCmpt = 12; + const int nCmpt = 13; const char* cmptNames[nCmpt] = { "chemistrySolver", "chemistryThermo", + "baseChemistry", "transport", "thermo", "equationOfState", @@ -107,8 +108,9 @@ New word chemistryTypeName ( word(chemistryTypeDict.lookup("chemistrySolver")) + '<' - + word(chemistryTypeDict.lookup("chemistryThermo")) + ',' - + solidThermoTypeName + ',' + gasThermoTypeName + ">" + + word(chemistryTypeDict.lookup("chemistryThermo")) + '<' + + typeName + ',' + + solidThermoTypeName + ',' + gasThermoTypeName + ">>" ); Info<< "chemistryTypeName " << chemistryTypeName << endl; diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/panelRegion/chemistryProperties b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/panelRegion/chemistryProperties index 9f8ecdd196..dd30353e69 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/panelRegion/chemistryProperties +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/panelRegion/chemistryProperties @@ -18,7 +18,7 @@ FoamFile chemistryType { chemistrySolver ode; - chemistryThermo pyrolysis; + chemistryThermo pyrolysisChemistryModel; } chemistry on; From 99eee3c0d631ba4319b53effd7c8974c6f6b748f Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 9 Apr 2013 16:26:08 +0100 Subject: [PATCH 02/14] ENH: Better handling for regExp usage in sampledSurfaces --- .../sampledSurfacesTemplates.C | 44 ++++++++----------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C index e6ba8d42f1..35880afafa 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C @@ -168,18 +168,32 @@ void Foam::sampledSurfaces::sampleAndWrite template void Foam::sampledSurfaces::sampleAndWrite(const IOobjectList& objects) { + wordList names; if (loadFromFiles_) { IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName)); + names = fieldObjects.names(); + } + else + { + names = mesh_.thisDb().names(); + } - wordList names(fieldObjects.names()); + labelList nameIDs(findStrings(fieldSelection_, names)); - labelList fieldNames(findStrings(fieldSelection_, names)); + wordHashSet fieldNames(wordList(names, nameIDs)); - forAll(fieldNames, fieldI) + forAllConstIter(wordHashSet, fieldNames, iter) + { + const word& fieldName = iter.key(); + + if ((Pstream::master()) && verbose_) { - const word& fieldName = names[fieldNames[fieldI]]; + Pout<< "sampleAndWrite: " << fieldName << endl; + } + if (loadFromFiles_) + { const GeoField fld ( IOobject @@ -192,30 +206,10 @@ void Foam::sampledSurfaces::sampleAndWrite(const IOobjectList& objects) mesh_ ); - if ((Pstream::master()) && verbose_) - { - Pout<< "sampleAndWrite: " << fieldName << endl; - } - sampleAndWrite(fld); } - } - else - { - const wordList fieldNames - ( - mesh_.thisDb().names(fieldSelection_) - ); - - forAll(fieldNames, i) + else { - const word& fieldName = fieldNames[i]; - - if ((Pstream::master()) && verbose_) - { - Pout<< "sampleAndWrite: " << fieldName << endl; - } - sampleAndWrite ( mesh_.thisDb().lookupObject(fieldName) From a97ff291c0c891d07d84255d83a48d5e3e42a4a1 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 9 Apr 2013 17:53:12 +0100 Subject: [PATCH 03/14] STYLE: Minor code formatting --- .../constraint/processorCyclic/processorCyclicPolyPatch.H | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H index 0b9d4f70d9..76a833ba61 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H @@ -45,7 +45,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class processorCyclicPolyPatch Declaration + Class processorCyclicPolyPatch Declaration \*---------------------------------------------------------------------------*/ class processorCyclicPolyPatch @@ -63,8 +63,6 @@ class processorCyclicPolyPatch //- Index of originating patch mutable label referPatchID_; - // Private member functions - protected: @@ -223,8 +221,7 @@ public: // Destructor - - virtual ~processorCyclicPolyPatch(); + virtual ~processorCyclicPolyPatch(); // Member functions From eecbe11085d87204b69651e650d2d01a63535e4d Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 10 Apr 2013 12:15:47 +0100 Subject: [PATCH 04/14] CentredFitSnGrad: Change deltaCoeffs -> nonOrthDeltaCoeffs for very non-orthogonal meshes --- .../CentredFitSnGrad/CentredFitSnGradData.C | 4 +--- .../CentredFitSnGrad/CentredFitSnGradData.H | 3 ++- .../CentredFitSnGrad/CentredFitSnGradScheme.H | 23 ++++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradData.C b/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradData.C index 135deac4bf..36a363ea1f 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradData.C +++ b/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradData.C @@ -25,9 +25,7 @@ License #include "CentredFitSnGradData.H" #include "surfaceFields.H" -#include "volFields.H" #include "SVD.H" -#include "syncTools.H" #include "extendedCentredCellToFaceStencil.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -226,7 +224,7 @@ void Foam::CentredFitSnGradData::calcFit() // find the fit coefficients for every face in the mesh const surfaceScalarField& w = mesh.surfaceInterpolation::weights(); - const surfaceScalarField& dC = mesh.deltaCoeffs(); + const surfaceScalarField& dC = mesh.nonOrthDeltaCoeffs(); for (label facei = 0; facei < mesh.nInternalFaces(); facei++) { diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradData.H b/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradData.H index c025a17dd5..be834684a7 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradData.H +++ b/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradData.H @@ -25,7 +25,7 @@ Class Foam::CentredFitSnGradData Description - Data for the quadratic fit correction interpolation scheme + Data for centred fit snGrad schemes SourceFiles CentredFitSnGradData.C @@ -64,6 +64,7 @@ class CentredFitSnGradData // values of the stencil to obtain the gradient for each direction List coeffs_; + public: TypeName("CentredFitSnGradData"); diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradScheme.H b/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradScheme.H index ca307811e6..d92478c317 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradScheme.H +++ b/src/finiteVolume/finiteVolume/snGradSchemes/CentredFitSnGrad/CentredFitSnGradScheme.H @@ -100,7 +100,7 @@ public: const GeometricField& ) const { - return this->mesh().deltaCoeffs(); + return this->mesh().nonOrthDeltaCoeffs(); } //- Return true if this scheme uses an explicit correction @@ -124,18 +124,18 @@ public: ); const CentredFitSnGradData& cfd = - CentredFitSnGradData::New - ( - mesh, - stencil, - linearLimitFactor_, - centralWeight_ - ); - - const List& f = cfd.coeffs(); + CentredFitSnGradData::New + ( + mesh, + stencil, + linearLimitFactor_, + centralWeight_ + ); tmp > sft - = stencil.weightedSum(vf, f); + ( + stencil.weightedSum(vf, cfd.coeffs()) + ); sft().dimensions() /= dimLength; @@ -143,6 +143,7 @@ public: } }; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace fv From 7e376c96851307ea72ca758748cd7cacc9032a9e Mon Sep 17 00:00:00 2001 From: laurence Date: Wed, 10 Apr 2013 16:35:39 +0100 Subject: [PATCH 05/14] BUG: extendedFeatureEdgeMesh: Swap feature point algorithm for a faster one The population of featurePointFeatureEdges was slow. Added a List called edgeMap that contains the featureEdge index for every edge in a patch (returns -1 if it is not a feature edge). --- .../extendedFeatureEdgeMeshTemplates.C | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C b/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C index 63cef912b1..ecc049995b 100644 --- a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C +++ b/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C @@ -65,8 +65,7 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges labelListList featurePointFeatureEdges(nFeatPts); forAll(featurePointFeatureEdges, pI) { - featurePointFeatureEdges[pI] = - labelList(pointEdges[featurePoints[pI]].size(), -1); + featurePointFeatureEdges[pI] = pointEdges[featurePoints[pI]]; } // Mapping between old and new indices, there is entry in the map for each @@ -74,6 +73,10 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges // >= 0 corresponds to the index labelList pointMap(sFeatLocalPts.size(), -1); + // Mapping between surface edge index and its feature edge index. -1 if it + // is not a feature edge + labelList edgeMap(sFeatEds.size(), -1); + // Noting when the normal of a face has been used so not to duplicate labelList faceMap(surf.size(), -1); @@ -98,6 +101,8 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges { label sFEI = featureEdges[i]; + edgeMap[sFEI] = i; + const edge& fE(sFeatEds[sFEI]); // Check to see if the points have been already used @@ -156,43 +161,31 @@ void Foam::extendedFeatureEdgeMesh::sortPointsAndEdges { regionEdges.append(i); } - - forAll(featurePointFeatureEdges, pI) - { - const labelList& fpfEdges = pointEdges[featurePoints[pI]]; - - labelList& fpfe = featurePointFeatureEdges[pI]; - - forAll(fpfEdges, eI) - { - if (sFEI == fpfEdges[eI]) - { - fpfe[eI] = i; - } - } - } } + // Populate feature point feature edges + DynamicList