CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

boundary condition for constant pipe flow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 25, 2014, 17:13
Default boundary condition for constant pipe flow
  #1
New Member
 
Join Date: Jul 2014
Posts: 17
Rep Power: 12
Specialist is on a distinguished road
hello guys,

right know I try to simulate a simple constant pipe flow with Open Foam. I use the solver "SimpleFoam". The pipe consisits of an an inlet on the left site and an outlet on the right site. At the cylindrical middle part friction exist.

I know the inflow velocity of 3 m/s. What about the BC?

Following BC are used in the velocity file:
Inlet

type fixed value
value uniform (3 0 0)

Outlet

zero gradient

middle part

fixed value
uniform (0 0 0)


in the Pressure file:
inlet

zero gradient

middle part

zero gradient

outlet

typ fixed value
value 0


I do not know why, but the simulation does not work. Can you give me a reason for that? Are the BC wrong?

Thanks!

Specialist
Specialist is offline   Reply With Quote

Old   July 26, 2014, 23:32
Default
  #2
New Member
 
Debb
Join Date: Sep 2011
Location: Toronto, Canada
Posts: 20
Rep Power: 15
tellico is on a distinguished road
you might want to try specifying an inlet pressure, rather than an outlet pressure

I've encountered this problem myself and this was how I got around it,
tellico is offline   Reply With Quote

Old   July 27, 2014, 03:38
Default
  #3
New Member
 
Join Date: Jul 2014
Posts: 17
Rep Power: 12
Specialist is on a distinguished road
I thought about that.

Look at that example:

http://www.foamcfd.org/Nabla/guides/...Guidese13.html

The pressure at the outlet must be defined with 0. I am interested in the loss of pressure in the pipe. If I define the pressure at the inlet and at the outlet, I would definde the loss of pressure for myself.
That does not make sense?
Do I have to use other types of BC? Something like OutletInlet oder Inletoutled?
But I thought, I should be possible with the normal simple BC.

Specialist is offline   Reply With Quote

Old   July 30, 2014, 06:32
Default
  #4
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
What does mean, your simulation does not work? Could you post the output of the solver.
jherb is offline   Reply With Quote

Old   October 29, 2014, 04:37
Default
  #5
Member
 
Join Date: Aug 2011
Posts: 89
Rep Power: 15
idefix is on a distinguished road
Hello,
I am dealing with the same topic at the moment.
My aim is the calculation of the pressure drop in a pipe (diameter d=0.02m, length L=5 m).
I consider at the beginning a stationary, laminar, incompressible flow and try the simulation with simpleFoam.
To see that everything is correct I want to compare the simulation with the analytical result.

I calculate the analytical result in the following way:
velocity at the inlet: v=0.0884 m/s
viscosity: 1x10e-6 m^2/s
pressure drop : delta_p = lambda * L*density *v^2/d/2
lambda is the coefficient, defined: lambda=64/Reynolds-Number=0.0362
So the calculated pressure drop is: 35.3 Pa

Now I start the simulation:
After the calculation Iīve got a pressure-field and I used paraview to calculate the pressure drop (with the calculator: pressure * densitiy (1000 kg/m^3)
The pressure drop is 15 Pa, which is not equal to the pressure drop I calculated in the analytical way.

Does anyone know where my mistake is?

I also tried to calculate the pressure drop, when I initialized the velocity profile with u(r) = u_max (1 - (r/R)^2) , called Hagen-Poiseuille, with R=0.01 m and u_max = 0.14 m/s so that the mean velocity (integrated over the above velocity profile) is 0.0884 m/s.

Thanks a lot for your help



Here are the files I used:

the U-file is:
Quote:
dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0.08842 0);
}

outlet
{
type zeroGradient;
//value uniform (0 0.08842 0);
}

fixedWalls
{
type fixedValue;
value uniform (0 0 0);
}

frontAndBack
{
type empty;
}
}
The p-file is:
Quote:
dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet
{
type zeroGradient;
}

outlet
{
type fixedValue;
value uniform 0;
}

fixedWalls
{
type zeroGradient;
}

frontAndBack
{
type empty;
}
}
my blockMesDict:
Quote:
convertToMeters 1;

vertices
(
(0 0 0)
(0.01 0 0)
(0.01 5 0)
(0 5 0)
(0 0 0.02)
(0.01 0 0.02)
(0.01 5 0.02)
(0 5 0.02)
);
3
blocks
(
hex (0 1 2 3 4 5 6 7) (1 100 20) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
inlet
{
type patch;
faces
(
(0 1 5 4)
);
}
fixedWalls
{
type wall;
faces
(
(0 1 2 3) //top
(6 7 4 5) //bottom
);
}
outlet
{
type patch;
faces
(
(6 2 3 7)
);
}
frontAndBack
{
type empty;
faces
(
(0 3 7 4)
(6 2 1 5)
);
}
);

mergePatchPairs
(
);
my fvSchemes:
Quote:
ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
}

divSchemes
{
default none;
div(phi,U) Gauss linearUpwindV grad(U);
div(phi,k) Gauss upwind;
div(phi,omega) Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p;
}
my fvSolution-file:
Quote:
solvers
{
p
{
solver GAMG;
tolerance 1e-7;
relTol 0.1;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration on;
agglomerator faceAreaPair;
nCellsInCoarsestLevel 10;
mergeLevels 1;
}

U
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.1;
nSweeps 1;
}

}

SIMPLE
{
nNonOrthogonalCorrectors 0;
}

potentialFlow
{
nNonOrthogonalCorrectors 10;
}

relaxationFactors
{
fields
{
p 0.3;
}
equations
{
U 0.7;
}
}

cache
{
grad(U);
}
my transportPorperties-file:
Quote:
transportModel Newtonian;

nu nu [0 2 -1 0 0 0 0] 0.000001;
idefix is offline   Reply With Quote

Old   October 29, 2014, 08:31
Default
  #6
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
@idefix: Are you using a turbulence model? Which? Your Re seems to be 1770 (calculating backward from lambda). So the flow is somewhere in the transition to a turbulent flow.
jherb is offline   Reply With Quote

Old   October 29, 2014, 15:37
Default
  #7
Member
 
Join Date: Aug 2011
Posts: 89
Rep Power: 15
idefix is on a distinguished road
Hello Joachim

thanks for you answer.
I dontīuse a turbulence model for this calculation, but I had the same thougth and changed the velocity to 0.265 m/s, so I am turbulent and I am using the k-epsilon-turublence model
I still have a big difference between simulation and analytical result.
But I changed the grid size to smaller cells and therefore I get closer to the real result.
As a consequence the time for othe simulation gets very big. Is there another way to get closer to the analytical result?

Thanks for your help
idefix
idefix is offline   Reply With Quote

Old   October 29, 2014, 17:12
Default
  #8
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
Just to be sure: Your solution is converged? The pressure difference is not oscillating between (time)steps?
jherb is offline   Reply With Quote

Old   October 30, 2014, 14:56
Default
  #9
Member
 
Join Date: Aug 2011
Posts: 89
Rep Power: 15
idefix is on a distinguished road
I used simpleFoam in the steady state-modus.
It stopped when the convergence criterion is reached. Till there the pressure was not constant.
I calculated the pressure drop with the help of the following command:
patchAverage p inlet >inletAvP

because the pressure at the outlet is set to 0, the calculated pressure is the wished pressure drop -
I hope everything is correct, if not please tell me.

is there a reason why you are asking?

Thanks a lot
idefix
idefix is offline   Reply With Quote

Old   October 30, 2014, 17:14
Default
  #10
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
If you look at the pressure values of different steps of the simulation, do they converge (together with the residuals)?
jherb is offline   Reply With Quote

Old   October 31, 2014, 02:54
Default
  #11
Member
 
Join Date: Aug 2011
Posts: 89
Rep Power: 15
idefix is on a distinguished road
I attached the residuals. Unfortunately the pressure is yello. I hope you can see it.
What do you think?
Attached Images
File Type: png p1.png (31.0 KB, 178 views)
idefix is offline   Reply With Quote

Old   October 31, 2014, 08:25
Default
  #12
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
Do your result change, if you set the convergence criteria to 1e-4?
jherb is offline   Reply With Quote

Old   November 1, 2014, 03:40
Default
  #13
Member
 
Join Date: Aug 2011
Posts: 89
Rep Power: 15
idefix is on a distinguished road
do you mean the tolerances in fvSolution-file?
idefix is offline   Reply With Quote

Old   November 1, 2014, 08:09
Default
  #14
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
I mean runtime control (chapter Residual/Convergence Control):
http://www.openfoam.org/version2.0.0...me-control.php
jherb is offline   Reply With Quote

