# Measuring wall shear stress in bend pipe

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 26, 2012, 06:51 #41 New Member   Tian Coulsting Join Date: Jun 2012 Posts: 19 Rep Power: 12 Ah OK, I will bear that in mind for future. Since it is working I'll leave it be for the moment! Cheers, Tian

March 15, 2013, 07:21
#42
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 14
Quote:
 Originally Posted by Amir Of course it is! the tau parameter depends on your model. (actually I prepared it for viscoelastic solver where the tau parameter exists but for general cases you have to set its formulation in your code)
Hi Amir,
Now I wonder how can I define tau boundary condition in 0 directory.
Can you please attach an example case?

Bests,

March 15, 2013, 09:45
#43
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 21
Quote:
 Originally Posted by Mojtaba.a Hi Amir, Thank you for your code. Now I wonder how can I define tau boundary condition in 0 directory. Can you please attach an example case? Bests,
Hi,

For this purpose, if it's really necessary according to your solver, take a look over the attachment.
It's Better to see this post (http://www.cfd-online.com/Forums/ope...tml#post377001) before any changes; note that the formulation of tau depends on your constitutive model you've used.

Bests,
Attached Files
 tau.zip (342 Bytes, 102 views)
__________________
Amir

March 15, 2013, 11:08
#44
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 14
Quote:
 Originally Posted by Amir note that the formulation of tau depends on your constitutive model you've used.
Thank you Amir, it really helped.
I am using simpleFoam to simulate steady incompressible air flow over a 3D cube, using LRR turbulence model.
How can I know what constitutive model i am using?

besides, I have some problems calculating shear stress, using your code. Before, using utilities like wallShearStress or wallGradU, it was all enough to run these commands in the case directory to calculate velocity gradient or wall traction as you mentioned before. but here after compiling your code, when I run "shear" command, I get this error message which needs tau boundary condition in the whole time directories. For instance I put tau baoundary condition in 0 directory and after running the command I got this:

Quote:
 --> FOAM FATAL IO ERROR: cannot find file file: /home/onixa/OpenFOAM/onixa-2.1.1/run/sehatSanj4/100/tau at line 0. From function regIOobject::readStream() in file db/regIOobject/regIOobjectRead.C at line 73. FOAM exiting

March 15, 2013, 12:38
#45
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 21
Quote:
 Originally Posted by Mojtaba.a Thank you Amir, it really helped. I am using simpleFoam to simulate steady incompressible air flow over a 3D cube, using LRR turbulence model. How can I know what constitutive model i am using?
Reasonably, it's consisted of laminar and turbulent parts; you can find that from the solver code and regarded libraries.
Quote:
 Originally Posted by Mojtaba.a besides, I have some problems calculating shear stress, using your code. Before, using utilities like wallShearStress or wallGradU, it was all enough to run these commands in the case directory to calculate velocity gradient or wall traction as you mentioned before. but here after compiling your code, when I run "shear" command, I get this error message which needs tau boundary condition in the whole time directories. For instance I put tau baoundary condition in 0 directory and after running the command I got this: Thanks in advance,
Dear Mojtaba,
This is not correct to put the "tau" file to "0" folder! All of your folders should have this file with their specific data according to that time! I developed this utility for viscoelastic solver in which the tau variable is stored like other variables such as U or p.
Anyway, if you want to use this code you have 3 options:
1- Use it as a utility; for this purpose, you've got to change this code; i.e., substitute "tau" with your appropriate relations according to your solver (looking over the main utility to compute wall traction may help you figure it out).
2- Change the solver to write "tau" at each time step like other variables like U or p.
3- Substitute this code as a part of your solver, embed it there properly ...

Hope that these options would clarify the situation for you.

