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

residual = nan on iteration 1 with rhoSimpleFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 23, 2015, 23:46
Default residual = nan on iteration 1 with rhoSimpleFoam
  #1
Senior Member
 
Join Date: Nov 2010
Posts: 682
Rep Power: 12
me3840 is on a distinguished road
Hello folks,

First try using rhoSimpleFoam here. Haven't really done much compressible flow in OpenFOAM before. I have a very simple case of a sphere in a tube. The mesh is about 500k cells and passes all meshCheck just fine.

My BCs are all very simple (trying to keep it that way the first time). I have:
Inlet (U fixed value, T fixed value, zero grad else)
Outlet (p fixed value, zero grad else)
and the walls (walls and sphere) which are all set to 0/zeroGradient.

However, it seems on my first iteration, all of the residuals are nan's and it crashes very quickly:


Time = 1

GAMG: Solving for Ux, Initial residual = nan, Final residual = nan, No Iterations 1000
GAMG: Solving for Uy, Initial residual = nan, Final residual = nan, No Iterations 1000
GAMG: Solving for Uz, Initial residual = nan, Final residual = nan, No Iterations 1000
smoothSolver: Solving for e, Initial residual = nan, Final residual = nan, No Iterations 1000
GAMG: Solving for p, Initial residual = nan, Final residual = nan, No Iterations 1000
time step continuity errors : sum local = nan, global = nan, cumulative = nan
rho max/min : 0.025 0.025
GAMG: Solving for omega, Initial residual = nan, Final residual = nan, No Iterations 1000
GAMG: Solving for k, Initial residual = nan, Final residual = nan, No Iterations 1000
ExecutionTime = 389.481 s ClockTime = 389 s


I can't seem to figure out why. Did I miss something in my BCs?
I set pRefValue manually to be 101325 Pa, so my other BCs and initial condition pressure should be gauge to that.

It says that the rho max/min is 0.025 - but the min and max limiter is 0.5 and 1.5, how did it get that low? This is almost STP...

There is a defaultFaces patch, but this is just left over from blockMesh and has zero faces, so I shouldn't need to worry about it, right?

Here's some of my files:
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (20 0 0);

boundaryField
{
    defaultFaces
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
	inlet
    {
        type            fixedValue;
        value           uniform (20 0 0);
    }
	outlet
    {
        type            zeroGradient;
    }
	wall
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
	sphere
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
  
}
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    defaultFaces
    {
        type            zeroGradient;
    }
	 inlet
    {
        type            zeroGradient;
    }
	 outlet
    {
        type            fixedValue;
		value			uniform 0;
    }
	wall
    {
        type            zeroGradient;
    }
	sphere
    {
        type            zeroGradient;
    }

}
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField   uniform 300;

boundaryField
{

    defaultFaces
    {
        type            zeroGradient;
    }
	 inlet
    {
        type            fixedValue;
        value           uniform 300;
    }
	 outlet
    {
        type            zeroGradient;
    }
	wall
    {
        type            zeroGradient;
    }
	sphere
    {
        type            zeroGradient;
    }

}
Code:
dimensions      [ 0 2 -2 0 0 0 0 ];

internalField   uniform 22.815;

boundaryField
{
    defaultFaces
    {
        type            compressible::kqRWallFunction;
        value           uniform 0;
    }
	inlet
    {
        type            fixedValue;
        value           uniform 22.815;
    }
	outlet
    {
        type            fixedValue;
        value           uniform 22.815;
    }
	wall
    {
        type            compressible::kqRWallFunction;
        value           uniform 0;
    }
	sphere
    {
        type            compressible::kqRWallFunction;
        value           uniform 0;
    }


}
Code:
dimensions      [ 0 0 -1 0 0 0 0 ];

internalField   uniform 477.26;

boundaryField
{
    defaultFaces
    {
        type            compressible::omegaWallFunction;
        value           uniform 0;
    }
	inlet
    {
        type            fixedValue;
        value           uniform 477.76;
    }
	outlet
    {
        type            fixedValue;
        value           uniform 477.76;
    }
	wall
    {
        type            compressible::omegaWallFunction;
        value           uniform 0;
    }
	 sphere
    {
        type            compressible::omegaWallFunction;
        value           uniform 0;
    }


}
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
    div(phi,U)      bounded Gauss linearUpwindV Gauss linear;
    div((muEff*dev2(T(grad(U))))) Gauss linear Gauss linear;
    div(phi,omega) bounded Gauss linearUpwind Gauss linear;
    div(phi,k)      bounded Gauss linearUpwind Gauss linear;
    div(phi,Ekp)    bounded Gauss linearUpwind Gauss linear;
	div(phi,e)    bounded Gauss linearUpwind Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    p               ;
}
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-08;
        relTol          0.05;
        smoother        GaussSeidel;
        cacheAgglomeration on;
        nCellsInCoarsestLevel 20;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }

    U
    {
        solver          GAMG;
        tolerance       1e-08;
        relTol          0.05;
        smoother        GaussSeidel;
        cacheAgglomeration on;
        nCellsInCoarsestLevel 20;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }

    e
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        tolerance       1e-06;
        relTol          0.1;
    }

    "(k|omega)"
    {
        $U;
        tolerance       1e-07;
        relTol          0.1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    rhoMin          rhoMin [ 1 -3 0 0 0 ] 0.5;
    rhoMax          rhoMax [ 1 -3 0 0 0 ] 1.5;
	pRefPoint (-4.9 0 0);
	pRefValue 101325;
    residualControl
    {
        p               1e-2;
        U               1e-4;
        e               1e-3;

        // possibly check turbulence fields
        "(k|epsilon|omega)" 1e-3;
    }
}

relaxationFactors
{
    fields
    {
        p               0.3;
        rho             0.05;
    }
    equations
    {
        U               0.7;
        "(k|omega)"   0.7;
        e               0.5;
    }
}
me3840 is offline   Reply With Quote

Old   September 25, 2015, 10:55
Default
  #2
Senior Member
 
Join Date: Nov 2010
Posts: 682
Rep Power: 12
me3840 is on a distinguished road
Nobody with any clues? Hm. I was going to try and see if I can get it to run in just a pipe.
me3840 is offline   Reply With Quote

Old   September 27, 2015, 21:25
Default
  #3
New Member
 
Joseph Urich
Join Date: Mar 2009
Location: Pittsburgh, PA
Posts: 14
Rep Power: 9
jurich is on a distinguished road
Hello,

I've always run rhoSimpleFoam using absolute pressures.

I don't think pRefValue works the way you describe using it. See this thread http://www.cfd-online.com/Forums/ope...prefvalue.html, section 4.5.3.1 of the user guide, and src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C; it seems to set the pressure level in one cell only.
jurich is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 02:20
pimpleFoam: turbulence->correct(); is not executed when using residualControl hfs OpenFOAM Running, Solving & CFD 3 October 29, 2013 09:35
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 07:37
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 05:24
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 12:18.