Boundary conditions 2D Poisseuille flow in a pipe
Dear OpenFOAMers,
I'm relatively new to OpenFOAM and as a part of my MScthesis 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, 
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 
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. 
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. 
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.151f1de99a4bc Exec : settlingFoam Date : Nov 09 2011 Time : 13:20:52 Host : Jochem PID : 3900 Case : /home/jochem/OpenFOAM/jochem2.0.1/run/tutorials/multiphase/settlingFoam/ras/pipe2D nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring runtime modified files using timeStampMaster allowSystemOperations : Disallowing usersupplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading g Reading field p_rgh > FOAM FATAL IO ERROR: inconsistent patch and patchField types for patch type wedge and patchField type empty file: /home/jochem/OpenFOAM/jochem2.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/OpenFOAM2.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 
Quote:
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. 
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.

Quote:
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? 
If you look at the analytical solution for 2D Poiseuille flow, those zerogradient 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 NavierStokes equations in a fully 3D and timedependant 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/tokkrozcijev/...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... 
Quote:
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 15:01. 