Bests,
__________________
Amir

 April 3, 2013, 23:46 wallGradU #46 Member   Ken Join Date: Aug 2012 Posts: 66 Blog Entries: 1 Rep Power: 12 @ Amir, Thank you for your clarification that wallShearStress computes traction. To clarify, would an acceptable alternative be to run the utility wallGradU, and then to multiply the resulting field by mu? In other words, tau = mu * wallGradU where 'tau' is the conventional wall shear stress. Is this also correct? Edit: I just tried this for my case, and I get the same result doing either of the following: tau = (wallShearStress) * rho tau = (wallGradU) * mu Is that expected? Was the wallShearStress utility fixed? I am solving a laminar incompressible flow with a density rho close to that of water. Last edited by Nucleophobe; April 4, 2013 at 00:29.

April 4, 2013, 05:42
#47
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 21
Quote:
 Originally Posted by Nucleophobe I just tried this for my case, and I get the same result doing either of the following: tau = (wallShearStress) * rho tau = (wallGradU) * mu Is that expected? Was the wallShearStress utility fixed? I am solving a laminar incompressible flow with a density rho close to that of water.
Hi,

None of the implemented statements are real wall shear stress but in many cases their differences are really negligible; i.e., it depends on the wall curvature and the velocity gradients.
In other words, your first equation computes wall traction including the normal stress and the second one just computes the normal gradient of the velocity vector while the real wall shear stress is originated from rate of deformation tensor.

Bests,
__________________
Amir

April 5, 2013, 07:52
#48
Member

Albert Tong
Join Date: Dec 2010
Location: Perth, WA, Australia
Posts: 76
Blog Entries: 1
Rep Power: 14
Quote:
 Originally Posted by Amir Dear Guifan, In many solvers such as FLUENT and OpenFOAM wall traction is considered as wall shear stress and I don't know why! If we assume T as stress tensor and n as unit normal vector of desired face we have: t= T.n ; t= traction (force vector exerted to desired face per unit area); the utility compute this, but we want: shear stress= t - (t.n)n ;which shear stress is tangential vector here. Bests,
Hi There,

Thank you Amir, for the clarification. I read this for several times and am really confused.

if shear stress= t - (t.n)n is the right definition (and it is), then why "FLUENT and OpenFOAM" prefer t= T.n?

Quote:
 Hi, None of the implemented statements are real wall shear stress but in many cases their differences are really negligible; i.e., it depends on the wall curvature and the velocity gradients. In other words, your first equation computes wall traction including the normal stress and the second one just computes the normal gradient of the velocity vector while the real wall shear stress is originated from rate of deformation tensor. Bests,
In what cases, "their differences are negligible"? Is it possible that when it comes to the space close to a wall, the wall normal stress is always small enough to be neglected? For those of you who have used Amir's code, could you please advise the difference? Thanks.

I need to solve the shear stress along a trench under sea bottom, is it good to just apply official utility?
__________________
Kind regards,

Albert

April 5, 2013, 10:51
#49
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 21
Quote:
 Originally Posted by tfuwa why "FLUENT and OpenFOAM" prefer t= T.n?
Dear Albert,

That's my question too!

Quote:
 Originally Posted by tfuwa I need to solve the shear stress along a trench under sea bottom, is it good to just apply official utility?
Regarding my own experience, and as a part my master thesis, I found around 10% deviation between these 2 relations for my case, which was a viscoelastic substance flowing in a sphere. As you can see, I developed a code for my own purpose and I've used the "tau" directly because it's computed explicitly in viscoelastic solver; however, you can easily merge some parts of that with the original utility in order to develop a more general one and use it without any doubt!
You know, the differences are really case dependent and difficult to estimate before examine.

Bests,
__________________
Amir

April 5, 2013, 13:26
#50
Member

Ken
Join Date: Aug 2012
Posts: 66
Blog Entries: 1
Rep Power: 12
Quote:
 Originally Posted by Amir Dear Albert, That's my question too! Regarding my own experience, and as a part my master thesis, I found around 10% deviation between these 2 relations for my case, which was a viscoelastic substance flowing in a sphere. As you can see, I developed a code for my own purpose and I've used the "tau" directly because it's computed explicitly in viscoelastic solver; however, you can easily merge some parts of that with the original utility in order to develop a more general one and use it without any doubt! You know, the differences are really case dependent and difficult to estimate before examine. Bests,

