
[Sponsors] 
September 8, 2018, 18:46 
slip or noslip U BC in openfoam?

#1 
Member
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 47
Rep Power: 5 
I'm modeling head loss in a pipe using openfoam. I'm using kepsilon turbulence model. Since I don't want to model the viscous layer, I'm using wall law, for k and epsilon (so I use kqRWallFunction and epsilonWallFunction). Should I use slip or noSlip BC for U on walls? (I know from the theory we should apply a tangential stress to U instead of a fixed 0 value, but I don't know how it's implemented on OpenFoam).


September 9, 2018, 14:01 

#2 
Senior Member
Michael Alletto
Join Date: Jun 2018
Posts: 100
Rep Power: 2 
Hello Federico,
in oder to apply wall functions in OF you have to set the velocity to uniform (0 0 0) at the walls. The wall function is applied through nut. so in the nut boundary condition you have to choose a wall function. For smooth wall nutkWallFunction is a good choice. see https://github.com/OpenFOAM/OpenFOAM...hScalarField.C 

September 9, 2018, 17:04 

#3  
Member
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 47
Rep Power: 5 
Quote:
In the walls: p: zeroGradient k: kqRWallFunction epsilon: epsilonWallFunction nut: nutkWallFunction U: ? Why do you say that I should use noSlip BC for U? In that case, U is fixed to zero in the wall, but what I really want is to eliminate the viscous layer from my domain, and replace its influence with a law function. In the theory, what we do is to replace the Dirichlet condition for the velocity with a tangential stress (which comes from the wall law) 

September 9, 2018, 17:55 

#4 
Senior Member
Michael Alletto
Join Date: Jun 2018
Posts: 100
Rep Power: 2 
you have an example in tutorials/incompressible/simpleFoam/pitzDaily.
Actually since the Navier Stokes equations are second order in U you need two boundary condition for each component of the velocity. For the walls that means you need the velocity and the stresses at the wall. If you think on the discretization of the derivative of the stress tensor in the framework of a finite volume method you sum up the contributions of the stresses over the cell faces. At the wall you need to calculate the wall shear stress. If you do not have any wall function you multiply the velocity gradient with the viscosity to get the wall shear stress. If you have wall functions you multiply the turbulent viscosity nut with the velocity gradient. In order to get the correct wall shear stress in order to get the correct velocity at the cell centre close to the wall you need a wall function for nut. Hope this helps a bit. Michael 

September 9, 2018, 18:28 

#5  
Member
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 47
Rep Power: 5 
Quote:
Anyway, I'm calculating pressure drop in a pipe. Using the noSlip BC for U the results are better, but the pressure that I calculate is still much lower than the pressure drop that I have to validate. Do you have any suggestion? (I'm using simpleFoam because I'm not interested in transient patterns. I have also tried using kOmeggaSST instead of kepsilon turbulence model). Thanks for all your help! 

September 10, 2018, 07:29 

#6 
Senior Member
Michael Alletto
Join Date: Jun 2018
Posts: 100
Rep Power: 2 
If the pressure drop is too low that means that the wall shear stress is not calculated correctly (at least for a straight pipe with no secondary flows). So I presume that either your did not correctly choose the wall boundary conditions or maybe the resolution is too coarse.
If you provide some figures this may help. 

September 10, 2018, 13:53 

#7  
Member
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 47
Rep Power: 5 
Quote:
My geometry consists in a pipe with an inlet, an elbow, and then a T junction which divides into two branches. Each branch has several outlets. My patchs are: inlet, outlet (all the outlets), and walls (the rest of the faces). These are the BC I'm using: U dimensions [0 1 1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { Inlet { type fixedValue; value uniform (9.18937 0 0); } Outlet { type inletOutlet;//zeroGradient; inletValue uniform (0 0 0); value uniform (0 0 0); } Walls { type noSlip; } } p dimensions [0 2 2 0 0 0 0]; internalField uniform 0; boundaryField { Inlet { type zeroGradient; } Outlet { type totalPressure; rho none; p0 uniform 0; value uniform 0; // Optional entries U U; phi phi; } Walls { type zeroGradient; } } k dimensions [0 2 2 0 0 0 0]; internalField uniform 1.215; boundaryField { Inlet { type turbulentIntensityKineticEnergyInlet; intensity 0.05; // 5% turbulent intensity value $internalField; } Outlet { type inletOutlet; inletValue $internalField; } Walls { type kqRWallFunction; value $internalField; } } epsilon dimensions [0 2 3 0 0 0 0]; internalField uniform 1.497; boundaryField { Inlet { type turbulentMixingLengthDissipationRateInlet; mixingLength 0.08; // half channel height value $internalField; } Outlet { type inletOutlet; inletValue $internalField; } Walls { type epsilonWallFunction; value $internalField; } } omega (when using KOmegaSST) dimensions [0 0 1 0 0 0 0]; internalField uniform 153.4; boundaryField { Inlet { type fixedValue; value uniform 153.4; } Outlet { //type zeroGradient; type inletOutlet; inletValue $internalField; } Walls { type omegaWallFunction; value $internalField; } } nut dimensions [0 2 1 0 0 0 0]; internalField uniform 0; boundaryField { Inlet { type calculated; value uniform 0; } Outlet { type calculated; value uniform 0; } Walls { type nutkWallFunction; value uniform 0; } } 

September 11, 2018, 03:48 

