Boundary Conditions on Divergence in Marker and Cell (MAC)

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 1, 2016, 15:50 Boundary Conditions on Divergence in Marker and Cell (MAC) #1 New Member   Jack Join Date: Jul 2016 Posts: 7 Rep Power: 3 Sponsored Links Hi all, I have been studying the Marker and Cell method by Harlow and Welsh, and had a question about the boundary condition on divergence. They suggest setting it so that the gradient of the of the divergence on the boundary is zero (div ghost cell = div cell on edge) for free-slip, no-slip, inlet and outlets. However, I am struggling to find any physical argument for this. Why not set it so that the divergence is zero on the boundary (div ghost cell = - div cell on edge)? This would also fit better with the other boundary conditions when setting the normal velocity on the edge of the ghost cell for satisfying the other boundary conditions. It also directly enforces the zero divergence condition on the boundary. The divergence in the ghost cell only comes in to play when calculating the laplacian of the divergence, and the original MAC report suggests that the laplacian of the divergence term can be left out of calculating R_(ij), so does it really matter if it might not even be used? Thanks again!

 August 1, 2016, 16:16 #2 Senior Member   Filippo Maria Denaro Join Date: Jul 2010 Posts: 3,415 Rep Power: 39 are considering this paper? http://www.cs.rpi.edu/~cutler/classe...rlow_welch.pdf could you better clarify your question?

 August 1, 2016, 16:22 #3 New Member   Jack Join Date: Jul 2016 Posts: 7 Rep Power: 3 Thats the paper, but the technical report is available here: http://permalink.lanl.gov/object/tr?...eport/LA-03425 Boundary conditions are discussed on page 49. Why set D_(i-1,j) = D(i,j) so that there is no gradient? Why not set D_(i-1,j) = - D(i,j) so as to enforce zero divergence on the boundary?

August 1, 2016, 16:42
#4
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,415
Rep Power: 39
Quote:
 Originally Posted by FluidFox Thats the paper, but the technical report is available here: http://permalink.lanl.gov/object/tr?...eport/LA-03425 Boundary conditions are discussed on page 49. Why set D_(i-1,j) = D(i,j) so that there is no gradient? Why not set D_(i-1,j) = - D(i,j) so as to enforce zero divergence on the boundary?

ok, so you are focusing on condition 6) in the paper.

You can see it a a numerical condition enforcing homogeneous Neumann condition for the divergence on the wall. When D(i,j) tends to zero, D(i-1,j) does too.

If you enforce the reflection condition D(i-1,j) = - D(i,j) you fix a linear extrapolation from the interior. Even in this case when D(i,j) tends to zero, D(i-1,j) does too. But, generally, extrapolation on the boundary is not a good choice as it can amplify oscillations and leading to instability.

However, this method is very old and now much more studies are published that clarified many issues in the numerical solution for incompressible flows.

 August 1, 2016, 17:02 #5 New Member   Jack Join Date: Jul 2016 Posts: 7 Rep Power: 3 OK, thank you. How wise would it be to replace R_(i,j) by Q_(i,j) as described on page 22 of the report, thus removing the question of setting a boundary condition on divergence? Can you briefly name some of the issues and studies so that I can read more at all? What might be a better alternative method that is similarly straight forward to implement? Thanks

 August 1, 2016, 17:06 #6 Senior Member   Filippo Maria Denaro Join Date: Jul 2010 Posts: 3,415 Rep Power: 39 fractional step methods (projection methods), as this one : https://www.google.it/url?sa=t&rct=j...E_ox2w&cad=rja

 August 1, 2016, 17:19 #7 New Member   Jack Join Date: Jul 2016 Posts: 7 Rep Power: 3 I have had a look at fractional step methods before. They seem very similar to the MAC method, so what advantage do they give? I was not sure about the boundary condition on the poisson equation of d(phi)/dn = 0, or in fact 'no boundary condition on phi' that Kim and Moin suggest. Surely there has to be a boundary condition (in the ghost cells) in order to evaluate the poisson equation for phi in the domain? What about if I wanted to set a zero pressure outlet?

August 1, 2016, 17:24
#8
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,415
Rep Power: 39
Quote:
 Originally Posted by FluidFox I have had a look at fractional step methods before. They seem very similar to the MAC method, so what advantage do they give? I was not sure about the boundary condition on the poisson equation of d(phi)/dn = 0, or in fact 'no boundary condition on phi' that Kim and Moin suggest. Surely there has to be a boundary condition (in the ghost cells) in order to evaluate the poisson equation for phi in the domain? What about if I wanted to set a zero pressure outlet?

if you read carefully the method, you see that the pressure equation is written in term of Div Grad phi, therefore on a boundary you will substitute directly n.Grad phi in terms of the difference between intermediate and real velocity.

I suggest to check in this forum for similar posts where many details are discussed.

 August 2, 2016, 02:07 #9 Senior Member   Arjun Join Date: Mar 2009 Location: Nurenberg, Germany Posts: 702 Rep Power: 19 I think this explains this step by step in detail have a look http://www.inf.ufes.br/~avalli/mestr...al/griebel.pdf I read it year back so i might be wrong but i believe what he describes is marker and cell method.

August 2, 2016, 12:59
#10
Senior Member

Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 702
Rep Power: 19
Found the code also for it. Attaching it.
Attached Files
 micGibNAST2d.tar.gz (55.7 KB, 5 views)

 Tags boundary condition, divergence, mac, marker and cell

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post thatdiverguy Main CFD Forum 0 January 3, 2015 15:57 sgangarapu Main CFD Forum 1 August 28, 2013 10:33 kujret Main CFD Forum 0 March 3, 2013 05:14 T Main CFD Forum 1 April 11, 2001 13:43 Albert Badal Main CFD Forum 0 February 27, 1999 20:53