Go to the documentation of this file.
45 displacementLayeredMotionMotionSolver,
51 displacementMotionSolver,
52 displacementLayeredMotionMotionSolver,
62 const label cellZoneI,
85 if (!isZonePoint[cPoints[cPointI]])
87 isZonePoint[cPoints[cPointI]] = 1;
92 syncTools::syncPointList
108 if (!isZoneEdge[cEdges[cEdgeI]])
110 isZoneEdge[cEdges[cEdgeI]] = 1;
115 syncTools::syncEdgeList
128 <<
" edges." <<
endl;
137 const label cellZoneI,
152 points0()[seedPoints[i]],
153 points0()[seedPoints[i]],
165 forAll(isZonePoint, pointI)
167 if (isZonePoint[pointI])
185 if (isZoneEdge[edgeI])
189 mesh().edges()[edgeI].centre(points0()),
206 mesh().globalData().nTotalPoints()
210 forAll(allPointInfo, pointI)
212 if (isZonePoint[pointI])
214 distance[pointI] = allPointInfo[pointI].dist();
215 data[pointI] = allPointInfo[pointI].data();
237 if (
type ==
"fixedValue")
241 else if (
type ==
"timeVaryingUniformFixedValue")
245 fld = timeSeries(
mesh().time().timeOutputValue());
247 else if (
type ==
"slip")
249 if ((patchI % 2) != 1)
252 <<
"FaceZone:" << fz.
name()
258 else if (
type ==
"follow")
263 else if (
type ==
"uniformFollow")
267 const word patchName(
dict.lookup(
"patch"));
268 label patchID =
mesh().boundaryMesh().findPatchID(patchName);
271 pointDisplacement_.boundaryField()[patchID].patchInternalField()
278 <<
"Unknown faceZonePatch type " <<
type <<
" for faceZone "
287 const label cellZoneI,
293 calcZoneMask(cellZoneI, isZonePoint, isZoneEdge);
297 if (patchesDict.size() != 2)
300 <<
"Two faceZones (patches) must be specifed per cellZone. "
301 <<
" cellZone:" << cellZoneI
302 <<
" patches:" << patchesDict.
toc()
313 const word& faceZoneName = patchIter().keyword();
314 label zoneI =
mesh().faceZones().findZoneID(faceZoneName);
318 <<
"Cannot find faceZone " << faceZoneName
319 <<
endl <<
"Valid zones are " <<
mesh().faceZones().names()
355 pointDisplacement_.correctBoundaryConditions();
360 const word& faceZoneName = patchIter().keyword();
361 const dictionary& faceZoneDict = patchIter().dict();
365 const labelList& fzMeshPoints = fz().meshPoints();
369 if (isZonePoint[fzMeshPoints[i]])
371 meshPoints.
append(fzMeshPoints[i]);
387 Info<<
"For cellZone:" << cellZoneI
388 <<
" for faceZone:" << fz.
name()
389 <<
" nPoints:" << tseed().size()
390 <<
" have patchField:"
391 <<
" max:" <<
gMax(tseed())
392 <<
" min:" <<
gMin(tseed())
411 patchDisp[patchI].correctBoundaryConditions();
427 mesh().cellZones()[cellZoneI].
name() +
":distance",
440 scalar d1 = patchDist[0][pointI];
441 scalar d2 = patchDist[1][pointI];
444 scalar
s = d1/(d1 + d2);
449 Info<<
"Writing " << pointScalarField::typeName
451 <<
mesh().time().timeName() <<
endl;
456 const word interpolationScheme = zoneDict.
lookup(
"interpolationScheme");
458 if (interpolationScheme ==
"oneSided")
460 forAll(pointDisplacement_, pointI)
462 if (isZonePoint[pointI])
464 pointDisplacement_[pointI] = patchDisp[0][pointI];
468 else if (interpolationScheme ==
"linear")
470 forAll(pointDisplacement_, pointI)
472 if (isZonePoint[pointI])
474 scalar d1 = patchDist[0][pointI];
475 scalar d2 = patchDist[1][pointI];
476 scalar
s = d1/(d1 + d2 + VSMALL);
478 const vector& pd1 = patchDisp[0][pointI];
479 const vector& pd2 = patchDisp[1][pointI];
481 pointDisplacement_[pointI] = (1 -
s)*pd1 +
s*pd2;
488 <<
"Invalid interpolationScheme: " << interpolationScheme
489 <<
". Valid schemes are 'oneSided' and 'linear'"
535 points0() + pointDisplacement_.internalField()
548 pointDisplacement_.boundaryField().updateCoeffs();
554 const word& cellZoneName = regionIter().keyword();
555 const dictionary& regionDict = regionIter().dict();
559 Info<<
"solving for zone: " << cellZoneName <<
endl;
564 <<
"Cannot find cellZone " << cellZoneName
569 cellZoneSolve(zoneI, regionDict);
586 const vectorField displacement(this->newPoints() - points0_);
596 if ((masterPointI != pointI))
602 points0_[pointI] -= displacement[pointI];
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
A class for handling words, derived from string.
Determines length of string of edges walked to point.
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
#define forAll(list, i)
Loop across all elements in list.
displacementLayeredMotionMotionSolver(const displacementLayeredMotionMotionSolver &)
Disallow default bitwise copy construct.
A class for managing temporary objects.
Type gAverage(const FieldField< Field, Type > &f)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
Wave propagation of information through grid. Every iteration information goes through one layer of e...
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void constrainDisplacement(pointVectorField &displacement, const bool overrideValue=false) const
Apply boundary conditions (single-patch constraints),.
Mesh consisting of general polyhedral cells.
static const pointConstraints & New(const pointMesh &mesh)
void setSize(const label, const unsigned int &val=0u)
Alias for resize()
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
bool set(const label) const
Is element set.
void walkStructured(const label cellZoneI, const PackedBoolList &isZonePoint, const PackedBoolList &isZoneEdge, const labelList &seedPoints, const vectorField &seedData, scalarField &distance, vectorField &data) const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
tmp< vectorField > faceZoneEvaluate(const faceZone &fz, const labelList &meshPoints, const dictionary &dict, const PtrList< pointVectorField > &patchDisp, const label patchI) const
A subset of mesh faces organised as a primitive patch.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
volVectorField vectorField(fieldObject, mesh)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
virtual void solve()
Solve for motion.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Virtual base class for displacement motion solver.
void calcZoneMask(const label cellZoneI, PackedBoolList &isZonePoint, PackedBoolList &isZoneEdge) const
Macros for easy insertion into run-time selection tables.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const word & name() const
Return name.
label findZoneID(const word &zoneName) const
Find zone index given a name.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
scalar distance(const vector &p1, const vector &p2)
wordList names() const
Return a list of zone names.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Application of (multi-)patch point contraints.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual void updateMesh(const mapPolyMesh &)
Update topology.
const labelList & reversePointMap() const
Reverse point map.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
volScalarField scalarField(fieldObject, mesh)
const labelList & pointMap() const
Old point map.
void cellZoneSolve(const label cellZoneI, const dictionary &zoneDict)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
~displacementLayeredMotionMotionSolver()
Destructor.
An interpolation/look-up table of scalar vs <Type> values. The reference scalar values must be monoto...
wordList toc() const
Return the table of contents.
void size(const label)
Override size to be inconsistent with allocated storage.
Type gMin(const FieldField< Field, Type > &f)
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Generic GeometricField class.
defineTypeNameAndDebug(combustionModel, 0)
Database for solution data, solver performance and other reduced data.
Type gMax(const FieldField< Field, Type > &f)
word name(const complex &)
Return a string representation of a complex.