From bed3074127917a38928cb02d96b26b6a7f81a7d8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 6 Dec 2013 16:29:00 +0000 Subject: [PATCH 01/18] ENH: mixerVessel: disable running; mesh only --- .../mesh/foamyHexMesh/mixerVessel/Allrun | 34 ++-------------- .../mixerVessel/Allrun-simulation | 40 +++++++++++++++++++ .../foamyHexMesh/mixerVessel/system/fvSchemes | 8 +--- .../mixerVessel/system/fvSolution | 7 ++++ 4 files changed, 52 insertions(+), 37 deletions(-) create mode 100755 tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun b/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun index 3953f6c668..99d75a9906 100755 --- a/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun +++ b/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun @@ -4,36 +4,10 @@ cd ${0%/*} || exit 1 # run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -\cp system/controlDict.flow system/controlDict - -# Set application name -application=$(getApplication) - -# Get number of processors to run on -nProcs=$(getNumberOfProcessors) - -\rm -rf 0 - -runApplication createBaffles -overwrite -runApplication mergeOrSplitBaffles -split -overwrite - -# Get rid of zero faced patches -runApplication createPatch -overwrite - -# Copy fields after meshing to avoind the generation of unnecessary patch fields -\cp -r 0.org 0 - -# Initialize alpha -runApplication setFields - -# Decompose -runApplication decomposePar -force - -# Run -runParallel $application 8 - -# Reconstruct -runApplication reconstructPar -noFunctionObjects +# Generate mesh +./Allrun-pre +## Run simulation +#./Allrun-simulation # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation b/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation new file mode 100755 index 0000000000..e789caef9f --- /dev/null +++ b/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation @@ -0,0 +1,40 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +\cp system/controlDict.flow system/controlDict + +# Set application name +application=$(getApplication) + +# Get number of processors to run on +nProcs=$(getNumberOfProcessors) + +\rm -rf 0 + +runApplication createBaffles -overwrite +runApplication mergeOrSplitBaffles -split -overwrite + +# Get rid of zero faced patches +runApplication createPatch -overwrite + +# Copy fields after meshing to avoind the generation of unnecessary patch fields +\cp -r 0.org 0 + +# Initialize alpha +runApplication setFields + +# Decompose +\rm log.decomposePar +runApplication decomposePar -force + +# Run +runParallel $application 8 + +# Reconstruct +runApplication reconstructPar -noFunctionObjects + + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSchemes b/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSchemes index 70e7cf49ab..0c01871945 100644 --- a/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSchemes +++ b/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSchemes @@ -28,17 +28,11 @@ gradSchemes divSchemes { - div(rho*phi,U) Gauss linearUpwind grad(U); + div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression 1; - div(phid1,p_rgh) Gauss upwind; - div(phid2,p_rgh) Gauss upwind; - div(rho*phi,T) Gauss linearUpwind unlimited; - div(rho*phi,K) Gauss upwind; div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; - div((muEff*dev2(T(grad(U))))) Gauss linear; - div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSolution b/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSolution index 946d84ed62..6798f4b2e0 100644 --- a/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSolution +++ b/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSolution @@ -51,6 +51,13 @@ solvers relTol 0; } + pcorrFinal + { + $pcorr; + tolerance 0.1; + relTol 0; + } + ".*(rho|rhoFinal)" { solver diagonal; From e9485ae96857a40a29081d24e0263388a8f9e74e Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 6 Dec 2013 18:05:33 +0000 Subject: [PATCH 02/18] GIT: boundary: generated file --- .../motorBike/constant/polyMesh/boundary | 427 +++++++++++++++++- 1 file changed, 411 insertions(+), 16 deletions(-) diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/constant/polyMesh/boundary b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/constant/polyMesh/boundary index 40530a746d..578783eaeb 100644 --- a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/constant/polyMesh/boundary +++ b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/constant/polyMesh/boundary @@ -15,46 +15,441 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -6 +72 ( - front + frontAndBack { type symmetryPlane; inGroups 1(symmetryPlane); - nFaces 160; - startFace 3456; - } - back - { - type symmetryPlane; - inGroups 1(symmetryPlane); - nFaces 160; - startFace 3616; + nFaces 320; + startFace 9440280; } inlet { type patch; nFaces 64; - startFace 3776; + startFace 9440600; } outlet { type patch; nFaces 64; - startFace 3840; + startFace 9440664; } lowerWall { type wall; - nFaces 160; - startFace 3904; + nFaces 15243; + startFace 9440728; } upperWall { type symmetryPlane; inGroups 1(symmetryPlane); nFaces 160; - startFace 4064; + startFace 9455971; + } + motorBike_frt-fairing:001%1 + { + type wall; + nFaces 90875; + startFace 9456131; + } + motorBike_windshield:002%2 + { + type wall; + nFaces 376; + startFace 9547006; + } + motorBike_rr-wh-rim:005%5 + { + type wall; + nFaces 2402; + startFace 9547382; + } + motorBike_rr-wh-rim:010%10 + { + type wall; + nFaces 5288; + startFace 9549784; + } + motorBike_fr-wh-rim:011%11 + { + type wall; + nFaces 7215; + startFace 9555072; + } + motorBike_fr-wh-brake-disk:012%12 + { + type wall; + nFaces 973; + startFace 9562287; + } + motorBike_frame:016-shadow%13 + { + type wall; + nFaces 1718; + startFace 9563260; + } + motorBike_rear-susp:014%14 + { + type wall; + nFaces 14936; + startFace 9564978; + } + motorBike_rear-susp:014-shadow%15 + { + type wall; + nFaces 8564; + startFace 9579914; + } + motorBike_frame:016%16 + { + type wall; + nFaces 969; + startFace 9588478; + } + motorBike_rr-wh-rim:005-shadow%17 + { + type wall; + nFaces 1251; + startFace 9589447; + } + motorBike_rr-wh-chain-hub:022%22 + { + type wall; + nFaces 1827; + startFace 9590698; + } + motorBike_rearseat%24 + { + type wall; + nFaces 3241; + startFace 9592525; + } + motorBike_frt-fairing%25 + { + type wall; + nFaces 5078; + startFace 9595766; + } + motorBike_windshield%26 + { + type wall; + nFaces 6545; + startFace 9600844; + } + motorBike_headlights%27 + { + type wall; + nFaces 455; + startFace 9607389; + } + motorBike_driversseat%28 + { + type wall; + nFaces 5112; + startFace 9607844; + } + motorBike_rear-body%29 + { + type wall; + nFaces 12033; + startFace 9612956; + } + motorBike_fuel-tank%30 + { + type wall; + nFaces 6586; + startFace 9624989; + } + motorBike_exhaust%31 + { + type wall; + nFaces 20319; + startFace 9631575; + } + motorBike_rr-wh-rim%32 + { + type wall; + nFaces 9928; + startFace 9651894; + } + motorBike_fr-mud-guard%33 + { + type wall; + nFaces 13989; + startFace 9661822; + } + motorBike_fr-wh-rim%34 + { + type wall; + nFaces 6592; + startFace 9675811; + } + motorBike_fr-wh-brake-disk%35 + { + type wall; + nFaces 7374; + startFace 9682403; + } + motorBike_fr-brake-caliper%36 + { + type wall; + nFaces 2178; + startFace 9689777; + } + motorBike_fr-wh-tyre%37 + { + type wall; + nFaces 9947; + startFace 9691955; + } + motorBike_hbars%38 + { + type wall; + nFaces 7345; + startFace 9701902; + } + motorBike_fr-forks%39 + { + type wall; + nFaces 10349; + startFace 9709247; + } + motorBike_chain%40 + { + type wall; + nFaces 7168; + startFace 9719596; + } + motorBike_rr-wh-tyre%41 + { + type wall; + nFaces 7245; + startFace 9726764; + } + motorBike_square-dial%42 + { + type wall; + nFaces 62; + startFace 9734009; + } + motorBike_round-dial%43 + { + type wall; + nFaces 183; + startFace 9734071; + } + motorBike_dial-holder%44 + { + type wall; + nFaces 1336; + startFace 9734254; + } + motorBike_rear-susp%45 + { + type wall; + nFaces 25738; + startFace 9735590; + } + motorBike_rear-brake-lights%46 + { + type wall; + nFaces 860; + startFace 9761328; + } + motorBike_rear-light-bracket%47 + { + type wall; + nFaces 2003; + startFace 9762188; + } + motorBike_frame%48 + { + type wall; + nFaces 20232; + startFace 9764191; + } + motorBike_rear-mud-guard%49 + { + type wall; + nFaces 10690; + startFace 9784423; + } + motorBike_rear-susp-spring-damp%50 + { + type wall; + nFaces 1769; + startFace 9795113; + } + motorBike_fairing-inner-plate%51 + { + type wall; + nFaces 4660; + startFace 9796882; + } + motorBike_clutch-housing%52 + { + type wall; + nFaces 8237; + startFace 9801542; + } + motorBike_radiator%53 + { + type wall; + nFaces 1849; + startFace 9809779; + } + motorBike_water-pipe%54 + { + type wall; + nFaces 1182; + startFace 9811628; + } + motorBike_water-pump%55 + { + type wall; + nFaces 902; + startFace 9812810; + } + motorBike_engine%56 + { + type wall; + nFaces 19087; + startFace 9813712; + } + motorBike_rear-shock-link%57 + { + type wall; + nFaces 512; + startFace 9832799; + } + motorBike_rear-brake-fluid-pot-bracket%58 + { + type wall; + nFaces 721; + startFace 9833311; + } + motorBike_rear-brake-fluid-pot%59 + { + type wall; + nFaces 795; + startFace 9834032; + } + motorBike_footpeg%60 + { + type wall; + nFaces 1405; + startFace 9834827; + } + motorBike_rr-wh-chain-hub%61 + { + type wall; + nFaces 1984; + startFace 9836232; + } + motorBike_rear-brake-caliper%62 + { + type wall; + nFaces 2119; + startFace 9838216; + } + motorBike_rider-helmet%65 + { + type wall; + nFaces 2244; + startFace 9840335; + } + motorBike_rider-visor%66 + { + type wall; + nFaces 171; + startFace 9842579; + } + motorBike_rider-boots%67 + { + type wall; + nFaces 5287; + startFace 9842750; + } + motorBike_rider-gloves%68 + { + type wall; + nFaces 3129; + startFace 9848037; + } + motorBike_rider-body%69 + { + type wall; + nFaces 22909; + startFace 9851166; + } + motorBike_frame:0%70 + { + type wall; + nFaces 361; + startFace 9874075; + } + motorBike_frt-fairing:001-shadow%74 + { + type wall; + nFaces 56996; + startFace 9874436; + } + motorBike_windshield-shadow%75 + { + type wall; + nFaces 4535; + startFace 9931432; + } + motorBike_fr-mud-guard-shadow%81 + { + type wall; + nFaces 9174; + startFace 9935967; + } + motorBike_fr-wh-brake-disk-shadow%83 + { + type wall; + nFaces 3923; + startFace 9945141; + } + motorBike_rear-mud-guard-shadow%84 + { + type wall; + nFaces 6792; + startFace 9949064; + } + motorBike_rear-susp-spring-damp-shadow%85 + { + type wall; + nFaces 1211; + startFace 9955856; + } + motorBike_radiator-shadow%86 + { + type wall; + nFaces 1080; + startFace 9957067; + } + motorBike_rear-shock-link-shadow%87 + { + type wall; + nFaces 357; + startFace 9958147; + } + motorBike_rear-brake-fluid-pot-bracket-shadow%88 + { + type wall; + nFaces 420; + startFace 9958504; + } + motorBike_rr-wh-chain-hub-shadow%89 + { + type wall; + nFaces 1071; + startFace 9958924; } ) From e551bdf2db865efe07ba6b8c76644e2f7ddc35d0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 9 Dec 2013 09:05:37 +0000 Subject: [PATCH 03/18] ENH: polyMeshFilter: enhanced checking (for merged points, map < -1) --- .../polyMeshFilter/polyMeshFilter.C | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C b/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C index 968ea6c483..28398bdc92 100644 --- a/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C +++ b/src/dynamicMesh/polyMeshFilter/polyMeshFilter.C @@ -267,7 +267,11 @@ Foam::label Foam::polyMeshFilter::filterFacesLoop(const label nOriginalBadFaces) newBadFaces = false; forAll(mesh_.points(), pI) { - if (isErrorPoint[origToCurrentPointMap[pI]]) + if + ( + origToCurrentPointMap[pI] >= 0 + && isErrorPoint[origToCurrentPointMap[pI]] + ) { if (!newErrorPoint[pI]) { @@ -862,14 +866,22 @@ void Foam::polyMeshFilter::updateOldToNewPointMap { label oldPointI = origToCurrentPointMap[origPointI]; - if (oldPointI < currToNew.size()) + if (oldPointI != -1) { label newPointI = currToNew[oldPointI]; - if (newPointI != -1) + if (newPointI >= 0) { origToCurrentPointMap[origPointI] = newPointI; } + else if (newPointI == -1) + { + origToCurrentPointMap[origPointI] = -1; + } + else + { + origToCurrentPointMap[origPointI] = -newPointI-2; + } } } } From 6dca9b09612d978f5d64749f4262f739a8bb82f1 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 9 Dec 2013 17:20:55 +0000 Subject: [PATCH 04/18] BUG: createBaffles: preserve faceZone orientation --- .../mesh/manipulation/createBaffles/createBaffles.C | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index cdbe770d1a..8a58b394ac 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -207,7 +207,10 @@ void createFaces } else { - // Use neighbour side of face + // Use neighbour side of face. + // To keep faceZone pointing out of original neighbour + // we don't need to set faceFlip since that cell + // now becomes the owner modifyOrAddFace ( meshMod, @@ -217,7 +220,7 @@ void createFaces true, // face flip newMasterPatches[i], // patch for face fZone.index(), // zone for face - true, // face flip in zone + false, // face flip in zone modifiedFace // modify or add status ); } @@ -264,7 +267,7 @@ void createFaces false, // face flip newSlavePatches[i], // patch for face fZone.index(), // zone for face - false, // face flip in zone + true, // face flip in zone modifiedFace // modify or add status ); } From 21ebd85eda847d2e8f78cda5916309a22194de59 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 10 Dec 2013 09:31:24 +0000 Subject: [PATCH 05/18] COMP: wmdep.l: added include file --- wmake/src/wmkdep.l | 1 + 1 file changed, 1 insertion(+) diff --git a/wmake/src/wmkdep.l b/wmake/src/wmkdep.l index d9d4b73591..3b6973209b 100644 --- a/wmake/src/wmkdep.l +++ b/wmake/src/wmkdep.l @@ -46,6 +46,7 @@ Usage #include #include #include +#include void nextFile(const char* fileName); void importFile(const char* fileName); From 1c9fbf6997a2ee16a31d119191a9f715f28c6b0f Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 11 Dec 2013 14:47:58 +0000 Subject: [PATCH 06/18] STYLE: edgeMesh: indentation etc. --- src/edgeMesh/edgeMesh.H | 3 ++- src/edgeMesh/edgeMeshNew.C | 9 +++------ .../extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.H | 2 +- src/edgeMesh/featureEdgeMesh/featureEdgeMesh.H | 4 +++- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/edgeMesh/edgeMesh.H b/src/edgeMesh/edgeMesh.H index 534c1fb568..c8abb55169 100644 --- a/src/edgeMesh/edgeMesh.H +++ b/src/edgeMesh/edgeMesh.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,6 +31,7 @@ SourceFiles edgeMeshI.H edgeMesh.C edgeMeshIO.C + edgeMeshNew.C \*---------------------------------------------------------------------------*/ diff --git a/src/edgeMesh/edgeMeshNew.C b/src/edgeMesh/edgeMeshNew.C index 6254ffd3f4..da7091c73a 100644 --- a/src/edgeMesh/edgeMeshNew.C +++ b/src/edgeMesh/edgeMeshNew.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,14 +48,11 @@ Foam::autoPtr Foam::edgeMesh::New << exit(FatalError); } - return autoPtr< edgeMesh >(cstrIter()(name)); + return autoPtr(cstrIter()(name)); } -Foam::autoPtr Foam::edgeMesh::New -( - const fileName& name -) +Foam::autoPtr Foam::edgeMesh::New(const fileName& name) { word ext = name.ext(); if (ext == "gz") diff --git a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.H b/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.H index 3695a39012..fdeeeb8dd0 100644 --- a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.H +++ b/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.H @@ -161,7 +161,7 @@ private: // points and edges, unsorted vectorField normals_; - //- + //- Type per normal: which side of normal to mesh List normalVolumeTypes_; //- Flat and open edges require the direction of the edge diff --git a/src/edgeMesh/featureEdgeMesh/featureEdgeMesh.H b/src/edgeMesh/featureEdgeMesh/featureEdgeMesh.H index 6275a5acf4..7f3a06cdf3 100644 --- a/src/edgeMesh/featureEdgeMesh/featureEdgeMesh.H +++ b/src/edgeMesh/featureEdgeMesh/featureEdgeMesh.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,6 +78,8 @@ public: featureEdgeMesh(const IOobject&, const featureEdgeMesh&); + // IO + //- ReadData function required for regIOobject read operation virtual bool readData(Istream&); From 06e3f4fad1f8d43f26cdc0ae76f5c208ec5172e1 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 11 Dec 2013 16:08:00 +0000 Subject: [PATCH 07/18] STYLE: splitMeshRegions: removed comment out code --- .../mesh/manipulation/splitMeshRegions/splitMeshRegions.C | 2 -- 1 file changed, 2 deletions(-) diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index 9771757c9e..6d7b9fe688 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -1078,7 +1078,6 @@ labelList addRegionPatches mesh.boundaryMesh() ); - //interfacePatches[interI] = addPatch(mesh, patch1); interfacePatches[interI] = fvMeshTools::addPatch ( mesh, @@ -1100,7 +1099,6 @@ labelList addRegionPatches point::zero, // offset mesh.boundaryMesh() ); - //addPatch(mesh, patch2); fvMeshTools::addPatch ( mesh, From 8a19a5545e2c73ce8055a432484764bc519bac20 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 11 Dec 2013 16:33:35 +0000 Subject: [PATCH 08/18] STYLE: SurfaceFilmModel: unused include file --- .../SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C | 1 - .../SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C index 8d1729361e..51272f3560 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C @@ -26,7 +26,6 @@ License #include "SurfaceFilmModel.H" #include "surfaceFilmModel.H" #include "mathematicalConstants.H" -#include "mappedPatchBase.H" using namespace Foam::constant; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H index 0f0a4d4196..9098782204 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H @@ -55,8 +55,6 @@ namespace regionModels } } -class mappedPatchBase; - /*---------------------------------------------------------------------------*\ Class SurfaceFilmModel Declaration \*---------------------------------------------------------------------------*/ From a67830e919a0fe81a2b16497b280d04083a1b0fe Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 11 Dec 2013 16:34:36 +0000 Subject: [PATCH 09/18] STYLE: refinementFeatures: typo --- .../autoHexMesh/refinementFeatures/refinementFeatures.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/refinementFeatures/refinementFeatures.C b/src/mesh/autoMesh/autoHexMesh/refinementFeatures/refinementFeatures.C index f3d969e691..a5109bc3c8 100644 --- a/src/mesh/autoMesh/autoHexMesh/refinementFeatures/refinementFeatures.C +++ b/src/mesh/autoMesh/autoHexMesh/refinementFeatures/refinementFeatures.C @@ -303,7 +303,7 @@ Foam::refinementFeatures::refinementFeatures Info<< "Detected " << featurePoints.size() << " featurePoints out of " << pointEdges.size() - << " on feature " << eMesh.name() << endl; + << " points on feature " << eMesh.name() << endl; buildTrees(i, featurePoints); } @@ -372,7 +372,7 @@ Foam::refinementFeatures::refinementFeatures Info<< "Detected " << featurePoints.size() << " featurePoints out of " << points.size() - << " on feature " << eMesh.name() + << " points on feature " << eMesh.name() << " when using feature cos " << minCos << endl; buildTrees(i, featurePoints); From 9a446b3cbc9341e0e9bf06867921fd5c5e3ee345 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 11 Dec 2013 16:34:56 +0000 Subject: [PATCH 10/18] ENH: autoHexMesh: switchable island detection --- .../medialAxisMeshMover.C | 137 ++++++++++++++---- .../medialAxisMeshMover.H | 1 + 2 files changed, 110 insertions(+), 28 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C b/src/mesh/autoMesh/autoHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C index eb223c8841..b2a142accf 100644 --- a/src/mesh/autoMesh/autoHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C +++ b/src/mesh/autoMesh/autoHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C @@ -66,7 +66,6 @@ Foam::labelList Foam::medialAxisMeshMover::getFixedValueBCs if (isA >(patchFld)) { adaptPatchIDs.append(patchI); - //Info<< "Detected adapt patch " << patchFld.patch().name() << endl; } } return adaptPatchIDs; @@ -1259,6 +1258,7 @@ handleFeatureAngleLayerTerminations void Foam::medialAxisMeshMover::findIsolatedRegions ( const scalar minCosLayerTermination, + const bool detectExtrusionIsland, const PackedBoolList& isMasterPoint, const PackedBoolList& isMasterEdge, const labelList& meshEdges, @@ -1268,6 +1268,8 @@ void Foam::medialAxisMeshMover::findIsolatedRegions ) const { const indirectPrimitivePatch& pp = adaptPatchPtr_(); + const labelListList& pointFaces = pp.pointFaces(); + Info<< typeName << " : Removing isolated regions ..." << endl; @@ -1292,40 +1294,110 @@ void Foam::medialAxisMeshMover::findIsolatedRegions syncPatchDisplacement(minThickness, patchDisp, extrudeStatus); - // Do not extrude from point where all neighbouring - // faces are not grown - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - boolList extrudedFaces(pp.size(), true); - forAll(pp.localFaces(), faceI) - { - const face& f = pp.localFaces()[faceI]; - forAll(f, fp) - { - if (extrudeStatus[f[fp]] == autoLayerDriver::NOEXTRUDE) - { - extrudedFaces[faceI] = false; - break; - } - } - } - const labelListList& pointFaces = pp.pointFaces(); + // Detect either: + // - point where all surrounding points are not extruded + // (detectExtrusionIsland) + // or + // - point where all the faces surrounding it are not fully + // extruded boolList keptPoints(pp.nPoints(), false); - forAll(keptPoints, patchPointI) - { - const labelList& pFaces = pointFaces[patchPointI]; - forAll(pFaces, i) + if (detectExtrusionIsland) + { + // Do not extrude from point where all neighbouring + // points are not grown + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + labelList islandPoint(pp.size(), -1); + forAll(pp, faceI) { - label faceI = pFaces[i]; - if (extrudedFaces[faceI]) + const face& f = pp.localFaces()[faceI]; + + forAll(f, fp) { - keptPoints[patchPointI] = true; - break; + label patchPointI = f[fp]; + + if (extrudeStatus[f[fp]] != autoLayerDriver::NOEXTRUDE) + { + if (islandPoint[faceI] == -1) + { + // First point to extrude + islandPoint[faceI] = patchPointI; + } + else + { + // Second or more point to extrude + islandPoint[faceI] = -2; + } + } + } + } + + // islandPoint: + // -1 : no point extruded + // -2 : >= 2 points extruded + // >=0: label of point extruded + + // Check all surrounding faces that I am the islandPoint + boolList keptPoints(pp.nPoints(), false); + forAll(pointFaces, patchPointI) + { + if (extrudeStatus[patchPointI] != autoLayerDriver::NOEXTRUDE) + { + const labelList& pFaces = pointFaces[patchPointI]; + + forAll(pFaces, i) + { + label faceI = pFaces[i]; + if (islandPoint[faceI] != patchPointI) + { + keptPoints[patchPointI] = true; + break; + } + } } } } + else + { + // Do not extrude from point where all neighbouring + // faces are not grown + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + boolList extrudedFaces(pp.size(), true); + forAll(pp.localFaces(), faceI) + { + const face& f = pp.localFaces()[faceI]; + forAll(f, fp) + { + if (extrudeStatus[f[fp]] == autoLayerDriver::NOEXTRUDE) + { + extrudedFaces[faceI] = false; + break; + } + } + } + + const labelListList& pointFaces = pp.pointFaces(); + + forAll(keptPoints, patchPointI) + { + const labelList& pFaces = pointFaces[patchPointI]; + + forAll(pFaces, i) + { + label faceI = pFaces[i]; + if (extrudedFaces[faceI]) + { + keptPoints[patchPointI] = true; + break; + } + } + } + } + syncTools::syncPointList ( @@ -1344,8 +1416,8 @@ void Foam::medialAxisMeshMover::findIsolatedRegions { if (unmarkExtrusion(patchPointI, patchDisp, extrudeStatus)) { - nPointCounter++; - nChanged++; + nPointCounter++; + nChanged++; } } } @@ -1701,6 +1773,13 @@ void Foam::medialAxisMeshMover::calculateDisplacement mesh().globalData().nTotalPoints() ); + //- Use strick extrusionIsland detection + const Switch detectExtrusionIsland = coeffDict.lookupOrDefault