|
[Sponsors] |
Meaning of sampleFrequency in particleTrackProperties? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 3, 2024, 17:29 |
Meaning of sampleFrequency in particleTrackProperties?
|
#1 | |
Member
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6 |
Dear all,
In the particleTrackProperties there is one entry that I don't know what it is and/or what does it mean:
According to the source code of the particleTracks utility, sampleFrequency must be a number greater than or equal to 1: Code:
sampleFrequency = max(1, sampleFrequency); // sanity Code:
trackSampler.setSampleRate(sampleFrequency, maxPositions, maxTracks); Here's the source code for setSampleRate: Code:
//- Set the sampling stride, upper limits // \return Number of tracks to generate label setSampleRate ( const label sampleFreq, // sampleFrequency is passed as the argument to this parameter const label maxPositions, const label maxTracks = -1 ) { // numTracks = numParticles/stride // stride_: the sampling interval stride_ = max(1, sampleFreq); maxPositions_ = maxPositions; nTracks_ = (origParcelAddr_.totalSize()/stride_); if (maxTracks > 0) { nTracks_ = min(nTracks_, maxTracks); } return nTracks_; } EDIT (ADDED)<<< Note that the value of the sampleFrequency is ended up being stored in the stride_ if its greater than 1. Further in the code there's this function that creates track fields: Code:
template<class Type> void Foam::particleTracksSampler::createTrackField ( const UList<Type>& values, List<DynamicList<Type>>& trackValues ) const { List<Type> allValues(cloudGather_.gather(values)); const label nTracks = trackValues.size(); forAll(allValues, i) { const label globalId = origParcelAddr_.toGlobal(origProcIds_[i], origParcelIds_[i]); if (globalId % stride_ == 0) { const label trackId = globalId/stride_; if ( trackId < nTracks && trackValues[trackId].size() < maxPositions_ ) { trackValues[trackId].append(allValues[i]); } } } } >>>EDIT (ADDED) END. There's also a maxPositions entry in the dictionary. According to the source code: Quote:
Last edited by reverseila; August 3, 2024 at 19:13. |
||
Tags |
lagrangian, particletracks, postprocess |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
meaning of this formula | FluidKo | Main CFD Forum | 5 | October 8, 2022 03:57 |
I want to know meaning of CFX Expression Language for numerical analysis of plasma. | Won-Ho Lee | CFX | 4 | March 13, 2020 03:16 |
What's the meaning of 'w' in 'wmake'? | random_ran | OpenFOAM Programming & Development | 1 | February 11, 2019 17:53 |
Meaning of values in combustion | kane | OpenFOAM Running, Solving & CFD | 1 | May 14, 2018 06:13 |
What's meaning of UDF FUNCTION | zhaoxinyu | Fluent UDF and Scheme Programming | 0 | March 31, 2010 09:04 |