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

Problem with icoFoam. Simulation diverges.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2021, 21:16
Default Problem with icoFoam. Simulation diverges.
  #1
New Member
 
Join Date: Mar 2021
Posts: 1
Rep Power: 0
Perri is on a distinguished road
Hi! I'm new using OpenFoam. I'm triying to run a case for my thesis work, but my simulation diverges.

The case is about a orifice place. The problem is that my courant number rises until values of 1e+50 (clearly diverges). I have tried changing the solver and use turbulent models like RAS or LES with solvers like pimpleFoam or simpleFoam (I have also tried to run the stationary problem). But apperantly the problem isn't in the configuration of the case.


I believe that the problem is in the Mesh. So I run checkMesh but everything seems to be okey.


So either the mesh is wrong or my boundary conditions are wrong.


I also have tried to use relaxation factors (like 0.3 ) and using smaller time steps, but this doesn't work either.


Here are all my config files.


BlockMeshDict
Code:
*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


Radio  4;
MinRadio #calc "-1.0*$Radio";
RadioEntr  2;
MinRadioEntr #calc "-1.0*$RadioEntr";
RadioSal 2;
MinRadioSal #calc "-1.0*$RadioSal";
EspPlaca 1;
DistEntr   8;
DistPlacaSal #calc "$DistEntr + $EspPlaca";
DistSalida  #calc "$DistPlacaSal +8";

halfAngle 45.0;

midPointRadio #calc "$Radio*sin(degToRad($halfAngle))";
MinmidPointRadio #calc "-1.0*$midPointRadio";

midPointRadioEntr #calc "$RadioEntr*sin(degToRad($halfAngle))";
MinmidPointRadioEntr #calc "-1.0*$midPointRadioEntr";

midPointRadioSal #calc "$RadioSal*sin(degToRad($halfAngle))";
MinmidPointRadioSal #calc "-1.0*$midPointRadioSal";

RadialMeshing 30;
LongMeshing 50;
vertices
(
    (0 0 0) //0
    (0 $Radio 0) //1
    ($MinRadio 0 0) //2 
    (0 $MinRadio 0) //3 
    ($Radio 0 0) //4
    (0 $Radio $DistEntr) //5
    ($MinRadio 0 $DistEntr) //6 
    (0 $MinRadio $DistEntr) //7 
    ($Radio 0 $DistEntr) //8
    (0 $RadioEntr $DistEntr) //9
    ($MinRadioEntr 0 $DistEntr) //10 
    (0 $MinRadioEntr $DistEntr) //11
    ($RadioEntr 0 $DistEntr) //12
    (0 $RadioSal $DistPlacaSal) //13
    ($MinRadioSal 0 $DistPlacaSal) //14 
    (0 $MinRadioSal $DistPlacaSal) //15 
    ($RadioSal 0 $DistPlacaSal) //16
    (0 $Radio $DistPlacaSal) //17
    ($MinRadio 0 $DistPlacaSal) //18 
    (0 $MinRadio $DistPlacaSal) //19 
    ($Radio 0 $DistPlacaSal) //20
    (0 $Radio $DistSalida) //21
    ($MinRadio 0 $DistSalida) //22 
    (0 $MinRadio $DistSalida) //23 
    ($Radio 0 $DistSalida) //24
    
    (0 $RadioEntr 0) //25
    ($MinRadioEntr 0 0) //26
    (0 $MinRadioEntr 0) //27
    ($RadioEntr 0 0) //28
    
    (0 $RadioSal $DistSalida) //29
    ($MinRadioSal 0 $DistSalida) //30
    (0 $MinRadioSal $DistSalida) //31
    ($RadioSal 0 $DistSalida) //32
);

