
[Sponsors] 
Nonphyscial solution in the case of triangular mesh from interFoam 

LinkBack  Thread Tools  Display Modes 
October 7, 2011, 00:30 
Nonphyscial solution in the case of triangular mesh from interFoam

#1 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8 
Hi
I have a problem with interFoam. When I run my problem on a quadrangular mesh every thing is OK but when I run my problem on a triangular mesh I have some nonphysical big velocities. I know this problem is due to high density ratio (1000/1) and triangular mesh because when I change the densities to (1000/1000) or when I set the gravity to (0 0 0) the parasitic current eliminates. Can any one tell me how I can get a good solution in the case of triangular mesh too? Best regards Ata 

October 8, 2011, 01:38 

#2 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26 
You should post the schemes you are using. As a general suggestion, use bounded schemes, and limit gradients too.
Best, 

October 8, 2011, 02:47 
What scheme?

#3 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8 
Hi Dear Alberto
These are schemes that I used: ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } divSchemes { div(rho*phi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } What is your suggestion? Thank you very much Best regards Ata 

October 8, 2011, 02:57 

#4 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26 
Try
Code:
gradSchemes { default cellLimited leastSquares 1; } Best, 

October 8, 2011, 03:31 
Nonphyscial solution in the case of triangular mesh from interFoam

#5 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8 
Hi Dear Alberto
Thank you very much for your quick reply. I used your suggested scheme but the problem did not solve? Do you have any other suggestion? Best regards Ata 

October 8, 2011, 14:06 

#6 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26 
Could you show a) a picture of the mesh, b) contour plot of alpha, and c) contour plot of the velocity, showing where the problem happens?
Best, 

October 9, 2011, 01:33 
Nonphyscial solution in the case of triangular mesh from interFoam

#7 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8 
Hi Dear Alberto
Please see the attachments Thank you very much Best regards Ata 

October 9, 2011, 01:55 

#8 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26 
It seems to me the problem is at the junction between the rectangular and the inclined part of the domain too, where the mesh is still hexahedral. The velocity peaks are all in hex cells too.
Your mesh seems fine to me, however I would play a bit with the schemes: Code:
divSchemes { div(rho*phi,U) Gauss limitedLinearV 1; div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss interfaceCompression; } laplacianSchemes { default Gauss linear limited 0.33; } snGradSchemes { default limited 0.33; } Best, 

October 10, 2011, 02:10 
Nonphyscial solution in the case of triangular mesh from interFoam

#9 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8 
Hi Dear Alberto and thank you very much for your help.
I used your proposed schemes and it seems that alpha is good but the velocity is nonphysical. Please see the attachments. Do you have any other proposition. Thank you very much. Best regards Ata 

October 10, 2011, 10:49 

#10 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26 
How is the solution behaving? Is it stable in time, or does the problem with alpha come back? Since the velocity is unphysical, I would expect alpha to be too.
What about the convergence history? Best, 

October 10, 2011, 11:07 

#11 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,594
Rep Power: 24 
Hi Ata
I have been having a lot of "fun" with interFoam/MULES over the last couple of years, and what you report is a well known problem. We, in our group, have tried a lot of different numerical schemes, etc, however, in vain. The problem lies in the evaluation of snGrad(rho), which is not evaluated in a manner, which is consistent with the underlying physics. This means, that you will not be able to run the "bucket of water" simulation with interFoam/MULES on a nonorthogonal, hexahedral mesh, or an orthogonal mesh with a gravity vector, which is not aligned with the mesh lines. Do a search for "Wemmenhove" and "gravityconsistent" on Google, and you will find a proposition to solve this problem, however, the solution is not compatible with MULES, because it solve the hyperbolic differential equation for alpha, whereas the proposed solutions is meant for the PLIC approach for free surface flows. Kind regards, Niels P.S. Are you looking at wave runup on a breakwater? 

October 10, 2011, 11:25 

#12 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26 
Interesting. Thanks Niels :)


October 10, 2011, 20:41 

