From 1c85c649849529983253cd8604c6a1e362c63902 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Thu, 24 Jan 2019 09:40:12 +0100 Subject: [PATCH] STYLE: clarify input requirements for extrusion models (#1181) - changed the sectorCoeffs keyword to 'point' from 'axisPt' for more similarity with other dictionaries. Continue to accept 'axisPt' for compatibility. --- .../extrude/extrudeMesh/extrudeMeshDict | 7 ++- .../extrudeToRegionMeshDict | 9 ++-- .../extrude2DMesh/extrude2DMeshDict | 6 ++- .../foamyMesh/foamyQuadMesh/foamyQuadMeshDict | 6 +-- etc/controlDict | 1 + .../axisymmetricJet/system/extrudeMeshDict | 6 +-- .../extrudeModel/cyclicSector/cyclicSector.C | 6 --- .../extrudeModel/cyclicSector/cyclicSector.H | 7 +-- .../extrudeModel/extrudeModel/extrudeModel.C | 13 ++--- .../extrudeModel/extrudeModel/extrudeModel.H | 26 ++++++---- .../linearDirection/linearDirection.C | 10 +--- .../linearDirection/linearDirection.H | 16 +++++-- .../extrudeModel/linearNormal/linearNormal.C | 47 ++++++++----------- .../extrudeModel/linearNormal/linearNormal.H | 16 +++++-- .../extrudeModel/linearRadial/linearRadial.C | 7 +-- .../extrudeModel/linearRadial/linearRadial.H | 17 +++++-- .../offsetSurface/offsetSurface.C | 31 ++++++------ .../offsetSurface/offsetSurface.H | 32 ++++++++----- .../planeExtrusion/planeExtrusion.C | 6 --- .../planeExtrusion/planeExtrusion.H | 8 ++-- src/mesh/extrudeModel/radial/radial.C | 6 --- src/mesh/extrudeModel/radial/radial.H | 13 +++-- src/mesh/extrudeModel/sector/sector.C | 19 ++------ src/mesh/extrudeModel/sector/sector.H | 27 ++++++++--- .../extrudeModel/sigmaRadial/sigmaRadial.C | 6 --- .../extrudeModel/sigmaRadial/sigmaRadial.H | 11 ++++- src/mesh/extrudeModel/wedge/wedge.C | 6 --- src/mesh/extrudeModel/wedge/wedge.H | 8 ++-- .../cylinderMesh/system/extrudeMeshDict | 9 ++-- .../cylinderMesh/system/extrudeMeshDict | 9 ++-- .../cylinderMesh/system/extrudeMeshDict | 9 ++-- .../OpenCFD/system/extrude2DMeshDict | 9 ++-- .../jaggedBoundary/system/extrude2DMeshDict | 9 ++-- .../square/system/extrude2DMeshDict | 12 ++--- .../climbingRod/system/extrudeMeshDict | 13 ++--- .../RAS/waterChannel/system/extrudeMeshDict | 1 - .../RAS/waterChannel/system/extrudeMeshDict.1 | 1 - .../RAS/waterChannel/system/extrudeMeshDict.2 | 1 - 38 files changed, 224 insertions(+), 222 deletions(-) diff --git a/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict b/applications/utilities/mesh/generation/extrude/extrudeMesh/extrudeMeshDict index 7ae794a6b9b..3f28a53731d 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 b33f3b87f2d..1ee3248583e 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 ce30c3e22b7..05c90052232 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 f58b1f6e381..1c4ceb5af92 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 5c65b06a663..6ccf2ef39c8 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 368750d8d17..4b43a195ce8 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 2d2e65b9a39..82e0526bd72 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 86d99e13859..3f3c0854cc7 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 cb041871f62..98eaeae338e 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 0b2871b48a8..b3e32aabf2f 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 fba68230221..2f65f64b467 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 9dea1084086..55dd476522d 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 d8084a47155..98e379f2bc5 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 18b29151bf5..0801249bc55 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 f468cecd60e..161142dbde7 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 b10e8e0e49e..65b06eea4de 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 435f8cca00b..dc28c4b881b 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 96d7db92618..731283bb196 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 dfcb24d10ea..333bdeacdae 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 253b956e088..19c2901119c 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 a27ebad2c4e..0aad5dc9b93 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 2143cde47dd..5f8fef57208 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 d03c31b5ac7..88302dfc6fd 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 16efba17430..f7dbb6098c9 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 c0cde228346..49d46483b41 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 a7c397e1998..0ec8985ea89 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 a5d139c1b3f..2f539fe9c20 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 434057589c6..4c1a46ea42d 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 53b7c40025e..bc373f155f0 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 46a664c2dc3..473be0cfa6a 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 53b7c40025e..bc373f155f0 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 c0be7d6a73e..a5ba04087ec 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 c0be7d6a73e..a5ba04087ec 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 3531c4a6e75..ba085a7520a 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 1f9fa379a5a..609c3e45d96 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 60a2615d6b1..92e718c52c9 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 4a8bcb26f6c..e4b9fbfa2d5 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 60a2615d6b1..92e718c52c9 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; } -- GitLab