CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

slip or noslip U BC in openfoam?

Register Blogs Community New Posts Updated Threads Search

Like Tree12Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 8, 2018, 18:46
Default slip or noslip U BC in openfoam?
  #1
Member
 
fede32's Avatar
 
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 10
fede32 is on a distinguished road
I'm modeling head loss in a pipe using openfoam. I'm using k-epsilon 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).
fede32 is offline   Reply With Quote

Old   September 9, 2018, 14:01
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
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
fede32 likes this.
mAlletto is offline   Reply With Quote

Old   September 9, 2018, 17:04
Default
  #3
Member
 
fede32's Avatar
 
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 10
fede32 is on a distinguished road
Quote:
Originally Posted by mAlletto View Post
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
Thanks for your repply! I'm using a k-epsilon model so I have BC for U, p, k, nut and epsilon:

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)
fede32 is offline   Reply With Quote

Old   September 9, 2018, 17:55
Default
  #4
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
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
fede32 and backscatter like this.
mAlletto is offline   Reply With Quote

Old   September 9, 2018, 18:28
Default
  #5
Member
 
fede32's Avatar
 
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 10
fede32 is on a distinguished road
Quote:
Originally Posted by mAlletto View Post
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
You are right Michael. I used to calculate with finite element method previously, and in that case you only need one BC for each U component because the formulation reduce one order of derivation.

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!
fede32 is offline   Reply With Quote

Old   September 10, 2018, 07:29
Default
  #6
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
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.
fede32 likes this.
mAlletto is offline   Reply With Quote

Old   September 10, 2018, 13:53
Default
  #7
Member
 
fede32's Avatar
 
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 10
fede32 is on a distinguished road
Quote:
Originally Posted by mAlletto View Post
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.

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;
}
}
fede32 is offline   Reply With Quote

Old   September 11, 2018, 03:48
Default
  #8
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
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 T-junction 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.
mAlletto is offline   Reply With Quote

Old   September 11, 2018, 08:40
Default
  #9
Member
 
fede32's Avatar
 
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 10
fede32 is on a distinguished road
Quote:
Originally Posted by mAlletto View Post
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 T-junction 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.

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-...CMJU4-spI6pKzb


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!
fede32 is offline   Reply With Quote

Old   September 11, 2018, 15:48
Default
  #10
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
maybe you should try to add some prims layers at the wall. maybe this helps.


What is the pressure loss measured?
fede32 likes this.
mAlletto is offline   Reply With Quote

Old   September 11, 2018, 15:51
Default
  #11
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
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
fede32 likes this.
mAlletto is offline   Reply With Quote

Old   September 11, 2018, 16:53
Default
  #12
Member
 
fede32's Avatar
 
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 10
fede32 is on a distinguished road
Quote:
Originally Posted by mAlletto View Post
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

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).
fede32 is offline   Reply With Quote

Old   September 12, 2018, 04:12
Default
  #13
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
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.
fede32 and Harish Selvam like this.
GerhardHolzinger is offline   Reply With Quote

Old   September 12, 2018, 09:29
Default
  #14
Member
 
fede32's Avatar
 
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 10
fede32 is on a distinguished road
Quote:
Originally Posted by GerhardHolzinger View Post
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.

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.
fede32 is offline   Reply With Quote

Old   September 12, 2018, 14:41
Default
  #15
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
Quote:
Originally Posted by GerhardHolzinger View Post
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.



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.
fede32 likes this.
mAlletto is offline   Reply With Quote

Old   October 3, 2018, 07:45
Default
  #16
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
Quote:
Originally Posted by fede32 View Post
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-...CMJU4-spI6pKzb


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!



did you achieve the get the correct pressure drop?
mAlletto is offline   Reply With Quote

Old   October 3, 2018, 08:16
Default
  #17
Member
 
fede32's Avatar
 
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 10
fede32 is on a distinguished road
Quote:
Originally Posted by mAlletto View Post
did you achieve the get the correct pressure drop?

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 under-relaxation. Thanks
fede32 is offline   Reply With Quote

Old   October 4, 2018, 03:40
Default
  #18
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
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.
fede32 likes this.
mAlletto is offline   Reply With Quote

Old   October 4, 2018, 14:06
Default
  #19
Member
 
fede32's Avatar
 
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 10
fede32 is on a distinguished road
Quote:
Originally Posted by mAlletto View Post
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.

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?
fede32 is offline   Reply With Quote

Old   October 5, 2018, 03:52
Default
  #20
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
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
fede32 likes this.
mAlletto is offline   Reply With Quote

Reply

Tags
head loss, kepsilon, pipe, slip, wall law


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
UNIGE February 13th-17th - 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 Pre-Processing 2 October 11, 2013 13:27
The OpenFOAM extensions project mbeaudoin OpenFOAM 16 October 9, 2007 09:33


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