diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index 03596aad33bce7749583656093b92ece6a56f440..c8f6b88705e822b8aab5c1ee23f98925a89c4c3a 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -2453,6 +2453,27 @@ int main(int argc, char *argv[]) meshMod ); + // Enforce actual point posititions according to extrudeModel (model) + // (extruder.setRefinement only does fixed expansionRatio) + // The regionPoints and nLayers are looped in the same way as in + // createShellMesh + DynamicList<point>& newPoints = const_cast<DynamicList<point>&> + ( + meshMod.points() + ); + label meshPointI = extrudePatch.localPoints().size(); + forAll(localRegionPoints, regionI) + { + label pointI = localRegionPoints[regionI]; + point pt = extrudePatch.localPoints()[pointI]; + const vector& n = localRegionNormals[regionI]; + + for (label layerI = 1; layerI <= model().nLayers(); layerI++) + { + newPoints[meshPointI++] = model()(pt, n, layerI); + } + } + shellMap = meshMod.changeMesh ( regionMesh, // mesh to change diff --git a/src/mesh/extrudeModel/linearNormal/linearNormal.C b/src/mesh/extrudeModel/linearNormal/linearNormal.C index 0028f3c03999f347c55d5dd82331c99e7c852d13..e08b79737c601a05aeaae45abbc46ec4af5e379c 100644 --- a/src/mesh/extrudeModel/linearNormal/linearNormal.C +++ b/src/mesh/extrudeModel/linearNormal/linearNormal.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 @@ -45,7 +45,9 @@ addToRunTimeSelectionTable(extrudeModel, linearNormal, dictionary); linearNormal::linearNormal(const dictionary& dict) : extrudeModel(typeName, dict), - thickness_(readScalar(coeffDict_.lookup("thickness"))) + thickness_(readScalar(coeffDict_.lookup("thickness"))), + firstCellThickness_(0), + layerPoints_(nLayers_) { if (thickness_ <= 0) { @@ -53,6 +55,34 @@ linearNormal::linearNormal(const dictionary& dict) << "thickness should be positive : " << thickness_ << exit(FatalError); } + + coeffDict_.readIfPresent("firstCellThickness", firstCellThickness_); + + if (firstCellThickness_ >= thickness_) + { + FatalErrorIn("linearNormal(const dictionary&)") + << "firstCellThickness is larger than thickness" + << exit(FatalError); + } + + if (firstCellThickness_ > 0) + { + layerPoints_[0] = firstCellThickness_; + + for (label layerI = 1; layerI < nLayers_; layerI++) + { + layerPoints_[layerI] = + (thickness_ - layerPoints_[0]) + *sumThickness(layerI) + layerPoints_[0]; + } + } + else + { + for (label layerI = 0; layerI < nLayers_; layerI++) + { + layerPoints_[layerI] = thickness_*sumThickness(layerI + 1); + } + } } @@ -71,9 +101,7 @@ point linearNormal::operator() const label layer ) const { - //scalar d = thickness_*layer/nLayers_; - scalar d = thickness_*sumThickness(layer); - return surfacePoint + d*surfaceNormal; + return surfacePoint + layerPoints_[layer - 1]*surfaceNormal; } diff --git a/src/mesh/extrudeModel/linearNormal/linearNormal.H b/src/mesh/extrudeModel/linearNormal/linearNormal.H index 29e115e2dc0256dbe361f77c5cbb288553dede8a..db2863ff7554de94cbf50e91cbd93b7205d7e0e5 100644 --- a/src/mesh/extrudeModel/linearNormal/linearNormal.H +++ b/src/mesh/extrudeModel/linearNormal/linearNormal.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 @@ -34,6 +34,7 @@ Description #include "point.H" #include "extrudeModel.H" +#include "scalarList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -55,6 +56,13 @@ class linearNormal //- layer thickness scalar thickness_; + //- first cell thickness + scalar firstCellThickness_; + + //- layer cell distibution + scalarList layerPoints_; + + public: