CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Problem verifying Hagen–Poiseuille flow in a Pipe

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 30, 2012, 13:05
Default Problem verifying Hagen–Poiseuille flow in a Pipe
  #1
New Member
 
Join Date: Aug 2012
Posts: 5
Rep Power: 3
cp1287 is on a distinguished road
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!
cp1287 is offline   Reply With Quote

Old   August 31, 2012, 06:18
Default
  #2
Senior Member
 
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 111
Rep Power: 4
Goutam is on a distinguished road
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
Goutam is offline   Reply With Quote

Old   August 31, 2012, 14:06
Default
  #3
New Member
 
Join Date: Aug 2012
Posts: 5
Rep Power: 3
cp1287 is on a distinguished road
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?
cp1287 is offline   Reply With Quote

Old   August 31, 2012, 14:24
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,469
Rep Power: 23
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   August 31, 2012, 14:55
Default
  #5
New Member
 
Join Date: Aug 2012
Posts: 5
Rep Power: 3
cp1287 is on a distinguished road
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!
cp1287 is offline   Reply With Quote

Old   September 1, 2012, 08:26
Default
  #6
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 912
Rep Power: 15
akidess will become famous soon enough
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.
*Check out the scientific computing exchange http://scicomp.stackexchange.com
akidess is offline   Reply With Quote

Old   September 2, 2012, 04:27
Default
  #7
New Member
 
Join Date: Aug 2012
Posts: 5
Rep Power: 3
cp1287 is on a distinguished road
I used a 3D unstructured tetraeder mesh. I tried different resolution but the change was very small.
cp1287 is offline   Reply With Quote

Old   September 2, 2012, 05:47
Default
  #8
New Member
 
Join Date: Aug 2012
Posts: 5
Rep Power: 3
cp1287 is on a distinguished road
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,
cp1287 is offline   Reply With Quote

Old   September 2, 2012, 05:55
Default
  #9
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,469
Rep Power: 23
ngj will become famous soon enoughngj will become famous soon enough
Hi

You would need to share your case, otherwise it is very hard to give any qualified response.

Kind regards,

Niels
ngj is offline   Reply With Quote

Old   September 3, 2012, 02:04
Default
  #10
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 912
Rep Power: 15
akidess will become famous soon enough
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.
*Check out the scientific computing exchange http://scicomp.stackexchange.com
akidess is offline   Reply With Quote

Old   September 3, 2012, 06:41
Default
  #11
Senior Member
 
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 111
Rep Power: 4
Goutam is on a distinguished road
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 !!!
Goutam is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
3D Swirl flow in the pipe: convergence problem Sachin U. Nimbalkar FLUENT 4 January 2, 2014 12:20
Review: Reversed flow CRT FLUENT 0 July 20, 2012 13:03
air flow in pipe with heat problem keng Main CFD Forum 1 March 5, 2010 10:40
Pipe flow with obstacle - HELP Min FLUENT 5 April 10, 2007 17:23
stepped pipe flow Tom Cloutier Main CFD Forum 0 April 20, 2003 13:19


All times are GMT -4. The time now is 11:42.