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.
This commit is contained in:
Mark Olesen
2019-01-24 09:40:12 +01:00
parent 8b3a00efcc
commit 1c85c64984
38 changed files with 224 additions and 222 deletions

View File

@ -71,9 +71,9 @@ nLayers 10;
expansionRatio 1.0; 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); axis (-1 0 0);
angle 360; // For nLayers=1 assume symmetry so angle/2 on each side angle 360; // For nLayers=1 assume symmetry so angle/2 on each side
} }
@ -92,8 +92,7 @@ linearDirectionCoeffs
linearRadialCoeffs linearRadialCoeffs
{ {
R 0.1; R 0.1;
// Optional inner radius Rsurface 0.01; // Optional inner radius
Rsurface 0.01;
} }
radialCoeffs radialCoeffs

View File

@ -85,9 +85,9 @@ linearNormalCoeffs
thickness 0.05; 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); axis (-1 0 0);
angle 360; // For nLayers=1 assume symmetry so angle/2 on each side angle 360; // For nLayers=1 assume symmetry so angle/2 on each side
} }
@ -100,9 +100,8 @@ linearDirectionCoeffs
linearRadialCoeffs linearRadialCoeffs
{ {
R 0.1; R 0.1;
// Optional inner radius Rsurface 0.01; // Optional inner radius
Rsurface 0.01;
} }
radialCoeffs radialCoeffs

View File

@ -32,9 +32,11 @@ linearDirectionCoeffs
thickness 0.1; thickness 0.1;
} }
wedgeCoeffs sectorCoeffs //<- Also used for wedge
{ {
axisPt (0 0 0); point (0 0 0);
axis (1 0 0); axis (1 0 0);
angle 10; angle 10;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -175,14 +175,12 @@ extrusion
thickness 0.1; thickness 0.1;
} }
wedgeCoeffs sectorCoeffs //<- Also used for wedge
{ {
axisPt (0 0 0); point (0 0 0);
axis (1 0 0); axis (1 0 0);
angle 10; angle 10;
} }
thickness 0.1;
} }

View File

@ -517,6 +517,7 @@ DebugSwitches
exponential 0; exponential 0;
extendedLeastSquares 0; extendedLeastSquares 0;
extendedLeastSquaresVectors 0; extendedLeastSquaresVectors 0;
extrudeModel 1;
face 0; face 0;
faceAreaPair 0; faceAreaPair 0;
faceCoupleInfo 0; faceCoupleInfo 0;

View File

@ -24,9 +24,9 @@ extrudeModel wedge;
sectorCoeffs sectorCoeffs
{ {
axisPt (0 0 0); point (0 0 0);
axis (1 0 0); axis (1 0 0);
angle 1; angle 1;
} }
flipNormals false; flipNormals false;

View File

@ -48,12 +48,6 @@ cyclicSector::cyclicSector(const dictionary& dict)
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
cyclicSector::~cyclicSector()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace extrudeModels } // End namespace extrudeModels

View File

@ -27,6 +27,8 @@ Class
Description Description
Extrudes a sector. Extrudes a sector.
Uses the sectorCoeffs dictionary.
See also See also
Foam::extrudeModels::sector Foam::extrudeModels::sector
@ -52,7 +54,6 @@ class cyclicSector
: :
public sector public sector
{ {
public: public:
//- Runtime type information //- Runtime type information
@ -61,11 +62,11 @@ public:
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary
cyclicSector(const dictionary& dict); explicit cyclicSector(const dictionary& dict);
//- Destructor //- Destructor
virtual ~cyclicSector(); virtual ~cyclicSector() = default;
}; };

View File

