Skip to content

Correction to SuperLatticeTimeAveragedCrossCorrelationF3D

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB Bug Reports Correction to SuperLatticeTimeAveragedCrossCorrelationF3D

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6847
    ramirofreile
    Participant

    Hello,

    I believe I spotted a small error on line 156 of file superLatticeTimeAveraged3D.hh for the calculation of the Reynolds stresses. An additional division by _ensembles is needed. Please see the corrected code below:

    template <typename T>
    bool SuperLatticeTimeAveragedCrossCorrelationF3D<T>::operator() (T output[], const int input[])
    {
    ……
    output[iDim] = _sDataMN.getBlock(iCloc).get(input+1,iDim)/_ensembles -_sDataM.getBlock(iCloc).get(input+1,iDimM)*_sDataN.getBlock(iCloc).get(input+1,iDimN)/_ensembles/_ensembles;
    ……
    };

    Thank you,

    Ramiro Freile

    • This topic was modified 1 year, 6 months ago by ramirofreile. Reason: forgot word corrected
    #6924
    stephan
    Moderator

    Dear Ramiro,

    thank you for the bug report.

    We will have a look and get back to you soon.
    Meanwhile, could you please explain your suggestion?

    BR
    Stephan

    #6934
    ramirofreile
    Participant

    Hi Stephan,

    If you take a look at SuperLatticeTimeAveraged3D.hh, in line 64 (current Doxygen), you will see that the expression matches the expression I wrote in my first bug report message.

    Mathematically, the cross correlation of two fields ends up being equal to

    CrossCorr = (uv)_av – u_av v_av ,

    where _av denotes a time average. Each time average is the sum of N observations divided by _ensembles.
    Thus, the first term requires a single division by _ensembles and the second term requires a double division by _ensembles.

    In my simulations I notices that the Reynolds stresses never converged and kept increasing in value.

    Thank you,

    Ramiro Freile

    #6944
    stephan
    Moderator

    Dear Ramiro,

    thanks again for your post, and for fixing the bug.
    We will include the correction.

    BR
    Stephan

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.