Skip to content

Is that a typo in olb source code

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Is that a typo in olb source code

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #4691
    Eric
    Participant

    Hi there,

    When I look into the function: olb::BoundaryConditionInstantiator3D::addVelocityBoundary in file: src/boundary/boundaryInstantiator3D.h, I found a typo of addInternalVelocityCorner to be addExternalVelocityCorner at line 585.

    I’m not sure if it is supposed to be like that or whether it will have an impact to the code, but it is a minor issue and we can quickly fix it.

    Best regards,
    Eric

    #4692
    mathias
    Keymaster

    Dear Eric,

    Thanks for reporting! We will check it. What version are you referring to? And can you caopy past the exact lines of code like, original code “..” should be changed to new code “..”.

    Thanks a lot!
    Best
    Mathias

    #4693
    Eric
    Participant

    Dear Mathias,

    I’m using the newest version, i.e. version 1.3-1.

    In file /src/boundary/boundaryInstantiator3D.h

     580           else if (discreteNormal[0] == 2) {
      581             if (discreteNormal[1] == 1 && discreteNormal[2] == 1 && discreteNormal[3] == 1) {
      582               addInternalVelocityCorner<1,1,1>(iX,iY,iZ, omega);
      583             }
      584             else if (discreteNormal[1] == 1 && discreteNormal[2] == -1 && discreteNormal[3] == 1) {
      585               addExternalVelocityCorner<1,-1,1>(iX,iY,iZ, omega);
      586             }

    In line 585 the function

    addExternalVelocityCorner<1,-1,1>(iX,iY,iZ, omega);

    should be

    addInternalVelocityCorner<1,-1,1>(iX,iY,iZ, omega);

    Thank you,
    Eric

    #4694
    mathias
    Keymaster

    Dear Eric,

    The case “discreteNormal[0] == 2” stands for special cases like with materials like that case is 2D

    1 2 2
    2 2* 2
    2 2 1

    Here, the node 2* needs a special treatment. We used the other dimentions of “discreteNormal” to encripted other special cases like that.

    Best
    Mathias

    #4695
    Eric
    Participant

    Dear Mathias,

    Sorry I don’t understand.

    What I know from function olb::BlockGeometryStatistics3D< T >::getType is that discreteNormal determines one boundary node’s type and normal direction. The type of boundary node is defined by discreteNormal[0], e.g. in D3Q19

    discreteNormal[0] = 0 means the node lays on faces and has 6 types;
    discreteNormal[0] = 1 means external corner node and has 8 types;
    discreteNormal[0] = 2 means internal corner node and has 8 types;
    discreteNormal[0] = 3 means external edge node and has 12 types;
    discreteNormal[0] = 4 means internal edge node and has 12 types;

    And in olb::BoundaryConditionInstantiator3D< T, DESCRIPTOR, BoundaryManager >::addVelocityBoundary, we add velocity boundary condition in respect to their types.

    If my understanding above is correct, could you please talk more about why we need a special treatment for InternalCornerPNP (discreteNormal=[2,1,-1,1]) only?

    Best regards,
    Eric

    #4697
    mathias
    Keymaster

    Dear Eric,

    I checked very carefully — your are right. That is a bug! Thank you very much for reporting! It will be corrected in the next release.

    Best
    Mathias

    #4700
    Eric
    Participant

    Dear Mathias,

    Thanks! I’m glad to help.

    Best regards,
    Eric

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