FreeSlip Boundary Condition – Implementation Doubts
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › FreeSlip Boundary Condition – Implementation Doubts
 This topic has 6 replies, 2 voices, and was last updated 6 years, 2 months ago by robin.trunk.

AuthorPosts

May 20, 2016 at 4:23 pm #1832Alejandro_ClaroMember
Hi Robin,rnrnThank you for your response. I have not been tried to implement the addConvectionBoundary function of the class sOnLatticeBoundaryCondition2D. I have already read your paper Inertial dilute particulate fluid flow simulations with an Euler–Euler lattice Boltzmann method, where you implemented this convectionboundary in order to simulate an outflow condition. It seems that “”advectionDiffusionBoundayPostProcessiorXD.h/hh”” it is only implemented in 3D, right? rnrnIn the case of freeslip, if “”U“”is the velocity vector and “”n“” is the normal vector to the boundary pointing outwards, the grad(U)*n = 0 (0 is the zero vector). Thus, if I am not wrong, the outflow condition of your paper should not be applied for this kind of boundary.rnrnI checked the addSlipBoundary function available in olb::sOnLatticeBoundaryCondition2D< T, Lattice > Class Template Reference. The processSubDomain, located in SlipBoundaryProcessor2D, works as the specular reflection approach explained by myself at the beginning of this post. However, I do not understand why the corner nodes are treated as a bounceback for the diagonal direction and the vertical and horizontal are switched 90°. For example, for a D2Q9 lattice and the NorthWest node, the distributions changed are :rn

f4 = f2rnf5 = f1rnf6 = f8
rnrnIt should be noted that the lattice arrangement is:rn
Code:rn 1—8—7rn  rn 2—0—6rn  rn 3—4—5rnrnrnAs pointed out by in Question about Cavity2d Example and How to set a slip boundary posts, it seems that the nodes residing in the overlap region could not be implemented as a SlipBoundaryCondition. Does someone know how to “”fix”” or overcome this problem?rnrnFinally, the user guide indicates that createInterpBoundaryConditionXD is the default nonlocal boundary condition based in the work of Skordos (1993). It seems that “”StraightFdBoundaryProcessor2D“” and “”PlaneFdBoundaryProcessor3D“” correspond to the postprocessing classes for 2D and 3D, respectively. Does someone know how theses classes are accessed by the createInterpBoundaryConditionXD object ? Because from the sOnLatticeBoundaryConditionXD class only the velocity/pressure/slip/convection boundary functions are available. rnrnBest regards,rnAlejandrorn
May 23, 2016 at 9:06 am #2366robin.trunkKeymasterHi Alejandro,rnrn1) To write a new boundary like BounceBack, you can have a look at the dynamics.hh file in the src folder. I think implementing the boundary this way is mainly a copy and paste work of the BounceBack class and changing the collide function.rnrn2) I implemented a convection boundary for AdvectionDiffusion problems,that computes the missing f_i by extrapolation, for more information you can have a look at section 3.3 ofrnhttp://www.sciencedirect.com/science/article/pii/S1877750316300345rnI think there is also a ConvectionBoundary for the fluid that might be worth checking.rnrnBest regardsrnRobin
May 24, 2016 at 11:02 am #2367Alejandro_ClaroMemberHi Robin,rnrnThank you for your response. I am trying to “”copypaste”” the BounceBack template in the code to change just the “”collide”” function. From the specular reflection’s concept I am having some difficulties to create a code that it is independent of the location of the surface and the existence of corners/edges in 2D/3D. However, I will tested this approach in the 2dcylinder example.rnrnI read the user guide of OpenLB and I found that in section 2.2 (define and use boundary conditions) the createInterpBoundaryConditionXD allows to implement the nonlocal boundaries. The velocity gradient is evaluated with this “”option””. If I well understood, the nonlocal boundary implements a postprocess step (just after the streaming step). I seems that the Class Template olb::BlockLattice3D<T,Lattice> has the function addPostProcessor (PostProcessorGenerator3D<T,Lattice> const &ppGen). The PostProcessorGenerator3D<T,Lattice> class has been implemented in Class Template olb::PlaneFdBoundaryProcessorGenerator3D<T,Lattice,direction,orientation>. However, I do not figure out how to define the postprocess routine. In this routine I would like to implement the functions found in olb::fd Namespace.rnrnThe direction and orientation parameters in PlaneFdBoundaryProcessorGenerator3D are for the plane of interest ? Theses parameters are scalars or vector ? The normal vector of the surface is inwards or outwards of it ? rnrnI will check your paper in these days.rnrnBest regards,rnAlejandro
May 24, 2016 at 3:24 pm #2368robin.trunkKeymasterHi Alejandro,rnrnyou are right, since the BounceBack is implemented as an Dynamics object, that replaces the standard collision step. This step is desired to be strictly local, therefore the code is not designed to allow nonlocal boundaries at this point.rnThe post processing is the right place for nonlocal boundary treatment. As an example you can look at the convection boundary implemented for advection diffusion problems. Especially at the filesrnopenlb > src > dynamics > advectionDiffusionBoundaryPostProcessor3D.h / .hhrnThe Generator creates an PostProcessor object that contains a function processSubDomain, where the actual treatment of the boundary is implemented.rnrndirection and orientation are computed from a discrete normal that is obtained byrndiscreteNormal = blockGeometryStructure.getStatistics().getType(iX,iY,iZ);rnThis normal is pointing outwards and discreteNormal[0] contains the type of boundary node (plane, edge, …). More information about this normal can be found in the doxygen.rnrnBest regardsrnRobin
May 26, 2016 at 1:58 pm #2346Alejandro_ClaroMemberHi Robin,rnrnThank you for your response. I have not been tried to implement the addConvectionBoundary function of the class sOnLatticeBoundaryCondition2D. I have already read your paper Inertial dilute particulate fluid flow simulations with an Euler–Euler lattice Boltzmann method, where you implemented this convectionboundary in order to simulate an outflow condition. It seems that “”advectionDiffusionBoundayPostProcessiorXD.h/hh”” it is only implemented in 3D, right? rnrnIn the case of freeslip, if “”U“”is the velocity vector and “”n“” is the normal vector to the boundary pointing outwards, the grad(U)*n = 0 (0 is the zero vector). Thus, if I am not wrong, the outflow condition of your paper should not be applied for this kind of boundary.rnrnI checked the addSlipBoundary function available in olb::sOnLatticeBoundaryCondition2D< T, Lattice > Class Template Reference. The processSubDomain, located in SlipBoundaryProcessor2D, works as the specular reflection approach explained by myself at the beginning of this post. However, I do not understand why the corner nodes are treated as a bounceback for the diagonal direction and the vertical and horizontal are switched 90°. For example, for a D2Q9 lattice and the NorthWest node, the distributions changed are :rn

