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

SimpleFoam converges to wrong values

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 26, 2015, 09:41
Default SimpleFoam converges to wrong values
  #1
New Member
 
Join Date: Jun 2015
Posts: 12
Rep Power: 11
eruwaedhiel is on a distinguished road
Hello everyone!

In a new take on my project, I am using a pressure jump baffle to act as an actuator disk above a helicopter fuselage mesh attempting to somewhat simulate forward flight. I tested the actuator disk alone and it seems to be doing what it should, but when I add the fuselage mesh and include a constant velocity across the entire area, I get some weird results. SimpleFoam converges, usually after somewhere between 30 and 230 iterations, but the values it converges on are nonsensical (I start with a pressure jump of around 450 Pa and a constant velocity across the simulation of 40 m/s, and end up with velocities on the order of 10^6 m/s or higher!).

What appears to be happening is the velocities slowly change with each iteration in a way that makes sense, up until about the last handful, where suddenly the velocity values blow up. Looking at the initial residuals, it seems the velocity residuals slowly decrease to a point, and then start increasing/decreasing again, while pressure residuals are decreasing over the course of all the iterations.

I am very new to CFD, so I'm not exactly sure how this situation comes about. The velocities seem to be changing rationally until the last few iterations, when I would have thought the simulation would diverge, but instead I get a message saying simpleFoam converged on an (incorrect) answer. It is definitely possible there is something weird about my initial conditions or settings, so I have those below. My initial epsilon is set high because I was initially running into issues where an epsilon bounding message would print, and another thread suggested increasing it to fix that issue (it seemed to work, I don't get the bounding message anymore). I ran a checkMesh and the only failed section was that it appears I have a few cells with high skewness (out of thousands). My non-orthogonality was around 50, which checkMesh gave an OK to.

Here are some of my relevant files:

fvSolution:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//The following variables must have line numbers of 17-18.
myPTolerance 1e-2;
myUTolerance 1e-5;
myTurbTolerance 1e-6;
myRelaxation 1;

solvers
{
    "(p|pFinal|pcorr)"
    {
	solver		 	GAMG;
	mergeLevels 1;
	smoother 		GaussSeidel;
	agglomerator 		faceAreaPair;
	nCellsInCoarsestLevel 1500;
	tolerance 		$myPTolerance;
	relTol 0.1;
    }
    "(k|kFinal|omega|omegaFinal|epsilon|epsilonFinal|nuTilda|nuTildaFinal)"
    {
        solver           smoothSolver;//PBiCG
        smoother         GaussSeidel;//preconditioner   DILU;
        tolerance        $myTurbTolerance;
        relTol 0.1;
    }
    "(U|UFinal)"
    {
	solver		 smoothSolver;//PBiCG
        smoother	 GaussSeidel;//preconditioner   DILU;
        tolerance        $myUTolerance;
	relTol 0.1;
    }
}

PIMPLE
{
    correctPhi          	no;
    nOuterCorrectors 		1;
    nCorrectors 		3;
    nNonOrthogonalCorrectors 	1;
    pRefCell           		0;
    pRefValue           	0;
}
/*relaxationFactors
{
    fields
    {
        p               $myRelaxation;
    }
    equations
    {
        k               $myRelaxation;
        U               $myRelaxation;
        omega           $myRelaxation;
        epsilon         $myRelaxation;
        nuTilda         $myRelaxation;
    }
}*/

SIMPLE
{
      nNonOrthogonalCorrectors 0; 
   
      residualControl 
      { 
          p               1e-2; 
          U               1e-3; 
          ”(k|epsilon|omega)” 1e-3; 
      } 
}
relaxationFactors
{
    fields
    {
        p               0.3;
    }
    equations
    {
        k               0.3;
        U               0.7;
        omega           0.3;
        epsilon         0.3;
        nuTilda         0.3;
    }
}
// ************************************************************************* //
fvSchemes:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         Gauss upwind;//Gauss linearUpwind leastSquares;
    // div(phi,U)	Gauss linearUpwind grad(U);
    // div(phi,nuTilda)     limitedLinear 1;
    // div(phi,k)      limitedLinear 1;
    // div(phi,omega)  limitedLinear 1;
    div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear limited 1;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    pcorr;
    p;
}

// ************************************************************************* //
initial velocity:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (0 -40 0);