#13  
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 367
Rep Power: 10 
Quote:
Hi thanks for pointing 'gravity consistent' part. I have been testing my code (NOT OPENFOAM) with VOF on different types of meshes and I have yet to face this spurious velocity problem even on far worse meshes than what Ata showed. Off course I do lots of things different than openFOAM so it could be any of the thing. One of the thing that I do differently is that I add gravity as (density * volume * g ) from the volume of cell and density of cell rather than calculation gravity source from integration from control volume faces (i think which is usual practice and assumed to be more stable). So in the way I do, gravity vector is not affected by type of mesh but by 'mass in cell'. 

October 10, 2011, 20:53 

#14 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26 
Why is the snGrad(rho) not consistent with the physics, and how should it be calculated?


October 10, 2011, 20:56 

#15  
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26 
Quote:
However, how do you manage the RhieChow interpolation in cases with strong density gradients then, since your body force does not seem to enter the interpolation formula? The body force should tend to destabilize the solution... 

October 10, 2011, 21:05 

#16 
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 367
Rep Power: 10 

October 10, 2011, 21:09 

#17  
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 367
Rep Power: 10 
Quote:
This is true. However so far I have only tried water air system and did not notice problems. NOTE: I do lots of other things to keep solver stable so it might be any one of the things that keeps solver stable and I did not notice it. 

October 11, 2011, 02:16 

#18 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,594
Rep Power: 24 
Hi Alberto
Their analysis with respect to the handling of the density on the faces is as follows: Consider four computational cells A B  0.0 0.3333 C D  0.6666 1.0000 where the letters are cell naming, and the numbers are the void ratio. The surface is a straight line, the mesh orthogonal in xy, the gravity vector is (1 2), and U = 0. They perform an interpolation of rho onto the faces and uses these values to find the hydrostatic pressure in D based on either going from A>C>D or A>B>D. Result: The two pressures in D differs! The solution is to do a special interpolation routine, which depends on the unique distance from the cell centers to the reconstructed interface in a PLIC fashion. As MULES will smear the interface over more than one cell, such a distance will be difficult to define. Their approach has removed the spurious currents at the interface. Another formulation of the same is that the face values of rho should fulfill curl( rho g ) = 0 according to Wemmehove et al (do not have the full refernce here), however, I am not happy about this formulation, as it does not seem to be mathematically rigid, because they do a operator change over the interface, where "grad rho" is not continuous. Hope this clarified the details. Niels 

October 11, 2011, 02:55 
How we can solve the problem?

#19 
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8 
Hi Dear Friends
Very nice discussions. I think that this problem can be solved in OpenFOAM by to ways: 1. Smoothed rho. I think we can use a normalized kernel function to smooth rho. I think this solves the problem. Because when I set gravity to zero or set the density ratio near one the problem has been solved. Therefore it seems that the problem is due to the discontinuity in the density near the surface and this can be solved using the smoother in order to grad(rho) calculate stably. 2. We can use pressure(p) instead of modified pressure(p_rgh) in order to grad(rho) eliminated from the momentum equation and in the wall boundaries we can use grad(p)=grad(rho*g&h) instead of grad(p_rgh)=0. What is your opinion about these? Best regards Ata 

October 11, 2011, 05:35 

#20 
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,594
Rep Power: 24 
Hi Ata
With respect to "2", then this was tried in OF1.6, however, they have returned to dynamic/excess pressure as of 1.7. The problem is simply that using total pressure you get very poor results. Example: Wave breaking on a coast with excess pressure gives the correct variation in the mean water level across the profile, i.e. setdown seaward of the breakpoint and subsequent setup shoreward of the breakpoint. If you use the formulation with total pressure, you will only get this behaviour under the severe constraint that the mesh lines are horizontal/vertical. If they are bending to become parallel with the bed, then you will experience a setup from the beginning of the sloping beach profile even this point is seaward of the break point. / Niels 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
snappyHexMesh won't work  zeros everywhere!  sc298  OpenFOAM Native Meshers: snappyHexMesh and Others  2  March 27, 2011 21:11 
IcoFoam parallel woes  msrinath80  OpenFOAM Running, Solving & CFD  9  July 22, 2007 02:58 
Discussion about Mesh independant solution  Seb  Main CFD Forum  13  May 22, 2001 13:37 
CFL Condition  Matt Umbel  Main CFD Forum  14  January 12, 2001 15:34 
unstructured vs. structured grids  Frank Muldoon  Main CFD Forum  1  January 5, 1999 11:09 