CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Pressure gradient in channel flow - mapped BC (http://www.cfd-online.com/Forums/openfoam-solving/106771-pressure-gradient-channel-flow-mapped-bc.html)

MaryBau September 7, 2012 13:34

Pressure gradient in channel flow - mapped BC
 
Hi!!

I want to simulate a simple channel flow with periodic boundary contidions in the inlet/outlet. If I understand correctly I have two ways of doing it:

Option 1: Use channelFoam and the solver will verify the mass flow rate.

Option 2: Use pisoFoam solver instead with the mapped (directMapped in previous OF versions) boundary conditions with "setAverage true" for the velocity. The code is also verify and correct the mass flow rate.

Is that correct? Are there any diferences between the two options?

Does it mean that by using a "mapped boundary" conditions I am imposing a pressure gradient in that direction?

Thanks in advance...

ripperjack February 15, 2013 14:35

Quote:

Originally Posted by MaryBau (Post 380770)
Hi!!

I want to simulate a simple channel flow with periodic boundary contidions in the inlet/outlet. If I understand correctly I have two ways of doing it:

Option 1: Use channelFoam and the solver will verify the mass flow rate.

Option 2: Use pisoFoam solver instead with the mapped (directMapped in previous OF versions) boundary conditions with "setAverage true" for the velocity. The code is also verify and correct the mass flow rate.

Is that correct? Are there any diferences between the two options?

Does it mean that by using a "mapped boundary" conditions I am imposing a pressure gradient in that direction?

Thanks in advance...

Same question, how to add pressure gradient.

MaryBau February 19, 2013 17:41

I tried two cases:

1) mapped boundary conditions (or directMapped in older versions) in the inlet/outlet with a "setAverage true" and using the regular OF pisoFoam (no pressure gradient).

2) having a pressure gradient added to the pisoFoam UEqn and cyclic inlet/outlet boundary conditions.

and I obtained the same results in both cases.

Now, to add a pressure gradient to drive the flow, you have to modified the UEqn in pisoFoam.

Code:

fvVectorMatrix UEqn
            (
                fvm::ddt(U)
              + fvm::div(phi, U)
              + turbulence->divDevReff(U)
              + gradP
            );

where

Code:

    dimensionedVector gradP
    (
        "gradP",
        dimensionSet(0, 1, -2, 0, 0),
        vector::zero
    );

Hope it helps!

ripperjack February 26, 2013 16:30

Hi MaryBau.
Thanks very much! In code:
Code:

    dimensionedVector gradP
    (
        "gradP",
        dimensionSet(0, 1, -2, 0, 0),
        vector::zero
    );

Why did you set the gradP=0? Since there is no pressure gradient, how to drive the flow?
I am a new user of openFoam.....

Quote:

Originally Posted by MaryBau (Post 408837)
I tried two cases:

1) mapped boundary conditions (or directMapped in older versions) in the inlet/outlet with a "setAverage true" and using the regular OF pisoFoam (no pressure gradient).

2) having a pressure gradient added to the pisoFoam UEqn and cyclic inlet/outlet boundary conditions.

and I obtained the same results in both cases.

Now, to add a pressure gradient to drive the flow, you have to modified the UEqn in pisoFoam.

Code:

fvVectorMatrix UEqn
            (
                fvm::ddt(U)
              + fvm::div(phi, U)
              + turbulence->divDevReff(U)
              + gradP
            );

where

Code:

    dimensionedVector gradP
    (
        "gradP",
        dimensionSet(0, 1, -2, 0, 0),
        vector::zero
    );

Hope it helps!



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