CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Boundary conditions 2D Poisseuille flow in a pipe (http://www.cfd-online.com/Forums/openfoam-pre-processing/94205-boundary-conditions-2d-poisseuille-flow-pipe.html)

 jochemvandenbosch November 9, 2011 04:51

Boundary conditions 2D Poisseuille flow in a pipe

Dear OpenFOAMers,

I'm relatively new to OpenFOAM and as a part of my MSc-thesis I am trying to simulate a fully developed (Poisseuille) flow in a pipe (and get the pressure losses, just for validation of the solver I'm using).
I'm having trouble :confused: what boundary conditions to set for P and U in the '0' map. I'm working with a 2D geometry (with a 'wedge' on both sides).
Any help would be MUCH appreciated!

Best regards,

 akidess November 9, 2011 05:08

You'll have three boundaries: inlet, outlet and sidewall. If you know the inlet velocity, this should work:

Outlet: U zeroGradient, p fixedValue uniform 0
Walls: U fixedValue uniform (0 0 0), p zeroGradient

 jochemvandenbosch November 9, 2011 05:20

Hi Anton, thanks so much for your quick response. I already suspected that this is the way to do it, but I was unsure whether this directly yields a parabolic velocity profile or that the flow first will have to develop.
I see you're from Delft, any affiliation with the Delft University? I'm doing my thesis under prof. Van Rhee @ offshore & dredging engineering.

 akidess November 9, 2011 05:49

If you specify a uniform fixedValue velocity on the inlet, the flow will have to develop first. I think the easiest way to specify a parabolic inlet velocity profile is using an extension called groovyBC.

We are neighbors. I'm a PhD candidate at Multiscale Physics, right behind 3ME.

 jochemvandenbosch November 9, 2011 08:24

Now when I try to run the simulation (solver=settlingFoam but I run it for just the continuous phase for now), I get the following error:

Build : 2.0.1-51f1de99a4bc
Exec : settlingFoam
Date : Nov 09 2011
Time : 13:20:52
Host : Jochem
PID : 3900
Case : /home/jochem/OpenFOAM/jochem-2.0.1/run/tutorials/multiphase/settlingFoam/ras/pipe2D
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

--> FOAM FATAL IO ERROR:
inconsistent patch and patchField types for
patch type wedge and patchField type empty

file: /home/jochem/OpenFOAM/jochem-2.0.1/run/tutorials/multiphase/settlingFoam/ras/pipe2D/0/p_rgh::boundaryField::front from line 25 to line 25.

From function fvPatchField<Type>::New(const fvPatch&, const DimensionedField<Type, volMesh>&, const dictionary&)
in file /home/opencfd/OpenFOAM/OpenFOAM-2.0.1/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 164.

FOAM exiting

I have defined the wedges as type empty in the '0' map for both pressure and speed. I tried symmetryPlane and zeroGradient as wel, just to see if that would change anything, but no luck.

What could be the cause of this problem?

Best regards,

ps. Anton, nice to hear we're neighbours, what are you working on currently?

EDIT: never mind, I should of course use the wedge as type

 jferrari December 20, 2011 12:36

Quote:
 Originally Posted by akidess (Post 331321) You'll have three boundaries: inlet, outlet and sidewall. If you know the inlet velocity, this should work: Inlet: U fixedValue, p zeroGradient Outlet: U zeroGradient, p fixedValue uniform 0 Walls: U fixedValue uniform (0 0 0), p zeroGradient
Anton,

How can you have a gradient of velocity (i.e. wouldn't that be the divergence)? In other codes when it comes to poisseuille flow, the velocity at the inlet and the pressure at the outlet will be fixed boundary conditions, but the pressure at the inlet and the velocity at the outlet will be calcualted - OpenFOAM seems to require hard boundary conditions at each boundary and doesn't (to my knowledge) seem to care about initial conditions (aside from the 0 time step folder). How can you differentiate between initial and boundary conditions?

I know I just rattled off a lot of questions, but I'm just having trouble understanding OpenFOAM's boundary conditions versus initial conditions, how to specify each, and what exactly the zeroGradient does/is on a fundamental level. I'd appreciate any insight you can give me.

 mturcios777 December 20, 2011 13:13

Because we are specifying information on a boundary, a zero gradient condition means that the gradient of velocity normal to the boundary is zero. For the example of Poisseuille flow with the channel oriented along the z axis, specifying zeroGradient at the outlet means that dUx/dz, dUy/dz, dUz/dz are all zero. At the inlet, dp/dz is zero.

 jferrari December 21, 2011 15:02

Quote:
 Originally Posted by mturcios777 (Post 336496) Because we are specifying information on a boundary, a zero gradient condition means that the gradient of velocity normal to the boundary is zero. For the example of Poisseuille flow with the channel oriented along the z axis, specifying zeroGradient at the outlet means that dUx/dz, dUy/dz, dUz/dz are all zero. At the inlet, dp/dz is zero.

Thanks for the reply Marco, I think I understand what is meant by the zeroGradient condition now.

I'm still unclear as to why you even need the boundary conditions for both pressure and velocity at the inlet and outlet. Wouldn't just the pressure at the outlet and just the velocity at the inlet be sufficient to solve the problem?

 mturcios777 December 22, 2011 13:08

If you look at the analytical solution for 2D Poiseuille flow, those zero-gradient boundary conditions are enforcing your fully developed condition, which (after applying the zero slip conditions at the wall and other assumptions) and solving the equations give you a flow that is only in the axial direction and only varies as you cross the channel.

OF solvers solve for the Navier-Stokes equations in a fully 3D and time-dependant form. By using the wedge you enforce axisymmetry, while in the 2D (using empty patches front and back), you state that the solution for flow normal to those boundaries are 0. In a sense, specifying the BC as they are is like making all the assumptions/simplifications that you would when solving analytically (take a look at an analytical solution to Posieuille flow to see what I mean: http://lions.math.hr/tok-kroz-cijev/...euille_en.html). Note that they use the pressure at either end as the two BC.

If a code ever got smart enough to do everything that page shows when you specified a problem, I'm sure we'd have a SkyNet scenario just around the corner...

 nandiganavishal March 27, 2013 15:49

Quote:
 Originally Posted by jochemvandenbosch (Post 331317) Dear OpenFOAMers, I'm relatively new to OpenFOAM and as a part of my MSc-thesis I am trying to simulate a fully developed (Poisseuille) flow in a pipe (and get the pressure losses, just for validation of the solver I'm using). I'm having trouble :confused: what boundary conditions to set for P and U in the '0' map. I'm working with a 2D geometry (with a 'wedge' on both sides). Any help would be MUCH appreciated! Best regards,
Hi Jochem van den Bosch,

I would like to know, if you were able to solve the 2D laminar pipe flow using axisymmetric simulations in openfoam. If so, can you share your geometry and the code, as I am trying to solve similar geometry for my problem.

Thanks for the help

Regards
Vishal

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