Since shear stress= t - (t.n)n, is the calculation using wallShearStress generally high, or low? Can the quantity (t.n)n be negative? I'm a little unfamiliar with the syntax so it isn't clear to me offhand.

It sounds like it would be very useful to develop a new utility for post-processing the correct WSS. (I'll try, we'll see how it goes!)

April 5, 2013, 14:11
#51
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 21
Quote:
 Originally Posted by Nucleophobe Since shear stress= t - (t.n)n, is the calculation using wallShearStress generally high, or low? Can the quantity (t.n)n be negative? I'm a little unfamiliar with the syntax so it isn't clear to me offhand.
The real wall shear stress would be lower since it's just one of the component of the wall traction. (The wall traction has 2 perpendicular components, the real wall shear stress and the normal one)
Quote:
 Originally Posted by Nucleophobe It sounds like it would be very useful to develop a new utility for post-processing the correct WSS. (I'll try, we'll see how it goes!)
Yep, it's not very complicated, just merge my code and the official utility with few modifications.

Bests,
__________________
Amir

April 5, 2013, 14:48
#52
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 14
Quote:
 Originally Posted by Nucleophobe It sounds like it would be very useful to develop a new utility for post-processing the correct WSS. (I'll try, we'll see how it goes!)
Quote:
 Originally Posted by Amir Yep, it's not very complicated, just merge my code and the official utility with few modifications. Bests,
Hi,
I just came up with the attached utility. I don't know if I have made any mistakes, but wallShearStress value is different from the actual wallShearStress value of the official utility. Is there anything I am missing?
P.S: mu is supposed to get read from transportProperties.
Attached Files
 shear.tar.gz (10.0 KB, 36 views)
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

April 5, 2013, 16:16
#53
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 21
Quote:
 Originally Posted by Mojtaba.a Hi, I just came up with the attached utility. I don't know if I have made any mistakes, but wallShearStress value is different from the actual wallShearStress value of the official utility. Is there anything I am missing? P.S: mu is supposed to get read from transportProperties.
If your flow field is turbulent, they shouldn't be the same. It's better to use the same definition for the stress tensor as it's done in the official utility. (It's more general)

Bests,
__________________
Amir

April 5, 2013, 18:45
#54
Senior Member

Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Tampa, US
Posts: 308
Rep Power: 14
Quote:
 Originally Posted by Amir If your flow field is turbulent, they shouldn't be the same. It's better to use the same definition for the stress tensor as it's done in the official utility. (It's more general) Bests,
Thank you Amir,
I finally compiled the correct wall shear stress utility successfully, based on the official wallShearStress utility which actually computes wall traction.
In my case error was about 5% between wall shear stress and wall traction.
utility is attached.

Bests
Attached Files
 shear2.tar.gz (10.0 KB, 82 views)
__________________
Learn OpenFOAM in Persian
SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member
Complex Heat & Flow Simulation Research Group
If you can't explain it simply, you don't understand it well enough. "Richard Feynman"

April 6, 2013, 00:03
#55
Member

Ken
Join Date: Aug 2012
Posts: 66
Blog Entries: 1
Rep Power: 12
Quote:
 Originally Posted by Amir Dear Guifan, In many solvers such as FLUENT and OpenFOAM wall traction is considered as wall shear stress and I don't know why! If we assume T as stress tensor and n as unit normal vector of desired face we have: t= T.n ; t= traction (force vector exerted to desired face per unit area); the utility compute this, but we want: shear stress= t - (t.n)n ;which shear stress is tangential vector here. Bests,
Just to clarify, what we are doing to correct the wall shear stress from the wallShearStress utility is to subtract the normal component of the traction vector, otherwise known as the pressure, right?

