CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Simulation of a no-flow steady-state scenario with interFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 20, 2025, 03:39
Default Simulation of a no-flow steady-state scenario with interFoam
  #1
LG_
New Member
 
Leonard Grabow
Join Date: Feb 2025
Posts: 3
Rep Power: 2
LG_ is on a distinguished road
Hello,


my goal is to simulate the stationary state where a cavity is partly filled with water and on top with air. From the physical point of view, it’s trivial: the velocity is zero everywhere and the pressure is hydrostatic, nothing will change over time. I implemented this with interFoam, however, no matter what I try it never reaches the expected stationary state mentioned before.


The boundary conditions are intended to be as friendly as possible, so the velocity is set to noSlip and the pressure is set to zeroGradient at all sides of the domain and a reference cell of defined pressure is added inside the domain. The initial guess for the velocity and the pressure is zero everywhere, so for the velocity the initial guess is already the physical solution. Hence, ideally, the velocity stays the same over simulation time.


Unfortunately, the velocity is oscillating and, depending on the configuration, diverging over time . I attached a picture of the maximum velocity over time for the test case where you can see that. Please find attached the test case, if you are interested in reproducing it.


My question is, is this type of simulation scenario generally problematic for interFoam or am I missing an important link in my model set-up? I tried many things, from different boundary conditions to solver configurations, mesh convergence test, etc. Even switching off the transport of alpha did not work.


In addition, I did a similar set-up with one phase in icoFoam (I had to start with some artificial non-zero velocity field though) and there a convergence behaviour was seen. But if the pressure is defined via a fixedValue at the boundary instead of a reference cell, even icoFoam does not converge.


Any suggestions or comments are highly appreciated!


Best wishes,
Leonard
Attached Images
File Type: png maxvel.png (29.2 KB, 5 views)
Attached Files
File Type: zip stst_cavity.zip (106.3 KB, 3 views)
LG_ is offline   Reply With Quote

Old   February 21, 2025, 03:39
Default
  #2
Senior Member
 
Join Date: Dec 2021
Posts: 275
Rep Power: 6
Alczem is on a distinguished road
Hey,


Initializing the pressure field according to the hydrostatic pressure usually helps with weird velocities at the beginning, but spurious velocities at the interface is a known phenomenon in interFoam and VoF solvers. Have you visually inspected the alpha field? Where does the max velocity occur?


Maybe switch to isoInterFoam since it does not rely on artificial compression, or add a turbulence model to dampen the oscillations, with the following fvOptions object:


https://www.openfoam.com/documentati...urbulence.html


Not sure if it is applicable to your case, but I found it helps in achieving a better interface. You can also try to decrease cAlpha to 0.5 or even 0 in fvSolution (the interface won't be as sharp but it might help the solver).
Alczem is offline   Reply With Quote

Old   February 21, 2025, 08:17
Default
  #3
LG_
New Member
 
Leonard Grabow
Join Date: Feb 2025
Posts: 3
Rep Power: 2
LG_ is on a distinguished road
Hey Alczem,
thanks for these suggestions. Setting the initial pressure to the final hydrostatic solution for the pressure did not change much.


Indeed, the velocity deviations are strongest at the interface. If I switch off the transport of alpha in the interFoam solver, so to guarantee no fluctuations of fluid properties, I still get an oscillating behaviour for the velocity around 10^-11 which I barely can lower no matter how I adjust the solver settings. Interestingly, the order of error increases for finer meshes. If a 4-times finer mesh is used, the velocity fluctuates around 10^-9.
LG_ is offline   Reply With Quote

Old   February 21, 2025, 08:48
Default
  #4
Senior Member
 
Join Date: Dec 2021
Posts: 275
Rep Power: 6
Alczem is on a distinguished road
Hey,


When you say 10^-11, you mean your velocity oscillates below 10^-11? Or the residuals are down to 10^-11? Because in any case you can't expect to get much lower values To consider a stable state, I am usually satisfied when the velocity reaches a few order of magnitudes below the domain size (say, less than 0.001 m/s for a domain a few meters wide). From what you describe, I would say this is a stable setup, and I cannot see a way to get an even more stable case.


Again, the spurious velocities are likely to be reoccuring, so you have to decide if they affect the solution too much to be neglected.


A finer mesh is able to capture more accurately the interface, and the currents nearby, so it does not surprise me that you get more unstable values. A coarser mesh smears the fields and adds numerical dissipation (hence more stability).
Alczem is offline   Reply With Quote

Old   February 24, 2025, 05:07
Default
  #5
LG_
New Member
 
Leonard Grabow
Join Date: Feb 2025
Posts: 3
Rep Power: 2
LG_ is on a distinguished road
Hey Alczem,


I guess I must accept this precision for a 'perfect' case then


When I let alpha to be transported again, modification of cAlpha in interFoam or switching completely to interIsoFoam did not change much in the magnitude of the velocity error. It seems that it's too much to expect a sharp scalar front to remain as sharp over time, even when it is not transported initially.
LG_ is offline   Reply With Quote

Old   February 24, 2025, 08:29
Default
  #6
Senior Member
 
Join Date: Dec 2021
Posts: 275
Rep Power: 6
Alczem is on a distinguished road
Hey,


That's my take on it, take it with a grain of salt can you share a view of the most stable velocity field you can get so people can maybe help you further?
Alczem is offline   Reply With Quote

Reply

Tags
converge, interfoam, steady state

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
From steady state to transient simulation Mechand FLUENT 0 December 24, 2020 12:17
Transient and Steady state simulation results do not match shahin1 FLUENT 0 July 23, 2020 07:24
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
Monitor point values in a steady state simulation Kushagra CFX 2 July 13, 2008 20:03


All times are GMT -4. The time now is 19:39.