39 Foam::scalar Foam::streamLineParticle::calcSubCycleDeltaT
46 particle testParticle(*
this);
48 bool oldKeepParticle = td.keepParticle;
49 bool oldSwitchProcessor = td.switchProcessor;
50 scalar fraction = testParticle.trackToFace(position()+dt*U, td);
51 td.keepParticle = oldKeepParticle;
52 td.switchProcessor = oldSwitchProcessor;
54 return dt*fraction/td.nSubCycle_;
60 const trackingData& td,
61 const point& position,
72 sampledScalars_.setSize(td.vsInterp_.size());
73 forAll(td.vsInterp_, scalarI)
75 sampledScalars_[scalarI].append
77 td.vsInterp_[scalarI].interpolate
86 sampledVectors_.setSize(td.vvInterp_.size());
87 forAll(td.vvInterp_, vectorI)
89 sampledVectors_[vectorI].append
91 td.vvInterp_[vectorI].interpolate
100 const DynamicList<vector>& U = sampledVectors_[td.UIndex_];
136 is >> lifeTime_ >> sampledPositions_ >> sampledScalars
142 sampledScalars_[i].transfer(sampledScalars[i]);
144 sampledVectors_.setSize(sampledVectors.size());
147 sampledVectors_[i].transfer(sampledVectors[i]);
154 "streamLineParticle::streamLineParticle" 155 "(const Cloud<streamLineParticle>&, Istream&, bool)" 166 lifeTime_(p.lifeTime_),
167 sampledPositions_(p.sampledPositions_),
168 sampledScalars_(p.sampledScalars_)
177 const scalar trackTime
185 scalar tEnd = (1.0 - stepFraction())*trackTime;
186 scalar maxDt = mesh_.bounds().mag();
206 sampledPositions_.append(position());
214 scalar magU =
mag(U);
234 dt = calcSubCycleDeltaT(td, dt, U);
243 scalar fraction = trackToFace(position() + dt*U, td);
247 stepFraction() = 1.0 - tEnd/trackTime;
249 if (tEnd <= ROOTVSMALL)
275 Pout<<
"streamLineParticle : Removing stagnant particle:" 277 <<
" sampled positions:" << sampledPositions_.
size()
285 sampledPositions_.append(position());
286 interpolateFields(td, position(),
cell(),
face());
290 Pout<<
"streamLineParticle : Removing particle:" 292 <<
" sampled positions:" << sampledPositions_.
size()
303 forAll(sampledScalars_, i)
310 forAll(sampledVectors_, i)
328 const scalar trackFraction,
445 iter().lifeTime_ = lifeTime[i];
446 iter().sampledPositions_.transfer(sampledPositions[i]);
478 lifeTime[i] = iter().lifeTime_;
479 sampledPositions[i] = iter().sampledPositions_;
485 sampledPositions.write();
494 os << static_cast<const particle&>(
p)
501 os.
check(
"Ostream& operator<<(Ostream&, const streamLineParticle&)");
Symmetry patch for non-planar or multi-plane patches.
const scalar trackLength_
static void writeFields(const Cloud< streamLineParticle > &)
Write.
#define forAll(list, i)
Loop across all elements in list.
List< DynamicList< vectorList > > & allVectors_
void hitSymmetryPlanePatch(const symmetryPlanePolyPatch &, trackingData &td)
Overridable function to handle the particle hitting a.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
A face is a list of labels corresponding to mesh vertices.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void size(const label)
Override size to be inconsistent with allocated storage.
void hitCyclicPatch(const cyclicPolyPatch &, trackingData &td)
Overridable function to handle the particle hitting a cyclic.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Class used to pass tracking data to the trackToFace function.
Vector< scalar > vector
A scalar version of the templated Vector.
static void readFields(CloudType &c)
Read the fields associated with the owner cloud.
List< DynamicList< scalarList > > & allScalars_
List< vector > vectorList
A List of vectors.
bool hitPatch(const polyPatch &, trackingData &td, const label patchi, const scalar trackFraction, const tetIndices &tetIs)
Overridable function to handle the particle hitting a patch.
Neighbour processor patch.
const vector & position() const
Return current particle position.
void hitSymmetryPatch(const symmetryPolyPatch &, trackingData &td)
Overridable function to handle the particle hitting a.
static void writeFields(const CloudType &c)
Write the fields associated with the owner cloud.
DynamicList< vectorList > & allPositions_
Particle class that samples fields as it passes through. Used in streamline calculation.
List< scalar > scalarList
A List of scalars.
Wedge front and back plane patch.
Storage and named access for the indices of a tet which is part of the decomposition of a cell...
bool keepParticle
Flag to indicate whether to keep particle (false = delete)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
static void readFields(Cloud< streamLineParticle > &)
Read.
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross product operators.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
prefixOSstream Pout(cout,"Pout")
static direction size()
Return the number of elements in the VectorSpace = Ncmpts.
streamLineParticle(const polyMesh &c, const vector &position, const label celli, const label lifeTime)
Construct from components.
void setSize(const label)
Reset size of List.
vector point
Point is a vector.
A cell is defined as a list of faces with extra functionality.
const dimensionedScalar c
Speed of light in a vacuum.
Ostream & operator<<(Ostream &, const ensightPart &)
virtual bool write() const
Write using setting from DB.
dimensioned< scalar > mag(const dimensioned< Type > &)
void hitProcessorPatch(const processorPolyPatch &, trackingData &td)
Mesh consisting of general polyhedral cells.
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
bool switchProcessor
Flag to switch processor.
A patch is a list of labels that address the faces in the global face list.
bool move(trackingData &, const scalar trackTime)
Track all particles to their end point.
A primitive field of type <T> with automated input and output.
void hitWedgePatch(const wedgePolyPatch &, trackingData &td)
Overridable function to handle the particle hitting a wedge.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void hitWallPatch(const wallPolyPatch &, trackingData &td, const tetIndices &)
Overridable function to handle the particle hitting a wallPatch.