blocks
(
    hex (28 4 1 25 12 8 5 9) ($RadialMeshing $RadialMeshing $LongMeshing) simpleGrading (1 1 0.5)
    hex (2 26 25 1 6 10 9 5) ($RadialMeshing $RadialMeshing $LongMeshing) simpleGrading (1 1 0.5)
    hex (26 2 3 27 10 6 7 11) ($RadialMeshing $RadialMeshing $LongMeshing) simpleGrading (1 1 0.5)
    hex (4 28 27 3 8 12 11 7) ($RadialMeshing $RadialMeshing $LongMeshing) simpleGrading (1 1 0.5)
    
    hex (25 26 27 28 9 10 11 12) ($RadialMeshing $RadialMeshing $LongMeshing) simpleGrading (1 1 0.5)
    
    hex (9 10 11 12 13 14 15 16) ($RadialMeshing $RadialMeshing 50) simpleGrading (1 1 1)
    
    hex (16 20 17 13 32 24 21 29) ($RadialMeshing $RadialMeshing $LongMeshing) simpleGrading (1 1 0.5)
    hex (13 17 18 14 29 21 22 30) ($RadialMeshing $RadialMeshing $LongMeshing) simpleGrading (1 1 0.5)
    hex (14 18 19 15 30 22 23 31) ($RadialMeshing $RadialMeshing $LongMeshing) simpleGrading (1 1 0.5)
    hex (15 19 20 16 31 23 24 32) ($RadialMeshing $RadialMeshing $LongMeshing) simpleGrading (1 1 0.5)
    
    hex (13 14 15 16 29 30 31 32) ($RadialMeshing $RadialMeshing $LongMeshing) simpleGrading (1 1 0.5)

);

edges
(
    arc 1 2 ($MinmidPointRadio $midPointRadio 0)
    arc 2 3 ($MinmidPointRadio $MinmidPointRadio 0)
    arc 3 4 ($midPointRadio $MinmidPointRadio 0)
    arc 4 1 ($midPointRadio $midPointRadio 0)
    arc 5 6 ($MinmidPointRadio $midPointRadio $DistEntr)
    arc 6 7 ($MinmidPointRadio $MinmidPointRadio $DistEntr)
    arc 7 8 ($midPointRadio $MinmidPointRadio $DistEntr)
    arc 8 5 ($midPointRadio $midPointRadio $DistEntr)
    arc 9 10 ($MinmidPointRadioEntr $midPointRadioEntr $DistEntr)
    arc 10 11 ($MinmidPointRadioEntr $MinmidPointRadioEntr $DistEntr)
    arc 11 12 ($midPointRadioEntr $MinmidPointRadioEntr $DistEntr)
    arc 12 9 ($midPointRadioEntr $midPointRadioEntr $DistEntr)
    arc 13 14 ($MinmidPointRadioSal $midPointRadioSal $DistPlacaSal)
    arc 14 15 ($MinmidPointRadioSal $MinmidPointRadioSal $DistPlacaSal)
    arc 15 16 ($midPointRadioSal $MinmidPointRadioSal $DistPlacaSal)
    arc 16 13 ($midPointRadioSal $midPointRadioSal $DistPlacaSal)
    arc 17 18 ($MinmidPointRadio $midPointRadio $DistPlacaSal)
    arc 18 19 ($MinmidPointRadio $MinmidPointRadio $DistPlacaSal)
    arc 19 20 ($midPointRadio $MinmidPointRadio $DistPlacaSal)
    arc 20 17 ($midPointRadio $midPointRadio $DistPlacaSal)
    arc 21 22 ($MinmidPointRadio $midPointRadio $DistSalida)
    arc 22 23 ($MinmidPointRadio $MinmidPointRadio $DistSalida)
    arc 23 24 ($midPointRadio $MinmidPointRadio $DistSalida)
    arc 24 21 ($midPointRadio $midPointRadio $DistSalida)
    arc 25 26 ($MinmidPointRadioEntr $midPointRadioEntr 0)
    arc 26 27 ($MinmidPointRadioEntr $MinmidPointRadioEntr 0)
    arc 27 28 ($midPointRadioEntr $MinmidPointRadioEntr 0)
    arc 28 25 ($midPointRadioEntr $midPointRadioEntr 0)
    arc 29 30 ($MinmidPointRadioSal $midPointRadioSal $DistSalida)
    arc 30 31 ($MinmidPointRadioSal $MinmidPointRadioSal $DistSalida)
    arc 31 32 ($midPointRadioSal $MinmidPointRadioSal $DistSalida)
    arc 32 29 ($midPointRadioSal $midPointRadioSal $DistSalida)
    
);

