56 if (rotationFraction_ < 0 || rotationFraction_ > 1)
59 <<
"Rotation fraction for face " <<
vertices()
60 <<
" must be between 0 and 1"
71 const label blockFacei,
78 label nRows = desc.
density()[blockFaceDirection0[blockFacei]] + 1;
79 label nCols = desc.
density()[blockFaceDirection1[blockFacei]] + 1;
84 bool transpose =
false;
86 static const labelList blockFaceAnchorEdgeis({4, 5, 0, 1, 0, 3});
87 const edge anchorEdge =
97 if (transpose)
Swap(nRows, nCols);
104 if (i < 0) i = nRows + i;
105 if (j < 0) j = nCols + j;
106 return transpose ? j*nRows + i : i*nCols + j;
115 for (
label i = 1; i < nRows - 1; ++ i)
119 const face fPrev({
pi(i,0),
pi(i,-1),
pi(i-1,-1),
pi(i-1,0)});
120 const face fNext({
pi(i+1,0),
pi(i+1,-1),
pi(i,-1),
pi(i,0)});
126 scalarList thetaAround0(nRows), thetaAround1(nRows);
127 thetaAround0[0] = thetaAround1[nRows-1] = 0;
128 for (
label i = 1; i < nRows - 1; ++ i)
130 thetaAround0[i] = thetaAround0[i-1] + dThetaAround[i];
132 for (
label i = nRows - 2; i > 0; -- i)
134 thetaAround1[i] = thetaAround1[i+1] - dThetaAround[i];
140 for (
label i = 1; i < nRows - 1; ++ i)
157 const tensor Raround0 =
Ra(axis0, rotationFraction_*thetaAround0[i]);
158 const tensor Raround1 =
Ra(axis1, rotationFraction_*thetaAround1[i]);
161 const scalar scale0 =
mag(
p(i,-1) -
p(i,0))/
mag(
p(0,-1) -
p(0,0));
162 const scalar scale1 =
mag(
p(i,-1) -
p(i,0))/
mag(
p(-1,-1) -
p(-1,0));
165 const tensor T0 = Rof0 & Raround0 * scale0;
166 const tensor T1 = Rof1 & Raround1 * scale1;
169 for (
label j = 1; j < nCols - 1; ++ j)
171 const scalar fi = scalar(i)/(nRows - 1);
172 const scalar fj = scalar(j)/(nCols - 1);
175 (1 - fi)*(1 - fj)*(
p(i,0) + (
T0 & (
p(0,j) -
p(0,0))))
176 + (1 - fi)*fj*(
p(i,-1) + (
T0 & (
p(0,j) -
p(0,-1))))
177 + fi*(1 - fj)*(
p(i,0) + (T1 & (
p(-1,j) -
p(-1,0))))
178 + fi*fj*(
p(i,-1) + (T1 & (
p(-1,j) -
p(-1,-1))));
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A List with indirect addressing.
Takes the description of the block and the list of curved edges and creates a list of points on edges...
const cellShape & blockShape() const
Return the block shape.
const Vector< label > & density() const
Return the mesh density (number of cells) in the i,j,k directions.
const face & vertices() const
Return block face vertices.
This curved face sweeps the points of an opposing pair of the face's four edges over the surface of t...
virtual void project(const blockDescriptor &, const label blockFacei, pointField &points) const
Project the given points onto the surface.
sweepFace(const dictionary &dict, const label index, const searchableSurfaceList &geometry, Istream &)
Construct from Istream setting pointsList.
edgeList edges() const
Edges of this cellShape.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
static int compare(const edge &, const edge &)
Compare edges.
A face is a list of labels corresponding to mesh vertices.
static vector area(const PointField &ps)
Return vector area given face points.
Container for searchableSurfaces.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
defineTypeNameAndDebug(projectFace, 0)
addToRunTimeSelectionTable(blockFace, projectFace, Istream)
static const coefficient A("A", dimPressure, 611.21)
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensionedScalar asin(const dimensionedScalar &ds)
pointField vertices(const blockVertexList &bvl)
tensor rotationTensor(const vector &n1, const vector &n2)
Rotational transformation tensor from unit vector n1 to n2.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tensor Ra(const vector &a, const scalar omega)
Rotational transformation tensor about axis a by omega radians.
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensionSet normalised(const dimensionSet &)
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)