CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Water-Air simulations (https://www.cfd-online.com/Forums/openfoam-solving/238093-water-air-simulations.html)

Miguel Hernandez August 23, 2021 09:46

Water-Air simulations
 
Correct me if I'm wrong: in Flow 3d, for open channel simulations, generally simulations consider only one fluid, water. I've rarely seen simulations with two fluids.
Is there a solver in openFoam able to do the same thing, or the only solution, for open channel simulations, is to use interFoam and therefore simulations with two fluids?

Miguel Hernandez August 25, 2021 11:13

In other words, for open channel simulations, which openFoam solvers can be used? Is there only interFoam?

geth03 August 30, 2021 08:21

interFoam is a solver for a two-fluid system with interface resolution.
so you need fluid properties (densities, kinematic viscosities, and interfacial tension) for both fluids.

Miguel Hernandez August 31, 2021 10:01

Quote:

Originally Posted by geth03 (Post 811254)
interFoam is a solver for a two-fluid system with interface resolution.
so you need fluid properties (densities, kinematic viscosities, and interfacial tension) for both fluids.

Thank you for your reply. I know that interFoam, being a multiphase solver, needs the characteristics of both fluids (water and air in my case), but my question is another one.
From my experience, I know that many free-flow simulations in Flow3D(the area for which Flow3D is famous) are based on simulations with only one fluid.

I'm asking to the more experienced forum's users if this capability is due to the use of TruVOF or something else.

Also, is there a solver in openFoam that can do the same thing?

Thank you.

snak September 1, 2021 00:36

There is an interface-tracking dynamic mesh. I'm not sure this fits your needs or not. I have an interest in this function but I have never used...

https://www.openfoam.com/news/main-n...rface-tracking

Santiago September 1, 2021 02:25

Quote:

Originally Posted by Miguel Hernandez (Post 811348)
Thank you for your reply. I know that interFoam, being a multiphase solver, needs the characteristics of both fluids (water and air in my case), but my question is another one.
From my experience, I know that many free-flow simulations in Flow3D(the area for which Flow3D is famous) are based on simulations with only one fluid.

I'm asking to the more experienced forum's users if this capability is due to the use of TruVOF or something else.

Also, is there a solver in openFoam that can do the same thing?

Thank you.

The solver in flow3d is also two-phase, like interFoam, since it implements VoF! The fact is that flow3d dumbs down much of the input/output, in order to create the feeling you're not solving for air. Perhaps the solver in flow3d does tricks in order to accelerate the solution on water, such as clipping the velocity on the air phase to zero or using a MAC method first in order to get an approximate topology of the water phase and then solve on that region only...

arjun September 1, 2021 03:17

Quote:

Originally Posted by Santiago (Post 811389)
The solver in flow3d is also two-phase, like interFoam, since it implements VoF! The fact is that flow3d dumbs down much of the input/output, in order to create the feeling you're not solving for air. Perhaps the solver in flow3d does tricks in order to accelerate the solution on water, such as clipping the velocity on the air phase to zero or using a MAC method first in order to get an approximate topology of the water phase and then solve on that region only...


Flow 3D indeed could solve for one phase. For this to happen there has to be a boundary condition to be applied on the free surface. The advantage of this approach is that the velocities from air could be neglected and thus allowing higher time steps.

However this is not the only way to do this, for example the implicit VOF in Wildkatze could have much higher courant numbers without smearing the interface. We do all the time.

For openfoam it is hard to tell.

Santiago September 1, 2021 04:12

Quote:

Originally Posted by arjun (Post 811392)
Flow 3D indeed could solve for one phase. For this to happen there has to be a boundary condition to be applied on the free surface.

This is a completely different approach, or "technology" as commercial people like to refer to things, known as Arbitrary Lagrangian-Eulerian (ALE) simulations. OpenFOAM implements such "technology" as well. The DISADVANTAGE of such approach is that you cannot solve "shocks" (read hydraulic jumps), or have to smear them somehow in order to avoid destroying the grid.

Quote:

Originally Posted by arjun (Post 811392)
However this is not the only way to do this, for example the implicit VOF in Wildkatze could have much higher courant numbers without smearing the interface. We do all the time.

The fact that one uses time-implicit approaches, and such allow for "arbitrary" Co numbers, doesn't mean that from a theoretical perspective using Co > 1 when in VoF is correct. All free-surface reconstruction methods for FVM/FDM are upwinded: PLIC, MULES, CICSAM, truVoF (CLS-VOF), gVoF, isoAdvector, level-set, etc. That is, the neibouring cells provide 'info' to the cell in question, when reconstructing the free surface. That implies that if you have Co > 1 then this 'info' will 'jump' many cells, producing mass conservation errors.

You can easily implement an implicit VoF In OpenFOAM, a là flow3d, but still the aforementioned problem will exist.

arjun September 1, 2021 04:23

Quote:

Originally Posted by Santiago (Post 811395)
This is a completely different approach, or "technology" as commercial people like to refer to things, known as Arbitrary Lagrangian-Eulerian (ALE) simulations. OpenFOAM implements such "technology" as well. The DISADVANTAGE of such approach is that you cannot solve "shocks" (read hydraulic jumps), or have to smear them somehow in order to avoid destroying the grid.


Flow 3D people obviously disagree with you here. They have multiple examples of using this. The method is limited but not as much as you are declaring here.


Quote:

Originally Posted by Santiago (Post 811395)

That implies that if you have Co > 1 then this 'info' will 'jump' many cells, producing mass conservation errors.

You can easily implement an implicit VoF In OpenFOAM, a là flow3d, but still the aforementioned problem will exist.


Ever heard of validations and benchamarking. We have done that a lot with this implicit appraoch.

As far as mass conversation goes, we have developed methods to keep that in check. We have infact done calculations (on unstructured polyhedral meshes) such a fluel capturing air due to sloshing and match the experimental values. A calculation where mass conservation and numerical errors are of utmost importance because air captured by fuel is quite low.

It all depends on what the method is and how it is implemented.

arjun September 1, 2021 04:33

1 Attachment(s)
Here you go one famous benchmark with courant number well above 5. Done on unstrcutured mesh.

Santiago September 1, 2021 05:06

Quote:

Originally Posted by arjun (Post 811396)

Flow 3D people obviously disagree with you here. They have multiple examples of using this. The method is limited but not as much as you are declaring here.

Of course they will.

I will go a step further: being able to resolve "shocks" accurately in ALE implies that you need to re-mesh (using MESQUITE, or other) which defeats the purpose of having a "faster" solver. Then there is the problem of remeshing and boundary layer inflation (you'll have to dispense of the latter), which begs the question: What's more important, resolving wall-bounded turbulence or the jump? A hard choice if you are studying an USBR dissipation bucket...

Unless you implement ALE under DG, this method is only physically relevant, and computationally cheap, for flows that do not undergo shocks, or hydraulic jumps, or breaking waves.

Quote:

Originally Posted by arjun (Post 811396)
Ever heard of validations and benchamarking. We have done that a lot with this implicit appraoch.

Yes, I've heard of those and made those. Not a strange notion.

Quote:

Originally Posted by arjun (Post 811396)

As far as mass conversation goes, we have developed methods to keep that in check. We have infact done calculations (on unstructured polyhedral meshes) such a fluel capturing air due to sloshing and match the experimental values. A calculation where mass conservation and numerical errors are of utmost importance because air captured by fuel is quite low.

Thanks for proving my point! The fact that you need to keep the mass conservation "in check", for an incompressible flow, using whatever trick you have at your disposal it's already a problem. Whatever trick you use is not going to make your velocities back to solenoidal, WHICH IS THE MATHEMATICAL MEANING OF MASS CONSERVATION in incompressible flows. The implications of this in turbulence (LES, DES) are non-negligible, but one that 99.9999999999% of users seem to not know, and one software vendors (including those in OpenFOAM mind you) don't mention when they promote their "technologies".

We may start arguing about it's importance for "real-life RANS/DES-CFD", and then I'd mention it's a problem of intellectual cleanliness and not of accuracy nor approximation.

Santiago September 1, 2021 05:24

Quote:

Originally Posted by arjun (Post 811398)
Here you go one famous benchmark with courant number well above 5. Done on unstrcutured mesh.

The mass-conservation errors in this case are readily seen! Whoever made this figure was very "sneaky", by putting the grid in YELLOW. Notice the yellow dimple in the lower left corner of the left image, and notice the TWO yellow dimples on the right-hand side image. A bubble rising in water is either FULL WATER or FULL AIR, you dont have dissolution.

On a structured mesh things may go better, and with a smaller Co EVEN BETTER.

frantov September 1, 2021 15:07

Quote:

Originally Posted by Miguel Hernandez (Post 810824)
for open channel simulations, is to use interFoam and therefore simulations with two fluids?

InterMixingFoam gives you the ability to simulate more than two fluids. Two of then are miscible as far as I understand.
Is that what you mean?

Miguel Hernandez September 2, 2021 03:11

Quote:

Originally Posted by frantov (Post 811443)
InterMixingFoam gives you the ability to simulate more than two fluids. Two of then are miscible as far as I understand.
Is that what you mean?

I am looking for an openFoam solver that allows simulation of open channels with a single fluid, similar to what Flow3d allows...

Santiago September 2, 2021 04:09

Quote:

Originally Posted by Miguel Hernandez (Post 811482)
I am looking for an openFoam solver that allows simulation of open channels with a single fluid, similar to what Flow3d allows...

"Single fluid"... You mean, A moving grid, where the free-surface is a boundary condition? Or VoF?

Miguel Hernandez September 2, 2021 06:20

Quote:

Originally Posted by Santiago (Post 811487)
"Single fluid"... You mean, A moving grid, where the free-surface is a boundary condition? Or VoF?

Flow3D allows simulations with only one fluid (water for example) and uses TruVOF (I'm not an expert but I think it is a modified version of VOF). In this type of simulations the user is not required to provide boundary conditions for the free-surface (nothing prevents the software to consider a boundary condition without showing it to the end user).
I have little experience with openFoam, but from the few projects I've done, I've noticed that interFoam (2 fluids) tends to be more easily unstable than what you get with Flow3D, as well as being much slower computationally. I thought this was due to the fact that interFoam needs to solve the equations for two fluids, hence my question about the existence of an openFoam solver that allow the simulation of open channel considering only one fluid, as Flow3D allows to do.

snak September 2, 2021 06:42

There is a tutorial case with a liquid filled cavity with free surface. pimpleFoam solver is used. Only one fluid is considered. Free surface moves using an interface-tracking dynamic mesh.


https://develop.openfoam.com/Develop...actAngleCavity

Miguel Hernandez September 2, 2021 08:22

Quote:

Originally Posted by snak (Post 811502)
There is a tutorial case with a liquid filled cavity with free surface. pimpleFoam solver is used. Only one fluid is considered. Free surface moves using an interface-tracking dynamic mesh.


https://develop.openfoam.com/Develop...actAngleCavity

thanks, very interesting...

Santiago September 2, 2021 10:04

Quote:

Originally Posted by Miguel Hernandez (Post 811501)
Flow3D allows simulations with only one fluid (water for example) and uses TruVOF (I'm not an expert but I think it is a modified version of VOF). In this type of simulations the user is not required to provide boundary conditions for the free-surface (nothing prevents the software to consider a boundary condition without showing it to the end user).

I have little experience with openFoam, but from the few projects I've done, I've noticed that interFoam (2 fluids) tends to be more easily unstable than what you get with Flow3D, as well as being much slower computationally. I thought this was due to the fact that interFoam needs to solve the equations for two fluids, hence my question about the existence of an openFoam solver that allow the simulation of open channel considering only one fluid, as Flow3D allows to do.

As I said 5 posts above, truVoF is VoF, so it solves for both phases or, at least, the governing equations being solved are written taking in consideration BOTH PHASES. Proof of that is that you make a grid BIGGER than the region that comprises only water.

This distinction IS IMPORTANT because, as you can see, a great deal of confusion can arise if you are not clear on what you want. A single-phase simulation IS NOT THE SAME as a VoF where the air phase IS CLIPPED, or a VoF where the air phase IS NOT CLIPPED. Different algorithms, and somewhat different math, hence the different naming conventions.

The thing you are looking for is **interFoam**, a VoF solver for two-immisible fluids, where you can use turbulence models. This solver is not though to be used for particular set of scenarios, as Flow3D does. Since OpenFOAM is not as foolproof as Flow3D, and IT IS NOT A SUITE OF SOLVERS but A LIBRARY FOR FVM which is full of **example solvers**, such as interFoam, you must be willing to go the extra mile (quite literally) in order to make things work. That sometimes imply you need to program things or, at the very least, dive into the code itself, or get scolded in forums like this one :).

If what you want is a SINGLE-PHASE solver with an upper moving boundary representing a free-surface, then you need to use **interTrackFoam** (PISO + ALE). Last time I checked there is no turbulence modelling implemented within. Setting one is not difficult though.

NOTE: interFoam is not that much slower compared to other solvers, when set up correctly. Have in mind that some solvers use pseudo-time integration by default, hence the impression that it "goes" faster. You can use local time stepping also in OpenFOAM.

arjun September 3, 2021 00:53

Quote:

Originally Posted by Santiago (Post 811400)

Thanks for proving my point! The fact that you need to keep the mass conservation "in check", for an incompressible flow, using whatever trick you have at your disposal it's already a problem.


You mean like better descretization ie better reconstruction and solving continuity equation is a trick??

No we are not adding or substracting any fluid to maintain the mass conservation if this is what you mean by trick.

If solving equations by descretisation is a problem to you, then there is nothing that could be done because without it there is no solution to the problem.


The scheme that we use is none of what you mentioned. The scheme that i use is something i have designed and the whole thinking about it is very different than the interface tracking that you think of. The method is at its base implicit in nature. This is why it can run on large courants and keep interface sharp.


Edited to add: It occured to me that it is openfoam that actually uses the 'trick'. They have extra term added to VOF equation to keep the interface sharp. Wildkatze does not do even that and there is no such option for user to chose from too.


All times are GMT -4. The time now is 20:32.