f4 = f2rnf5 = f1rnf6 = f8
rnrnIt should be noted that the lattice arrangement is:rn
Code:rn 1—8—7rn  rn 2—0—6rn  rn 3—4—5rnrnrnAs pointed out by in Question about Cavity2d Example and How to set a slip boundary posts, it seems that the nodes residing in the overlap region could not be implemented as a SlipBoundaryCondition. Does someone know how to “”fix”” or overcome this problem?rnrnFinally, the user guide indicates that createInterpBoundaryConditionXD is the default nonlocal boundary condition based in the work of Skordos (1993). It seems that “”StraightFdBoundaryProcessor2D“” and “”PlaneFdBoundaryProcessor3D“” correspond to the postprocessing classes for 2D and 3D, respectively. Does someone know how theses classes are accessed by the createInterpBoundaryConditionXD object ? Because from the sOnLatticeBoundaryConditionXD class only the velocity/pressure/slip/convection boundary functions are available. rnrnBest regards,rnAlejandrorn
May 31, 2016 at 9:17 am #2347robin.trunkKeymasterHi Alejandro,rnrn
Quote:It seems that “”advectionDiffusionBoundayPostProcessiorXD.h/hh”” it is only implemented in 3D, right?rnThis is correct, but for 2D it should be possible to do an analogue implementation.rnrn
Quote:the grad(U)*n = 0 (0 is the zero vector)rnWasn’t that just what you wanted? In your first post you wrote:rn
Quote:2. von Neumann boundary condition : The gradient of the velocity normal to the wall is zerornSo for free slip you want something similiar (replacing the vector n with a vector tangential to the surface), or am I wrong?rnrn
Quote:it seems that the nodes residing in the overlap region could not be implemented as a SlipBoundaryCondition. Does someone know how to “”fix”” or overcome this problem?rnIf you refer to the “”could not add boundary”” messages in the beginning, this shouldn’t be a problem, since computations on the overlap are not required, hence no boundary condition has to be applied.rnrnBest regardsrnRobin
May 31, 2016 at 10:31 pm #2348Alejandro_ClaroMemberHi Robin,rnrnThanks for your response. From your last post I have some doubts:rn

rn1. What do you mean by doing an analogue implementation ?rnrn2. The vector
n should be the normal vector in order to implement the condition grad(U)*n = 0. Maybe I did not express myself correctly in my post for the “”von Neumann boundary condition””. So in this case it is me that is wrong ;).rnrn3. I have not well understood the “”overlap”” region. But from your response, will all the nodes/lattices at the boundary be implemented to the boundary condition defined by slipboundary/velocityboundary/etc.? rnrnrnI am trying to implement the freeslip boundary condition at the boundary from the default nonlocal boundary condition based in the work of Skordos (1993). I figured out how the addVelocityBoundary from the class olb::sOnLatticeBoundaryCondition2D implements:rnrnolb::StraightFdBoundaryProcessor2D< T, Lattice, direction, orientation > Class Template ReferencernrnThis class corresponds to the algorithm proposed by Skordos. This class is used as postprocessor. The process is called from the class SuperLatticeXD in the collideAndStream() function.rnrnI would like to define a new class from StraightFdBoundaryProcessor2D class in order to redefine a new process function that will define grad(U)*n = 0. Also, I am trying to inheritance the class SuperLattice2D to add a new function addFreeSlipBoundary which will used to invoke the new class from StraightFdBoundaryProcessor2D. Basically, I want to modify the postprocess function according to what I want and then I define a new function to implement this postprocessor function, like the addVelocityBoundary function.rnrnDo you have any idea how could this could be made ? Does exist a better way to give the boundary conditions for the velocity and the grad(u) in the Skordos algorithm?rnrnBest Regards,rnrnAlejandro

AuthorPosts
 You must be logged in to reply to this topic.