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

potentialFoam not writing and only one iteration

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

Like Tree1Likes
  • 1 Post By PHS-

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2014, 10:14
Default potentialFoam not writing and only one iteration
  #1
New Member
 
Max Foamer
Join Date: Oct 2014
Posts: 5
Rep Power: 11
Max Foamer is on a distinguished road
Hi,

I have downloaded and installed OpenFoam 2.3 and I am currently trying to simulate the testcase for the Ahmed body. The mesh is built so that The first cell (prism layer) is as tiny as to solve the boundary layer (y+=1). Therefore I am not using any wall functions.

The thing is that when I am about to run potentialFoam for initialization, it does only one iteration, and it does not save the result. I have checked with paraview, and The low field is as I specified in 0. There fore simpleFoam chrashes when it tries to calculate the flow.

Does Anyone know how to use potentialFoam on OpenFoam 2.3 just as any other solver? I mean in the sense that, I want it to do as many iterations as I specify in controlDict. Any ideas why is not writing the result of the potentialFoam iteration?

Cheers

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver           GAMG;
        tolerance        1e-6;
        relTol           0.08;
        smoother         GaussSeidel;
        nPreSweeps       0;
        nPostSweeps      2;
        cacheAgglomeration on;
        agglomerator     faceAreaPair;
        nCellsInCoarsestLevel 190;
        mergeLevels      2;
    }

    U
    {
        solver           smoothSolver;
        smoother         symGaussSeidel;
        tolerance        1e-5;
        relTol           0.08;
        nSweeps          2;
    }

    k
    {
        solver           smoothSolver;
        smoother         symGaussSeidel;
        tolerance        1e-5;
        relTol           0.08;
        nSweeps          2;
    }

    epsilon
    {
        solver           smoothSolver;
        smoother         symGaussSeidel;
        tolerance        1e-5;
        relTol           0.08;
        nSweeps          2;
    }

}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
     residualControl
    {
        p               1e-4;
        U               1e-4;
        k        1e-4;
    epsilon        1e-4;
    }
}



potentialFlow
{
    nNonOrthogonalCorrectors 10;

    // Residuals here (one per variable)
    // If one variable is not specified, zero is assumed as
    // desired residual (iterations will not stop)
    residualControl
    {
        p               1e-10;
        U               1e-10;
        k        1e-10;
    epsilon        1e-10;
    }
}

relaxationFactors
{
    fields
    {
        p               0.3;
    }
    equations
    {
        U               0.5;
        k               0.5;
        epsilon         0.5;
    }
}

cache
{
    grad(U);
}

// ************************************************************************* //

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         seteadyState;
}

gradSchemes
{
    default         leastSquares;
    grad(U)         leastSquares;
    grad(p)         leastSquares;
    grad(epsilon)   leastSquares;
    grad(k)         leastSquares;
}

divSchemes
{
    default         none;
    div(phi,U)      bounded Gauss upwind;
    div(phi,k)      bounded Gauss upwind ;
    div(phi,epsilon)  bounded Gauss upwind ;
    div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    p;
}

// ************************************************************************* //

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

libs
(
    "libOpenFOAM.so"
    "libincompressibleTurbulenceModel.so"
    "libincompressibleRASModels.so"
    "libmyfiniteVolume.so"
);

application     simpleFoam;

startFrom        latestTime;// startTime;

startTime       0;

stopAt          endTime;

endTime         1000;

deltaT          1;

writeControl    timeStep;

writeInterval   25;

purgeWrite      0;


//- Uncomment to have regular (every 2 hours of run time) restart files
//secondaryWriteControl    cpuTime; // runtime
//secondaryWriteInterval   7200;    // seconds
//secondaryPurgeWrite      1;       // keep all but last dump


writeFormat     binary;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;




// ************************************************************************* //
Max Foamer is offline   Reply With Quote

Old   October 9, 2014, 17:06
Default
  #2
New Member
 
Join Date: Jul 2011
Posts: 9
Rep Power: 14
PHS- is on a distinguished road
potentialFoam only needs one iteration to converge.
It computes an analytical solution for your flow, meaning that it creates a conservative field from a non-conservative initial field.
It is usually used to get a more stable initial state for other solvers.

In your case you set writeInterval to 25, so the converged solution of the first time step is never written.

So in your case if you set writeInterval to 1 you should be able to see a potential flow in paraview.

Good tutorial for potentialFoam can be found here :
http://www.foamcfd.org/Nabla/guides/...Guidese12.html
granzer likes this.
PHS- is offline   Reply With Quote

Old   October 10, 2014, 08:05
Default
  #3
New Member
 
Max Foamer
Join Date: Oct 2014
Posts: 5
Rep Power: 11
Max Foamer is on a distinguished road
Cheers, it works great now. The tutorial was very helpful.
Max Foamer is offline   Reply With Quote

Reply

Tags
potentialfoam, teration, writing

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 22:33.