Hi, I would like to use OF for
Hi, I would like to use OF for estimating the pressure losses in a piping arrangement. The problem consists of an inlet and an outlet and some pipes, bends, reductions and enlargements inbetween. The inlet has a known flowrate and the outlet has a known pressure. I would like to estimate what the inlet pressure would be so that a suitable pump can be chosen for the system.
I appreciate this is a straightforward problem and that I can to some extent calculate this by hand. I have tried to do this in OF using a decent mesh of a 300mm dia pipe, a fixed velocity inlet (eg 3m/s) and a pressure outlet (eg 2.5bar) and noslip walls. I have two problems: 1/ Using simpleFoam set to laminar or turbulent, everything converges fine. The velocity predictions are as expected however the pressure losses are miniscule (eg 0.001 bar) which I cannot believe. I have a nice believable velocity profile in the pipe sections and separation where expected. 2/ If I set the initial (0) internal field to anything other than the same as the outlet pressure (2.5bar) the solution diverges. I've tried the nonorthogonal correction but it doesn't help. Not wanting to blow my own trumpet but I have worked in CFD for 15 years so hopefully I havent made too many mistakes in the problem setup. I would also be confident of obtaining a decent solution using this mesh in say Star or Fluent. Hope you can enlighten. Jason 
Ok, I got it, simpleFoam uses
Ok, I got it, simpleFoam uses normalised pressure, found the answer here
http://www.cfdonline.com/OpenFOAM_D...es/1/5124.html Now I know what to do, Many thanks Jason 
This is resolved, right?
Hr
This is resolved, right?
Hrv 
Hi Jason,
i have a similar
Hi Jason,
i have a similar test case. Do you have a method to calculate a mean pressure over a surface/cut. In paraview i can plot the pressure in the cut and estimate the averaged pressure over the cut, but do you have an idea how to get an exact value. Bests Gabriel 
Hi,
Issue is resolved, than
Hi,
Issue is resolved, thanks. Gabriel, the calcPressureForces routine found at the link above outputs the Surface area, mean pressure and total forces on each patch you specify. Not sure how you can do this in paraview, you can do it in Fieldview using the integrate over a surface option. Reg Jason 
Hi OpenFOAMers,
I made some
Hi OpenFOAMers,
I made some pressure loss computations inside a straight pipe using simpleFoam at different Reynolds. Compared to Moody diagram, results are quite disappointing as they give errors up to 30%. I have tried several schemes, kepsilon and komega, several convergence criteria and several meshes (Y+ around 2). Note : I use the development version of OpenFOAM. Has anybody got good results on such cases? Does anybody have an idea on where I could be wrong? Thank you, JeanLuc Pelerin 
Hi JeanLuc
The 30% is not
Hi JeanLuc
The 30% is not surprising, if it comes from the kepsilon model. It has been reported in [1] for channel flows that the kepsilon model deviates up to 30% from the Moody diagrams at k+=1200 / k/H = 0.02, H being channel height and k Nikuradses roughness height. Though, if you get the the order of magnitude error using the komega model I would get surprised. [1] reportes error in the order of magnitude 13% and I have made some tests myself and get the same order of magnitude for a channel flow. Both [1] and I have been using the Wilcox 1993 model. By the way, are you using a rough or smooth boundary? All the above mentioned are for completely rough boundaries. Best regards, Niels [1] V. C. Patel and J. Y. Yoon, Application of Turbulence Models to Seperated Flow Over Rough Surfaces, Journal of Fluid Engineering, June 1995 
Hi Niels,
Thank you for you
Hi Niels,
Thank you for your enlightenments. I will have a look at this paper asap. I cannot find the Wilcox implementation in OpenFOAM. Can you tell me where it is? I am working on smooth walls. I want to validate OF before going on with rough walls. (By the way, is there a repository for OF test cases/benchmarks ?) I have enclosed one of my problem set up: http://www.cfdonline.com/OpenFOAM_D...hment_icon.gif SmoothkoLongRe2e4steady.tar.gz Could someone have a look? And this is the evolution of the friction factor obtained with simpleFoam:  Reynolds is Re = 2e4  Moody gives 0.026  OF gives 0.031  the pseudo time step is 0.005 http://www.cfdonline.com/OpenFOAM_D...ges/1/6688.png Thank you very much, Best regards, JeanLuc 
Hi
It should be said that
Hi
It should be said that I have never worked with smooth surfaces (main interest: sediment transporthttp://www.cfdonline.com/OpenFOAM_D...part/happy.gif), but I have found the following by looking in Wilcox (2006) p383386 and I'll give a small summary on the komega part: For smooth wall boundary layers with komega, the main issue is how to treat the boundary condition for omega. He states that a good solution can be obtained for such things as pipe flows, etc, if the analytic solution to omega is applied in the 10 grid points closed to the boundary under the constraint that they are all below y+ < 2.5! This is not an acceptable solution and becomes problematic for complex geometry and unstructured meshed. The solution to this is to apply the rough boundary layer condition under the restriction that ks+ < 5. I have not worked with the komega model in OF, thus I do not know if such a boundary condition exists. The limit ks+ < 5 is due to the fact that the viscous sublayer in terms of wall coordinates is 11.7, thus the roughness elements are covered by the vicous sublayer and the wall is therefore considered hydraulicly smooth from a physical point on view. The Wilcox (1993) model is as far as I know not implemented in OF, but as komega SST is closed related (and improved) with a limitation and the eddy viscosity in the far field among other thing, I would not recommend you to use time om implementing it ... simply use SST. Best regards, Niels 
BTW, if you do not have Wilcox
BTW, if you do not have Wilcox (2006) the BC on omega is
omega = 40000 nu_wall / ks^2 where nu_wall is the kinematic viscosity of the fluid and ks is the DIMENSIONED roughness height. Make sure that ks+ < 5 and further that the location of the first grid point above the surface is less than 1 in wall coordinates. JeanLuc: Please tell if you get an improved prediction of the pressure loss. Best regards, Niels 
Hi Niels,
Thanks a lot for
Hi Niels,
Thanks a lot for your help. I don't have Wilcox (2006), but I have a paper on roughness and SST (Extension of the kw SST turbulence model for flows over rough surfaces  Antti Hellsen and Seppo Laine). I will try to implement it asap. I have also started to implement formula found in Fluent manual... It seems promising but results are not yet good enough for me to present them. Anyway, if I manage to have good results on smooth and rough pipes, I will let you know! Best regards, JeanLuc 
Sorry the authors are "Antti H
Sorry the authors are "Antti Hellsten and Seppo Laine"

Hi Niels,
I have much bette
Hi Niels,
I have much better results on smooth pipes with komega SST (less than 5%). (It was just a newbie error : y+ really has to be between 30 and 300, as close as possible from 30) I have started to implement the log law used in Fluent for rough walls and first results are not too bad in some cases... But I still have to work. JeanLuc 
Hi JeanLuc
Well, that's ho
Hi JeanLuc
Well, that's how it goes, but it is good to hear that the results are as expected. Did you implement the omega condition? I have read the Hellsten article, and it is short. Thus it does not cover the boundary condition for k using SST. There are three regimes regarding roughness, namely 'hydraulically smooth', 'roughtransitional' and 'completely rough'. For the smooth case the viscous sublayer is present and therefor k=0 for y=0. In the completely rough case, the viscous sublayer is not present. In the near wall area vortices are shed from behind the roughness elements ([1], page 32), thus the turbulence does not go to zero. Experiments have shown that dk/dn is a better approximation. For a discussion of the boundaries see [2]. Regarding the transitional regime your engineering hunch is what you have to rely onhttp://www.cfdonline.com/OpenFOAM_D...part/happy.gif The effect of having dk/dn instead is that k does not go to zero, Thus nu_t becomes different from zero which gives larger bed shear stress since tau/rho = (nu+nu_t)du/dy. I am not familiar with the log law from Fluent, but you might want to consider the boundary evaluation of tau discussed in [2], as they have been able to use coarser grids using a van Driest profile to evaluate tau. / Niels [1]: (Free notes of turbulence in smooth and rough regimes in both current and waves) http://www.external.mek.dtu.dk/perso...te_30_6_04.pdf [2]: Numerical and experimental investigation of flow and scour around a circular pile, A. Roulund, B. M. Sumer, J. Fredsoe and J. Michelsen, Journal of Fluid Mechanics, 2005 
Hi OpenFoamers,
I am still
Hi OpenFoamers,
I am still working on pressure losses in rough pipes and I think I am on the right way for the modified rough komega SST (Compared to Moody, results are within 4% except for region 4 < Ks+ < 15 where error is about 10%. And I still have to validate for Re greater than 1e7). But I still have a problem. I have two solutions to get the pressure gradient: i. I compute a long pipe (enough long for boundary layer to stabilize) ii. I use a RANS based modified version of channelOodles. I would like to have a third solution with a cyclic velocity boundary condition between inlet and outlet and just a fixed pressure at outlet and of course an fixed mass flow. Is it possible to have such different boundary conditions for different fields??? I know it is possible in CFX using subdomains... Is there an equivalent in OpenFoam? Thank you, JeanLuc 
Hi JeanLuc
First of all, I
Hi JeanLuc
First of all, I would go for (ii). I seems to be the cheapest of the two. I do not know how channelOodles is working, but the straight forward way would be to add an internal body force and then have cyclic boundaries on both p and U. Then adjust the body force until you have the desired mass flux. This body force will be identically balanced by your wall shear stress. The pressure gradient would in this be zero. Is that in some way want you are suggesting for your third option? Best regards, Niels 
Hi Niels,
You are right, ch
Hi Niels,
You are right, channelOodles adds a body force (a constant pressure gradient) to the momentum equation and tries to converge in terms of mass flow. I also thought it would be the fastest method. And it does in some cases. But with more complex geometries and higher Reynolds it becomes incredibly slow. I may have found an alternative method today : I use directMappedPatch to couple inlet and oulet velocities. It also allows to specify a mean velocity. And the pressure is set up just as it would be in a simple pipe (this will probably have to be changed). It is still work in progress. BTW : I also started to have a look at low reynolds turbulence models. Mainly because I have difficulties to live with coarse meshes at the wall :)... I may give up komega and focus on these for roughness... Best regards, JeanLuc 
Hi JeanLuc
I have had simi
Hi JeanLuc
I have had similar problems with convergence, and I found that when using the correct tuning, something called PIDcontrol actually yielded good results. It is a routine, which considers both the actual residual in the flux, the time derivative in the calculated flux and in integral of the flux over time. Using these informations, a correction to the pressure gradient is found. There are 4 tuning parameters, and if they are set correctly, then you get a reasonably fast convergence to the correct pressure gradient. Good luckhttp://www.cfdonline.com/OpenFOAM_D...part/happy.gif Niels 
Hello All,
I'm new here, ju
Hello All,
I'm new here, just started working with OF. So forgive me if I ask some newbie questions, just let me know if it becomes to stupid http://www.cfdonline.com/OpenFOAM_D...part/happy.gif I am also trying to calculate the pressure losses in a trapezium shaped duct, and I get reasonably good results (10%) for a "long" (7m) "small" (0.2m x 0.1m) smooth duct. Still searching for the difference (10% vs 5%). My other problem is that I need to simulate ducts with a max length of 0.2m and I want to couple the inlet and outlets as well. So I have some questions, JeanLuc, do you have the directMappedPatch option working with good results?? At which dimensions? Are you still using simpleFOAM with kOmegaSST? Niels, what kind of lengths do you use ? And you are using simpleFOAM with a rewritten Wilcox kOmega model to implement the boundary/roughness conditions? Best regards, Bart 
Hi Bart
I am sorry to say,
Hi Bart
I am sorry to say, that I am not using any of the RANSmodels in OpenFOAM. My knowledge is based on a study I did for my master thesis where I used an inhouse numerical code and needed to decide upon either komega or kepsilon. Best regards, Niels 
All times are GMT 4. The time now is 21:43. 