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
- This topic has 6 replies, 2 voices, and was last updated 4 years, 11 months ago by Eric.
-
AuthorPosts
-
December 18, 2019 at 12:39 pm #4691EricParticipant
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,
EricDecember 18, 2019 at 11:29 pm #4692mathiasKeymasterDear 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
MathiasDecember 19, 2019 at 1:59 pm #4693EricParticipantDear 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,
EricDecember 19, 2019 at 9:25 pm #4694mathiasKeymasterDear 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 1Here, the node 2* needs a special treatment. We used the other dimentions of “discreteNormal” to encripted other special cases like that.
Best
MathiasDecember 20, 2019 at 4:33 pm #4695EricParticipantDear Mathias,
Sorry I don’t understand.
What I know from function
olb::BlockGeometryStatistics3D< T >::getType
is thatdiscreteNormal
determines one boundary node’s type and normal direction. The type of boundary node is defined bydiscreteNormal[0]
, e.g. in D3Q19discreteNormal[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,
EricDecember 25, 2019 at 11:11 pm #4697mathiasKeymasterDear 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
MathiasDecember 27, 2019 at 12:12 am #4700EricParticipantDear Mathias,
Thanks! I’m glad to help.
Best regards,
Eric -
AuthorPosts
- You must be logged in to reply to this topic.