Commit 3bf15d1b authored by Kutalmis Bercin's avatar Kutalmis Bercin Committed by Andrew Heather
Browse files

DOC: elaborate the usage of topoSet

  TUT: add topoSet examples to pisoFoam/RAS/cavity tutorial
  BUG: fixes #1673
parent 2c827fdf
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -27,10 +27,49 @@ Class
Foam::boundaryToCell
Description
A topoSetCellSource to select all external (boundary) faces.
\heading Dictionary parameters
None
A \c topoSetCellSource to select all cells possessing
at least a single face on all external boundaries.
Operands:
\table
Operand | Type | Location
output | cellSet | $FOAM_CASE/constant/polyMesh/sets/\<set\>
\endtable
Usage
Minimal example by using \c system/topoSetDict.actions:
\verbatim
{
// Mandatory (inherited) entries
name <name>;
type cellSet;
action <action>;
// Mandatory entries
source boundaryToCell;
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
name | Name of cellSet | word | yes | -
type | Type name: cellSet | word | yes | -
action | Action applied on cells - see below | word | yes | -
source | Source name: boundaryToCell | word | yes | -
\endtable
Options for the \c action entry:
\verbatim
new | Create a new cellSet from selected cells
add | Add selected cells into this cellSet
subtract | Remove selected cells from this cellSet
\endverbatim
See also
- Foam::topoSetSource
- Foam::topoSetCellSource
- Foam::patchToCell
SourceFiles
boundaryToCell.C
......@@ -55,7 +94,7 @@ class boundaryToCell
:
public topoSetCellSource
{
// Private data
// Private Data
//- Add usage string
static addToUsageTable usage_;
......@@ -71,6 +110,7 @@ public:
//- Runtime type information
TypeName("boundaryToCell");
// Constructors
//- Construct from components
......@@ -94,7 +134,6 @@ public:
const topoSetSource::setAction action,
topoSet& set
) const;
};
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -28,20 +28,80 @@ Class
Foam::boxToCell
Description
A topoSetCellSource to select cells based on cell centres inside box(es).
A \c topoSetCellSource to select all cells
whose cell centre inside given bounding box(es).
\heading Dictionary parameters
Operands:
\table
Property | Description | Required | Default
boxes | Multiple bounding boxes | partly |
box | A single bounding box | partly |
min | Minimum point for a single box | partly |
max | Maximum point for a single box | partly |
Operand | Type | Location
output | cellSet | $FOAM_CASE/constant/polyMesh/sets/\<set\>
\endtable
Usage
Minimal example by using \c system/topoSetDict.actions:
\verbatim
{
// Mandatory (inherited) entries
name <name>;
type cellSet;
action <action>;
// Mandatory entries
source boxToCell;
// Conditional mandatory entries
// Select either of the below
// Option-1
boxes
(
(<minX> <minY> <minZ>) (<maxX> <maxY> <maxZ>) // box-1
(<minX> <minY> <minZ>) (<maxX> <maxY> <maxZ>) // box-2
...
);
// Option-2
box (<minX> <minY> <minZ>) (<maxX> <maxY> <maxZ>);
// Option-3
min (<minX> <minY> <minZ>);
max (<maxX> <maxY> <maxZ>);
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
name | Name of cellSet | word | yes | -
type | Type name: cellSet | word | yes | -
action | Action applied on cells - see below | word | yes | -
source | Source name: boxToCell | word | yes | -
\endtable
Options for the \c action entry:
\verbatim
new | Create a new cellSet from selected cells
add | Add selected cells into this cellSet
subtract | Remove selected cells from this cellSet
\endverbatim
Options for the conditional mandatory entries:
\verbatim
Entry | Description | Type | Req'd | Dflt
boxes | Multiple bounding boxes | vectorList | cond'l | -
box | A single bounding box | vector | cond'l | -
min | Minimum point for a single box | vector | cond'l | -
max | Maximum point for a single box | vector | cond'l | -
\verbatim
Note
Must specify "boxes", "box" or a "min/max" pair
(compatibility with searchable box) - highest to lowest precedence.
The order of precedence among the conditional mandatory entries from the
highest to the lowest is \c boxes, \c box or a \c min-max pair
(compatibility with \c searchableBox).
See also
- Foam::topoSetSource
- Foam::topoSetCellSource
SourceFiles
boxToCell.C
......@@ -67,7 +127,7 @@ class boxToCell
:
public topoSetCellSource
{
// Private data
// Private Data
//- Add usage string
static addToUsageTable usage_;
......@@ -86,6 +146,7 @@ public:
//- Runtime type information
TypeName("boxToCell");
// Constructors
//- Construct from components, copying bounding boxes
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -28,17 +28,73 @@ Class
Foam::cellToCell
Description
A topoSetCellSource to select the cells from another cellSet.
A \c topoSetCellSource to select all the cells from given \c cellSet(s).
\heading Dictionary parameters
Operands:
\table
Property | Description | Required | Default
sets | The input cellSet names | possibly |
set | The input cellSet name | possibly |
Operand | Type | Location
input | cellSet(s) | $FOAM_CASE/constant/polyMesh/sets/\<set\>
output | cellSet | $FOAM_CASE/constant/polyMesh/sets/\<set\>
\endtable
Usage
Minimal example by using \c system/topoSetDict.actions:
\verbatim
{
// Mandatory (inherited) entries
name <name>;
type cellSet;
action <action>;
// Mandatory entries
source cellToCell;
// Conditional mandatory entries
// Select either of the below
// Option-1
sets
(
<cellSetName1>
<cellSetName2>
...
);
// Option-2
set <cellSetName>;
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
name | Name of cellSet | word | yes | -
type | Type name: cellSet | word | yes | -
action | Action applied on cells - see below | word | yes | -
source | Source name: cellToCell | word | yes | -
\endtable
Options for the \c action entry:
\verbatim
new | Create a new cellSet from selected cells
add | Add selected cells into this cellSet
subtract | Remove selected cells from this cellSet
\endverbatim
Options for the conditional mandatory entries:
\verbatim
Entry | Description | Type | Req'd | Dflt
sets | Names of input cellSets | wordList | cond'l | -
set | Name of input cellSet | word | cond'l | -
\verbatim
Note
Must specify "sets" or "set" (highest to lowest precedence).
The order of precedence among the conditional mandatory entries from the
highest to the lowest is \c sets, and \c set.
See also
- Foam::topoSetSource
- Foam::topoSetCellSource
SourceFiles
cellToCell.C
......@@ -63,7 +119,7 @@ class cellToCell
:
public topoSetCellSource
{
// Private data
// Private Data
//- Add usage string
static addToUsageTable usage_;
......@@ -77,6 +133,7 @@ public:
//- Runtime type information
TypeName("cellToCell");
// Constructors
//- Construct from components
......@@ -100,7 +157,6 @@ public:
const topoSetSource::setAction action,
topoSet& set
) const;
};
......
......@@ -121,7 +121,15 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell
point2_(point2),
radius_(radius),
innerRadius_(innerRadius)
{}
{
if (innerRadius_ > radius_)
{
FatalErrorInFunction
<< "inner radius = " << innerRadius_ << "cannot be larger than "
<< "outer radius = " << radius_
<< exit(FatalIOError);
}
}
Foam::cylinderAnnulusToCell::cylinderAnnulusToCell
......@@ -135,8 +143,8 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell
mesh,
dict.get<point>("p1"),
dict.get<point>("p2"),
dict.get<scalar>("outerRadius"),
dict.get<scalar>("innerRadius")
dict.getCheck<scalar>("outerRadius", scalarMinMax::ge(SMALL)),
dict.getCheck<scalar>("innerRadius", scalarMinMax::ge(0))
)
{}
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -27,19 +27,64 @@ License
Class
Foam::cylinderAnnulusToCell
Group
grpCellSources
Description
A topoSetCellSource to select cells based on cell centres inside a
cylinder annulus.
A \c topoSetCellSource to select all cells whose cell
centre inside a given bounding cylinder annulus.
Operands:
\table
Operand | Type | Location
output | cellSet | $FOAM_CASE/constant/polyMesh/sets/\<set\>
\endtable
\heading Dictionary parameters
Usage
Minimal example by using \c system/topoSetDict.actions:
\verbatim
{
// Mandatory (inherited) entries
name <name>;
type cellSet;
action <action>;
// Mandatory entries
source cylinderAnnulusToCell;
p1 (<p1X> <p1Y> <p1Z>);
p2 (<p2X> <p2Y> <p2Z>);
outerRadius <radius1>;
// Optional entries
innerRadius <radius2>;
}
\endverbatim
where the entries mean:
\table
Property | Description | Required | Default
p1 | Coordinate of endpoint | yes |
p2 | Coordinate of endpoint | yes |
outerRadius | Cylinder outer radius | yes |
innerRadius | Cylinder inner radius | yes |
Property | Description | Type | Req'd | Dflt
name | Name of cellSet | word | yes | -
type | Type name: cellSet | word | yes | -
action | Action applied on cells - see below | word | yes | -
source | Source name: cylinderAnnulusToCell | word | yes | -
p1 | Coordinate of one of the endpoints | vector | yes | -
p2 | Coordinate of the other endpoint | vector | yes | -
outerRadius | Cylinder outer radius | scalar | yes | -
innerRadius | Cylinder inner radius | scalar | no | 0
\endtable
Options for the \c action entry:
\verbatim
new | Create a new cellSet from selected cells
add | Add selected cells into this cellSet
subtract | Remove selected cells from this cellSet
\endverbatim
See also
- Foam::topoSetSource
- Foam::topoSetCellSource
- Foam::cylinderToCell
SourceFiles
cylinderAnnulusToCell.C
......@@ -63,8 +108,7 @@ class cylinderAnnulusToCell
:
public topoSetCellSource
{
// Private data
// Private Data
//- Add usage string
static addToUsageTable usage_;
......@@ -123,7 +167,6 @@ public:
const topoSetSource::setAction action,
topoSet& set
) const;
};
......
......@@ -110,7 +110,15 @@ Foam::cylinderToCell::cylinderToCell
point2_(point2),
radius_(radius),
innerRadius_(innerRadius)
{}
{
if (innerRadius_ > radius_)
{
FatalErrorInFunction
<< "inner radius = " << innerRadius_ << "cannot be larger than "
<< "outer radius = " << radius_
<< exit(FatalIOError);
}
}
Foam::cylinderToCell::cylinderToCell
......@@ -124,8 +132,8 @@ Foam::cylinderToCell::cylinderToCell
mesh,
dict.get<point>("p1"),
dict.get<point>("p2"),
dict.get<scalar>("radius"),
dict.getOrDefault<scalar>("innerRadius", 0)
dict.getCheck<scalar>("radius", scalarMinMax::ge(SMALL)),
dict.getCheckOrDefault<scalar>("innerRadius", 0, scalarMinMax::ge(0))
)
{}
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -28,17 +28,60 @@ Class
Foam::cylinderToCell
Description
A topoSetCellSource to select cells with their centres inside a cylinder.
A \c topoSetCellSource to select all cells whose cell centre
inside a given bounding cylinder or cylinder annulus.
\heading Dictionary parameters
Operands:
\table
Property | Description | Required | Default
p1 | Coordinate of endpoint | yes |
p2 | Coordinate of endpoint | yes |
radius | Cylinder (outer) radius | yes |
innerRadius | Cylinder inner radius | no | 0
Operand | Type | Location
output | cellSet | $FOAM_CASE/constant/polyMesh/sets/\<set\>
\endtable
Usage
Minimal example by using \c system/topoSetDict.actions:
\verbatim
{
// Mandatory (inherited) entries
name <name>;
type cellSet;
action <action>;
// Mandatory entries
source cylinderToCell;
p1 (<p1X> <p1Y> <p1Z>);
p2 (<p2X> <p2Y> <p2Z>);
radius <radius1>;
// Optional entries
innerRadius <radius2>;
}
\endverbatim
where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
name | Name of cellSet | word | yes | -
type | Type name: cellSet | word | yes | -
action | Action applied on cells - see below | word | yes | -
source | Source name: cylinderToCell | word | yes | -
p1 | Coordinate of one of the endpoints | vector | yes | -
p2 | Coordinate of the other endpoint | vector | yes | -
radius | Cylinder outer radius | scalar | yes | -
innerRadius | Cylinder inner radius | scalar | no | 0
\endtable
Options for the \c action entry:
\verbatim
new | Create a new cellSet from selected cells
add | Add selected cells into this cellSet
subtract | Remove selected cells from this cellSet
\endverbatim
See also
- Foam::topoSetSource
- Foam::topoSetCellSource
- Foam::cylinderAnnulusToCell
SourceFiles
cylinderToCell.C
......@@ -62,8 +105,7 @@ class cylinderToCell
:
public topoSetCellSource
{
// Private data
// Private Data
//- Add usage string
static addToUsageTable usage_;
......@@ -122,7 +164,6 @@ public:
const topoSetSource::setAction action,
topoSet& set
) const;
};
......
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -28,18 +28,86 @@ Class
Foam::faceToCell
Description
A topoSetCellSource to select cells based on usage in a face set.
A \c topoSetCellSource to select all cells based on usage in given
\c faceSet(s), e.g. select cells that are the \c owner/neighbour/any
of the faces in a given \c faceSet.
\heading Dictionary parameters
Operands:
\table
Property | Description | Required | Default
sets | The faceSet names to use | possibly |
set | The faceSet name to use | possibly |
option | Selection type (all/any/owner/neighbour) | yes |
Operand | Type | Location
input | faceSet(s) | $FOAM_CASE/constant/polyMesh/sets/\<set\>