Skip to content

Density calculation error in Sourced AD BGK dynamics computeRhoU

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB Bug Reports Density calculation error in Sourced AD BGK dynamics computeRhoU

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5087
    Julius
    Participant

    Dear Developers,

    I think I have found a small bug in the file src/dynamics/advectionDiffusionDynamics.hh for the class SourcedAdvectionDiffusionBGKdynamics in the function computeRhoU. The density is calculated as follows:

    {
      this->_momenta.computeRhoU( cell, rho, u );
      const T* source = cell.template getFieldPointer<descriptors::SOURCE>();
      rho += 0.5 * source[0] * _omegaMod;
    }

    In the function computeRho of the same class, the density is calculated as:

    {
      const T* source = cell.template getFieldPointer<descriptors::SOURCE>();
      return this->_momenta.computeRho( cell ) + 0.5 * source[0];
    }

    From what I have read, the density calculation of computeRho is correct, while in computeRhoU the density has a erroneous * _omegaMod term.

    Kind Regards,
    Julius Weinmiller

    • This topic was modified 2 years ago by Julius. Reason: Formatting code
    #5089
    mgaedtke
    Keymaster

    Hi Julius,

    thank you very much for identifying this. You are absolutely right. I changed our development version accordingly and the model will be fixed in the upcoming release.

    Kind Regards,
    Max

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