@ -43,15 +43,12 @@ Foam::extrudeModel::extrudeModel
: :
nLayers_(dict.lookupOrDefault<label>("nLayers", 1)), nLayers_(dict.lookupOrDefault<label>("nLayers", 1)),
expansionRatio_(dict.lookupOrDefault<scalar>("expansionRatio", 1)), expansionRatio_(dict.lookupOrDefault<scalar>("expansionRatio", 1)),
dict_(dict),
coeffDict_(dict.optionalSubDict(modelType + "Coeffs")) coeffDict_(dict.optionalSubDict(modelType + "Coeffs"))
{} {
DebugInfo
<< "Selected extrudeModel for " << modelType
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // << "using coeffs " << coeffDict_ << nl;
}
Foam::extrudeModel::~extrudeModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,6 +27,13 @@ Class
Description Description
Top level extrusion model class 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 SourceFiles
extrudeModel.C extrudeModel.C
@ -59,8 +66,6 @@ protected:
const scalar expansionRatio_; const scalar expansionRatio_;
const dictionary& dict_;
const dictionary& coeffDict_; const dictionary& coeffDict_;
@ -94,27 +99,30 @@ public:
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary for given model type
extrudeModel(const word& modelType, const dictionary&); // The corresponding model Coeffs dictionary must exist.
extrudeModel(const word& modelType, const dictionary& dict);
// Selectors // Selectors
//- Select null constructed //- Select null constructed
static autoPtr<extrudeModel> New(const dictionary&); static autoPtr<extrudeModel> New(const dictionary& dict);
//- Destructor //- Destructor
virtual ~extrudeModel(); virtual ~extrudeModel() = default;
// Member Functions // Member Functions
// Access // Access
label nLayers() const; //- Return the number of layers
label nLayers() const;
scalar expansionRatio() const; //- Return the expansion ratio
scalar expansionRatio() const;
// Member Operators // Member Operators

View File

