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

interFoam - unphysical behavior when filling tank

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2016, 06:25
Default interFoam - unphysical behavior when filling tank
  #1
New Member
 
Join Date: Sep 2014
Posts: 6
Rep Power: 11
TommyCP is on a distinguished road
Dear fellow FOAMers, I’ve run into a problem with an interFoam simulation that I would like to request your help with.

I’m trying to simulate the filling of a tank with a high-viscosity liquid. The vessel has both the inlet and outlet placed on top. At the start, the vessel is filled half with air, half with liquid. The vessel is then filled with liquid until full.

The expectation of the simulation is that the vessel would be filled up almost completely with some air pockets remaining. However, it currently will not fill for more than 80-85 %. Once it is filled up this far, the liquid starts getting ‘sucked’ into the outlet in an unphysical way. Oddilly enough, it does not come into contact with the ceiling of the vessel nor with the walls of the outlet.

I’ve tried many things to create a more realistic behavior, all to no avail. Things I’ve tried:

Geometry-related:
- tilting the whole mesh at a very slight angle
- increasing the height of the outlet (see attached images)

Mesh-related:
- adding more/less layers on the walls
- increasing/decreasing mesh fineness
- using a more fine mesh only around the inlet and outlet
- note: checkMesh never reports any errors

transportProperties-related:
- varying sigma from 0.07 down to 0

BC-related:
- trying various boundary conditions for inlet, outlet, and walls (see below for current BCs), based on the capillaryRise and damBreak examples as well as various hints on these forums. To name a few of the important ones:
o for alpha: * inlet: inletOutlet; * walls: zeroGradient or constrantAlphaContactAngle (with various values for theta0); * outlet: inletOutlet or zeroGradient
o for p_rgh: * inlet: fixedFluxPressure; * walls: fixedFluxPressure or fixedValue; * outlet: fixedValue or totalPressure
o for U: * inlet: flowRateInletVelocity; * walls: fixedValue; * outlet: pressureInletOutletVelocity or zeroGradient.

Solver-related:
- trying interpolationSchemes ‘linear’ and ‘midPoint’
- trying divSchemes ‘Gauss limitedLinearV 1’ and ‘Gauss upwind’ for div(rhoPhi,U)
- trying divSchemes ‘Gauss linear’ and ‘Gauss interfaceCompression’ for div(phirb,alpha)
- playing with nAlphacorr, nAlphaSubCycles, cAlpha
- enabling/disabling the momentumPredictor
- reducing maxCo from 0.95 to 0.2

Currently, I’m at a loss so I would like to ask if anyone has an idea how to get more realistic results. Below are some of the settings I last used. I also attached a few screenshots of the simulation. Thank you for any help you can provide!


alpha
Code:
internalField   uniform 0; 
   
  boundaryField
  {
      inlet
      {
          type            inletOutlet;
          inletValue      uniform 1;
          value           uniform 1;
      }
      main
      {
          type            constantAlphaContactAngle;
          theta0          45;
          limit           gradient;
          value           nonuniform 0;
      }
      outlet
      {
          type            inletOutlet;
          inletValue      uniform 0;
          value           uniform 0;
      }
  }
p_rgh
Code:
internalField   uniform 0;
   
  boundaryField
  {
      inlet
      {
          type            fixedFluxPressure;
          value           uniform 0;
      }
      main
      {
          type            fixedFluxPressure;
          value           uniform 0;
      }
      outlet
      {
          type            totalPressure;
              p0          uniform 0;
              U           U;
              phi         phi;
              rho         rho;
              psi         none;
              gamma       1;
              value       uniform 0;
      }
  }
U
Code:
internalField   uniform (0 0 0);
   
  boundaryField
  {
      inlet
      {
          type            flowRateInletVelocity;
          massFlowRate    constant 0.1;
          value           uniform (0 0 -0.1);
      }
      main
      {
          type            fixedValue;
          value           uniform (0 0 0);
      }
      outlet
      {
          type            zeroGradient;
      }
  }
fvSolution
Code:
solvers
  {
      alpha.water
      {
          nAlphaCorr      1;
          nAlphaSubCycles 2;
          cAlpha          1;
      }
   
      pcorr
      {
          solver          PCG;
          preconditioner  DIC;
          tolerance       1e-10;
          relTol          0.01;
      }
   
      p_rgh
      {
          solver          GAMG;
          smoother        GaussSeidel
          tolerance       1e-07;
          relTol          0.05;
      }
   
      p_rghFinal
      {
          $p_rgh;
          tolerance       1e-08;
          relTol          0.01;
      }
   
      U
      {
          solver          smoothSolver;
          smoother        symGaussSeidel;
          tolerance       1e-06;
          relTol          0;
      }
   
      UFinal
      {
          $U;
          tolerance       1e-08;
          relTol          0;
      }
  }
   
  PIMPLE
  {
      momentumPredictor no;
      nCorrectors     3;
      nOuterCorrectors   1;
      nNonOrthogonalCorrectors 0;
  }
fvSchemes
Code:
ddtSchemes
  {
      default            Euler;
  }
   
  gradSchemes
  {
      default         Gauss linear;
  }
   
  divSchemes
  {
      div(rhoPhi,U) Gauss limitedLinearV 1;
      div(phi,alpha) Gauss vanLeer;
      div(phirb,alpha) Gauss interfaceCompression;
      div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
  }
   
  laplacianSchemes
  {
      default         Gauss linear corrected;
  }
   
  interpolationSchemes
  {
      default         midPoint;
  }
   
  snGradSchemes
  {
      default         corrected;
  }
   
  fluxRequired
  {
      default         no;
      p_rgh;
      pcorr;
      alpha;
  }