#8 
Senior Member
Michael Alletto
Join Date: Jun 2018
Posts: 100
Rep Power: 2 
Ok I see.
The boundary conditions applied seem ok. But without exact geometry and maybe a figure which describes the experiment and also the comparison between the experiment and the simulation it is difficult to find out what is going wrong. Generally applying wall functions in flows where you expect separation (in Tjunction you get some for sure) is no good idea since they are known to not correctly reproduce recirculation regions). In your case if you have too low pressure drop I suppose the recirculation regions are not captured correctly (I hope you applied boundary conditions which match the one used in the experiment). But in general the problem you describe is a rather standard one and with a bit of google search I guess you would find someone which simulated a similar flow. 

September 11, 2018, 08:40 

#9  
Member
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 47
Rep Power: 5 
Quote:
I was searching a lot on google but I couldn't find too much help. Do you suggest me any particular site? I attach you the geometry of the problem. The inlet is in the upper side, and the 20 outlets are in the branches below. The Reynolds is ~300K. (Air at 10m/s). https://drive.google.com/open?id=16...CMJU4spI6pKzb I made simulations using 300K tetrahedras, and I increased the resolution until 3 million, and the pressure loss hardly improved. Instead of using wall law's, do you have another idea? I think I can't try to capture the viscous layer due to the high resolution requirements. Thank you very much for all your help! 

September 11, 2018, 15:48 

#10 
Senior Member
Michael Alletto
Join Date: Jun 2018
Posts: 100
Rep Power: 2 
maybe you should try to add some prims layers at the wall. maybe this helps.
What is the pressure loss measured? 

September 11, 2018, 15:51 

#11 
Senior Member
Michael Alletto
Join Date: Jun 2018
Posts: 100
Rep Power: 2 
In general for wall bounded flows it is important to have a fine resolution close to the wall in order to resolve the steep gradients happening at the wall correctly


September 11, 2018, 16:53 

#12  
Member
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 47
Rep Power: 5 
Quote:
Perfect, I have analyzed a fine mesh but I would increase more the resolution in the walls. The pressure loss meassured in the experiment is more than twice the pressure I'm calculating (which is converged in the meshes I used). 

September 12, 2018, 04:12 

#13 
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 236
Rep Power: 20 
I recently had a similar issue: computing the pressure loss of a straight pipe using a 2D simulation. In my case it turned out, I was using kEpsilon with way too small y+ values at the wall, thus refining the mesh did deterioriate the results.
I remedied the issue by using a mesh resolution that led to approriate y+ values, or using the kOmega turbulence model. The velocity profiles were rather independent of the mesh fineness, or the turbulence model. However, the pressure loss was very sensitive to mesh resolution and turbulence modelling. 

September 12, 2018, 09:29 

#14  
Member
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 47
Rep Power: 5 
Quote:
Great! Thanks for sharing your experience, I'm going to recompute the y+ and mesh accordly. I was using the kOmega turbulence model with a little improve. 

September 12, 2018, 14:41 

#15  
Senior Member
Michael Alletto
Join Date: Jun 2018
Posts: 100
Rep Power: 2 
Quote:
That's interesting. I always thought that if y+ is in the range of approximately 40 to 300 (the range of the log layer in a wall bounded flow) the wall shear stress computed is roughly independent of the cell size close to the wall if wall functions are applied. If the y+ values are close to 1 or less and no wall functions are applied (in the viscous sub layer) also in this case the wall shear stress should be correctly computed. If y+ values are between 5 and 40 (buffer layer) the standard wall functions are not appropriate. 

October 3, 2018, 07:45 

#16  
Senior Member
Michael Alletto
Join Date: Jun 2018
Posts: 100
Rep Power: 2 
Quote:
did you achieve the get the correct pressure drop? 

October 3, 2018, 08:16 

#17 
Member
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 47
Rep Power: 5 
I'm working on this. Now I made a mesh with hexaedras and I refined the mesh in the boundary layer, trying to obtain y+<50 in all my geometry. Using yplus openfoam tool, the postprocessing says me that the av y+ is 34 and the max is 450, using kwSST. I get better values in pressure drop, but I'm not having a stable solution to the problem. Solving with SIMPLE, results have a +/ 40% variation and never converges. I'm going to analyze better the underrelaxation. Thanks 

October 4, 2018, 03:40 

#18 
Senior Member
Michael Alletto
Join Date: Jun 2018
Posts: 100
Rep Power: 2 
For your geometry it is not suppressing you don't get a steady solution because of the number of sharp corners you have.
I think it is quite ok if you averaged you pressure drop. 

October 4, 2018, 14:06 

#19  
Member
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 47
Rep Power: 5 
Quote:
Thanks for your idea. Is there a justification for why the average should be the right one, and not the value of one of the extremes for example? 

October 5, 2018, 03:52 

#20 
Senior Member
Michael Alletto
Join Date: Jun 2018
Posts: 100
Rep Power: 2 
It reflects what you are doing in reality. In reality you don't have either a steady flow and you have to average over a longer time to obtain meaningful values


Tags 
head loss, kepsilon, pipe, slip, wall law 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
UNIGE February 13th17th  2107. OpenFOAM advaced training days  joegi.geo  OpenFOAM Announcements from Other Sources  0  October 1, 2016 19:20 
slip & noslip boundary conditions are wrong on dynamic mesh  oschi  OpenFOAM Running, Solving & CFD  3  February 18, 2016 12:52 
Superlinear speedup in OpenFOAM 13  msrinath80  OpenFOAM Running, Solving & CFD  18  March 3, 2015 05:36 
can slip boundary condition in openFoam mean "inviscid wall" ?  s.m  OpenFOAM PreProcessing  2  October 11, 2013 13:27 
The OpenFOAM extensions project  mbeaudoin  OpenFOAM  16  October 9, 2007 09:33 