From 1307836caac1e2b9b7e823ff487ae1021eedaca8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 2 Sep 2019 12:40:22 +0100 Subject: [PATCH] ENH: checkMesh: write wall distance. See #71 --- .../mesh/manipulation/checkMesh/checkMesh.C | 3 ++- .../mesh/manipulation/checkMesh/writeFields.C | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C index fbd24180c4..1e247fb95a 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C @@ -160,7 +160,8 @@ int main(int argc, char *argv[]) "cellVolume", "cellVolumeRatio", "minTetVolume", - "cellRegion" + "cellRegion", + "wallDistance" }); } diff --git a/applications/utilities/mesh/manipulation/checkMesh/writeFields.C b/applications/utilities/mesh/manipulation/checkMesh/writeFields.C index 53faa768c6..0246355859 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/writeFields.C +++ b/applications/utilities/mesh/manipulation/checkMesh/writeFields.C @@ -6,6 +6,7 @@ #include "syncTools.H" #include "tetPointRef.H" #include "regionSplit.H" +#include "wallDist.H" using namespace Foam; @@ -281,6 +282,7 @@ void Foam::writeFields // Aspect ratio // ~~~~~~~~~~~~ + if (selectedFields.found("aspectRatio")) { volScalarField aspectRatio @@ -498,5 +500,19 @@ void Foam::writeFields cellRegion.write(); } + if (selectedFields.found("wallDistance")) + { + // Wall distance + //const volScalarField& y = wallDist::New(mesh).y(); + volScalarField y("wallDistance", wallDist::New(mesh).y()); + Info<< " Writing wall distance to " << y.name() << endl; + y.write(); + + // Wall-reflection vectors + //const volVectorField& n = wallDist::New(mesh).n(); + //Info<< " Writing wall normal to " << n.name() << endl; + //n.write(); + } + Info<< endl; }