|
[Sponsors] |
March 25, 2014, 17:10 |
|
#21 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
Quote:
|
||
March 25, 2014, 18:00 |
|
#22 |
Senior Member
adrin
Join Date: Mar 2009
Posts: 115
Rep Power: 17 |
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: 6,896
Rep Power: 73 |
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 |
Senior Member
adrin
Join Date: Mar 2009
Posts: 115
Rep Power: 17 |
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: 6,896
Rep Power: 73 |
Quote:
The question for a general function q I think that depends upon the discretization of the integrals ... for example, mid-point 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: 1,290
Rep Power: 34 |
||
March 29, 2014, 14:48 |
|
#27 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
Could You elaborate?
|
|
March 30, 2014, 03:41 |
|
#28 |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
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, 06:29 |
|
#29 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
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) R-C 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 second-order accurate projection-based Finite Volume code on non-staggered, non-uniform structured grids with continuity preserving properties: application to buoyancy-driven flows,Int. J. Num. Meth. Fluids, 52, 4, 393-432, 2006.A. Aprovitola, F.M. Denaro, A non-diffusive, divergence-free, Finite Volume-based double projection method on non-staggered grids, Int. J. Num. Meth. Fluids,53, 1127-1172, 2007. |
||
March 30, 2014, 10:03 |
|
#30 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
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, 10:10 |
|
#31 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
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 divergence-free contraint cell-by-cell until to machine precision, even on non-staggered 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, 20:36 |
|
#32 |
New Member
Patricio Cumsille
Join Date: Jan 2014
Posts: 4
Rep Power: 12 |
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^5-r^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, 22:53 |
|
#33 |
Senior Member
adrin
Join Date: Mar 2009
Posts: 115
Rep Power: 17 |
Hi Patricio,
Sorry, I hadn't checked cfd-online 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 post-processing and has nothing to do with your real concern of convergence guarantee) Adrin |
|
April 23, 2015, 18:32 |
imposing pressure gradient at free surface of a channel flow
|
#34 |
New Member
marjan
Join Date: Aug 2013
Posts: 11
Rep Power: 13 |
Dear All,
I am trying to simulate the free-surface 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 free-surface 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 mass-balance get apart from zero. does anyone knows anything related to this issue? Thanks in advance |
|
April 23, 2015, 18:46 |
|
#35 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
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, 19:03 |
|
#36 |
New Member
marjan
Join Date: Aug 2013
Posts: 11
Rep Power: 13 |
Dear Fillipo ,
The mass balance is also getting far form zero, but I can not find where it rise up from. |
|
April 23, 2015, 19:43 |
|
#37 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
Quote:
Are you using the correct normal component inserted in the Hodge decomposition? |
||
April 23, 2015, 23:46 |
|
#38 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
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 01:19. |
||
February 11, 2019, 17:57 |
|
#39 |
Member
Tony Zahtila
Join Date: Mar 2016
Posts: 33
Rep Power: 10 |
Hi there, I am working in pyAMG and have Neumann-Periodic boundary conditions. on my 2D domain.
I am aware of the compatibility condition for such a problem and have satisfied it. I have been able to solve my system with a pyamg.bicgSTAB but have had no luck with multigrid methods. I was wondering if anyone had any advice on how to solve a system with Neumann-Periodic BCs with a multigrid solver? Kind regards. |
|
February 11, 2019, 19:32 |
|
#40 |
Senior Member
adrin
Join Date: Mar 2009
Posts: 115
Rep Power: 17 |
In my experience, at least for the type of poisson solvers I'd developed when I tried it, using AMG as a preconditioner for Krylov solvers is more robust than using AMG as a solver. Recently, I've been looking into developing a high-order poisson solver and found AMG (even as a preconditioner) to be quite sensitive to the various parameters that one can tweak! The latter is not definitive, yet; I still need to make sure that I have a "nice" matrix. Make sure you do have a good matrix (for example, perhaps you should try rearranging the entries using various methods available to you).
adrin |
|
Tags |
neumann bcs, poisson equation |
|
|
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 12: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 05:40 |