
[Sponsors] 
July 25, 2014, 16:13 
boundary condition for constant pipe flow

#1 
New Member
Join Date: Jul 2014
Posts: 17
Rep Power: 5 
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 

July 26, 2014, 22:32 

#2 
New Member
Debb
Join Date: Sep 2011
Location: Toronto, Canada
Posts: 20
Rep Power: 8 
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, 

July 27, 2014, 02:38 

#3 
New Member
Join Date: Jul 2014
Posts: 17
Rep Power: 5 
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. 

July 30, 2014, 05:32 

#4 
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 427
Rep Power: 13 
What does mean, your simulation does not work? Could you post the output of the solver.


October 29, 2014, 04:37 

#5  
Member
Join Date: Aug 2011
Posts: 83
Rep Power: 8 
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: 1x10e6 m^2/s pressure drop : delta_p = lambda * L*density *v^2/d/2 lambda is the coefficient, defined: lambda=64/ReynoldsNumber=0.0362 So the calculated pressure drop is: 35.3 Pa Now I start the simulation: After the calculation Iīve got a pressurefield 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 HagenPoiseuille, 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 Ufile is: Quote:
Quote:
Quote:
Quote:
Quote:
Quote:


October 29, 2014, 15:37 

#7 
Member
Join Date: Aug 2011
Posts: 83
Rep Power: 8 
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 kepsilonturublence 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 

October 29, 2014, 17:12 

#8 
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 427
Rep Power: 13 
Just to be sure: Your solution is converged? The pressure difference is not oscillating between (time)steps?


October 30, 2014, 14:56 

#9 
Member
Join Date: Aug 2011
Posts: 83
Rep Power: 8 
I used simpleFoam in the steady statemodus.
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 

October 30, 2014, 17:14 

#10 
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 427
Rep Power: 13 
If you look at the pressure values of different steps of the simulation, do they converge (together with the residuals)?


October 31, 2014, 02:54 

#11 
Member
Join Date: Aug 2011
Posts: 83
Rep Power: 8 
I attached the residuals. Unfortunately the pressure is yello. I hope you can see it.
What do you think? 

October 31, 2014, 08:25 

#12 
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 427
Rep Power: 13 
Do your result change, if you set the convergence criteria to 1e4?


November 1, 2014, 03:40 

#13 
Member
Join Date: Aug 2011
Posts: 83
Rep Power: 8 
do you mean the tolerances in fvSolutionfile?


November 1, 2014, 08:09 

#14 
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 427
Rep Power: 13 
I mean runtime control (chapter Residual/Convergence Control):
http://www.openfoam.org/version2.0.0...mecontrol.php 

November 3, 2014, 10:21 

#15 
Member
Join Date: Aug 2011
Posts: 83
Rep Power: 8 
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 10e4 but the solution till now changes only with the first decimal place. did you expect that? Thanks a lot idefix 

November 3, 2014, 19:00 

#16 
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 427
Rep Power: 13 
Actually no. At the moment I do not have an idea what could cause this problem.


November 4, 2014, 12:42 

#17 
Senior Member

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 Xdirection. 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.77581226583e07, Final residual = 9.23550690215e09, No Iterations 2 DILUPBiCG: Solving for Uy, Initial residual = 3.83955671681e05, Final residual = 1.96642296575e07, No Iterations 2 DILUPBiCG: Solving for Uz, Initial residual = 4.31920726089e05, Final residual = 6.31032523367e07, No Iterations 2 GAMG: Solving for p, Initial residual = 3.79720211706e06, Final residual = 3.77066594274e07, No Iterations 141 GAMG: Solving for p, Initial residual = 6.2556196152e07, Final residual = 6.20062840895e08, No Iterations 194 GAMG: Solving for p, Initial residual = 1.54883049595e07, Final residual = 1.52631870121e08, No Iterations 151 time step continuity errors : sum local = 3.23088878426e10, global = 1.41736741757e12, cumulative = 2.60173230963e07 ExecutionTime = 988.65 s ClockTime = 989 s ... Last edited by alexeym; November 4, 2014 at 12:43. Reason: Addition 

November 12, 2014, 04:33 

#18 
Member
Join Date: Aug 2011
Posts: 83
Rep Power: 8 
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 

November 12, 2014, 04:34 

#19 
Member
Join Date: Aug 2011
Posts: 83
Rep Power: 8 
here are the attached files


November 12, 2014, 05:39 

#20 
Senior Member

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 DarcyWeisbach equation for circular tube). 

Thread Tools  
Display Modes  


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 07:08 
rotating pipe flow wall boundary condition problem  preetam69  FLUENT  0  October 8, 2013 11:16 
An error has occurred in cfx5solve:  volo87  CFX  5  June 14, 2013 17: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 00:42 