
[Sponsors] 
March 25, 2014, 17:10 

#21  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,415
Rep Power: 39 
Sponsored Links
Quote:


Sponsored Links 
March 25, 2014, 18:00 

#22 
Member
adrin
Join Date: Mar 2009
Posts: 82
Rep Power: 10 
The compatibility may already be incorporated in the implementation, depending on the details of the formulation. I'm just curious ... suppose you have a unit cubic box with N^3 uniformly distributed grids. The volume for this will be one, irrespective of the value of N. Now, let's perturb the interior grids (keep the surface grids uniformly distributed), say (1) randomly, or (2) sinusoidally in all three directions (A*sin(2.pi.x)*sin(2.pi.y)*sin(2.pi.z)). What is the volume you get for such grid distributions?
Adrin 

March 25, 2014, 18:15 

#23  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,415
Rep Power: 39 
Quote:
to tell the truth I don't understand that question clearly ... the key is the numerical construction of the surface integral of dp/dn that must balance the volume integral of the source term whatever the shape of the domain and its discretization is used Now, in the actual construction of the pressure equation Div Grad p = q the source term q is in the form of a divergence, therefore it is numerically constructed as the same as the divergence of the pressure gradient in the left hand side. That ensures that the compatibility constraint is ensured, provided that the correct BC for Grad p are used. 

March 25, 2014, 18:26 

#24 
Member
adrin
Join Date: Mar 2009
Posts: 82
Rep Power: 10 
Ah, in your case q is in divergence form. In general, though, q could be any function, and in this case it's the volume integral of q that must match the surface integral of the flux. In discrete form the volumes may be off a bit, and so the volume integral of q may not match the LHS exactly.
Adrin 

March 25, 2014, 18:34 

#25  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,415
Rep Power: 39 
Quote:
The question for a general function q I think that depends upon the discretization of the integrals ... for example, midpoint rule for the surface integral must be associated to the use of centroid value x measure of the volume... trapezoidal rule for the surface integral must be associated to its 3D extension for the volume integral and so on 

March 29, 2014, 09:12 

#26 
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 702
Rep Power: 19 

March 29, 2014, 14:48 

#27 
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,415
Rep Power: 39 
Could You elaborate?


March 30, 2014, 02:41 

#28 
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 702
Rep Power: 19 
In theory, what you said is fine. In practice, these are few possible scenarios.
1. You meant div(v) = 0 on cell by cell basis. Which is only possiblibly be true in fully converged case, even then for a non  staggered system we would have div( v + v_due_to_rhie_chow) = 0 (fully converged case). So I take it that you meant globally, that is summing all equations. 2. In this case, if you have say velocity inlet and a pressure outlet, until convergence is achieved div (vel ) = 0 is not achieved. (this scenario could be discounted because then p equation is not all neumann anyway) 3. In a case if had inlet and outflow condition. In this case div(v) = 0 is only achieved if you fixed outflow such that inflow = outflow, that too when there is no reversed flow. In the end, in practice, div(v) = 0 is not taken to be granted. 

March 30, 2014, 05:29 

#29  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,415
Rep Power: 39 
Quote:
ok, now I see what you meant. However, let me address some issues. 1) Also in practice, the Div V = 0 constraint can be reached at machine precision. It depend on your choice, if you want to adopt an Exact or Approximate Projection Method (EPM/APM). 2) RC interpolation is not necessary, you are not forced to use it as other approaches are possible. 3) In a case with inlet and outflow condition Div V = 0 is achieved because, provide correct BC are fixed, you get inflow = outflow at machine accuracy If you are interested in, I report two of my papers about the above issues, you will find cited many other useful papers. F.M. Denaro, A 3D secondorder accurate projectionbased Finite Volume code on nonstaggered, nonuniform structured grids with continuity preserving properties: application to buoyancydriven flows,Int. J. Num. Meth. Fluids, 52, 4, 393432, 2006.A. Aprovitola, F.M. Denaro, A nondiffusive, divergencefree, Finite Volumebased double projection method on nonstaggered grids, Int. J. Num. Meth. Fluids,53, 11271172, 2007. 

March 30, 2014, 09:03 

#30  
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 702
Rep Power: 19 
Quote:
2) I agree that it is matter of practice. PS: for (1) if you meant cell by cell basis then I would not agree because div(u) = 0 would only be achieved after convergence, but the pressure equation is driving the solution to convergence div(v) = 0 cell by cell basis is not given. In fact that is source of pressure equation, without source there will be no correction. 

March 30, 2014, 09:10 

#31  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,415
Rep Power: 39 
Quote:
Sorry, I do not understand clearly this point ... at each time step I will solve the pressure equation (double precision) even with a simple SOR method. With the pressure gradient I can drive the divergencefree contraint cellbycell until to machine precision, even on nonstaggered grid... Any source term can be used to solve an elliptic equation and the solution provide the gradient which correct the velocity... 

