CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Calculation of Pressure Loss (https://www.cfd-online.com/Forums/openfoam-solving/57923-calculation-pressure-loss.html)

jason October 25, 2007 11:43

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 no-slip 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

jason October 25, 2007 12:41

Ok, I got it, simpleFoam uses
 
Ok, I got it, simpleFoam uses normalised pressure, found the answer here

http://www.cfd-online.com/OpenFOAM_D...es/1/5124.html

Now I know what to do,

Many thanks

Jason

hjasak October 25, 2007 16:45

This is resolved, right? Hr
 
This is resolved, right?

Hrv

gabriel October 25, 2007 17:40

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

jason October 26, 2007 05:39

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

jlpelerin February 14, 2008 10:32

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, k-epsilon and k-omega, 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,

Jean-Luc Pelerin

ngj February 15, 2008 04:17

Hi Jean-Luc The 30% is not
 
Hi Jean-Luc

The 30% is not surprising, if it comes from the k-epsilon model. It has been reported in [1] for channel flows that the k-epsilon 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 k-omega model I would get surprised. [1] reportes error in the order of magnitude 1-3% 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

jlpelerin February 15, 2008 08:05

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.cfd-online.com/OpenFOAM_D...hment_icon.gif Smooth-ko-Long-Re2e4-steady.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.cfd-online.com/OpenFOAM_D...ges/1/6688.png

Thank you very much,

Best regards,

Jean-Luc

ngj February 15, 2008 09:22

Hi It should be said that
 
Hi

It should be said that I have never worked with smooth surfaces (main interest: sediment transporthttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif), but I have found the following by looking in Wilcox (2006) p383-386 and I'll give a small summary on the k-omega part:

For smooth wall boundary layers with k-omega, 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 k-omega 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 k-omega 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

ngj February 18, 2008 08:18

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.

Jean-Luc: Please tell if you get an improved prediction of the pressure loss.

Best regards,

Niels

jlpelerin February 18, 2008 08:55

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 k-w 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,

Jean-Luc

jlpelerin February 18, 2008 08:59

Sorry the authors are "Antti H
 
Sorry the authors are "Antti Hellsten and Seppo Laine"

jlpelerin February 22, 2008 03:44

Hi Niels, I have much bette
 
Hi Niels,

I have much better results on smooth pipes with k-omega 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.

Jean-Luc

ngj February 22, 2008 05:16

Hi Jean-Luc Well, that's ho
 
Hi Jean-Luc

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', 'rough-transitional' 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.cfd-online.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

jlpelerin February 28, 2008 05:26

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 k-omega 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,

Jean-Luc

ngj March 4, 2008 10:48

Hi Jean-Luc First of all, I
 
Hi Jean-Luc

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

jlpelerin March 4, 2008 11:47

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 k-omega and focus on these for roughness...

Best regards,

Jean-Luc

ngj March 5, 2008 07:12

Hi Jean-Luc I have had simi
 
Hi Jean-Luc

I have had similar problems with convergence, and I found that when using the correct tuning, something called PID-control 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.cfd-online.com/OpenFOAM_D...part/happy.gif

Niels

bboonacker May 22, 2008 05:31

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.cfd-online.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,

Jean-Luc, 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 re-written Wilcox kOmega model to implement the boundary/roughness conditions?

Best regards,

Bart

ngj May 22, 2008 06:02

Hi Bart I am sorry to say,
 
Hi Bart

I am sorry to say, that I am not using any of the RANS-models in OpenFOAM. My knowledge is based on a study I did for my master thesis where I used an in-house numerical code and needed to decide upon either k-omega or k-epsilon.

Best regards,

Niels

bboonacker May 22, 2008 06:37

Hey Niels, That's to bad, I
 
Hey Niels,

That's to bad, I am also working on my master thesis, but I only have OF http://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif
Thanks anyway for the quick answer.

Bart

jlpelerin May 26, 2008 10:28

Hi Bart, If your geometry i
 
Hi Bart,

If your geometry is a "simple" extrusion of a 2D profile, it should not be too difficult to get good results. But if the profile changes periodically along the axis it may become much harder.

I do not use directMappedPatch anymore but cyclic boundary conditions associated with a source term in the momentum equation. I think it is the best way to compute a pressure drop.

Best regards,

Jean-Luc

ngj June 18, 2008 05:33

Hi Jean-Luc and Bart I know
 
Hi Jean-Luc and Bart

I know that you both have been working with kOmegaSST, and I have just begun reading the source for the turbulence module, and something is quite strange.

Basicly it is line 265 in kOmegaSST.C. In this line it is stated that if the production of turbulence is larger than c1 times the dissipation of turbulence, then the production is limited to c1 times the dissipation. Is this some kind of numerical issue, which needs to limit the production?

Hope you can help,

Best regards,

Niels

jlpelerin June 23, 2008 09:05

Hi Niels, Accordind to http
 
Hi Niels,

Accordind to http://www.cfd-online.com/Wiki/SST_k-omega_model the term is from the original model and not OpenFOAM specific. But I have no idea of why this term is used.

Sorry I can't help you, you should probably contact the author of the OpenFOAM implementation of SST...

Jean-Luc

ngj June 23, 2008 09:46

Thanks Jean-Luc I have made
 
Thanks Jean-Luc

I have made an implementation without the wall functions, i.e. in the way we discussed above, as I was not fond of the results with the standard implementation. I have begun testing it, and it looks good. As I have removed the wall function I have also removed the limitation on the production term, as I think it is the reason for the limit. Have ordered the article by Menter, thus will soon know explicitly.
Further I am also testing a body-force correcter, which should help you approach a certain flux faster.

/ Niels

jlpelerin June 26, 2008 02:54

Hi Niels, That is a very go
 
Hi Niels,

That is a very good news!!!

Do you plan to implement a roughness model?
Do you plan to share it?
Do you need help?

Thank you,

Jean-Luc

ngj June 26, 2008 04:05

Hi Jean-Luc > Do you plan t
 
Hi Jean-Luc

> Do you plan to implement a roughness model?
I have already modified kOmegaSST -> kOmegaSSTRough, i.e. removed all functionality with regard to the wall functions and implemented two different boundary conditions for omega: Wilcox (2006) and Roulund (2005).
> Do you plan to share it?
Actually had not considered that point yet, but yes.
> Do you need help?
For the testing phase, I would indeed appreciate some help. I will return to you, when I think that stage is reached.

/ Niels

jlpelerin June 26, 2008 05:17

Niels, Sorry for my first q
 
Niels,

Sorry for my first question that didn't make any sense... Of course it is a roughness model!

I would be glad to test it. I can run it on pipes and on our geometry.
As it is confidential I won't be able to give the cases set up but I will be able to give you an error.

Jean-Luc

ngj June 26, 2008 07:38

Hi Jean-Luc This is my work
 
Hi Jean-Luc

This is my working version, but haven't started the tested yet. I have implemented two versions of a omega-BC. The first is the one given in Wilcox (2006) and the second is a version by Roulund (2005).

I have added two parameters two the turbulence-list. Namely d50, which is the median grain diameter of the roughness, and omegaBC, which can take the values as seen below in the coeffs list.
The present boundary condition should be working for both rough, transitional and smooth boundaries (Wilcox (2006)), where d50 just need to be chosen to be some appropriate value for smooth boundaries.

As we have previously discussed the boundary condition on k needs to be considered as a function of the roughness in wall coordinates, but as of now there is no generic implementation, i.e. still controlled by /0/k.

I'll be looking forward to hear about your experiences. If any questions, etc, you can also reach me by email.

/ Niels

Place the files in ~/src/turbulence/incompressible and compile with the other turbulence-schemes.
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif kOmegaSSTRough.tar.gz

To be copy-pasted into turbulenceProperties:

kOmegaSSTRoughCoeffs
{
alphaK1 alphaK1 [0 0 0 0 0 0 0] 0.85034;
alphaK2 alphaK1 [0 0 0 0 0 0 0] 1.0;
alphaOmega1 alphaOmega1 [0 0 0 0 0 0 0] 0.5;
alphaOmega2 alphaOmega2 [0 0 0 0 0 0 0] 0.85616;
gamma1 gamma1 [0 0 0 0 0 0 0] 0.5532;
gamma2 gamma2 [0 0 0 0 0 0 0] 0.4403;
beta1 beta1 [0 0 0 0 0 0 0] 0.0750;
beta2 beta2 [0 0 0 0 0 0 0] 0.0828;
betaStar betaStar [0 0 0 0 0 0 0] 0.09;
a1 a1 [0 0 0 0 0 0 0] 0.31;
c1 c1 [0 0 0 0 0 0 0] 1000;

Cmu Cmu [0 0 0 0 0 0 0] 0.09;
d50 d50 [0 1 0 0 0 0 0] 0.001;
omegaBC wilcox2006; //roulund2005
}

jlpelerin June 26, 2008 08:03

Niels, Thanks a lot. I will
 
Niels,

Thanks a lot. I will start working on it now :-)

