CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Non-physcial solution in the case of triangular mesh from interFoam (https://www.cfd-online.com/Forums/openfoam/93177-non-physcial-solution-case-triangular-mesh-interfoam.html)

 ata October 7, 2011 00:30

Non-physcial 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 non-physical 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

 alberto October 8, 2011 01:38

You should post the schemes you are using. As a general suggestion, use bounded schemes, and limit gradients too.

Best,

 ata October 8, 2011 02:47

What scheme?

Hi Dear Alberto
These are schemes that I used:
ddtSchemes
{
default Euler;
}

{
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;
}

{
default corrected;
}

Thank you very much
Best regards

Ata

 alberto October 8, 2011 02:57

Try

Code:

```gradSchemes {       default        cellLimited leastSquares 1; }```
Also, check the mesh with checkMesh to see if it presents some problem.

Best,

 ata October 8, 2011 03:31

Non-physcial solution in the case of triangular mesh from interFoam

Hi Dear Alberto
I used your suggested scheme but the problem did not solve?
Do you have any other suggestion?
Best regards

Ata

 alberto October 8, 2011 14:06

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,

 ata October 9, 2011 01:33

Non-physcial solution in the case of triangular mesh from interFoam

2 Attachment(s)
Hi Dear Alberto
Thank you very much
Best regards

Ata

 alberto October 9, 2011 01:55

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; }```
Also, turn on the momentum predictor, and check if you have convergence difficulties for the equations.

Best,

 ata October 10, 2011 02:10

Non-physcial 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 non-physical. Please see the attachments.
Do you have any other proposition.
Thank you very much.
Best regards

Ata

 alberto October 10, 2011 10:49

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.

Best,

 ngj October 10, 2011 11:07

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 non-orthogonal, hexahedral mesh, or an orthogonal mesh with a gravity vector, which is not aligned with the mesh lines.

Do a search for "Wemmenhove" and "gravity-consistent" 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 run-up on a breakwater?

 alberto October 10, 2011 11:25

Interesting. Thanks Niels :-)

 arjun October 10, 2011 20:41

Quote:
 Originally Posted by ngj (Post 327344) 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 non-orthogonal, hexahedral mesh, or an orthogonal mesh with a gravity vector, which is not aligned with the mesh lines. Do a search for "Wemmenhove" and "gravity-consistent" 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 run-up on a breakwater?

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'.

 alberto October 10, 2011 20:53

Why is the snGrad(rho) not consistent with the physics, and how should it be calculated?

 alberto October 10, 2011 20:56

Quote:
 Originally Posted by arjun (Post 327385) 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'.
Sounds easy to verify. :-)

However, how do you manage the Rhie-Chow 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...

 arjun October 10, 2011 21:05

Quote:
 Originally Posted by alberto (Post 327386) Why is the snGrad(rho) not consistent with the physics, and how should it be calculated?

Edited to remove, it seems something wrong with what I wrote. I will rewrite once I confirm it.

Sorry.

 arjun October 10, 2011 21:09

Quote:
 Originally Posted by alberto (Post 327387) Sounds easy to verify. :-) However, how do you manage the Rhie-Chow 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...

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.

 ngj October 11, 2011 02:16

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 x-y, 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

 ata October 11, 2011 02:55

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.

Best regards

Ata

 ngj October 11, 2011 05:35

Hi Ata

With respect to "2", then this was tried in OF-1.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. set-down seaward of the breakpoint and subsequent set-up 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 set-up 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 11:52.