From cf370883644ec59782be375041b2434eb3e2c4ed Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 11 Feb 2015 12:31:09 +0000 Subject: [PATCH] blockMesh: Add support for multi/sectional grading in a block Consider a block describing a channel with two opposite walls. Currently in order to grade the mesh towards the walls and have a uniform region in the centre the channel would need to be spit into 3 blocks. With the new multi/sectional grading this can be achieved in a single block e.g. blocks ( hex (0 1 2 3 4 5 6 7) (20 60 20) simpleGrading ( 1 ((0.2 0.3 4) (0.6 0.4 1) (0.2 0.3 0.25)) 1 ) ); In this example the block is divided uniformly in the x and z -directions and split into three grading sections in the y-direction described by three triples: ((0.2 0.3 4) (0.6 0.4 1) (0.2 0.3 0.25)). Each of the grading sections is described by a triple consisting of the fraction of the block, the fraction of the divisions and the grading ratio (size of first division/size of last division). Both the fraction of the block and the fraction of the divisions are normalized automatically so they can be specified scaled in anyway, e.g. as percentages: blocks ( hex (0 1 2 3 4 5 6 7) (20 60 20) simpleGrading ( 1 ((2 3 4) (6 4 1) (2 3 0.25)) 1 ) ); and they need not sum to 1 or 100. This is very new functionality and not well tested but backward compatibility has been well tested so all existing blockMeshDicts should parse correctly. --- src/mesh/blockMesh/Make/files | 3 + .../blockDescriptor/blockDescriptor.C | 14 +- .../blockDescriptor/blockDescriptor.H | 10 +- .../blockDescriptor/blockDescriptorEdges.C | 58 ++----- src/mesh/blockMesh/curvedEdges/lineDivide.C | 82 +++++++-- src/mesh/blockMesh/curvedEdges/lineDivide.H | 7 +- .../gradingDescriptor/gradingDescriptor.C | 151 +++++++++++++++++ .../gradingDescriptor/gradingDescriptor.H | 157 ++++++++++++++++++ .../gradingDescriptor/gradingDescriptors.C | 101 +++++++++++ .../gradingDescriptor/gradingDescriptors.H | 94 +++++++++++ 10 files changed, 608 insertions(+), 69 deletions(-) create mode 100644 src/mesh/blockMesh/gradingDescriptor/gradingDescriptor.C create mode 100644 src/mesh/blockMesh/gradingDescriptor/gradingDescriptor.H create mode 100644 src/mesh/blockMesh/gradingDescriptor/gradingDescriptors.C create mode 100644 src/mesh/blockMesh/gradingDescriptor/gradingDescriptors.H diff --git a/src/mesh/blockMesh/Make/files b/src/mesh/blockMesh/Make/files index 28410a11..123b6510 100644 --- a/src/mesh/blockMesh/Make/files +++ b/src/mesh/blockMesh/Make/files @@ -10,6 +10,9 @@ curvedEdges/lineDivide.C curvedEdges/BSplineEdge.C curvedEdges/splineEdge.C +gradingDescriptor/gradingDescriptor.C +gradingDescriptor/gradingDescriptors.C + blockDescriptor/blockDescriptor.C blockDescriptor/blockDescriptorEdges.C diff --git a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C index 7fd7ad31..bafbc065 100644 --- a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C +++ b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.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-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,7 +34,7 @@ Foam::blockDescriptor::blockDescriptor const pointField& blockPointField, const curvedEdgeList& edges, const Vector