boundaryField
{
    top
    {
        type            slip;
    }
    bottom
    {
        type            slip;
    }
    front
    {
        type            fixedValue;
        value           uniform (0 -40 0);
    }
    back
    {
        type            inletOutlet;
        inletValue      uniform (0 0 0);
        value           uniform (0 -40 0);
    }
    sides
    {
        type            slip;
    }
    fuselage
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    disk
    {
        type            cyclic;
    }
    diskother
    {
        type            cyclic;
    }
}


// ************************************************************************* //
initial pressure:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    top
    {
        type            slip;
    }
    bottom
    {
        type            slip;
    }
    front
    {
        type            zeroGradient;
    }
    back
    {
        type            fixedValue;
        value           uniform 0;
    }
    sides
    {
        type            slip;
    }
    fuselage
    {
        type            zeroGradient;
    }
    disk
    {
        type            fixedJump;
        patchType       cyclic;
        jump            uniform 448.6;
        value           uniform 0;
    }
    diskother
    {
        type            fixedJump;
        patchType       cyclic;
        value           uniform 0;
    }
}


// ************************************************************************* //
initial k:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0.00325;

boundaryField
{
    top
    {
        type            slip;
    }
    bottom
    {
        type            slip;
    }
    front
    {
        type            fixedValue;
        value           uniform 0.00325;
    }
    back
    {
        type            inletOutlet;
        inletValue      uniform 0.00325;
        value           uniform 0.00325;
    }
    sides
    {
        type            slip;
    }
    fuselage
    {
        type            kqRWallFunction;
        value           uniform 0;
    }
    disk
    {
        type            cyclic;
    }
    diskother
    {
        type            cyclic;
    }
}


// ************************************************************************* //
initial epsilon:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 400;

boundaryField
{
    top
    {
        type            slip;
    }
    bottom
    {
        type            slip;
    }
    front
    {
        type            fixedValue;
        value           uniform 400;
    }
    back
    {
        type            inletOutlet;
        inletValue      uniform 400;
        value           uniform 400;
    }
    sides
    {
        type            slip;
    }
    fuselage
    {
        type            epsilonWallFunction;
        value           uniform 0;
    }
    disk
    {
        type            cyclic;
    }
    diskother
    {
        type            cyclic;
    }
}


// ************************************************************************* //
eruwaedhiel is offline   Reply With Quote

Old   June 26, 2015, 20:02
Default
  #2
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
First of al, you are using a very big tolerance for the pressure, the pressure tolerance must be something like 1e-7 or less. Second, you are fixing the velocity in the inlet, this might not be physical and might produce some instabilities if the outlet is not far away from the disk
ssss is offline   Reply With Quote

Old   June 30, 2015, 18:44
Default
  #3
New Member
 
Join Date: Jun 2015
Posts: 12
Rep Power: 11
eruwaedhiel is on a distinguished road
Thanks for the reply. Sorry for my delay in responding, my computer died last week and I just got it back and running yesterday.

I can certainly change the tolerance for pressure, but in my previous example, once the TKE and velocities start blowing up, they never go back, so I'm not sure I'll ever actually reach the desired tolerance with a realistic result.

My outlet is tens of meters away from my inlet, so I don't think that should cause issues. The constant velocity I'm using is to simulate the helicopter in forward flight.

I tried initializing the scenario with potentialFoam to see if that would help, but it looks like that just generated a phi file, and then every iteration after the 1st gave me very nominal results (it appears that the pressure jump from the actuator disk is nullified by running potentialFoam). I ran the case for several thousand iterations and have only been able to see the velocity affects of the 40m/s I initialize in front - it never blows up but it doesn't perform as expected either, since the rotor effects are essentially nonexistent.
eruwaedhiel is offline   Reply With Quote

Old   July 1, 2015, 04:01
Default
  #4
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Can you post the log file?
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Reply

Tags
actuator disk, simplefoam


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
cell values vs node values reversemermaid FLUENT 0 March 13, 2014 19:06
Wrong forces on a 2D airfoil using interPhaseChangeFoam Artur OpenFOAM 0 August 7, 2013 12:38
CFX problems with supersonic inlet condition - Inlet values in CFX-Post are wrong jannnesss CFX 5 February 25, 2011 17:24
Ensight - node values -cell values leo FLUENT 1 May 12, 2010 09:47
node values or cell values? aPpA FLUENT 0 November 10, 2006 09:56


All times are GMT -4. The time now is 13:40.