Jean-Luc

ngj June 26, 2008 08:18

BTW: forgot to mention that th
 
BTW: forgot to mention that this procedure is highly y+ dependent, i.e. U_f deltaY_wall / nu should be around 1 (at least).

/ Niels

louisgag September 19, 2008 15:34

There is a method proposed by
 
There is a method proposed by Hellsten to reduce the y+ dependency of the results using either Wilcox's or Menter's appraoches of the k-omega model.

I am attaching the document here.



louisgag September 19, 2008 15:37

Hi, There is a method propo
 
Hi,

There is a method proposed by Hellsten to reduce the y+ dependency of the friction coefficient using either Wilcox's or Menter's approaches of the k-omega model.

You can view the full report online: http://www.aero.hut.fi/pubs/reports/B50_abstract.html

Also, I am trying to implement this B.C. in the current kOmegaSST model of OF.


regards,

-Louis

braennstroem September 23, 2008 03:30

Hi Nils, nice work! Though
 
Hi Nils,

nice work! Though I have a question about the omega implementation. As I understand it, you modified compared to the OpenFoam version you modify all wall-patches in a averaged (using patchi) way and do not access the each 'faceCelli' on these wall separetly. Is there any reason for this?

Fabian

ngj September 23, 2008 04:59

Hi Fabian If you consider e
 
