40 const label tZeroBufferSize
43 sampleSteps_ = ceil(sampleInterval_/mesh_.time().deltaTValue());
45 sampleInterval_ = sampleSteps_*mesh_.time().deltaTValue();
47 label bufferLength(ceil(duration_/sampleInterval_));
49 duration_ = bufferLength*sampleInterval_;
51 label bufferingInterval(ceil(averagingInterval_/sampleInterval_));
53 averagingInterval_ = bufferingInterval*sampleInterval_;
55 label nBuffers(ceil(duration_/averagingInterval_));
84 const label tZeroBufferSize
90 duration_ = cfDict.template lookup<scalar>(
"duration");
92 sampleInterval_ = cfDict.template lookup<scalar>(
"sampleInterval");
94 averagingInterval_ = cfDict.template lookup<scalar>(
"averagingInterval");
96 setTimesAndSizes(tZeroBufferSize);
104 const label tZeroBufferSize,
105 const scalar duration,
106 const scalar sampleInterval,
107 const scalar averagingInterval
113 sampleInterval_(sampleInterval),
114 averagingInterval_(averagingInterval)
116 setTimesAndSizes(tZeroBufferSize);
135 if (measurandFieldSize() != currentValues.
size())
138 <<
"Trying to supply a Field of length" 139 << currentValues.
size()
140 <<
" to calculate the correlation function. " 141 <<
"Expecting a Field of length " 142 << measurandFieldSize() <<
nl 148 forAll(tZeroBuffers_, tZB)
150 scalar& cFSum = cFSums[tZB];
152 const Field<Type>& tZeroBuffer = tZeroBuffers_[tZB];
156 const Type& tZeroBufferValue = tZeroBuffer[cV];
158 const Type& currentValue = currentValues[cV];
169 cFSum /= (measurandFieldSize()*currentValues[0].
size());
172 label bufferToRefill = addToBuffers(cFSums);
174 if (bufferToRefill != -1)
176 tZeroBuffers_[bufferToRefill] = currentValues;
184 const Type& currentValue
187 if (measurandFieldSize() != 1)
190 <<
"Trying to supply a single value to calculate the correlation " 191 <<
"function. Expecting a Field of length " 192 << measurandFieldSize()
196 calculateCorrelationFunction(
Field<Type>(1, currentValue));
205 scalar cFIntegral = 0.0;
207 for (
label v = 0; v < averageCF.
size() - 1; v++)
212 *(averageCF[v+1] + averageCF[v]);
~correlationFunction()
Destructor.
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
void calculateCorrelationFunction(const Field< Type > &)
Pre-declare SubField and related Field type.
errorManip< error > abort(error &err)
static const char *const typeName
Mesh consisting of general polyhedral cells.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)