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

interFoam Solver diverges

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Swift
  • 1 Post By ErenC

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 28, 2020, 17:42
Default interFoam Solver diverges
  #1
New Member
 
samanngh's Avatar
 
Saman Naghavi
Join Date: Feb 2020
Posts: 8
Rep Power: 6
samanngh is on a distinguished road
Hello everyone,


I am trying to simulate a simple two-phase flow in foam-extend-4.1 using interFoam. However, the solution immediately diverges.


It may be worth to mention that if I only use one phase, there would be no problem, and the solver's outputs would be rational. I also used my mesh with some other solvers like icoFoam and pimpleFoam, and it does not have any problem.


I would be grateful if anyone can help me with this problem.
Thanks.


My fvsolution code:
Code:
solvers
{
    pcorr
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-10;
        relTol          0;
    }

    pd
    {
        solver          GAMG;
        tolerance       1e-06;
        relTol          0.01;
        smoother        GaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }
    pdFinal
    {
        solver          GAMG;
        tolerance       1e-06;
        relTol          0;
        smoother        GaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }
    U
    {
        solver          BiCGStab;
        preconditioner  DILU;
        tolerance       1e-05;
        relTol          0.1;
    }
    UFinal
    {
        solver          BiCGStab;
        preconditioner  DILU;
        tolerance       1e-05;
        relTol          0;
    }
}
PIMPLE
{
    momentumPredictor   no;
    nOuterCorrectors    5;
    nCorrectors         1;
    nNonOrthogonalCorrectors 0;
    nAlphaCorr      4;
    cAlpha          1;
    nAlphaSubCycles 1;
}

PISO
{
    nAlphaCorr      1;
    nAlphaSubCycles 3;
    cAlpha          1;
    nCorrectors    1;
    nNonOrthogonalCorrectors 0;
}

relaxationFactors
{
    p               0.3;
    U               0.5;
}
My fvschemes code:
Code:
ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         leastSquares;
    grad(U)         leastSquares;
    grad(alpha1)    leastSquares;
}

divSchemes
{
    div(rho*phi,U)   Gauss limitedLinearV 1;
    div(phi,alpha)   Gauss limitedLinear 1;
    div(phirb,alpha) Gauss limitedLinear 1;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}
Outputs on the terminal:
Code:
Create time

Create mesh for time = 0


PIMPLE: no residual control data found. Calculations will employ 5 corrector loops


Reading g
Reading field pd

Reading field alpha1

Reading field U

Reading/calculating face flux field phi

Reading transportProperties

Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
Calculating field g.h

Selecting turbulence model type laminar
time step continuity errors : sum local = 0.000243902, global = -0.000243902, cumulative = -0.000243902
DICPCG:  Solving for pcorr, Initial residual = 1, Final residual = 9.95567e-11, No Iterations 482
time step continuity errors : sum local = 9.4318e-14, global = -1.43407e-16, cumulative = -0.000243902
Courant Number mean: 0.0809734 max: 0.444883 velocity magnitude: 0.0210762

Starting time loop

Courant Number mean: 0.0809734 max: 0.444883 velocity magnitude: 0.0210762
Time = 1e-05

PIMPLE: iteration 1
MULES: Solving for alpha1
MULES: Solving for alpha1
MULES: Solving for alpha1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.0385366  Min(alpha1) = -4.70714e-41  Max(alpha1) = 1
GAMG:  Solving for pd, Initial residual = 1, Final residual = 0.00493303, No Iterations 3
time step continuity errors : sum local = 0.00378463, global = -0.000229376, cumulative = -0.000473279
PIMPLE: iteration 2
MULES: Solving for alpha1
MULES: Solving for alpha1
MULES: Solving for alpha1
MULES: Solving for alpha1
Liquid phase volume fraction = 0.0385366  Min(alpha1) = -2.22552e+08  Max(alpha1) = 3.20113e+08
GAMG:  Solving for pd, Initial residual = 1, Final residual = 0.00699827, No Iterations 4
time step continuity errors : sum local = 769831, global = 42.6834, cumulative = 42.6829
PIMPLE: iteration 3
MULES: Solving for alpha1
Floating point exception (core dumped)
samanngh is offline   Reply With Quote

Old   March 18, 2020, 07:53
Default
  #2
Member
 
Thomas Sprich
Join Date: Mar 2015
Posts: 76
Rep Power: 11
Swift is on a distinguished road
Hi Samanngh

Check you boundary conditions. This is most likely where your error lies.

See this part from your output:
Quote:
Liquid phase volume fraction = 0.0385366 Min(alpha1) = -2.22552e+08 Max(alpha1) = 3.20113e+08
The problem is most likely in pressure or in U. Use the dam break tutorial as an example.

Regards,
Thomas
samanngh likes this.
Swift is offline   Reply With Quote

Old   March 18, 2020, 09:35
Default
  #3
Member
 
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 9
ErenC is on a distinguished road
After reviewing your BC's as Swift said, change cellLimited's to Gauss upwind. Why do you need to limit those?

Also, increase tolerance of pcorr to 1e-6. These will quicken your simulation.
samanngh likes this.
ErenC is offline   Reply With Quote

Old   March 19, 2020, 12:43
Default
  #4
New Member
 
samanngh's Avatar
 
Saman Naghavi
Join Date: Feb 2020
Posts: 8
Rep Power: 6
samanngh is on a distinguished road
Thanks for your consideration. The problem was with my boundary conditions as both of you mentioned. I was not aware about the definition of contact angle in boundary conditions. I used the capillary rise example to solve my problem.
One more thing, As I am new to cfd-online, I would be grateful if you could inform me whether I should delete this thread or is there a way to mark it as solved? Or should I leave it as it is?
Thanks,

Quote:
Originally Posted by ErenC View Post
After reviewing your BC's as Swift said, change cellLimited's to Gauss upwind. Why do you need to limit those?

Also, increase tolerance of pcorr to 1e-6. These will quicken your simulation.
Quote:
Originally Posted by Swift View Post
Hi Samanngh

Check you boundary conditions. This is most likely where your error lies.

See this part from your output:


The problem is most likely in pressure or in U. Use the dam break tutorial as an example.

Regards,
Thomas
samanngh is offline   Reply With Quote

Reply

Tags
foam extend 4.1, interfoam diverging


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
Can interFoam be used as a heat transfer solver? eca OpenFOAM Running, Solving & CFD 8 July 28, 2018 15:41
interFoam solver - Vacuum saba_saeb OpenFOAM Running, Solving & CFD 3 October 13, 2014 11:41
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 01:01
interface tension question with interFoam solver openTom OpenFOAM Running, Solving & CFD 4 May 29, 2009 14:18
interFoam solver needs pdRefCell? openTom OpenFOAM Running, Solving & CFD 2 May 10, 2009 11:20


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