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

Unstable Solver: compressibleInterFoam for Water-Air Mixture in Vertical Pipe

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 24, 2016, 09:55
Post Unstable Solver: compressibleInterFoam for Water-Air Mixture in Vertical Pipe
  #1
New Member
 
Colin
Join Date: Mar 2015
Location: UK
Posts: 3
Rep Power: 9
colinjd is on a distinguished road
Hello to All,

I have been correlating compressibleInterFoam to experimental data for a water-gas mixture in a 2" vertical pipe with a 90deg bend at the top of the pipe (see images below).

The correlation has been good but the simulation time has been too long due to a short timestep (relative to commercial packages). Therefore the timestep has been increased - by increasing the global courant number (maxCo) - and stability has almost been maintained by increasing number of Alpha sub cycles and the number of corrector loops. The simulation appears to be stable for a significant length of simulation time but, eventually, the pressure field diverges very quickly over a short number of iterations.

I will share more details of the problem below for two reasons:
1) It would be interesting to hear if anyone is modelling a similar problem (internal pipe flow with interFoam/compressibleInterFoam) and would like to share ideas;
2) This stability problem must have occurred in a range of problems involving interFoam/compressibleInterFoam and it would be good to get an insight into possible fixes.

Problem Details:

In this problem, the volume flowrates of the water and gas phases have been set to create a churn flow regime in the pipeline not that annular, bubble or slug flow regimes could also be modeled with the same setup.

Correlation between Openfoam and experimental data is being assessed by the forces on the bend, although qualitative assessment of the liquid-gas interaction is also being considered.

A good match was achieved between Openfoam and the experimental forces with a cross sectional mesh of ~2000 cells. Reducing the cell count to 1000 caused the flow to remain annular, i.e. the churn was not captured, and gave poor correlation of forces.

The main issue is the timestep:
Timestep for compressibleInterFoam = ~0.025 ms (based on a variable timestep with maxCo = 0.9),
Timestep for commercial software = 0.5 ms.

In order to improve the timestep for compressibleInterFoam, the following steps were taken based on information from a range of sources (mostly on this forum):
1) maxCo was increased to 20, therefore the timestep is increased to ~0.5 ms,
2) To compensate for the high courant, nAlphaSubCycles was increased from 1 to 20 (increasing the temporal resolution at the interface) and the nCorrectors was increased from 2 to 5.

The forces predicted at the bend were similar for the smaller timestep (0.025 ms) and the larger timestep (0.5 ms).

The simulation was stable for a long time with the longer timestep before the p_rgh solver diverged very quickly over a few timesteps and the simulation crashed, judging by information in the log file. The key lines from the log file are below, showing that the pressure (p_rgh) field becomes unstable:

// Third from last timestep
MULES: Solving for alpha.water
Liquid phase volume fraction = 0.38169616 Min(alpha1) = -3.4303282e-010 Min(alpha2) = -1.6419778e-008
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver: Solving for T, Initial residual = 0.0029579322, Final residual = 4.8871982e-009, No Iterations 11
GAMG: Solving for p_rgh, Initial residual = 0.06971069, Final residual = 0.00021760878, No Iterations 2
max(U) 76.158088
min(p_rgh) 75754.152
GAMG: Solving for p_rgh, Initial residual = 0.00067329133, Final residual = 5.3663336e-006, No Iterations 7
max(U) 76.251723
min(p_rgh) 75866.826
GAMG: Solving for p_rgh, Initial residual = 0.00024910425, Final residual = 2.0648368e-006, No Iterations 5
max(U) 76.259826
min(p_rgh) 75942.442
GAMG: Solving for p_rgh, Initial residual = 0.00010118246, Final residual = 8.6403481e-007, No Iterations 6
max(U) 75.918665
min(p_rgh) 57112.713
GAMGPCG: Solving for p_rgh, Initial residual = 5.9935275e-005, Final residual = 6.1802835e-008, No Iterations 3
max(U) 75.505351
min(p_rgh) 66943.616
smoothSolver: Solving for k, Initial residual = 0.016007869, Final residual = 4.9682593e-009, No Iterations 10

// Final timestep
MULES: Solving for alpha.water
Liquid phase volume fraction = 0.38170974 Min(alpha1) = -4.0773482e-010 Min(alpha2) = -1.6431006e-008
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver: Solving for T, Initial residual = 0.32416271, Final residual = 7.2539381e-009, No Iterations 11
GAMG: Solving for p_rgh, Initial residual = 0.02297837, Final residual = nan, No Iterations 1000
max(U) 9890.5646
min(p_rgh) -939927.14
GAMG: Solving for p_rgh, Initial residual = 0.98541529, Final residual = nan, No Iterations 1000


Iíve included the end of the log file in the attachment.

This leaves a few questions:
Is it possible to diagnose the stability issue from this information?
Is it possible to output more diagnostic information in the log file?

For your reference, I have attached the model setup for the stable case (shorter timestep) and the unstable case (longer timestep) which will give more information of the fvSchemes and fvSolution which I fell may hold the key to this problem.

A few other things have been considered to improve stability but with no success:
1) Tightening the solver tolerance for pressure, velocity and temperature fields,
2) Bounding the div(phi, alpha) scheme,
3) Applying 2 outerCorrector cycles (going from PISO to PIMPLE),
4) Adjusting multigrid coarse level cell count,
5) momentumCorrector switched on... not sure what this does but the simulation fails immediately.

Could stability be improved by the choice of solvers or the numerical schemes? Any advice or feedback would be greatly appreciated.

Happy to post more information on request.

Kind regards,
Colin
Attached Files
File Type: zip Case42_Stable_ShorterTimestep.zip (9.2 KB, 86 views)
File Type: zip Case42_Unstable_LongerTimestep.zip (10.7 KB, 45 views)
File Type: zip InletBoundaryAndResults.zip (194.1 KB, 73 views)
colinjd is offline   Reply With Quote

Old   October 3, 2016, 05:01
Default
  #2
Member
 
Arnout
Join Date: Nov 2010
Posts: 46
Rep Power: 14
The King is on a distinguished road
Hi, you're setup looks ok to me. Maybe the problem is in your boundary condition? How is you're inlet defined? Defining separate inlets for air and water can introduce a sharp jump in you're velocity field which make the solution unstable. Can you mail/post you boundary conditions as well?
The King is offline   Reply With Quote

Old   October 13, 2016, 10:33
Default
  #3
Member
 
Arnout
Join Date: Nov 2010
Posts: 46
Rep Power: 14
The King is on a distinguished road
Hi, I get the same small time steps when simulating annular flow. If I increase the Courant number the simulation crashes. Did you made any progress on getting it faster?
The King is offline   Reply With Quote

Reply

Tags
compressibleinterfoam, oil and gas, openfoam 2.3.1, slug flow, vertical pipe

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
No flow in vertical pipe. vishmehr24 OpenFOAM Pre-Processing 0 February 5, 2015 06:52
Boundary condition of velocity and pressure at interface for air water pipe flow jignesh_thaker2007 OpenFOAM Running, Solving & CFD 7 June 19, 2014 11:12
Working directory via command line Luiz CFX 4 March 6, 2011 21:02
air bubble is disappear increasing time using vof xujjun CFX 9 June 9, 2009 08:59
vertical pipe flow sanjib das sharma CFX 2 July 30, 2001 07:17


All times are GMT -4. The time now is 16:00.