# Problem verifying Hagen–Poiseuille flow in a Pipe

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 30, 2012, 13:05 Problem verifying Hagen–Poiseuille flow in a Pipe #1 New Member   Join Date: Aug 2012 Posts: 5 Rep Power: 4 Hello everyone, I am trying to model Hagen–Poiseuille flow in a pipe of circular cross section with a radius of 0.1m . The pipe is 1m long and the pressure difference applied is one Pa. The viscosity is set to 0.01. From the theory I would expect a parabolic velocity profile (which is correctly computed). With a maxmal velocity of 0.25 m/s in the center. Open Foam computes the maximal velocity as 0.15 m/s. I tried different boundary conditions but that changed the velocity values only slightly. I also used the same mesh in ELMER FEM were I computed the correct velocity of 0.25 m/s. The initial conditions are as follows: for p: FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { Wall { type zeroGradient; } In { type fixedValue; value 1; } Out { type fixedValue; value 0; } } // ************************************************** *********************** // and U: --*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { Wall { type fixedValue; value uniform (0 0 0); } In { type pressureInletVelocity; value uniform (0 0 0); } Out { type zeroGradient; } } // ************************************************** *********************** // the transport properties read: FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // nu nu [ 0 2 -1 0 0 0 0 ] 0.01; // ************************************************** *********************** // The rest is taken from the icoFoam lid driven cavity example. I hope somebody knows the answer to this problem. Thank you!

 August 31, 2012, 06:18 #2 Senior Member   Goutam Saha Join Date: Dec 2011 Location: UK Posts: 128 Rep Power: 5 Its better to use coded fixed value Bcs or Groovy BC options at the inlet where you can set the parabolic velocity profile i.e. u(r) = 2 U_mean [ 1 - (r/R)^2 ] where U_mean = neu * Re / D. So, flow will be fully developed from inlet to outlet and you will get the correct results. Thanks

 August 31, 2012, 14:06 #3 New Member   Join Date: Aug 2012 Posts: 5 Rep Power: 4 Hello Goutam, thank you for your reply. I already experimented with different boundary conditions. My intitial conditions were: FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { Wall { type zeroGradient; } In { type fixedValue; value uniform 1; } Out { type fixedValue; value uniform 0; } } // ************************************************** *********************** // FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { Wall { type fixedValue; value uniform (0 0 0); } In { type zeroGradient; } Out { type zeroGradient; } } // ************************************************** *********************** // I assumed these conditions are reasonable and started with this setting. Only after getting the wrong results I experimented with different boundary conditions but all the results are far of the analytic solution. The above intitial conditions give a maximum velocity of 0.152 instead of 0.15 when using the intial conditions from my first post. So yes their is a small influence from the boundary but the error has to be somewhere else. I also made an interesting observation: When I reduce the diameter by a factor of two I also reduce the error (from 40%) by a factor of two (to 20%). Any other suggestions?

 August 31, 2012, 14:24 #4 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,608 Rep Power: 25 Hi Please note that unless you use the density of air as being 1 kg/m3, then the pressure difference is not 1 Pa. You have given a pressure difference of 1 m2/s2, because you are using a solver, which is normalised by rho. This also means that the viscosity is the kinematic one and not the dynamic one. Kind regards, Niels

 August 31, 2012, 14:55 #5 New Member   Join Date: Aug 2012 Posts: 5 Rep Power: 4 Hi Niels, thank you for your reply. Yes, I know that Open Foam renormalizes the presure For that purpose I used the hagen-poiseuille equation with the kinematic viscosity. In the computation I did with ELMER FEM, I used a density of 1 and also a viscosity of 0.01 so either way the analytic solution, ELMER and OpenFoam should compute the same velocity in the center of the pipe. Elmer agrees to less than 1% to the analytic solution but OpenFoam is way of (40% resp. 20% depending on the pipe diameter). Regards!

 September 1, 2012, 08:26 #6 Senior Member     Anton Kidess Join Date: May 2009 Location: Delft, Netherlands Posts: 919 Rep Power: 17 What does your mesh look like? __________________ *On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. *Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology

 September 2, 2012, 04:27 #7 New Member   Join Date: Aug 2012 Posts: 5 Rep Power: 4 I used a 3D unstructured tetraeder mesh. I tried different resolution but the change was very small.

 September 2, 2012, 05:47 #8 New Member   Join Date: Aug 2012 Posts: 5 Rep Power: 4 I think the problem is linked to the unstructured mesh. I did some further experiments on a pipe with a rectangular cross section. If I discretize the pipe with tetraeder (even with high resolution) I get around 10% deviation in the velocity computed by ELMER FEM and simpleFoam. If I model the brick-pipe with blockMesh, the ELMER FEM and simpleFoam results are virtually identical (less than 0.1% deviation). Is this a known openFoam issue? Or am I doing something wrong with the unstructured mesh in OpenFoam? Best Regards,

 September 2, 2012, 05:55 #9 Senior Member   Niels Gjoel Jacobsen Join Date: Mar 2009 Location: Deltares, Delft, The Netherlands Posts: 1,608 Rep Power: 25 Hi You would need to share your case, otherwise it is very hard to give any qualified response. Kind regards, Niels

 September 3, 2012, 02:04 #10 Senior Member     Anton Kidess Join Date: May 2009 Location: Delft, Netherlands Posts: 919 Rep Power: 17 This is not an issue with OpenFOAM, but with finite volumes in general - the discretization error converges much faster with orthogonal meshes. Are you sure you've reached mesh independence even on the grid you call very fine? You should take that one, double the cell count and then compare. __________________ *On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. *Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology

 September 3, 2012, 06:41 #11 Senior Member   Goutam Saha Join Date: Dec 2011 Location: UK Posts: 128 Rep Power: 5 Where you set your inlet velocity !!! You can use the following coded BC: FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type zeroGradient; } outlet { type fixedValue; value uniform 0; } Walls { type zeroGradient; } } --------------------------- FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { inlet { type codedFixedValue; value \$internalField; redirectType ramp; code #{ scalar U_0=Your_Umean; scalar r=Your_Radius; fixedValueFvPatchVectorField myPatch(*this); forAll(this->patch().Cf(),i) { myPatch[i]=vector(2*U_0*(1-Foam:Pow(this->patch().Cf()[i].x(),2)/pow(r,2)),0,0); } operator==(myPatch); #}; } outlet { type zeroGradient; } Walls { type fixedValue; value uniform (0 0 0); } } You can use coded Boundary condition given above. Its better to share you file here so we can understand the problem. Otherwise its really difficult to understand your problem !!! Best of Luck. Cheers !!!

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Sachin U. Nimbalkar FLUENT 4 January 2, 2014 13:20 CRT FLUENT 0 July 20, 2012 13:03 keng Main CFD Forum 1 March 5, 2010 11:40 Min FLUENT 5 April 10, 2007 17:23 Tom Cloutier Main CFD Forum 0 April 20, 2003 13:19

All times are GMT -4. The time now is 01:43.