Hi Fabian

If you consider e.g. omegaWilcox.H, then I loop over all boundaries. Those which are wall-type are further investigated.

In either I work with fields, thus I calculate the individual shear stress in either boundary face cell and as you will se, both wallStress and Sr are scalarFields, thus the values set to the boundary is face-specific.

If this does not answer you question, please elaborate on your uncertainty.

Further I would definitely recommend Wilcox over Roulund, as some small investigation shows that Roulund is unreliable.

Further the report given by Louis gives another way around, but I do not like the modified roughness model, as my intuition tells me that it will not give Reynolds independent results in the limit Re->inf.

Best,

Niels

ngj September 23, 2008 05:00

Even though a proof would be s
 
Even though a proof would be significantly better than intuitionhttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif

braennstroem September 23, 2008 05:41

Hi Niels, (sorry for the missp
 
Hi Niels, (sorry for the misspelled name!)

thanks; though I do not understand it...maybe I do not get the implementation of the OpenFOAM SST model. There one loops over all patches (mesh_.boundaries) and if is of type wall, one further loops over each cell of theses wall!?

Fabian

ngj September 23, 2008 07:18

Hi Fabian If the patch is a
 
Hi Fabian

If the patch is a wall, it is correct that further computations are done.

E.g. "vectorField uGrad" means that the velocity gradient normal to the wall is computed in _every_ face on the patch in question. Thus if there are a 100 faces on that patch, uGrad will consist of 100 vectors. All computations, except for Sr is done in that way, i.e. working on fields instead of individual faces.

The forAll(kPlus,kI) then loops over all faces, because I at that time didn't use Foam::pos as extensively as today. The use of Foam::pos would actually make the loop unnecessary.

Best,

Niels

louisgag September 23, 2008 10:07

Hi Niels, Nice to know you
 
Hi Niels,

Nice to know you were interested in the report! What I will actually try to implement from this report is the modification to Menter's method (basically changing the wall estimate of the omega value by a factor of 1.5/10), and that will, at the same time, help me understand how the 1.5 version of the kOmegaSST model is implemented (because it has wall functions that force the use of zeroGradient conditions).. I'll keep you posted when I have something coded.

Cheers,

-Louis

ngj September 23, 2008 11:09

Hi Louis The forcing of zer
 
Hi Louis

The forcing of zeroGradient is basically removed by deleting the files in the kOmegaSST, which makes that exact inquiry.

It is done in my own implementation above, if that could be of any help.

/ Niels


All times are GMT -4. The time now is 10:58.