So if the pressure is relatively low in the system, then the error in using the wallShearStress utility is relatively low; however, if the pressure in the system is high, the error will be greater.

Questions:
1) Am I thinking about this correctly? In my case, the error is far less that 1%, but the pressure is low
2) What is the effect of curved geometry? I don't see why that would affect the normal component of the traction vector...

Last edited by Nucleophobe; April 6, 2013 at 00:20.

April 6, 2013, 07:17
#56
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 21
Quote:
 Originally Posted by Nucleophobe Just to clarify, what we are doing to correct the wall shear stress from the wallShearStress utility is to subtract the normal component of the traction vector, otherwise known as the pressure, right?
No, this is not correct! We are talking about deviation tensor (T) not the whole stress tensor. The pressure is not a part of deviation tensor. The normal component is originated from the strain rate tensor.

Quote:
 Originally Posted by Nucleophobe Questions: What is the effect of curved geometry? I don't see why that would affect the normal component of the traction vector...
In curved surfaces, the normal components are much more considerable because or rotation effects.

Bests,
__________________
Amir

April 10, 2013, 17:16
#57
Member

Ken
Join Date: Aug 2012
Posts: 66
Blog Entries: 1
Rep Power: 12
Quote:
 Originally Posted by Amir The normal component is originated from the strain rate tensor. Bests,
Ah, thank you for the clarification. I'm starting to understand now.

Can we say then that the normal component of t.n is related instead to the gradient of the normal velocity in the normal direction?

For instance, if the surface normal is in the x-direction, we would have:
n = (1, 0, 0)
sigma_ij = 2 * mu * e_ij
sigma_ij . n = 2 * mu * (partial(u,x), 1/2 (partial(v,x) + partial(u,y)), 1/2 (partial(w,x) + partial(u,z)))
(sigma_ij . n)n = 2 * mu * partial(u,x)

where sigma_ij is the deviatoric stress tensor in notation that I'm used to.

Also, is the 't' that we've been referring to simply the Cauchy strain tensor (e_ij)?

April 10, 2013, 17:59
#58
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 21
Quote:
 Originally Posted by Nucleophobe Can we say then that the normal component of t.n is related instead to the gradient of the normal velocity in the normal direction?
Yep, something like that.
Quote:
 Originally Posted by Nucleophobe (sigma_ij . n)n = 2 * mu * partial(u,x)
You have to change it to "(sigma_ij . n).n = 2 * mu * partial(u,x)"
Quote:
 Originally Posted by Nucleophobe Also, is the 't' that we've been referring to simply the Cauchy strain tensor (e_ij)?
No, in your notation it is (sigma.n)!

Bests,
__________________
Amir

April 10, 2013, 18:07
#59
Member

Ken
Join Date: Aug 2012
Posts: 66
Blog Entries: 1
Rep Power: 12
Quote:
 Originally Posted by Amir You have to change it to "(sigma_ij . n).n = 2 * mu * partial(u,x)"
Ah, yes. The normal component is of course a vector. I guess I meant :

(sigma_ij . n)n = (2 * mu * partial(u,x), 0, 0)

Edit: Oops; the above is still wrong!; This should be right:
((sigma_ij.n).n) = magnitude of traction in normal direction (scalar), and
((sigma_ij.n).n)n = (2 * mu * partial(u,x), 0, 0)

Quote:
 No, in your notation it is (sigma.n)!
And here I meant big 'T' not the little 't' for traction.

I guess what I'm asking is this: what is the definition of what you call the "deviation tensor" T? Is it the same as the sigma I defined? So
T = sigma_ij = 2 * mu * e_ij

Or do I error again?

Last edited by Nucleophobe; April 10, 2013 at 18:27.

April 10, 2013, 18:18
#60
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 21
Quote:
 Originally Posted by Nucleophobe T = sigma_ij = 2 * mu * e_ij
Yes, this is correct. It's called the deviation tensor because it causes deviation from the isometric pressure tensor.

Bests,
__________________
Amir