@ -57,12 +57,6 @@ linearDirection::linearDirection(const dictionary& dict)
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
linearDirection::~linearDirection()
{}
// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
point linearDirection::operator() point linearDirection::operator()
@ -72,9 +66,7 @@ point linearDirection::operator()
const label layer const label layer
) const ) const
{ {
//scalar d = thickness_*layer/nLayers_; return surfacePoint + (thickness_*sumThickness(layer)) * direction_;
scalar d = thickness_*sumThickness(layer);
return surfacePoint + d*direction_;
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -25,7 +25,15 @@ Class
Foam::extrudeModels::linearDirection Foam::extrudeModels::linearDirection
Description 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 // Constructors
//- Construct from dictionary //- Construct from dictionary
linearDirection(const dictionary& dict); explicit linearDirection(const dictionary& dict);
//- Destructor //- Destructor
virtual ~linearDirection(); virtual ~linearDirection() = default;
// Member Operators // Member Operators

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -46,7 +46,10 @@ linearNormal::linearNormal(const dictionary& dict)
: :
extrudeModel(typeName, dict), extrudeModel(typeName, dict),
thickness_(coeffDict_.get<scalar>("thickness")), thickness_(coeffDict_.get<scalar>("thickness")),
firstCellThickness_(0), firstCellThickness_
(
coeffDict_.lookupOrDefault<scalar>("firstCellThickness", 0)
),
layerPoints_(nLayers_) layerPoints_(nLayers_)
{ {
if (thickness_ <= 0) if (thickness_ <= 0)
@ -56,42 +59,34 @@ linearNormal::linearNormal(const dictionary& dict)
<< exit(FatalError); << exit(FatalError);
} }
coeffDict_.readIfPresent("firstCellThickness", firstCellThickness_); if (nLayers_ > 1 && firstCellThickness_ > 0)
if (firstCellThickness_ >= thickness_)
{ {
FatalErrorInFunction if (thickness_ <= firstCellThickness_)
<< "firstCellThickness is larger than thickness" {
<< exit(FatalError); FatalErrorInFunction
} << "firstCellThickness leave no room for further layers"
<< exit(FatalError);
}
if (firstCellThickness_ > 0)
{
layerPoints_[0] = firstCellThickness_; layerPoints_[0] = firstCellThickness_;
for (label layerI = 1; layerI < nLayers_; layerI++) for (label layer = 1; layer < nLayers_; ++layer)
{ {
layerPoints_[layerI] = layerPoints_[layer] =
(thickness_ - layerPoints_[0]) (thickness_ - layerPoints_[0])
*sumThickness(layerI) + layerPoints_[0]; *sumThickness(layer) + layerPoints_[0];
} }
} }
else 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 * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
point linearNormal::operator() point linearNormal::operator()
@ -101,14 +96,12 @@ point linearNormal::operator()
const label layer const label layer
) const ) const
{ {
if (layer == 0) if (layer <= 0)
{ {
return surfacePoint; return surfacePoint;
} }
else
{ return surfacePoint + layerPoints_[layer - 1]*surfaceNormal;
return surfacePoint + layerPoints_[layer - 1]*surfaceNormal;
}
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -27,6 +27,13 @@ Class
Description Description
Extrudes by transforming points normal to the surface by a given distance. 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 #ifndef linearNormal_H
@ -44,7 +51,7 @@ namespace extrudeModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class linearNormal Declaration Class extrudeModels::linearNormal Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class linearNormal class linearNormal
@ -63,7 +70,6 @@ class linearNormal
scalarList layerPoints_; scalarList layerPoints_;
public: public:
//- Runtime type information //- Runtime type information
@ -72,11 +78,11 @@ public:
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary
linearNormal(const dictionary& dict); explicit linearNormal(const dictionary& dict);
//- Destructor //- Destructor
virtual ~linearNormal(); virtual ~linearNormal() = default;
// Member Operators // Member Operators

View File

@ -48,12 +48,6 @@ linearRadial::linearRadial(const dictionary& dict)
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
linearRadial::~linearRadial()
{}
// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
point linearRadial::operator() point linearRadial::operator()
@ -66,6 +60,7 @@ point linearRadial::operator()
// radius of the surface // radius of the surface
scalar rs = mag(surfacePoint); scalar rs = mag(surfacePoint);
vector rsHat = surfacePoint/rs; vector rsHat = surfacePoint/rs;
if (Rsurface_ >= 0) rs = Rsurface_; if (Rsurface_ >= 0) rs = Rsurface_;
scalar r = rs + (R_ - rs)*sumThickness(layer); scalar r = rs + (R_ - rs)*sumThickness(layer);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -25,6 +25,14 @@ Class
Foam::extrudeModels::linearRadial Foam::extrudeModels::linearRadial
Description 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 class linearRadial
@ -62,15 +70,16 @@ public:
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary
linearRadial(const dictionary& dict); explicit linearRadial(const dictionary& dict);
//- Destructor //- Destructor
virtual ~linearRadial(); virtual ~linearRadial() = default;
// Member Operators // Member Operators
//- Return point
point operator() point operator()
( (
const point& surfacePoint, const point& surfacePoint,

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -51,24 +51,16 @@ offsetSurface::offsetSurface(const dictionary& dict)
project_(coeffDict_.lookupOrDefault("project", false)) project_(coeffDict_.lookupOrDefault("project", false))
{ {
// Read surface // Read surface
fileName baseName(coeffDict_.lookup("baseSurface")); fileName baseName(coeffDict_.get<fileName>("baseSurface").expand());
baseName.expand();
baseSurfPtr_.reset(new triSurface(baseName)); baseSurfPtr_.reset(new triSurface(baseName));
// Construct search engine
baseSearchPtr_.reset(new triSurfaceSearch(baseSurfPtr_()));
// Read offsetted surface // Read offsetted surface
fileName offsetName(coeffDict_.lookup("offsetSurface")); fileName offsetName(coeffDict_.get<fileName>("offsetSurface").expand());
offsetName.expand();
offsetSurfPtr_.reset(new triSurface(offsetName)); offsetSurfPtr_.reset(new triSurface(offsetName));
// Construct search engine
offsetSearchPtr_.reset(new triSurfaceSearch(offsetSurfPtr_()));
const triSurface& b = *baseSurfPtr_;
const triSurface& b = baseSurfPtr_(); const triSurface& o = *offsetSurfPtr_;
const triSurface& o = offsetSurfPtr_();
if if
( (
@ -78,10 +70,17 @@ offsetSurface::offsetSurface(const dictionary& dict)
) )
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "offsetSurface " << offsetName << "offsetSurface:\n " << offsetName
<< " should have exactly the same topology as the baseSurface " << " has different topology than the baseSurface:\n "
<< baseName << exit(FatalIOError); << baseName << endl
<< exit(FatalIOError);
} }
// Construct search engine
baseSearchPtr_.reset(new triSurfaceSearch(b));
// Construct search engine
offsetSearchPtr_.reset(new triSurfaceSearch(o));
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. 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 have to be topologically identical i.e. one has to be an offsetted version
of the other. 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 #ifndef offsetSurface_H
@ -41,16 +49,15 @@ Description
namespace Foam namespace Foam
{ {
// Forward declarations
class triSurface; class triSurface;
class triSurfaceSearch; class triSurfaceSearch;
namespace extrudeModels namespace extrudeModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class offsetSurface Declaration Class extrudeModels::offsetSurface Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class offsetSurface class offsetSurface
@ -59,21 +66,22 @@ class offsetSurface
{ {
// Private data // Private data
//- surface //- The base surface
autoPtr<triSurface> baseSurfPtr_; autoPtr<triSurface> baseSurfPtr_;
//- search engine //- The offset surface
autoPtr<triSurfaceSearch> baseSearchPtr_;
//- offsets
autoPtr<triSurface> offsetSurfPtr_; autoPtr<triSurface> offsetSurfPtr_;
//- search engine //- The search engine
autoPtr<triSurfaceSearch> baseSearchPtr_;
//- The search engine
autoPtr<triSurfaceSearch> offsetSearchPtr_; autoPtr<triSurfaceSearch> offsetSearchPtr_;
// Whether to re-project onto offsetted surface //- Project onto offsetted surface?
const bool project_; const bool project_;
public: public:
//- Runtime type information //- Runtime type information
@ -82,7 +90,7 @@ public:
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary
offsetSurface(const dictionary& dict); explicit offsetSurface(const dictionary& dict);
//- Destructor //- Destructor

View File

@ -56,12 +56,6 @@ plane::plane(const dictionary& dict)
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
plane::~plane()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace extrudeModels } // End namespace extrudeModels

View File

@ -28,6 +28,8 @@ Description
Extrudes by transforming points normal to the surface by 1 layer over Extrudes by transforming points normal to the surface by 1 layer over
a given distance. a given distance.
Uses the linearNormalCoeffs dictionary
See also See also
Foam::extrudeModels::linearNormal Foam::extrudeModels::linearNormal
@ -46,7 +48,7 @@ namespace extrudeModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class plane Declaration Class extrudeModels::plane Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class plane class plane
@ -62,11 +64,11 @@ public:
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary
plane(const dictionary& dict); explicit plane(const dictionary& dict);
//- Destructor //- Destructor
virtual ~plane(); virtual ~plane() = default;
}; };

View File

@ -49,12 +49,6 @@ radial::radial(const dictionary& dict)
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
radial::~radial()
{}
// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
point radial::operator() point radial::operator()

View File

@ -25,6 +25,13 @@ Class
Foam::extrudeModels::radial Foam::extrudeModels::radial
Description 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 class radial
@ -62,11 +69,11 @@ public:
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary
radial(const dictionary& dict); explicit radial(const dictionary& dict);
//-Destructor //-Destructor
virtual ~radial(); virtual ~radial() = default;
// Member Operators // Member Operators

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -46,18 +46,9 @@ addToRunTimeSelectionTable(extrudeModel, sector, dictionary);
sector::sector(const dictionary& dict) sector::sector(const dictionary& dict)
: :
extrudeModel(typeName, dict), extrudeModel(typeName, dict),
axisPt_(coeffDict_.lookup("axisPt")), refPoint_(coeffDict_.getCompat<point>("point", {{"axisPt", -1812}})),
axis_(coeffDict_.lookup("axis")), axis_(coeffDict_.get<vector>("axis").normalise()),
angle_ angle_(degToRad(coeffDict_.get<scalar>("angle")))
(
degToRad(coeffDict_.get<scalar>("angle"))
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
sector::~sector()
{} {}
@ -93,7 +84,7 @@ point sector::operator()
// Find projection onto axis (or rather decompose surfacePoint // Find projection onto axis (or rather decompose surfacePoint
// into vector along edge (proj), vector normal to edge in plane // into vector along edge (proj), vector normal to edge in plane
// of surface point and surface normal. // of surface point and surface normal.
point d = surfacePoint - axisPt_; point d = surfacePoint - refPoint_;
d -= (axis_ & d)*axis_; d -= (axis_ & d)*axis_;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -35,6 +35,18 @@ Description
with extreme aspect ratio and internal faces wrong way around in with extreme aspect ratio and internal faces wrong way around in
checkMesh 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 #ifndef sector_H
@ -50,7 +62,7 @@ namespace extrudeModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class sector Declaration Class extrudeModels::sector Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class sector class sector
@ -60,12 +72,12 @@ class sector
// Private data // Private data
//- Point on axis //- Point on axis
const point axisPt_; const point refPoint_;
//- Normalized direction of axis //- Normalized axis direction
const vector axis_; const vector axis_;
//- Overall angle (radians) //- Overall angle (radians), converted from degrees on input
const scalar angle_; const scalar angle_;
@ -77,15 +89,16 @@ public:
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary
sector(const dictionary& dict); explicit sector(const dictionary& dict);
//- Destructor //- Destructor
virtual ~sector(); virtual ~sector() = default;
// Member Operators // Member Operators
//- Return corresponding point
point operator() point operator()
( (
const point& surfacePoint, const point& surfacePoint,

View File

@ -57,12 +57,6 @@ sigmaRadial::sigmaRadial(const dictionary& dict)
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
sigmaRadial::~sigmaRadial()
{}
// * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * * //
point sigmaRadial::operator() point sigmaRadial::operator()

View File

@ -25,6 +25,15 @@ Class
Foam::extrudeModels::sigmaRadial Foam::extrudeModels::sigmaRadial
Description 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 //-Destructor
virtual ~sigmaRadial(); virtual ~sigmaRadial() = default;
// Member Operators // Member Operators

View File

@ -56,12 +56,6 @@ wedge::wedge(const dictionary& dict)
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
wedge::~wedge()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace extrudeModels } // End namespace extrudeModels

View File

@ -27,6 +27,8 @@ Class
Description Description
Extrudes by rotating a surface symmetrically around axis by 1 layer. Extrudes by rotating a surface symmetrically around axis by 1 layer.
Uses the sectorCoeffs dictionary.
See also See also
Foam::extrudeModels::sector Foam::extrudeModels::sector
@ -45,7 +47,7 @@ namespace extrudeModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class wedge Declaration Class extrudeModels::wedge Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class wedge class wedge
@ -61,11 +63,11 @@ public:
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary
wedge(const dictionary& dict); explicit wedge(const dictionary& dict);
//- Destructor //- Destructor
virtual ~wedge(); virtual ~wedge() = default;
}; };

View File

@ -71,9 +71,9 @@ nLayers 10;
expansionRatio 1.02; 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); axis (-1 0 0);
angle 360; // For nLayers=1 assume symmetry so angle/2 on each side angle 360; // For nLayers=1 assume symmetry so angle/2 on each side
} }
@ -92,14 +92,13 @@ planeCoeffs
linearDirectionCoeffs linearDirectionCoeffs
{ {
direction (0 1 0); direction (0 1 0);
thickness 0.5; thickness 0.5;
} }
linearRadialCoeffs linearRadialCoeffs
{ {
R 0.1; R 0.1;
// Optional inner radius Rsurface 0.01; // Optional inner radius
Rsurface 0.01;
} }
radialCoeffs radialCoeffs

View File

@ -44,9 +44,9 @@ nLayers 10;
expansionRatio 1.02; 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); axis (-1 0 0);
angle 360; // For nLayers=1 assume symmetry so angle/2 on each side angle 360; // For nLayers=1 assume symmetry so angle/2 on each side
} }
@ -65,14 +65,13 @@ planeCoeffs
linearDirectionCoeffs linearDirectionCoeffs
{ {
direction (0 1 0); direction (0 1 0);
thickness 0.5; thickness 0.5;
} }
linearRadialCoeffs linearRadialCoeffs
{ {
R 0.1; R 0.1;
// Optional inner radius Rsurface 0.01; // Optional inner radius
Rsurface 0.01;
} }
radialCoeffs radialCoeffs