Old   November 3, 2014, 10:21
Default
  #15
Member
 
Join Date: Aug 2011
Posts: 89
Rep Power: 15
idefix is on a distinguished road
the calculation is still running.
the pressure residual and the residual of the velocity component in the main flow direction is not getting smaller than 10e-4

but the solution till now changes only with the first decimal place.

did you expect that?

Thanks a lot
idefix
idefix is offline   Reply With Quote

Old   November 3, 2014, 19:00
Default
  #16
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
Actually no. At the moment I do not have an idea what could cause this problem.
jherb is offline   Reply With Quote

Old   November 4, 2014, 12:42
Default
  #17
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

my guess is: two parallel infinite planes are rather poor model of tube

I've decided to make fully 3D simulation of the described laminar case. Pressure drop is around 40 Pa. Rather high, maybe due to rather coarse mesh in X-direction.

You can find case files (mesh is in Gmsh format) and pressure colour profile attached to the message.

Also here's simpleFoam output (at the point where I've decided to stop simulation):

Code:
...
Time = 218

DILUPBiCG:  Solving for Ux, Initial residual = 8.77581226583e-07, Final residual = 9.23550690215e-09, No Iterations 2
DILUPBiCG:  Solving for Uy, Initial residual = 3.83955671681e-05, Final residual = 1.96642296575e-07, No Iterations 2
DILUPBiCG:  Solving for Uz, Initial residual = 4.31920726089e-05, Final residual = 6.31032523367e-07, No Iterations 2
GAMG:  Solving for p, Initial residual = 3.79720211706e-06, Final residual = 3.77066594274e-07, No Iterations 141
GAMG:  Solving for p, Initial residual = 6.2556196152e-07, Final residual = 6.20062840895e-08, No Iterations 194
GAMG:  Solving for p, Initial residual = 1.54883049595e-07, Final residual = 1.52631870121e-08, No Iterations 151
time step continuity errors : sum local = 3.23088878426e-10, global = -1.41736741757e-12, cumulative = -2.60173230963e-07
ExecutionTime = 988.65 s  ClockTime = 989 s
...
Attached Images
File Type: png pressure.png (17.1 KB, 107 views)
Attached Files
File Type: gz tube-pressue-drop.tar.gz (4.9 KB, 88 views)

Last edited by alexeym; November 4, 2014 at 12:43. Reason: Addition
alexeym is offline   Reply With Quote

Old   November 12, 2014, 04:33
Default
  #18
Member
 
Join Date: Aug 2011
Posts: 89
Rep Power: 15
idefix is on a distinguished road
Hello,
I tried a lot but still it doesnīt work.
Unfortunately Iīve got some "bad looking" cells at the end of the pipe and also I donīt get such a nice velocity distribution as you have.

I copied your whole case and just changed the mesh.

The picture shows the mesh cut in the middle.

Do you have any idea what I did wrong?

Thanks a lot for your help
idefix is offline   Reply With Quote

Old   November 12, 2014, 04:34
Default
  #19
Member
 
Join Date: Aug 2011
Posts: 89
Rep Power: 15
idefix is on a distinguished road
here are the attached files
Attached Images
File Type: jpg pipe.jpg (13.7 KB, 113 views)
Attached Files
File Type: gz tube.tar.gz (3.6 KB, 34 views)
idefix is offline   Reply With Quote

Old   November 12, 2014, 05:39
Default
  #20
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

you should at least check your mesh before running case (and asking question ). Attached is a picture of the boundaries of the mesh in the attached case: green is outlet and red is walls. Well, at least inlet patch has correct geometry

Also to save computation time, try running simulation on 2D axisymmetric mesh (as anyway you're trying to check if simpleFoam will return pressure drop estimated from Darcy-Weisbach equation for circular tube).
Attached Images
File Type: png boundaries.png (9.7 KB, 128 views)
alexeym is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FSI] flexible pipe simulation (boundary condition) Daniel_Khazaei OpenFOAM Running, Solving & CFD 16 May 5, 2016 08:08
rotating pipe flow wall boundary condition problem preetam69 FLUENT 0 October 8, 2013 12:16
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
OpenFOAM open channel flow downsteam boundary condition Brickman OpenFOAM Running, Solving & CFD 2 November 5, 2012 21:14
External,incompressible flow boundary condition? John FLUENT 2 August 19, 2011 01:42


All times are GMT -4. The time now is 07:21.