58 Info<<
"Updating vertex markup. curLeft: " 59 << curLeft <<
" curRight: " << curRight <<
endl;
61 tmp<scalarField> tvertexMarkup(
new scalarField(p.size()));
66 if (p[pI].
x() < curLeft - SMALL)
68 vertexMarkup[pI] = -1;
70 else if (p[pI].
x() > curRight + SMALL)
84 void Foam::movingConeTopoFvMesh::addZonesAndModifiers()
93 || topoChanger_.size()
97 <<
"Zones and modifiers already present. Skipping." 103 Info<<
"Time = " << time().timeName() << endl
104 <<
"Adding zones and modifiers to the mesh" <<
endl;
110 boolList flipZone1(fc.size(),
false);
111 label nZoneFaces1 = 0;
114 boolList flipZone2(fc.size(),
false);
115 label nZoneFaces2 = 0;
121 fc[facei].
x() > -0.003501
122 && fc[facei].
x() < -0.003499
125 if ((fa[facei] &
vector(1, 0, 0)) < 0)
127 flipZone1[nZoneFaces1] =
true;
130 zone1[nZoneFaces1] = facei;
131 Info<<
"face " << facei <<
" for zone 1. Flip: " 132 << flipZone1[nZoneFaces1] <<
endl;
137 fc[facei].
x() > -0.00701
138 && fc[facei].
x() < -0.00699
141 zone2[nZoneFaces2] = facei;
143 if ((fa[facei] &
vector(1, 0, 0)) > 0)
145 flipZone2[nZoneFaces2] =
true;
148 Info<<
"face " << facei <<
" for zone 2. Flip: " 149 << flipZone2[nZoneFaces2] <<
endl;
154 zone1.setSize(nZoneFaces1);
155 flipZone1.setSize(nZoneFaces1);
157 zone2.setSize(nZoneFaces2);
158 flipZone2.setSize(nZoneFaces2);
163 List<pointZone*> pz(0);
164 List<faceZone*> fz(2);
165 List<cellZone*> cz(0);
172 "rightExtrusionFaces",
183 "leftExtrusionFaces",
193 Info<<
"Adding mesh zones." <<
endl;
194 addZones(pz, fz, cz);
199 List<polyMeshModifier*> tm(2);
203 new layerAdditionRemoval
208 "rightExtrusionFaces",
211 motionDict_.subDict(
"right").lookup(
"minThickness")
215 motionDict_.subDict(
"right").lookup(
"maxThickness")
220 tm[nMods] =
new layerAdditionRemoval
225 "leftExtrusionFaces",
228 motionDict_.subDict(
"left").lookup(
"minThickness")
232 motionDict_.subDict(
"left").lookup(
"maxThickness")
238 Info<<
"Adding " << nMods <<
" mesh modifiers" <<
endl;
239 topoChanger_.addTopologyModifiers(tm);
248 Foam::movingConeTopoFvMesh::movingConeTopoFvMesh(
const IOobject& io)
264 ).subDict(typeName +
"Coeffs")
266 motionVelAmplitude_(motionDict_.
lookup(
"motionVelAmplitude")),
271 Foam::
sin(time().value()*M_PI/motionVelPeriod_)
278 <<
" Initial curMotionVel_:" << curMotionVel_
281 addZonesAndModifiers();
287 faceZones().findZoneID(
"leftExtrusionFaces")
295 faceZones().findZoneID(
"rightExtrusionFaces")
299 motionMask_ = vertexMarkup
329 Pout<<
"time:" <<
time().
value() <<
" curMotionVel_:" << curMotionVel_
330 <<
" curLeft:" << curLeft_ <<
" curRight:" << curRight_
333 if (topoChangeMap.
valid())
335 Info<<
"Topology change. Calculating motion points" <<
endl;
337 if (topoChangeMap().hasMotionPoints())
339 Info<<
"Topology change. Has premotion points" <<
endl;
344 topoChangeMap().preMotionPoints(),
351 topoChangeMap().preMotionPoints()
353 pos(0.5 -
mag(motionMask_))
358 Info<<
"Topology change. Already set mesh points" <<
endl;
372 pos(0.5 -
mag(motionMask_))
378 Info<<
"No topology change" <<
endl;
383 pos(0.5 -
mag(motionMask_))
388 Info <<
"Executing mesh motion" <<
endl;
396 faceZones().findZoneID(
"leftExtrusionFaces")
404 faceZones().findZoneID(
"rightExtrusionFaces")
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool movePoints()
Do what is neccessary if the mesh has moved.
const Type & value() const
Return const reference to value.
Vector< scalar > vector
A scalar version of the templated Vector.
virtual bool update()
Update the mesh for both mesh motion and topology change.
autoPtr< mapPolyMesh > changeMesh(const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Macros for easy insertion into run-time selection tables.
virtual const pointField & points() const
Return raw points.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
List< bool > boolList
Bool container classes.
dimensionedScalar pos(const dimensionedScalar &ds)
vectorField pointField
pointField is a vectorField.
stressControl lookup("compactNormalStress") >> compactNormalStress
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Abstract base class for a topology changing fvMesh.
List< label > labelList
A List of labels.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set).
prefixOSstream Pout(cout,"Pout")
dimensionedScalar sin(const dimensionedScalar &ds)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
dimensionedScalar deltaT() const
Return time step.
Constant dispersed-phase particle diameter model.
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
const faceZoneMesh & faceZones() const
Return face zone mesh.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A class for managing temporary objects.
polyTopoChanger topoChanger_
virtual ~movingConeTopoFvMesh()
Destructor.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const Time & time() const
Return the top-level database.
#define InfoInFunction
Report an information message using Foam::Info.