CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Inflow moving in wrong direction (https://www.cfd-online.com/Forums/openfoam/201315-inflow-moving-wrong-direction.html)

cuikahlil April 28, 2018 01:57

Inflow moving in wrong direction
 
1 Attachment(s)
Greetings!

I am simulating a very simple scenario of fluid entering through an inflow patch, overcoming a static boundary and exiting through an outflow. Very similar to the weir overflow in interfoam. My problem is that, instead of flowing in the x-direction, the flow goes up! I tried my boundary conditions on the blockMesh of the dambreak example, and it seemed to work fine, indicating that the problem is with my geometry.

Here is my blockMesh
Code:

convertToMeters 1;

vertices
(
    (0 0 0)//0
    (2 0 0)//1
    (3 0 0)//2
    (5 0 0)//3
    (0 1 0)//4
    (2 1 0)//5
    (3 1 0)//6
    (5 1 0)//7
    (0 1.5 0)//8
    (2 1.5 0)//9
    (3 1.5 0)//10
    (5 1.5 0)//11
    (0 5 0)//12
    (2 5 0)//13
    (3 5 0)//14
    (5 5 0)//15

    (0 0 0.5)//16
    (2 0 0.5)//17
    (3 0 0.5)//18
    (5 0 0.5)//19
    (0 1 0.5)//20
    (2 1 0.5)//21
    (3 1 0.5)//22
    (5 1 0.5)//23
    (0 1.5 0.5)//24
    (2 1.5 0.5)//25
    (3 1.5 0.5)//26
    (5 1.5 0.5)//27
    (0 5 0.5)//28
    (2 5 0.5)//29
    (3 5 0.5)//30
    (5 5 0.5)//31
);

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

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 16 20 4)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (7 23 19 3)
        );
    }
    leftWall
    {
        type wall;
        faces
        (
            (4 20 24 8)
            (8 24 28 12)
        );
    }
    rightWall
    {
        type wall;
        faces
        (
            (11 27 23 7)
            (15 31 27 11)
        );
    }
    lowerWall
    {
        type wall;
        faces
        (
            (0 1 17 16)
            (1 5 21 17)
            (9 10 26 25)
            (10 6 22 26)
            (6 2 18 22)
            (2 3 19 18)
        );
    }
    atmosphere
    {
        type patch;
        faces
        (
            (12 28 29 13)
            (14 13 29 30)
            (14 30 31 15)
        );
    }
);

As you can see it is extremely simple. Its pretty much like an overgrown dambreak which is why i don't understand the problem.
To further clarify my U:
Code:

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

internalField  uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value                uniform (1 0 0);
    }
    outlet
    {
        type            zeroGradient;
    }
    leftWall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    rightWall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    lowerWall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    atmosphere
    {
        type            pressureInletOutletVelocity;
        value          uniform (0 0 0);
    }
    defaultFaces
    {
        type            empty;
    }
}

and p:
Code:

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

internalField  uniform 0;

boundaryField
{
    inlet
    {
        type                zeroGradient;
    }
    outlet
    {
        type            totalPressure;
        p0              uniform 0;
        U              U;
        phi            phi;
        rho            rho;
        psi            none;
        gamma          1;
        value          uniform 0;
    }

    leftWall
    {
        type            fixedFluxPressure;
        value          uniform 0;
    }

    rightWall
    {
        type            fixedFluxPressure;
        value          uniform 0;
    }

    lowerWall
    {
        type            fixedFluxPressure;
        value          uniform 0;
    }

    atmosphere
    {
        type            totalPressure;
        p0              uniform 0;
        U              U;
        phi            phi;
        rho            rho;
        psi            none;
        gamma          1;
        value          uniform 0;
    }

    defaultFaces
    {
        type            empty;
    }
}

are as follows.

The simulation results are attached as an image.
The error might be very simple. If you could just point me in the right direction, i'd be really grateful!

mturcios777 May 1, 2018 14:21

Hi there,

Could you upload a stripped version of your case with all the BC's. I'm thinking perhaps your alpha field might have issues? If you suspect your geometry, does checkmesh work?

cuikahlil May 1, 2018 21:22

Hello!

Thanks for the response, but I already figured out the error. I should've updated this question then. I apologize.

I actually found out that one of my floor faces was undefined. Weird thing was it didn't turn up during checkMesh. When I re-created the whole mesh, I found out I neglected one face. I also didn't expect the fluid to behave that way as a reaction to a missing face.

Hope my error becomes a lesson for someone else.


All times are GMT -4. The time now is 06:46.