CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Simple explain for satisfying boundary conditions in Stam and Bridson papers (https://www.cfd-online.com/Forums/main/188550-simple-explain-satisfying-boundary-conditions-stam-bridson-papers.html)

AnasVFX June 1, 2017 16:10

Simple explain for satisfying boundary conditions in Stam and Bridson papers
 
I read Stable Fluids by Jos Stam and FLUID SIMULATION SIGGRAPH 2007 Course Notes by Robert Bridson. The boundary conditions in the two papers are different in my sight. I don't understand them. How are these two ways related to solving a linear system of PDEs with boundary conditions?

In Stam's paper, he uses a function called set_bnd to set boundaries, so is this function just setting the boundaries that I need in my matrix of linear systems of Pressure Poisson and Diffuse Equation? In Numerical Analysis, we don't modify the matrix with the boundary values, but we put the boundary condition either it's a Neumann or Dirichlet. I don't really understand what kind of boundaries is this set_bnd function. My thinking now is that it sets the boundary values which will be used to solve linear systems but what kind of boundaries?

In Bridson's paper, I don't find any implementation about boundaries except for speaking about the normal components of velocity. Actually, I can't find any relation between this and Stam's way. In the section on making fluid incompressible, he says something about boundaries but I don't understand. He just satisfies boundary conditions on the boundary cells then he solves the system or he put the boundaries in the matrix? Actually I don't know how to satisfy u*n = u_solid * n which I think is the no stick boundaries for interacting between a fluid and solid boundaries.

FMDenaro June 1, 2017 16:17

Quote:

Originally Posted by AnasVFX (Post 651248)
I read Stable Fluids by Jos Stam and FLUID SIMULATION SIGGRAPH 2007 Course Notes by Robert Bridson. The boundary conditions in the two papers are different in my sight. I don't understand them. How are these two ways related to solving a linear system of PDEs with boundary conditions?

In Stam's paper, he uses a function called set_bnd to set boundaries, so is this function just setting the boundaries that I need in my matrix of linear systems of Pressure Poisson and Diffuse Equation? In Numerical Analysis, we don't modify the matrix with the boundary values, but we put the boundary condition either it's a Neumann or Dirichlet. I don't really understand what kind of boundaries is this set_bnd function. My thinking now is that it sets the boundary values which will be used to solve linear systems but what kind of boundaries?

In Bridson's paper, I don't find any implementation about boundaries except for speaking about the normal components of velocity. Actually, I can't find any relation between this and Stam's way. In the section on making fluid incompressible, he says something about boundaries but I don't understand. He just satisfies boundary conditions on the boundary cells then he solves the system or he put the boundaries in the matrix? Actually I don't know how to satisfy u*n = u_solid * n which I think is the no stick boundaries for interacting between a fluid and solid boundaries.


That's not correct...when you prescribe Neumann BC.s, some entries of the matrix are changed.

AnasVFX June 1, 2017 16:54

I mean that if we just have a dirichlet or Neumann condition like u'(0)=1,we can just evaluate u (0) and put it in the first row of the matrix
Another thing, when we just solve the pressure poisson equation, if we just solve at the slip boundary conditions u.n = u.solid , do we use the pressure normal derivative boundary condition (partial P / Partial n =0)? Or we just use this pressure condition in the no slip condition?

FMDenaro June 1, 2017 17:05

We recently discussed about BC.s for the pressure equation in this thread:
https://www.cfd-online.com/Forums/ma...er-stokes.html

AnasVFX June 1, 2017 21:06

I am reading but my question is a lot simpler. I just want to solve the pressure poisson equation with the slip boundary conditions. The condition for the velocity is u*n = usolid*n which I don't know how to satisfy in the simulation. Another condition for the pressure, will it be the normal derivative of pressure =0? Is it different from the collocation grids and mac grids(staggered grid)? Please I am a beginner and seeking your help please be patient with me and help although my questions are stupid.

FMDenaro June 1, 2017 22:27

Quote:

Originally Posted by AnasVFX (Post 651282)
I am reading but my question is a lot simpler. I just want to solve the pressure poisson equation with the slip boundary conditions. The condition for the velocity is u*n = usolid*n which I don't know how to satisfy in the simulation. Another condition for the pressure, will it be the normal derivative of pressure =0? Is it different from the collocation grids and mac grids(staggered grid)? Please I am a beginner and seeking your help please be patient with me and help although my questions are stupid.

As you see, a tangential bc is not involved in the pressure equation...slip or no-slip bc is prescribed in the momentum.
For the pressure equation, to be well posed the problem, you prescribe:

dp/dn=n.(v*-v)

AnasVFX June 2, 2017 00:04

Can you take a look at the paper of Bridson? He didn't apply this boundary you said. I don't know actually how to apply the boundary of the pressure in the equation pf pressure poisson. His way is totally confusing and I can't understand the usage of velocity solid boundaries. He doesn't talk about the pressure boundaries. Please if you have a source or an explanation to clarify all of this confusion about boundaries please send me it. Thanks and cheers. What do you mean that it's prescribed in the momentum?

FMDenaro June 2, 2017 02:50

Quote:

Originally Posted by AnasVFX (Post 651289)
Can you take a look at the paper of Bridson? He didn't apply this boundary you said. I don't know actually how to apply the boundary of the pressure in the equation pf pressure poisson. His way is totally confusing and I can't understand the usage of velocity solid boundaries. He doesn't talk about the pressure boundaries. Please if you have a source or an explanation to clarify all of this confusion about boundaries please send me it. Thanks and cheers. What do you mean that it's prescribed in the momentum?


He describes the bc.s at the wall in terms of Neumann condition, see the section at page 27.

AnasVFX June 2, 2017 12:22

Quote:

Originally Posted by FMDenaro (Post 651299)
He describes the bc.s at the wall in terms of Neumann condition, see the section at page 27.

So when we use the boundary partial p / partial n = 0? In the sli condition only?

FMDenaro June 2, 2017 12:29

Quote:

Originally Posted by AnasVFX (Post 651385)
So when we use the boundary partial p / partial n = 0? In the sli condition only?


No, the Neumann condition implies only the normal component of the velocity, that means physically permeable/not-permeable wall. The tangential condition is prescribed ONLY in the momentum equations.

AnasVFX June 2, 2017 14:25

Quote:

Originally Posted by FMDenaro (Post 651388)
No, the Neumann condition implies only the normal component of the velocity, that means physically permeable/not-permeable wall. The tangential condition is prescribed ONLY in the momentum equations.

I read in Stam's ways of implementing a Fluid solvers that we use this normal derivative boundary condition to solve the pressure poisson problem. And he said that we use this zero normal derivative of pressure. Actually I don't understand what you mean with prescribed only in the momentum. Thanks for your time and help cheers.

FMDenaro June 2, 2017 14:31

Quote:

Originally Posted by AnasVFX (Post 651398)
I read in Stam's ways of implementing a Fluid solvers that we use this normal derivative boundary condition to solve the pressure poisson problem. And he said that we use this zero normal derivative of pressure. Actually I don't understand what you mean with prescribed only in the momentum. Thanks for your time and help cheers.


The pressure equation requires only one boundary condition that is prescribed in term of the normal component of the velocity (by meanso of the Neumann condition) to fulfill the divergence-free constraint. That does not imply that you fix also the tangential component of the velocity, this latter being prescribed when solving the momentum equation.
Setting dp/dn=0 implies that n.v*=n.v_n+1

AnasVFX June 2, 2017 16:30

Quote:

Originally Posted by FMDenaro (Post 651399)
The pressure equation requires only one boundary condition that is prescribed in term of the normal component of the velocity (by meanso of the Neumann condition) to fulfill the divergence-free constraint. That does not imply that you fix also the tangential component of the velocity, this latter being prescribed when solving the momentum equation.
Setting dp/dn=0 implies that n.v*=n.v_n+1

I am really sorry I still don't understand the relationship between the normal derivative of pressure and the solid boundaries. Actually I don't know how to force u.n =u.solid.n
in the code :( I am totally confused

FMDenaro June 2, 2017 16:37

The Neumann BC is derived from the momentum equation written in the form of the Hodge decomposition:

v_n+1 + Grad phi = v*

you have just to project along the vector unit n.
But if you do not have a theoretical background about the numerical formulation for the incompressible form, I suggest to start with a good texbook of CFD.

AnasVFX June 2, 2017 16:53

In this source here in section 38.2.4
http://developer.download.nvidia.com...gems_ch38.html

He said in the boundary conditions section
Quote:

. For velocity, we use the no-slip condition, which specifies that velocity goes to zero at the boundaries. The correct solution of the Poisson-pressure equation requires pure Neumann boundary conditions:partial p/ partial n = 0. This means that at a boundary, the rate of change of pressure in the direction normal to the boundary is zero. We revisit boundary conditions at the end of Section 38.3.
And at the end of the chapter he said
Quote:

First we should look at how our grid discretization affects the computation of boundary conditions. The no-slip condition dictates that velocity equals zero on the boundaries, and the pure Neumann pressure condition requires the normal pressure derivative to be zero at the boundaries. The boundary is defined to lie on the edge between the boundary cell and its nearest interior cell, but grid values are defined at cell centers. Therefore, we must compute boundary values such that the average of the two cells adjacent to any edge satisfies the boundary condition.

For the velocity boundary on the left side, for example, we have:

Equation 17

Here


where N is the grid resolution. In order to satisfy this equation, we must set u 0, j equal to –u 1, j . The pressure equation works out similarly. Using the forward difference approximation of the derivative, we get:

Equation 18

Here


On solving this equation for p 0, j , we see that we need to set each pressure boundary value to the value just inside the boundary.

We can use a simple fragment program for both the pressure and the velocity boundaries, as shown in Listing 38-5
So, his workflow is too different from Bridson. Now I want to know the relationship between them.

FMDenaro June 2, 2017 17:20

I don't see mathematical difference in that... Sec.4 in the Bridson notes explains nothing else that a projection method based on the Hodge decomposition.

AnasVFX June 2, 2017 17:57

Quote:

Originally Posted by FMDenaro (Post 651413)
I don't see mathematical difference in that... Sec.4 in the Bridson notes explains nothing else that a projection method based on the Hodge decomposition.

stam is just implementing boundaries for the pressure and he implements equation 18 in the code to enforce the normal derivative of pressure =0
Bridson uses a different notation of the pressure at boundaries. What's the difference ?

FMDenaro June 2, 2017 18:16

Prescribing homogeneous or non homogeneous Neumann bc for the pressure equation is largely discussed in literature. It has difference in terms of accuracy, you can see that dp/dn=0 is a buondary layer approximation.
However, both bc.s are mathematically correct for the Poisson problem to be well posed. Again, you cannot set the tangential velocity component in the pressure equation. Do not forget that the pressure equation is nothing else that the continuity equation. Eq.17 is prescribed for the momentum equation.

AnasVFX June 2, 2017 20:26

Quote:

Originally Posted by FMDenaro (Post 651420)
Prescribing homogeneous or non homogeneous Neumann bc for the pressure equation is largely discussed in literature. It has difference in terms of accuracy, you can see that dp/dn=0 is a buondary layer approximation.
However, both bc.s are mathematically correct for the Poisson problem to be well posed. Again, you cannot set the tangential velocity component in the pressure equation. Do not forget that the pressure equation is nothing else that the continuity equation. Eq.17 is prescribed for the momentum equation.

now , I understood . Thanks :)

FMDenaro June 3, 2017 04:11

Ok, however the issue is not simple and requires some care. I suggest to read other references about the topic of (exact/approximate) projection methods.


All times are GMT -4. The time now is 08:53.