View File

@ -71,9 +71,9 @@ nLayers 10;
expansionRatio 1.02; 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); axis (-1 0 0);
angle 360; // For nLayers=1 assume symmetry so angle/2 on each side angle 360; // For nLayers=1 assume symmetry so angle/2 on each side
} }
@ -92,14 +92,13 @@ planeCoeffs
linearDirectionCoeffs linearDirectionCoeffs
{ {
direction (0 1 0); direction (0 1 0);
thickness 0.5; thickness 0.5;
} }
linearRadialCoeffs linearRadialCoeffs
{ {
R 0.1; R 0.1;
// Optional inner radius Rsurface 0.01; // Optional inner radius
Rsurface 0.01;
} }
radialCoeffs radialCoeffs

View File

@ -31,12 +31,11 @@ linearDirectionCoeffs
thickness 0.1; thickness 0.1;
} }
wedgeCoeffs sectorCoeffs //<- Also used for wedge
{ {
axisPt (0 0 0); point (0 0 0);
axis (1 0 0); axis (1 0 0);
angle 10; angle 10;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -31,12 +31,11 @@ linearDirectionCoeffs
thickness 0.1; thickness 0.1;
} }
wedgeCoeffs sectorCoeffs //<- Also used for wedge
{ {
axisPt (0 0 0); point (0 0 0);
axis (1 0 0); axis (1 0 0);
angle 10; angle 10;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -14,18 +14,18 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
extrudeModel wedge; extrudeModel wedge;
patchInfo patchInfo
{} {}
patchType wedge; patchType wedge;
sectorCoeffs sectorCoeffs //<- Also used for wedge
{ {
axisPt (0 0 0); point (0 0 0);
axis (1 0 0); axis (1 0 0);
angle 10; angle 10;
} }

View File

@ -20,16 +20,17 @@ sourceCase "$FOAM_CASE";
sourcePatches (front); sourcePatches (front);
exposedPatchName back; exposedPatchName back;
extrudeModel wedge; extrudeModel wedge;
sectorCoeffs sectorCoeffs //<- Also used for wedge
{ {
axisPt (0 0 0); point (0 0 0);
axis (0 -1 0); axis (0 -1 0);
angle 1; angle 1;
} }
flipNormals false; flipNormals false;
mergeFaces false;
mergeFaces false;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -27,7 +27,6 @@ expansionRatio 1.0;
linearDirectionCoeffs linearDirectionCoeffs
{ {
axisPt (0 0 0);
direction (1 -0.2 -0.03); direction (1 -0.2 -0.03);
thickness 40; thickness 40;
} }

View File

@ -27,7 +27,6 @@ expansionRatio 1.0;
linearDirectionCoeffs linearDirectionCoeffs
{ {
axisPt (0 0 0);
direction (1 0.2 0.02); direction (1 0.2 0.02);
thickness 60; thickness 60;
} }

View File

@ -27,7 +27,6 @@ expansionRatio 1.0;
linearDirectionCoeffs linearDirectionCoeffs
{ {
axisPt (0 0 0);
direction (1 -0.2 -0.03); direction (1 -0.2 -0.03);
thickness 40; thickness 40;
} }