Skip to content

Initialize at Equilibrium

  • This topic has 2 replies, 2 voices, and was last updated 6 years ago by Eric.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1975
    Eric
    Participant

    Dear OpenLB team,

    I have a question about the initialize. As shown in cylinder2D example, function

    Code:
    sLattice.iniEquilibrium( superGeometry, 1, rhoF, uF )

    is applied to initialize the flow field at equilibrium distribution with rhoF and uF. As far as I can see, uF is set in the code with a non-zero value. But when I checked the core code:

    Code:
    template<typename T, template<typename U> class Lattice>
    void BlockLatticeStructure2D<T,Lattice>::iniEquilibrium(
    BlockGeometryStructure2D<T>& blockGeometry, int material,
    AnalyticalF2D<T,T>& rho , AnalyticalF2D<T,T>& u)
    {
    T physR[2]= {T(),T()};
    for (int iX = 0; iX < this->_nx; iX++) {
    for (int iY = 0; iY < this->_ny; iY++) {
    if (blockGeometry.getMaterial(iX, iY) == material) {
    blockGeometry.getPhysR(physR,iX,iY);
    T uTmp[] = {T(),T()};
    u(uTmp,physR);
    T rhoTmp = T();
    rho(&rhoTmp,physR);
    get(iX,iY).iniEquilibrium(rhoTmp,uTmp);
    std::cout << “iX ” << iX << ” iY ” << iY << ” rho ” << rhoTmp << ” u ” << uTmp[0] << ” ” << uTmp[1] << ” physR ” << physR[0] << ” ” << physR[1] << std::endl;
    }
    }
    }
    }

    the uTmp, which is used to iniEquilibrium at cells, is always 0. May I ask is that intended or not? If so, is there any method to initialize the domain with non-zero uniform velocity?

    Looking forward to hearing from you. 🙂

    Best regards,
    Eric

    #2831
    albert.mink
    Moderator

    Hi Eric,

    did you tried to call
    sLattice.iniEquilibrium( superGeometry, 1, rhoF, uF )
    with uF different to zero?

    First the array is initialized by zeros.
    Then it gets the value from the passed AnalyticalF2D object.

    Code:
    T uTmp[] = {T(),T()};
    u(uTmp,physR);

    So just try it.

    All the best
    Albert

    #2832
    Eric
    Participant

    Hi Albert,

    You are right. I made a mistake when setting the uF.
    Thank you for the swift reply!

    Best regards,
    Eric

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