CFD Online Discussion Forums

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

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

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

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
Please see the attachments
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.

What about the convergence history?

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

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

ata October 11, 2011 06:43

Hi Niels Gjoel Jacobsen
I know it was in OF1.6 and in the OF1.7 p_rgh has been used but as I know they used p_rgh to make BC more comfortable grad(p_rgh)=0 but as I said I think we can solve this problem by using p in the momentum equation and setting grad(p)=grad(rgh) on the walls.
I do not know do you understand me?

Good luck
Best regards

Ata

arjun October 11, 2011 22:21

@Ata, Does openFOAM able to run standard test problems with triangular or tet meshes. For example there must be simple tutorial that openFOAM can run. What happens if you keep everything the same and just change the mesh?? Are you able to run the solver.

A simple test could be a water column falling etc etc.

ata October 12, 2011 02:54

Hi
Yes I examine some different grids and in all triangular grids I had the same problem.
Good luck

Ata

arjun October 12, 2011 05:25

Quote:

Originally Posted by ata (Post 327588)
Hi
Yes I examine some different grids and in all triangular grids I had the same problem.

Thats too bad.


Quote:

Originally Posted by ata (Post 327588)
Good luck

Thank you. I need lots of luck.

In my case though, my solver works well irrespective of the type of grid (if no negative volume cells exist then usually no problems). Grid type is not much a problem for me.

ata October 12, 2011 05:43

Hi
In your cases how much is the density ratio?
Good luck

Ata

arjun October 12, 2011 06:16

Quote:

Originally Posted by ata (Post 327621)
Hi
In your cases how much is the density ratio?
Good luck

Ata


1000 : 1

Water air.


Edited to add: So far as per my experience with multiphase simulations with various softwares like Fluent, CFX, StarCCM+ etc, I think the viscosity ratio is much much more problematic than density ratio. 1000 : 1 density ratio is usually not much a problem.

jdiorio March 6, 2013 16:25

1 Attachment(s)
Similar issue here. Test problem of a sphere entering a free-surface. Using OF-2.1.0 with sliding AMI interfaces. InterDyMFoam solver although issue occurs with others as well. Results for cavity shape/pinch-off etc. are fine with cartesian grids. When there are just a few non-cartesian cells however, the cavity closes unphysically (see image).

Have a copy of Wemmenhove's paper. Their analysis makes sense to me. I am going to start looking into the evaluation of the snGrad terms in the momentum equation (pd and rho), unless others have some ideas. Has there been anymore discussion on this topic? This is the only thread I could find dealing with the issue.

Also, changing the snGrad scheme from corrected to limited did not fix the issue (results shown here are with the limited scheme).

giack July 8, 2013 05:34

opposite experience with mesh geometry
 
Hi to all,
this is a very interesting thread. I simulated a multiphase case in which a horizontal closed pipe filled with water is opened at one side at time zero, allowing the gas to enter and liquid to exit the domain.
I used a hexahedral mesh with all possible scheme for gradient and divergence scheme (also cellMDLimited version) and the result are very bad.
So i tried to change mesh geometry and I used a tetrahedral mesh. In this case the results are very good.

So this experience is opposite to yours.
The reason is probabily that using a tetahedral mesh there isn't a preferential direction for gradient calculations. What is your opinion?

Thank to all

Zaphod'sSecondHead September 4, 2016 11:59

Quote:

Originally Posted by arjun (Post 327618)
In my case though, my solver works well irrespective of the type of grid (if no negative volume cells exist then usually no problems). Grid type is not much a problem for me.

Hey Arjun,

I'm working on building an Adaptive Mesh Refinement algorithm based on the current version, but that also deals with arbitrary meshes. I face a huge problem of spurious currents in my solution - the grid I'm using is mainly tetrahedral.

Could you share what corrections you used to make your code independent of cell shape and orientation?


All times are GMT -4. The time now is 12:41.