From 9fda4249f0175f93a84416a2d7ab0b4061dd445c Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 20 Dec 2013 12:15:32 +0000 Subject: [PATCH 01/30] ENH: snappyHexMeshDict: remove debug flag --- .../snappyHexMesh/flange/system/snappyHexMeshDict | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict index d100d0749b..409b18a781 100644 --- a/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict @@ -86,7 +86,7 @@ castellatedMeshControls features ( { - file "flange.eMesh"; + file "flange.extendedFeatureEdgeMesh"; level 0; } ); @@ -301,12 +301,13 @@ meshQualityControls // Advanced -// Flags for optional output -// 0 : only write final meshes -// 1 : write intermediate meshes -// 2 : write volScalarField with cellLevel for postprocessing -// 4 : write current intersections as .obj files -debug 0; +// Write flags +writeFlags +( + scalarLevels // write volScalarField with cellLevel for postprocessing + layerSets // write cellSets, faceSets of faces in layer + layerFields // write volScalarField for layer coverage +); // Merge tolerance. Is fraction of overall bounding box of initial mesh. From 1186a190aac6770139372cfd72037e7843f3d7d5 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 20 Dec 2013 13:20:50 +0000 Subject: [PATCH 02/30] ENH: Test-hexref8: added pointFields --- applications/test/hexRef8/Test-hexRef8.C | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/applications/test/hexRef8/Test-hexRef8.C b/applications/test/hexRef8/Test-hexRef8.C index 67477aae44..ed10807809 100644 --- a/applications/test/hexRef8/Test-hexRef8.C +++ b/applications/test/hexRef8/Test-hexRef8.C @@ -34,11 +34,13 @@ Description #include "Time.H" #include "volFields.H" #include "surfaceFields.H" +#include "pointFields.H" #include "hexRef8.H" #include "mapPolyMesh.H" #include "polyTopoChange.H" #include "Random.H" #include "zeroGradientFvPatchFields.H" +#include "calculatedPointPatchFields.H" #include "fvcDiv.H" using namespace Foam; @@ -144,6 +146,29 @@ int main(int argc, char *argv[]) surfaceOne.write(); + // Uniform point field + pointScalarField pointX + ( + IOobject + ( + "pointX", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + pointMesh::New(mesh), + dimensionedScalar("one", dimless, 1.0), + calculatedPointPatchScalarField::typeName + ); + pointX.internalField() = mesh.points().component(0); + pointX.correctBoundaryConditions(); + Info<< "Writing x-component field " + << pointX.name() << " in " << runTime.timeName() << endl; + pointX.write(); + + + // Force allocation of V. Important for any mesh changes since otherwise // old time volumes are not stored const scalar totalVol = gSum(mesh.V()); From 6af4a60a539835ed06cadfcfdf54e9fe6bee5b3f Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 20 Dec 2013 15:57:10 +0000 Subject: [PATCH 03/30] ENH: scalarTransport: old files in header --- .../utilities/scalarTransport/scalarTransport.H | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H index ae3db7635c..3006ca197d 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H @@ -43,9 +43,6 @@ SourceFiles scalarTransport.C IOscalarTransport.H -SeeAlso - Foam::basicSourceList - \*---------------------------------------------------------------------------*/ #ifndef scalarTransport_H From 4d4205779194183a91ee87ac2c8002625afd817c Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 20 Dec 2013 15:57:56 +0000 Subject: [PATCH 04/30] BUG: trackedParticle: could get stuck on processor face --- .../trackedParticle/trackedParticle.C | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C index c8e8be3d06..ce713217cd 100644 --- a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C +++ b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C @@ -90,27 +90,36 @@ Foam::trackedParticle::trackedParticle bool Foam::trackedParticle::move ( trackingData& td, - const scalar trackedParticle + const scalar trackTime ) { td.switchProcessor = false; - td.keepParticle = true; - scalar tEnd = (1.0 - stepFraction())*trackedParticle; + scalar tEnd = (1.0 - stepFraction())*trackTime; scalar dtMax = tEnd; - while (td.keepParticle && !td.switchProcessor && tEnd > SMALL) + if (tEnd <= SMALL) { - // set the lagrangian time-step - scalar dt = min(dtMax, tEnd); + // Remove the particle + td.keepParticle = false; + } + else + { + td.keepParticle = true; - // mark visited cell with max level. - td.maxLevel()[cell()] = max(td.maxLevel()[cell()], level_); + while (td.keepParticle && !td.switchProcessor && tEnd > SMALL) + { + // set the lagrangian time-step + scalar dt = min(dtMax, tEnd); - dt *= trackToFace(end_, td); + // mark visited cell with max level. + td.maxLevel()[cell()] = max(td.maxLevel()[cell()], level_); - tEnd -= dt; - stepFraction() = 1.0 - tEnd/trackedParticle; + dt *= trackToFace(end_, td); + + tEnd -= dt; + stepFraction() = 1.0 - tEnd/trackTime; + } } return td.keepParticle; From 2a9a899d8f8acff70a26d6895e91ce865787baca Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 20 Dec 2013 15:59:10 +0000 Subject: [PATCH 05/30] BUG: polyMesh: update pointMesh objects --- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 3 ++- src/OpenFOAM/meshes/polyMesh/polyMeshClear.C | 12 +++++++++ src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C | 1 + .../volPointInterpolation/pointConstraints.C | 27 ++++++++++++------- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 162e895170..c20baae3f2 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -34,7 +34,7 @@ License #include "indexedOctree.H" #include "treeDataCell.H" #include "MeshObject.H" - +#include "pointMesh.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -1160,6 +1160,7 @@ Foam::tmp Foam::polyMesh::movePoints solutionD_ = Vector