controlDict
Code:
application     interFoam;
  startFrom       startTime;
  startTime       0;
  stopAt          endTime;
  endTime         125;
  deltaT          2e-3;
  adjustTimeStep  yes;
  writeControl    adjustableRunTime;
  writeInterval   5;
  purgeWrite      0;
  writeFormat     ascii;
  writePrecision  6;
  writeCompression uncompressed;
  timeFormat      general;
  timePrecision   6;
  runTimeModifiable yes;
  adjustTimeStep  yes;
  maxCo           0.95;
  maxAlphaCo      0.95;
  maxDeltaT       1;
Attached Images
File Type: png geometry.png (3.6 KB, 86 views)
File Type: png cross section at start.png (47.0 KB, 91 views)
File Type: png cross section at end.png (67.5 KB, 98 views)
TommyCP is offline   Reply With Quote

Old   September 26, 2016, 03:24
Default
  #2
New Member
 
Join Date: Sep 2014
Posts: 6
Rep Power: 11
TommyCP is on a distinguished road
I've done some additional experimentation with my case. Using water (instead of the viscous liquid used earlier) did not lead to better results -- again, the liquid phase got 'sucked' into the outlet in an unphysical way. I'm currently running out of ideas on how to get a more realistic behavior.

If anyone has any ideas on this, I'd really appreciate it!
TommyCP is offline   Reply With Quote

Old   September 26, 2016, 04:14
Default
  #3
Member
 
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 11
TobM is on a distinguished road
Try to use pressureInletOutletValocity BC on outlet (refer to point 5.2.3.2 in the user guide).
Use "normal" schemes as in damBreak or so.
Your mesh seems pretty coarse at the outlet, only 10 or so cells is not enough.
TobM is offline   Reply With Quote

Old   October 5, 2016, 04:28
Default
  #4
New Member
 
Join Date: Sep 2014
Posts: 6
Rep Power: 11
TommyCP is on a distinguished road
Thank you for your suggestion. I've increased mesh fineness 2x in general and 4x around the inlet and outlet. Also, I changed my schemes back to those used in the damBreak example. Unfortunately, it did not change the behavior of my system. As for pressureInletOutletVelocity, I was already using this on the outlet.

My current BCs are as follows:

alpha
- inlet: inletOutlet
- outlet: inletOutlet
- wall: constantAlphaContactAngle

p_rgh
- inlet: fixedFluxPressure
- outlet: totalPressure
- wall: fixedFluxPressure

U
- inlet: flowRateInletVelocity
- outlet: pressureInletOutletVelocity
- wall: fixedValue

If you have any further suggestions, I'd much appreciate it.

Edit: just upgraded to OpenFOAM 4.0. Will try the new noSlip BC in U and make some changes to fvSolution.

Last edited by TommyCP; October 5, 2016 at 06:52. Reason: copy-pase error in listing p_rgh boundary conditions
TommyCP is offline   Reply With Quote

Old   October 5, 2016, 04:41
Default
  #5
Member
 
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 11
TobM is on a distinguished road
You haven't read the user guide .
pressureInletOutletVelocity for U is used together with totalPressure for p_rgh
TobM is offline   Reply With Quote

Old   October 5, 2016, 06:53
Default
  #6
New Member
 
Join Date: Sep 2014
Posts: 6
Rep Power: 11
TommyCP is on a distinguished road
Sorry, that is an error in my post. I do indeed use totalPressure for p_rgh and pressureInletOutletVelocity for U.
TommyCP is offline   Reply With Quote

Old   October 5, 2016, 07:10
Default
  #7
Member
 
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 11
TobM is on a distinguished road
Please compare your entire settings with settings from a similar tutorial, and check if your mesh is ok --> checkMesh.
TobM is offline   Reply With Quote

Old   October 6, 2016, 03:25
Default
  #8
New Member
 
Join Date: Sep 2014
Posts: 6
Rep Power: 11
TommyCP is on a distinguished road
Meshes always check out OK with checkMesh. I'm currently testing my case with settings taken from the angledDuct tutorial. I will let you know how it works out.

Thank you for your suggestions thus far.
TommyCP is offline   Reply With Quote

Old   October 14, 2016, 03:40
Default
  #9
New Member
 
Join Date: Sep 2014
Posts: 6
Rep Power: 11
TommyCP is on a distinguished road
Update: settings from the angledDuct tutorial result in a more physically correct behavior. Unfortunately, the case blows up when the tank is around 85 % full. I've found no way to avoid this.

I think it's time to give up and move. I've been trying to a lot of things to make this works, but apparently there's more to this seemingly simple case than meets the eye.

Again, thank you for your help.
TommyCP is offline   Reply With Quote

Old   February 4, 2020, 08:07
Default
  #10
Member
 
Munaf
Join Date: May 2019
Posts: 38
Rep Power: 6
mwmalkawi is on a distinguished road
Hi Tommy

Have yo umnaged to find the soluiton fo your problem

Thakns
mwmalkawi is offline   Reply With Quote

Reply


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
interFoam / bubbleFoam to simulate an aerated tank Meratb OpenFOAM Running, Solving & CFD 3 November 6, 2020 11:45
Filling Tank with Water leff CFX 7 August 21, 2017 07:47
Filling of empty tank using interFoam behcfd OpenFOAM Running, Solving & CFD 11 August 21, 2017 07:20
tank filling (water/air), I think I messed up the BCs simpomann OpenFOAM Running, Solving & CFD 2 August 21, 2017 07:16
Air tank filling gsr_132 FLUENT 1 June 10, 2016 03:16


All times are GMT -4. The time now is 09:57.