diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict index 7ae794a6b9bf4c53d8719ab249b5eb9cb8ee2edf..3f28a53731dbd7f214d716811261f3a7bf751d80 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict +++ b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict @@ -71,9 +71,9 @@ nLayers 10; expansionRatio 1.0; -sectorCoeffs +sectorCoeffs //<- Also used for wedge { - axisPt (0 0.1 -0.05); + point (0 0.1 -0.05); axis (-1 0 0); angle 360; // For nLayers=1 assume symmetry so angle/2 on each side } @@ -92,8 +92,7 @@ linearDirectionCoeffs linearRadialCoeffs { R 0.1; - // Optional inner radius - Rsurface 0.01; + Rsurface 0.01; // Optional inner radius } radialCoeffs diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict index b33f3b87f2de85a63d96c2089a0eb93b9f4c4f23..1ee3248583e06b2d067103d832f091c6ff196127 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict @@ -85,9 +85,9 @@ linearNormalCoeffs thickness 0.05; } -wedgeCoeffs +sectorCoeffs //<- Also used for wedge { - axisPt (0 0.1 -0.05); + point (0 0.1 -0.05); axis (-1 0 0); angle 360; // For nLayers=1 assume symmetry so angle/2 on each side } @@ -100,9 +100,8 @@ linearDirectionCoeffs linearRadialCoeffs { - R 0.1; - // Optional inner radius - Rsurface 0.01; + R 0.1; + Rsurface 0.01; // Optional inner radius } radialCoeffs diff --git a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshDict b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshDict index ce30c3e22b72ee4a21ab361c83dea61773c5b031..05c900522323121f36610145586f77cb3f98ddf6 100644 --- a/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshDict +++ b/applications/utilities/mesh/generation/extrude2DMesh/extrude2DMeshDict @@ -32,9 +32,11 @@ linearDirectionCoeffs thickness 0.1; } -wedgeCoeffs +sectorCoeffs //<- Also used for wedge { - axisPt (0 0 0); + point (0 0 0); axis (1 0 0); angle 10; } + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/foamyQuadMeshDict b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/foamyQuadMeshDict index f58b1f6e381328aa44b1fa9e30e6da217c24ca8c..1c4ceb5af92b7db6a840909c8988f4016de57fdf 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/foamyQuadMeshDict +++ b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/foamyQuadMeshDict @@ -175,14 +175,12 @@ extrusion thickness 0.1; } - wedgeCoeffs + sectorCoeffs //<- Also used for wedge { - axisPt (0 0 0); + point (0 0 0); axis (1 0 0); angle 10; } - - thickness 0.1; } diff --git a/etc/controlDict b/etc/controlDict index 5c65b06a663d0f041f2a54e3728ac5f2328b89f4..6ccf2ef39c89ade400ba08dda3461cdbd2fc4cdb 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -517,6 +517,7 @@ DebugSwitches exponential 0; extendedLeastSquares 0; extendedLeastSquaresVectors 0; + extrudeModel 1; face 0; faceAreaPair 0; faceCoupleInfo 0; diff --git a/etc/templates/axisymmetricJet/system/extrudeMeshDict b/etc/templates/axisymmetricJet/system/extrudeMeshDict index 368750d8d17a6e29d3a4c4c56d8facd26bab11f0..4b43a195ce860656950c1e2f070e9baa7468e15b 100644 --- a/etc/templates/axisymmetricJet/system/extrudeMeshDict +++ b/etc/templates/axisymmetricJet/system/extrudeMeshDict @@ -24,9 +24,9 @@ extrudeModel wedge; sectorCoeffs { - axisPt (0 0 0); - axis (1 0 0); - angle 1; + point (0 0 0); + axis (1 0 0); + angle 1; } flipNormals false; diff --git a/src/mesh/extrudeModel/cyclicSector/cyclicSector.C b/src/mesh/extrudeModel/cyclicSector/cyclicSector.C index 2d2e65b9a393b2aaa27fd2d07cab314bee7f34b4..82e0526bd72a9065eb3fb5795ad2e2fceb6d2cc9 100644 --- a/src/mesh/extrudeModel/cyclicSector/cyclicSector.C +++ b/src/mesh/extrudeModel/cyclicSector/cyclicSector.C @@ -48,12 +48,6 @@ cyclicSector::cyclicSector(const dictionary& dict) {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -cyclicSector::~cyclicSector() -{} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace extrudeModels diff --git a/src/mesh/extrudeModel/cyclicSector/cyclicSector.H b/src/mesh/extrudeModel/cyclicSector/cyclicSector.H index 86d99e138598fd15380be8702aa6ae673784b964..3f3c0854cc7d37ce3f7603da0f9f186c99eb312f 100644 --- a/src/mesh/extrudeModel/cyclicSector/cyclicSector.H +++ b/src/mesh/extrudeModel/cyclicSector/cyclicSector.H @@ -27,6 +27,8 @@ Class Description Extrudes a sector. + Uses the sectorCoeffs dictionary. + See also Foam::extrudeModels::sector @@ -52,7 +54,6 @@ class cyclicSector : public sector { - public: //- Runtime type information @@ -61,11 +62,11 @@ public: // Constructors //- Construct from dictionary - cyclicSector(const dictionary& dict); + explicit cyclicSector(const dictionary& dict); //- Destructor - virtual ~cyclicSector(); + virtual ~cyclicSector() = default; }; diff --git a/src/mesh/extrudeModel/extrudeModel/extrudeModel.C b/src/mesh/extrudeModel/extrudeModel/extrudeModel.C index cb041871f6226377111d617c226cdddc42aa1d25..98eaeae338ebd223982f1f5333d0670a4480faee 100644 --- a/src/mesh/extrudeModel/extrudeModel/extrudeModel.C +++ b/src/mesh/extrudeModel/extrudeModel/extrudeModel.C @@ -43,15 +43,12 @@ Foam::extrudeModel::extrudeModel : nLayers_(dict.lookupOrDefault<label>("nLayers", 1)), expansionRatio_(dict.lookupOrDefault<scalar>("expansionRatio", 1)), - dict_(dict), coeffDict_(dict.optionalSubDict(modelType + "Coeffs")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::extrudeModel::~extrudeModel() -{} +{ + DebugInfo + << "Selected extrudeModel for " << modelType + << "using coeffs " << coeffDict_ << nl; +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/mesh/extrudeModel/extrudeModel/extrudeModel.H b/src/mesh/extrudeModel/extrudeModel/extrudeModel.H index 0b2871b48a857fbcdb52abc05b092cecd7207cab..b3e32aabf2f13f27e71aad7c62367fe7e138f582 100644 --- a/src/mesh/extrudeModel/extrudeModel/extrudeModel.H +++ b/src/mesh/extrudeModel/extrudeModel/extrudeModel.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,6 +27,13 @@ Class Description Top level extrusion model class + Dictionary entries + \table + Property | Description | Required | Default + nLayer | Number of extrusion layers | no | 1 + expansionRatio | Expansion ratio | no | 1 + \endtable + SourceFiles extrudeModel.C @@ -59,8 +66,6 @@ protected: const scalar expansionRatio_; - const dictionary& dict_; - const dictionary& coeffDict_; @@ -94,27 +99,30 @@ public: // Constructors - //- Construct from dictionary - extrudeModel(const word& modelType, const dictionary&); + //- Construct from dictionary for given model type + // The corresponding model Coeffs dictionary must exist. + extrudeModel(const word& modelType, const dictionary& dict); // Selectors //- Select null constructed - static autoPtr<extrudeModel> New(const dictionary&); + static autoPtr<extrudeModel> New(const dictionary& dict); //- Destructor - virtual ~extrudeModel(); + virtual ~extrudeModel() = default; // Member Functions // Access - label nLayers() const; + //- Return the number of layers + label nLayers() const; - scalar expansionRatio() const; + //- Return the expansion ratio + scalar expansionRatio() const; // Member Operators diff --git a/src/mesh/extrudeModel/linearDirection/linearDirection.C b/src/mesh/extrudeModel/linearDirection/linearDirection.C index fba682302216616616aba6d1f845b513ce9e0905..2f65f64b467840142bf1c68a4c127505fb1e9220 100644 --- a/src/mesh/extrudeModel/linearDirection/linearDirection.C +++ b/src/mesh/extrudeModel/linearDirection/linearDirection.C @@ -57,12 +57,6 @@ linearDirection::linearDirection(const dictionary& dict) } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -linearDirection::~linearDirection() -{} - - // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // point linearDirection::operator() @@ -72,9 +66,7 @@ point linearDirection::operator() const label layer ) const { - //scalar d = thickness_*layer/nLayers_; - scalar d = thickness_*sumThickness(layer); - return surfacePoint + d*direction_; + return surfacePoint + (thickness_*sumThickness(layer)) * direction_; } diff --git a/src/mesh/extrudeModel/linearDirection/linearDirection.H b/src/mesh/extrudeModel/linearDirection/linearDirection.H index 9dea1084086cf17bffa32215c1a14badcbdde5be..55dd476522d05d0468bae47884cef385908e6db4 100644 --- a/src/mesh/extrudeModel/linearDirection/linearDirection.H +++ b/src/mesh/extrudeModel/linearDirection/linearDirection.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,7 +25,15 @@ Class Foam::extrudeModels::linearDirection Description - Extrudes by transforming points in a specified direction by a given distance + Extrudes by transforming points in a specified direction by the given + distance. + + The linearDirectionCoeffs dictionary entries + \table + Property | Description | Required | Default + direction | The extrusion direction, normalized on input | yes | + thickness | The extrusion thickness | yes | + \endtable \*---------------------------------------------------------------------------*/ @@ -67,11 +75,11 @@ public: // Constructors //- Construct from dictionary - linearDirection(const dictionary& dict); + explicit linearDirection(const dictionary& dict); //- Destructor - virtual ~linearDirection(); + virtual ~linearDirection() = default; // Member Operators diff --git a/src/mesh/extrudeModel/linearNormal/linearNormal.C b/src/mesh/extrudeModel/linearNormal/linearNormal.C index d8084a47155a5db329990b01d1a051fd378233e5..98e379f2bc56886fbb9ace12a4d7406943124d3c 100644 --- a/src/mesh/extrudeModel/linearNormal/linearNormal.C +++ b/src/mesh/extrudeModel/linearNormal/linearNormal.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,7 +46,10 @@ linearNormal::linearNormal(const dictionary& dict) : extrudeModel(typeName, dict), thickness_(coeffDict_.get<scalar>("thickness")), - firstCellThickness_(0), + firstCellThickness_ + ( + coeffDict_.lookupOrDefault<scalar>("firstCellThickness", 0) + ), layerPoints_(nLayers_) { if (thickness_ <= 0) @@ -56,42 +59,34 @@ linearNormal::linearNormal(const dictionary& dict) << exit(FatalError); } - coeffDict_.readIfPresent("firstCellThickness", firstCellThickness_); - - if (firstCellThickness_ >= thickness_) + if (nLayers_ > 1 && firstCellThickness_ > 0) { - FatalErrorInFunction - << "firstCellThickness is larger than thickness" - << exit(FatalError); - } + if (thickness_ <= firstCellThickness_) + { + FatalErrorInFunction + << "firstCellThickness leave no room for further layers" + << exit(FatalError); + } - if (firstCellThickness_ > 0) - { layerPoints_[0] = firstCellThickness_; - for (label layerI = 1; layerI < nLayers_; layerI++) + for (label layer = 1; layer < nLayers_; ++layer) { - layerPoints_[layerI] = + layerPoints_[layer] = (thickness_ - layerPoints_[0]) - *sumThickness(layerI) + layerPoints_[0]; + *sumThickness(layer) + layerPoints_[0]; } } else { - for (label layerI = 0; layerI < nLayers_; layerI++) + for (label layer = 0; layer < nLayers_; ++layer) { - layerPoints_[layerI] = thickness_*sumThickness(layerI + 1); + layerPoints_[layer] = thickness_*sumThickness(layer + 1); } } } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -linearNormal::~linearNormal() -{} - - // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // point linearNormal::operator() @@ -101,14 +96,12 @@ point linearNormal::operator() const label layer ) const { - if (layer == 0) + if (layer <= 0) { return surfacePoint; } - else - { - return surfacePoint + layerPoints_[layer - 1]*surfaceNormal; - } + + return surfacePoint + layerPoints_[layer - 1]*surfaceNormal; } diff --git a/src/mesh/extrudeModel/linearNormal/linearNormal.H b/src/mesh/extrudeModel/linearNormal/linearNormal.H index 18b29151bf5e3057f45678a0239d784a55f6fa4b..0801249bc55a9ca767a2837fcc6ff14fead8b936 100644 --- a/src/mesh/extrudeModel/linearNormal/linearNormal.H +++ b/src/mesh/extrudeModel/linearNormal/linearNormal.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -27,6 +27,13 @@ Class Description Extrudes by transforming points normal to the surface by a given distance. + The linearNormalCoeffs dictionary entries + \table + Property | Description | Required | Default + thickness | Extrusion thickness | yes | + firstCellThickness | Thickness of the first layer | no | 0 + \endtable + \*---------------------------------------------------------------------------*/ #ifndef linearNormal_H @@ -44,7 +51,7 @@ namespace extrudeModels { /*---------------------------------------------------------------------------*\ - Class linearNormal Declaration + Class extrudeModels::linearNormal Declaration \*---------------------------------------------------------------------------*/ class linearNormal @@ -63,7 +70,6 @@ class linearNormal scalarList layerPoints_; - public: //- Runtime type information @@ -72,11 +78,11 @@ public: // Constructors //- Construct from dictionary - linearNormal(const dictionary& dict); + explicit linearNormal(const dictionary& dict); //- Destructor - virtual ~linearNormal(); + virtual ~linearNormal() = default; // Member Operators diff --git a/src/mesh/extrudeModel/linearRadial/linearRadial.C b/src/mesh/extrudeModel/linearRadial/linearRadial.C index f468cecd60e9233c0c97c9edb2e40cbdf8fc4551..161142dbde79fdf903a164b84772393e681b8abf 100644 --- a/src/mesh/extrudeModel/linearRadial/linearRadial.C +++ b/src/mesh/extrudeModel/linearRadial/linearRadial.C @@ -48,12 +48,6 @@ linearRadial::linearRadial(const dictionary& dict) {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -linearRadial::~linearRadial() -{} - - // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // point linearRadial::operator() @@ -66,6 +60,7 @@ point linearRadial::operator() // radius of the surface scalar rs = mag(surfacePoint); vector rsHat = surfacePoint/rs; + if (Rsurface_ >= 0) rs = Rsurface_; scalar r = rs + (R_ - rs)*sumThickness(layer); diff --git a/src/mesh/extrudeModel/linearRadial/linearRadial.H b/src/mesh/extrudeModel/linearRadial/linearRadial.H index b10e8e0e49ec24a0d20d6892c8d15c0b7d844e0b..65b06eea4de2e5c0f36d23c6e87ce6a0e86a2d92 100644 --- a/src/mesh/extrudeModel/linearRadial/linearRadial.H +++ b/src/mesh/extrudeModel/linearRadial/linearRadial.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -25,6 +25,14 @@ Class Foam::extrudeModels::linearRadial Description + Extrudes by transforming radially from the surface. + + The linearRadialCoeffs dictionary entries + \table + Property | Description | Required | Default + R | The radial thickness | yes | + Rsurface | Surface inner radius | no | -1 + \endtable \*---------------------------------------------------------------------------*/ @@ -41,7 +49,7 @@ namespace extrudeModels { /*---------------------------------------------------------------------------*\ - Class linearRadial Declaration + Class extrudeModels::linearRadial Declaration \*---------------------------------------------------------------------------*/ class linearRadial @@ -62,15 +70,16 @@ public: // Constructors //- Construct from dictionary - linearRadial(const dictionary& dict); + explicit linearRadial(const dictionary& dict); //- Destructor - virtual ~linearRadial(); + virtual ~linearRadial() = default; // Member Operators + //- Return point point operator() ( const point& surfacePoint, diff --git a/src/mesh/extrudeModel/offsetSurface/offsetSurface.C b/src/mesh/extrudeModel/offsetSurface/offsetSurface.C index 435f8cca00bec90eace844630716216a5c88c5bb..dc28c4b881bcb26a738324fc858f9d2f5384cee8 100644 --- a/src/mesh/extrudeModel/offsetSurface/offsetSurface.C +++ b/src/mesh/extrudeModel/offsetSurface/offsetSurface.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -51,24 +51,16 @@ offsetSurface::offsetSurface(const dictionary& dict) project_(coeffDict_.lookupOrDefault("project", false)) { // Read surface - fileName baseName(coeffDict_.lookup("baseSurface")); - baseName.expand(); + fileName baseName(coeffDict_.get<fileName>("baseSurface").expand()); baseSurfPtr_.reset(new triSurface(baseName)); - // Construct search engine - baseSearchPtr_.reset(new triSurfaceSearch(baseSurfPtr_())); - // Read offsetted surface - fileName offsetName(coeffDict_.lookup("offsetSurface")); - offsetName.expand(); + fileName offsetName(coeffDict_.get<fileName>("offsetSurface").expand()); offsetSurfPtr_.reset(new triSurface(offsetName)); - // Construct search engine - offsetSearchPtr_.reset(new triSurfaceSearch(offsetSurfPtr_())); - - const triSurface& b = baseSurfPtr_(); - const triSurface& o = offsetSurfPtr_(); + const triSurface& b = *baseSurfPtr_; + const triSurface& o = *offsetSurfPtr_; if ( @@ -78,10 +70,17 @@ offsetSurface::offsetSurface(const dictionary& dict) ) { FatalIOErrorInFunction(dict) - << "offsetSurface " << offsetName - << " should have exactly the same topology as the baseSurface " - << baseName << exit(FatalIOError); + << "offsetSurface:\n " << offsetName + << " has different topology than the baseSurface:\n " + << baseName << endl + << exit(FatalIOError); } + + // Construct search engine + baseSearchPtr_.reset(new triSurfaceSearch(b)); + + // Construct search engine + offsetSearchPtr_.reset(new triSurfaceSearch(o)); } diff --git a/src/mesh/extrudeModel/offsetSurface/offsetSurface.H b/src/mesh/extrudeModel/offsetSurface/offsetSurface.H index 96d7db926184db0cf6e81ed67b00ca29b0ee4615..731283bb196fc9107f24d093ed451f127708de89 100644 --- a/src/mesh/extrudeModel/offsetSurface/offsetSurface.H +++ b/src/mesh/extrudeModel/offsetSurface/offsetSurface.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,6 +29,14 @@ Description have to be topologically identical i.e. one has to be an offsetted version of the other. + The offsetSurfaceCoeffs dictionary entries + \table + Property | Description | Required | Default + baseSurface | Base surface file name | yes | + offsetSurface | Offset surface file name | yes | + project | Project onto offsetted surface | no | false + \endtable + \*---------------------------------------------------------------------------*/ #ifndef offsetSurface_H @@ -41,16 +49,15 @@ Description namespace Foam { - +// Forward declarations class triSurface; class triSurfaceSearch; - namespace extrudeModels { /*---------------------------------------------------------------------------*\ - Class offsetSurface Declaration + Class extrudeModels::offsetSurface Declaration \*---------------------------------------------------------------------------*/ class offsetSurface @@ -59,21 +66,22 @@ class offsetSurface { // Private data - //- surface + //- The base surface autoPtr<triSurface> baseSurfPtr_; - //- search engine - autoPtr<triSurfaceSearch> baseSearchPtr_; - - //- offsets + //- The offset surface autoPtr<triSurface> offsetSurfPtr_; - //- search engine + //- The search engine + autoPtr<triSurfaceSearch> baseSearchPtr_; + + //- The search engine autoPtr<triSurfaceSearch> offsetSearchPtr_; - // Whether to re-project onto offsetted surface + //- Project onto offsetted surface? const bool project_; + public: //- Runtime type information @@ -82,7 +90,7 @@ public: // Constructors //- Construct from dictionary - offsetSurface(const dictionary& dict); + explicit offsetSurface(const dictionary& dict); //- Destructor diff --git a/src/mesh/extrudeModel/planeExtrusion/planeExtrusion.C b/src/mesh/extrudeModel/planeExtrusion/planeExtrusion.C index dfcb24d10ea558d2afe2c1eed9e7d79d7c12df1f..333bdeacdae4ba4fe08b56150acdbbfecccdef63 100644 --- a/src/mesh/extrudeModel/planeExtrusion/planeExtrusion.C +++ b/src/mesh/extrudeModel/planeExtrusion/planeExtrusion.C @@ -56,12 +56,6 @@ plane::plane(const dictionary& dict) } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -plane::~plane() -{} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace extrudeModels diff --git a/src/mesh/extrudeModel/planeExtrusion/planeExtrusion.H b/src/mesh/extrudeModel/planeExtrusion/planeExtrusion.H index 253b956e088937f8a9a82550ba2c4185b9afd447..19c2901119c029195e6f318c5d44720104054069 100644 --- a/src/mesh/extrudeModel/planeExtrusion/planeExtrusion.H +++ b/src/mesh/extrudeModel/planeExtrusion/planeExtrusion.H @@ -28,6 +28,8 @@ Description Extrudes by transforming points normal to the surface by 1 layer over a given distance. + Uses the linearNormalCoeffs dictionary + See also Foam::extrudeModels::linearNormal @@ -46,7 +48,7 @@ namespace extrudeModels { /*---------------------------------------------------------------------------*\ - Class plane Declaration + Class extrudeModels::plane Declaration \*---------------------------------------------------------------------------*/ class plane @@ -62,11 +64,11 @@ public: // Constructors //- Construct from dictionary - plane(const dictionary& dict); + explicit plane(const dictionary& dict); //- Destructor - virtual ~plane(); + virtual ~plane() = default; }; diff --git a/src/mesh/extrudeModel/radial/radial.C b/src/mesh/extrudeModel/radial/radial.C index a27ebad2c4e4727001e5ff72cdd6b654430c4742..0aad5dc9b93f8cba958b6f36168e279c2b58fc3b 100644 --- a/src/mesh/extrudeModel/radial/radial.C +++ b/src/mesh/extrudeModel/radial/radial.C @@ -49,12 +49,6 @@ radial::radial(const dictionary& dict) {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -radial::~radial() -{} - - // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // point radial::operator() diff --git a/src/mesh/extrudeModel/radial/radial.H b/src/mesh/extrudeModel/radial/radial.H index 2143cde47dd7d3e2f451ae31a30ee2348d19ac89..5f8fef572085d510aad814f25f7eddf8239203e6 100644 --- a/src/mesh/extrudeModel/radial/radial.H +++ b/src/mesh/extrudeModel/radial/radial.H @@ -25,6 +25,13 @@ Class Foam::extrudeModels::radial Description + Extrudes radially according to the Function1 description. + + The radialCoeffs dictionary entries + \table + Property | Description | Required | Default + R | The radii as a Function1 | yes | + \endtable \*---------------------------------------------------------------------------*/ @@ -42,7 +49,7 @@ namespace extrudeModels { /*---------------------------------------------------------------------------*\ - Class radial Declaration + Class extrudeModels::radial Declaration \*---------------------------------------------------------------------------*/ class radial @@ -62,11 +69,11 @@ public: // Constructors //- Construct from dictionary - radial(const dictionary& dict); + explicit radial(const dictionary& dict); //-Destructor - virtual ~radial(); + virtual ~radial() = default; // Member Operators diff --git a/src/mesh/extrudeModel/sector/sector.C b/src/mesh/extrudeModel/sector/sector.C index d03c31b5ac7ac069b12af24ea73e649c686015b3..88302dfc6fd0e8c49724edbd8ab2aa1aee5a28ca 100644 --- a/src/mesh/extrudeModel/sector/sector.C +++ b/src/mesh/extrudeModel/sector/sector.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -46,18 +46,9 @@ addToRunTimeSelectionTable(extrudeModel, sector, dictionary); sector::sector(const dictionary& dict) : extrudeModel(typeName, dict), - axisPt_(coeffDict_.lookup("axisPt")), - axis_(coeffDict_.lookup("axis")), - angle_ - ( - degToRad(coeffDict_.get<scalar>("angle")) - ) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -sector::~sector() + refPoint_(coeffDict_.getCompat<point>("point", {{"axisPt", -1812}})), + axis_(coeffDict_.get<vector>("axis").normalise()), + angle_(degToRad(coeffDict_.get<scalar>("angle"))) {} @@ -93,7 +84,7 @@ point sector::operator() // Find projection onto axis (or rather decompose surfacePoint // into vector along edge (proj), vector normal to edge in plane // of surface point and surface normal. - point d = surfacePoint - axisPt_; + point d = surfacePoint - refPoint_; d -= (axis_ & d)*axis_; diff --git a/src/mesh/extrudeModel/sector/sector.H b/src/mesh/extrudeModel/sector/sector.H index 16efba17430a4a2b07c9182fb55527d9a7aeda6f..f7dbb6098c94099db70f0ac18ac35a09a5917221 100644 --- a/src/mesh/extrudeModel/sector/sector.H +++ b/src/mesh/extrudeModel/sector/sector.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -35,6 +35,18 @@ Description with extreme aspect ratio and internal faces wrong way around in checkMesh + The sectorCoeffs dictionary entries + \table + Property | Description | Required | Default + point | A point on the axis | yes | + axis | Axis direction, normalized on input | yes | + angle | Sector angle (degrees) | yes | + \endtable + +Note + For compatibility, accepts the entry \c axisPt (1812 and earlier) + as equivalent to \c point. + \*---------------------------------------------------------------------------*/ #ifndef sector_H @@ -50,7 +62,7 @@ namespace extrudeModels { /*---------------------------------------------------------------------------*\ - Class sector Declaration + Class extrudeModels::sector Declaration \*---------------------------------------------------------------------------*/ class sector @@ -60,12 +72,12 @@ class sector // Private data //- Point on axis - const point axisPt_; + const point refPoint_; - //- Normalized direction of axis + //- Normalized axis direction const vector axis_; - //- Overall angle (radians) + //- Overall angle (radians), converted from degrees on input const scalar angle_; @@ -77,15 +89,16 @@ public: // Constructors //- Construct from dictionary - sector(const dictionary& dict); + explicit sector(const dictionary& dict); //- Destructor - virtual ~sector(); + virtual ~sector() = default; // Member Operators + //- Return corresponding point point operator() ( const point& surfacePoint, diff --git a/src/mesh/extrudeModel/sigmaRadial/sigmaRadial.C b/src/mesh/extrudeModel/sigmaRadial/sigmaRadial.C index c0cde228346e4452da996795ce38964bab51d329..49d46483b417f9fa1fab81d1a7fe6b9185918d36 100644 --- a/src/mesh/extrudeModel/sigmaRadial/sigmaRadial.C +++ b/src/mesh/extrudeModel/sigmaRadial/sigmaRadial.C @@ -57,12 +57,6 @@ sigmaRadial::sigmaRadial(const dictionary& dict) } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -sigmaRadial::~sigmaRadial() -{} - - // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // point sigmaRadial::operator() diff --git a/src/mesh/extrudeModel/sigmaRadial/sigmaRadial.H b/src/mesh/extrudeModel/sigmaRadial/sigmaRadial.H index a7c397e19989d27b4c337767ec635b9c2f889a4b..0ec8985ea89800b3ffc39f211bed8f24b705b9c6 100644 --- a/src/mesh/extrudeModel/sigmaRadial/sigmaRadial.H +++ b/src/mesh/extrudeModel/sigmaRadial/sigmaRadial.H @@ -25,6 +25,15 @@ Class Foam::extrudeModels::sigmaRadial Description + Extrudes into sphere with grading according to pressure (atmospherics) + + The sigmaRadialCoeffs dictionary entries + \table + Property | Description | Required | Default + RTbyg | | yes | + pRef | | yes | + pStrat | | yes | + \endtable \*---------------------------------------------------------------------------*/ @@ -67,7 +76,7 @@ public: //-Destructor - virtual ~sigmaRadial(); + virtual ~sigmaRadial() = default; // Member Operators diff --git a/src/mesh/extrudeModel/wedge/wedge.C b/src/mesh/extrudeModel/wedge/wedge.C index a5d139c1b3fdf3e40e311ab5bd677a9243fe0920..2f539fe9c2047b3db191c6a1b7d5b9dd927cae31 100644 --- a/src/mesh/extrudeModel/wedge/wedge.C +++ b/src/mesh/extrudeModel/wedge/wedge.C @@ -56,12 +56,6 @@ wedge::wedge(const dictionary& dict) } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -wedge::~wedge() -{} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace extrudeModels diff --git a/src/mesh/extrudeModel/wedge/wedge.H b/src/mesh/extrudeModel/wedge/wedge.H index 434057589c655838c4f500a1e89213f9cee385f6..4c1a46ea42d7ba419273a66833b950b502db737b 100644 --- a/src/mesh/extrudeModel/wedge/wedge.H +++ b/src/mesh/extrudeModel/wedge/wedge.H @@ -27,6 +27,8 @@ Class Description Extrudes by rotating a surface symmetrically around axis by 1 layer. + Uses the sectorCoeffs dictionary. + See also Foam::extrudeModels::sector @@ -45,7 +47,7 @@ namespace extrudeModels { /*---------------------------------------------------------------------------*\ - Class wedge Declaration + Class extrudeModels::wedge Declaration \*---------------------------------------------------------------------------*/ class wedge @@ -61,11 +63,11 @@ public: // Constructors //- Construct from dictionary - wedge(const dictionary& dict); + explicit wedge(const dictionary& dict); //- Destructor - virtual ~wedge(); + virtual ~wedge() = default; }; diff --git a/tutorials/basic/overPotentialFoam/cylinder/cylinderMesh/system/extrudeMeshDict b/tutorials/basic/overPotentialFoam/cylinder/cylinderMesh/system/extrudeMeshDict index 53b7c40025e77616b0c54255abd22294ab49afe8..bc373f155f089be875778ec490bed5a89f266ef9 100644 --- a/tutorials/basic/overPotentialFoam/cylinder/cylinderMesh/system/extrudeMeshDict +++ b/tutorials/basic/overPotentialFoam/cylinder/cylinderMesh/system/extrudeMeshDict @@ -71,9 +71,9 @@ nLayers 10; expansionRatio 1.02; -sectorCoeffs +sectorCoeffs //<- Also used for wedge { - axisPt (0 0.1 -0.05); + point (0 0.1 -0.05); axis (-1 0 0); angle 360; // For nLayers=1 assume symmetry so angle/2 on each side } @@ -92,14 +92,13 @@ planeCoeffs linearDirectionCoeffs { direction (0 1 0); - thickness 0.5; + thickness 0.5; } linearRadialCoeffs { R 0.1; - // Optional inner radius - Rsurface 0.01; + Rsurface 0.01; // Optional inner radius } radialCoeffs diff --git a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderMesh/system/extrudeMeshDict b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderMesh/system/extrudeMeshDict index 46a664c2dc3d4ef61be3544abca234abd807f387..473be0cfa6afa689f6edb4906bbcd73b433aa6f1 100644 --- a/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderMesh/system/extrudeMeshDict +++ b/tutorials/compressible/overRhoSimpleFoam/hotCylinder/cylinderMesh/system/extrudeMeshDict @@ -44,9 +44,9 @@ nLayers 10; expansionRatio 1.02; -sectorCoeffs +sectorCoeffs //<- Also used for wedge { - axisPt (0 0.1 -0.05); + point (0 0.1 -0.05); axis (-1 0 0); angle 360; // For nLayers=1 assume symmetry so angle/2 on each side } @@ -65,14 +65,13 @@ planeCoeffs linearDirectionCoeffs { direction (0 1 0); - thickness 0.5; + thickness 0.5; } linearRadialCoeffs { R 0.1; - // Optional inner radius - Rsurface 0.01; + Rsurface 0.01; // Optional inner radius } radialCoeffs diff --git a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderMesh/system/extrudeMeshDict b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderMesh/system/extrudeMeshDict index 53b7c40025e77616b0c54255abd22294ab49afe8..bc373f155f089be875778ec490bed5a89f266ef9 100644 --- a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderMesh/system/extrudeMeshDict +++ b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderMesh/system/extrudeMeshDict @@ -71,9 +71,9 @@ nLayers 10; expansionRatio 1.02; -sectorCoeffs +sectorCoeffs //<- Also used for wedge { - axisPt (0 0.1 -0.05); + point (0 0.1 -0.05); axis (-1 0 0); angle 360; // For nLayers=1 assume symmetry so angle/2 on each side } @@ -92,14 +92,13 @@ planeCoeffs linearDirectionCoeffs { direction (0 1 0); - thickness 0.5; + thickness 0.5; } linearRadialCoeffs { R 0.1; - // Optional inner radius - Rsurface 0.01; + Rsurface 0.01; // Optional inner radius } radialCoeffs diff --git a/tutorials/mesh/foamyQuadMesh/OpenCFD/system/extrude2DMeshDict b/tutorials/mesh/foamyQuadMesh/OpenCFD/system/extrude2DMeshDict index c0be7d6a73eb108e6a3e19eb953713642ef61391..a5ba04087ec9e6a7326e212a3b0de27ee282d662 100644 --- a/tutorials/mesh/foamyQuadMesh/OpenCFD/system/extrude2DMeshDict +++ b/tutorials/mesh/foamyQuadMesh/OpenCFD/system/extrude2DMeshDict @@ -31,12 +31,11 @@ linearDirectionCoeffs thickness 0.1; } -wedgeCoeffs +sectorCoeffs //<- Also used for wedge { - axisPt (0 0 0); - axis (1 0 0); - angle 10; + point (0 0 0); + axis (1 0 0); + angle 10; } - // ************************************************************************* // diff --git a/tutorials/mesh/foamyQuadMesh/jaggedBoundary/system/extrude2DMeshDict b/tutorials/mesh/foamyQuadMesh/jaggedBoundary/system/extrude2DMeshDict index c0be7d6a73eb108e6a3e19eb953713642ef61391..a5ba04087ec9e6a7326e212a3b0de27ee282d662 100644 --- a/tutorials/mesh/foamyQuadMesh/jaggedBoundary/system/extrude2DMeshDict +++ b/tutorials/mesh/foamyQuadMesh/jaggedBoundary/system/extrude2DMeshDict @@ -31,12 +31,11 @@ linearDirectionCoeffs thickness 0.1; } -wedgeCoeffs +sectorCoeffs //<- Also used for wedge { - axisPt (0 0 0); - axis (1 0 0); - angle 10; + point (0 0 0); + axis (1 0 0); + angle 10; } - // ************************************************************************* // diff --git a/tutorials/mesh/foamyQuadMesh/square/system/extrude2DMeshDict b/tutorials/mesh/foamyQuadMesh/square/system/extrude2DMeshDict index 3531c4a6e753b916ab925490ec460d27fcf0941b..ba085a7520ad2718cf2da0f21c1270a99e9c5e67 100644 --- a/tutorials/mesh/foamyQuadMesh/square/system/extrude2DMeshDict +++ b/tutorials/mesh/foamyQuadMesh/square/system/extrude2DMeshDict @@ -14,18 +14,18 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -extrudeModel wedge; +extrudeModel wedge; patchInfo {} -patchType wedge; +patchType wedge; -sectorCoeffs +sectorCoeffs //<- Also used for wedge { - axisPt (0 0 0); - axis (1 0 0); - angle 10; + point (0 0 0); + axis (1 0 0); + angle 10; } diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/extrudeMeshDict b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/extrudeMeshDict index 1f9fa379a5add77f270581af2847cd53af861cab..609c3e45d965a4e606791592984dd4516eb1c458 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/extrudeMeshDict +++ b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/extrudeMeshDict @@ -20,16 +20,17 @@ sourceCase "$FOAM_CASE"; sourcePatches (front); exposedPatchName back; -extrudeModel wedge; +extrudeModel wedge; -sectorCoeffs +sectorCoeffs //<- Also used for wedge { - axisPt (0 0 0); - axis (0 -1 0); - angle 1; + point (0 0 0); + axis (0 -1 0); + angle 1; } flipNormals false; -mergeFaces false; + +mergeFaces false; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict b/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict index 60a2615d6b18aa7d5efdeebad6cfe1fb74cd8a7f..92e718c52c90386842ef237e2c862b030f8ca225 100644 --- a/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict +++ b/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict @@ -27,7 +27,6 @@ expansionRatio 1.0; linearDirectionCoeffs { - axisPt (0 0 0); direction (1 -0.2 -0.03); thickness 40; } diff --git a/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict.1 b/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict.1 index 4a8bcb26f6c69ef671c5a013b8068f1af1b59325..e4b9fbfa2d5c8a7c0bf7b6ce8b767876a304c632 100644 --- a/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict.1 +++ b/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict.1 @@ -27,7 +27,6 @@ expansionRatio 1.0; linearDirectionCoeffs { - axisPt (0 0 0); direction (1 0.2 0.02); thickness 60; } diff --git a/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict.2 b/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict.2 index 60a2615d6b18aa7d5efdeebad6cfe1fb74cd8a7f..92e718c52c90386842ef237e2c862b030f8ca225 100644 --- a/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict.2 +++ b/tutorials/multiphase/interFoam/RAS/waterChannel/system/extrudeMeshDict.2 @@ -27,7 +27,6 @@ expansionRatio 1.0; linearDirectionCoeffs { - axisPt (0 0 0); direction (1 -0.2 -0.03); thickness 40; }