CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Steady State Multiphase Simulation (https://www.cfd-online.com/Forums/openfoam/226890-steady-state-multiphase-simulation.html)

MikeWorth May 11, 2020 06:49

Steady State Multiphase Simulation
 
I'm trying to simulate some flow where the geometry is quite different, but the physics is pretty similar to the capillaryRise tutorial. I'm using the interIsoFoam solver in v1912.

I'm after a steady-state solution, but am suffering from oscillations driven by the initial energy in the system. As far as I can tell, the tutorial case suffers from the same issue. Is there a way to damp the solution or similar to remove this 'sloshing energy' so that the solution tends towards the minimum energy (steady state) condition?

I've tried adding velocityDampingConstraint to my fvOptions file, (which is being read as it gives errors if misspelled), but I don't actually see the velocity being limited. This isn't an ideal way to make my simulation work, but would at least enable me to get an initial 'sloshing-free' surface driven condition.

I find it odd that there don't seem to be any steady-state multiphase solvers. Is this because there is a workaround where (for example) the fvSolution can be adjusted to give pseudo-steady-state without requiring a duplicate solver?

Many thanks,
Mike

HPE May 11, 2020 18:32

Hi,

- Might interFoam with the local time-stepping (LTS) support help?

https://openfoam.org/release/2-0-0/steady-state-vof/

https://github.com/OpenFOAM/OpenFOAM...6d5bee6f131c7a

Code:

LTS is selected by the ddt scheme e.g. in the
tutorials/multiphase/interFoam/ras/DTCHull case:

ddtSchemes
{
    default        localEuler rDeltaT;
}


MikeWorth May 12, 2020 10:21

Thanks for that pointer; I think it's going to form the core of what I need. I'm not quite sure how to make it work though.

I had a quick look at the DTCHull tutorial, but in the interests of reducing solve times decided that a simpler case would be a better way to figure it all out. I copied the controlDict, fvSchemes & fvSolution files from DCTHull into capillaryRise, figuring that should result in a steady-state capillary meniscus that I could verify was working as expected. Unfortunately that just runs for 4000 steps without ever seeming to settle into a stable interface - there is constant rippling with a significant velocity.

Are there some controls that I can use to push this towards stability? I've tried playing with relaxation factors, but that doesn't seem to converge towards a stable meniscus height - there is oscillation up and down.

Thanks,
Mike

MikeWorth May 13, 2020 04:49

I've had a closer look at the LTS concept, and as far as I can tell there are implementations out there (e.g. 1,2) that do work properly for transient simulation. They are aimed at reducing computational effort by being coarser with timesteps on some areas of the domain.

While LTS may help me save effort, it will not in and of itself lead to a steady state solution. I need to somehow damp out some energy from the system to prevent it oscillating for ever. An analogy would be trying to find the steady state solution of a pendulum (stationary, at the bottom) using a transient solver (which would swing back and forth for ever).

I mucked about with under-relaxation to no avail. Turns out that only changes things within a timestep - it is ignored for the last simple loop in each timestep. Is there a way to do under-relaxation on the scale of timesteps themselves? Obviously this violates the laws of physics, but ought to help converge towards a steady answer. I could then do a final step without it to ensure that the answer is physical.

If I want a proper steady state version of inter(Iso)Foam, is my only option to delve into the C++ and try to combine the relevant parts of inter(Iso)Foam with simpleFoam?

Thanks,
Mike

HPE May 13, 2020 16:33

Hi

- Before considering your questions regarding the steady-state modifications, is there any chance to consider to use a transient solver (e.g. interIsoFoam), and do the time-averaging of the field of interest by using fieldAverage function object to obtain a steady-state picture of the flow? Or would this be too naive?
- I have asked a friend more knowledgeable in this regard, the response was:
"Any solver that can handle LTS time scheme can be run as steady state. InterFoam is one.
Not sure about the other interXXXFoam solvers.
The handling of LTS needs to be accounted on the top level solver"

Hope this helps.

MikeWorth May 19, 2020 03:39

Thanks for that; I've poked around a little more, and it appears that a lot of my sloshing was coming from numeric errors - I've tightened up all of my residual limits and it provides a much more stable solution that appears to converge to a stable state.

Is there a mechanism by which I can make interFoam terminate once it's outputs stop changing? As a fundamentally transient solver I can't see how to do this, butI'd like to check before I start writing scripts to manually look for it and terminate the solver.

HPE May 19, 2020 04:43

Hi,

- I think you can use `runTimeControl` FO: https://www.openfoam.com/documentati...e-control.html

MikeWorth June 12, 2020 10:43

Thanks for the suggestion - that looks like the correct approach.

In order to terminate upon a stable surface shape, I want to put the condition on alpha flux. When that is a uniformly low value, the surface has stopped moving.

I can't quite see how to access this alpha flux parameter - presumably there is a way to do it within a configuration file, rather than having to recompile interfoam?

geth03 June 22, 2020 09:57

the steady state would imply a non-changing value of the property solved in the equation. i once used the LTS function for reactingMultiphaseEulerFOam, but a true steady state was never achieved.
i mean the properties U,p etc. still change over time.

i compared results with transient solutions and they weren't even nearly similar, i had completely different results.

does it make sense to use it for complex systems? i mean, turbulence for example is always a transient phenomena.

MikeWorth June 23, 2020 05:12

1 Attachment(s)
In terms of the physics I'm modelling, I feel happy that a steady-state solution should exist. It's the Landau-Levich film case; flow is laminar.

As can be seen in the attached plot, it doesn't want to converge to a stable value. It seems to fluctuate at approximately the expected value of film thickness, but after 2 million iterations hasn't properly stabilized.


All times are GMT -4. The time now is 15:11.