CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   potentialFoam not working properly (https://www.cfd-online.com/Forums/openfoam-solving/142731-potentialfoam-not-working-properly.html)

GAlava October 8, 2014 07:47

potentialFoam not working properly
 
1 Attachment(s)
Hi there!

I am running potentialFoam to initially solve the airflow over a cube, but I am not getting a reasonable velocity field. It runs, but it seems that it has done nothing by the results. The flow is not developed at all.
I also would like to ask if potentialFoam can run several iterations (I want 10 in this case) as any oher solver and write the correspondent output folders (1, 2, 3, ...), since it seems that it is not the case.

I attach my controlDict file

CONTROLDICT
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;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application    potentialFoam;

startFrom      startTime;

startTime      0;

stopAt          endTime;

endTime        10;

deltaT          1;

writeControl    timeStep;

writeInterval  1;

purgeWrite      0;

writeFormat    ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision  6;

runTimeModifiable true;


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

I upload an image of the Velocity field after running potentialFoam

Thank you.

alexeym October 8, 2014 08:38

Hi,

it'll be much easier for everybody if you attach case files to the message. Otherwise there will be lots of standard questions:

1. What are your BCs?
2. What are your ICs?
3. Can you show your fvSchemes and fvSolution?

Concerning you question about " ... run several iterations ... ". No, if you take a look at source code of potentialFoam, it's supposed to run just one iteration.

GAlava October 8, 2014 11:12

Thanks for your rapid response, These are the schemes and the 0/U file. I am using a typical inlet-outles, wall for the floor and the surface of the cube and symmetry for the wrap of the domain configuration.

fvSolution

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;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance      1e-07;
        relTol          0.08;
        smoother        GaussSeidel;
        nPreSweeps      0;
        nPostSweeps    2;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels    1;
        maxIter            100;
    }

    U
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance      1e-07;
        relTol          0.1;
    }
}

potentialFlow
{
    nNonOrthogonalCorrectors 8;
}

relaxationFactors
{
    fields
    {
        p              0.3;
    }
    equations
    {
        U              0.7;
    }
}

fvSchemes

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;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default        steadyState;
}

gradSchemes
{
    default        leastSquares;
}

divSchemes
{
    default        none;
}

laplacianSchemes
{
    default        Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p              ;
}


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

BC

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      volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform (0 0 0);

boundaryField
{
    OUTLET
    {
        type            uniformFixedValue;
        uniformValue    constant (5 0 0);
    }
    INLET
    {
        type            uniformFixedValue;
        uniformValue    constant (5 0 0);
    }
   
// GROUND, WALL and DENSITY are physical walls   

    GROUND
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    WALL
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    DENSITY
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
   
   
    SYM_RIGHT
    {
        type            symmetryPlane;
    }
    SYM_UP
    {
        type            symmetryPlane;
    }
    SYM_LEFT
    {
        type            symmetryPlane;
    }
}


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


alexeym October 8, 2014 11:47

Hi,

well, in general the following BCs are imposed (btw you've forgotten pressure boundary conditions):

inlet: U - fixed value, p - zero gradient
outlet: U - zero gradient, p - fixed value

Also I'm not quite sure in two things:

1. Necessity for this potentialFoam run.
2. Symmetry of the flow.

GAlava October 8, 2014 12:41

I use the symmetryPlane as a numerical trick to impose a non-viscous wall (the normal to the fake wall component of the velocity is null end the gradient is null)

Are you suggesting that the imposed BC can be the problem? Which BC do you suggest? It is a very simple incompressible flow entering a tunnel, for examle.

Thanks.

alexeym October 8, 2014 13:16

Another possibility is that you've messed up the direction of the velocity. As your screenshot lacks coordinate axes, maybe (5 0 0) is directed into the wall and not along the tunnel ;)

If you'd like to simulate incompressible flow in the tunnel, I'd suggest you to use pimpleFoam (if you're interested in transient state) or simpleFoam (if you need steady state). Use fixed value BC for velocity at the inlet, zero gradient BC for velocity at the outlet; and vice-a-versa for pressure: zero gradient at the inlet, fixed value at the outlet.

Quote:

I use the symmetryPlane as a numerical trick to impose a non-viscous wall (the normal to the fake wall component of the velocity is null end the gradient is null)
Do you mean slip BC?

GAlava October 8, 2014 14:29

Yep, slip BC was what I meant.

Thank you vey much alexeym, great help!

B_R_Khan March 9, 2021 11:34

Hi!

I know this thread was posted long time ago but were you able to run potentialFoam over a cube? I have been trying to do the same but get no results. It gives no errors but there are no pressure and velocity fields solved by it. I'm using slip boundary condition on cube walls.


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