Nonphyscial solution in the case of triangular mesh from interFoam
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 
You should post the schemes you are using. As a general suggestion, use bounded schemes, and limit gradients too.
Best, 
What scheme?
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 
Try
Code:
gradSchemes Best, 
Nonphyscial solution in the case of triangular mesh from interFoam
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 
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, 
Nonphyscial solution in the case of triangular mesh from interFoam
2 Attachment(s)
Hi Dear Alberto
Please see the attachments Thank you very much Best regards Ata 
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 Best, 
Nonphyscial solution in the case of triangular mesh from interFoam
2 Attachment(s)
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 
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, 
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? 
Interesting. Thanks Niels :)

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'. 
Why is the snGrad(rho) not consistent with the physics, and how should it be calculated?

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... 
Quote:
Edited to remove, it seems something wrong with what I wrote. I will rewrite once I confirm it. Sorry. 
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. 
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 
How we can solve the problem?
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 
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 
All times are GMT 4. The time now is 01:20. 