patches
(
    wall fixedWalls
    (
        (1 5 8 4)
        (4 8 7 3)
        (7 3 2 6)
        (2 6 1 5)
        (9 13 16 12)
        (12 16 15 11)
        (11 15 10 14)
        (10 14 9 13)
        (17 21 20 24)
        (20 24 19 23)
        (19 23 18 22)
        (18 22 17 21)
        (5 9 10 6)
        (10 6 7 11)
        (11 7 12 8)
        (8 12 5 9)
        (17 13 14 18)
        (17 20 16 13)
        (20 19 15 16)
        (14 15 19 18)

    )
    patch inlet
    (
        (1 2 26 25)
        (2 3 27 26)
        (3 4 28 27)
        (4 1 25 28)
        (25 26 27 28)
    )
    patch Outlet
    (
        (29 30 31 32)
        (21 22 30 29)
        (22 23 31 30)
        (23 24 32 31)
        (24 21 29 32)
    )
);
mergePatchPairs
(
);

// ************************************************************************* //
ControlDict

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     icoFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         20;

deltaT          0.001;

writeControl    runTime;

writeInterval   1;

purgeWrite      0;

writeFormat     ascii;

writePrecision  12;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

// ************************************************************************* //
fvSchemes

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         CrankNicolson 0.5;
}

gradSchemes
{
    default         Gauss linear;
    grad(p)         Gauss linear;
}

divSchemes
{
    default         none;
    div(phi,U)      Gauss linearUpwind grad(U);
}

laplacianSchemes
{
    default         Gauss linear orthogonal;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         orthogonal;
}


// ************************************************************************* //
fvSolution

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-05;
        relTol          1e-02;
        maxIter         10000;
    }

    pFinal
    {
        $p;
        relTol          1e-03;
    }

    U
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-05;
        relTol          1e-02;
        maxIter         10000;
    }
}

PISO
{
    nCorrectors     3;
    nNonOrthogonalCorrectors 0;

}
relaxationFactors
{
    fields
    {
        ".*"       0.3;
    }
    equations
    {
        ".*"       0.3;
    }
}

// ************************************************************************* //
U boundary condition

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0.1);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (0 0 0.1);
    }
    Outlet
    {
        type            zeroGradient;
    }
    fixedWalls
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

}

// ************************************************************************* //
p boundary condition

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  8
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }
    
    Outlet
    {
//I have also tried using pRefCell 0, pRefValue 0 and zeroGradient in this condition

        type            fixedValue;
        value            uniform 0;
    }

    fixedWalls
    {
        type            zeroGradient;
    }

}

// ************************************************************************* //
Thanks for the help !
Perri 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
Continuous casting simulation problem luke.christ FLUENT 6 November 24, 2020 08:14
Defrosting Windscreen Simulation diverges and leads to floating point exception Dehyp STAR-CCM+ 9 March 7, 2017 11:27
Problem storing values at UDM for tranisient dynamic mesh simulation xab Fluent UDF and Scheme Programming 4 December 22, 2016 05:10
Problem in initializing transient simulation with a finer mesh sidd CFX 8 April 29, 2016 03:25
Dynamic mesh simulation (pimpleDyMFoam) problem sidlof OpenFOAM Running, Solving & CFD 6 April 12, 2013 12:24


All times are GMT -4. The time now is 01:34.