April 4, 2014, 19:36 

#32 
New Member
Patricio Cumsille
Join Date: Jan 2014
Posts: 4
Rep Power: 5 
Dear Adrin:
I have implemented the trick that you adviced me, but in practice the only thing I got is to project the RHS on the orthogonal of the kernel of the matrix obtained from the discretization Poisson problem with pure Neumann BC. Unfortunately, you still cannot ensure the uniqueness of the solution and therefore you do not know which solution is computed. The experiment that I have performed is with FD and the test function is u(x,y)=x^5+y^5r^5, with r=0.5 and the RHS is obtained by computing the Laplacian of u, and so is for the Neumann BC. The issue is that even if you project the RHS on the orthogonal of the kernel of the matrix for this problem, you cannot ensure the uniqueness of the solution and therefore you cannot ensure the convergence of the numerical method. After all, the analytic solution is defined up to an additive constant and any method that converges have to handle correctly this issue. The fact of projecting the RHS is not enough to handle that! Best regards, Patricio Cumsille 

April 11, 2014, 21:53 

#33 
Member
adrin
Join Date: Mar 2009
Posts: 82
Rep Power: 10 
Hi Patricio,
Sorry, I hadn't checked cfdonline for a while... Yes, you are absolutely correct that the solution is/will not be unique by just discretely ensuring the consistency  the same problem at different resolution levels will give different potential distributions (but the solution is only shifted up or down; the shape is the same). But, as you suggested, that is to be expected because the original problem is itself not unique. The only way to do that properly would be to remove one of the equations (any one would do, which basically means you're setting its value to zero) and replace it with the consistency equation. That is essentially what I did in my boundary element methods based solution, where a unique solution is obtained irrespective of the resolution. Nevertheless, since we're generally interested in the gradient and not the potential itself, it really doesn't matter if the value shifts up/down  the only real concern is whether we're guaranteed to get a solution. I suspect in an infinite precision computation we won't get a converged solution. So far, I haven't experienced a problem in my finite precision tests. If you want a "pinned" solution, that means you know the potential value at a particular point (no other option available, by definition). In that case, just get the difference between the value that you have obtained and the value that you want at that node, and then adjust the value at all nodes by this difference. This will give you the unique values you want (but it's a simple postprocessing and has nothing to do with your real concern of convergence guarantee) Adrin 

April 23, 2015, 17:32 
imposing pressure gradient at free surface of a channel flow

#34 
New Member
marjan
Join Date: Aug 2013
Posts: 11
Rep Power: 5 
Dear All,
I am trying to simulate the freesurface shape, by imposing a vertical pressure gradient at uppest ghost cell of a rectangular channel. I m using a LES code, which solves the Navier Stockes Equation, and the flow is driven by a stream wise pressure gradient while the periodicity condition is applied in stream wise and span wise direction. To do that I modify the Poisson equation by changing the Boundary condition to desired pressure gradient which is do= g*dh/dz.(dh /dz is presenting the variation of freesurface level along the span wise direction) at upper grid and a hydrostatic pressure gradient along all the vertical direction dp/dh=g. After Running my code, The residual of poisson equation is not converging and massbalance get apart from zero. does anyone knows anything related to this issue? Thanks in advance 

April 23, 2015, 17:46 

#35  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,415
Rep Power: 39 
Quote:
could you better elaborate your model? I think you are not correctly setting the BC.s. You can check if the compatibility relation is numerically satisfied 

April 23, 2015, 18:03 

#36 
New Member
marjan
Join Date: Aug 2013
Posts: 11
Rep Power: 5 
Dear Fillipo ,
The mass balance is also getting far form zero, but I can not find where it rise up from. 

April 23, 2015, 18:43 

#37  
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,415
Rep Power: 39 
Quote:
Are you using the correct normal component inserted in the Hodge decomposition? 

April 23, 2015, 22:46 

#38  
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 702
Rep Power: 19 
Quote:
Edited to add: I went back and read again what you wrote. Sorry I misunderstood you. You were saying the same thing (div (V) = 0 is used to construct pressure equation rather than it is a given condition. Discard my comment above. Last edited by arjun; April 24, 2015 at 00:19. 

Tags 
neumann bcs, poisson equation 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Dealing with BC's in OF 1.6  vkrastev  OpenFOAM Running, Solving & CFD  5  September 4, 2012 11:58 
BCs for Pressure Correction Equation (SIMPLE)  Bharath Somayaji  Main CFD Forum  1  March 1, 2006 07:12 
Recommendation of a good poisson solver  Quarkz  Main CFD Forum  2  December 2, 2005 10:12 
Poisson Equation in CFD  Maciej Matyka  Main CFD Forum  9  November 10, 2004 12:30 
Poisson BC's  Peter  Main CFD Forum  2  May 18, 2001 04:40 
Sponsored Links 