CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Measuring wall shear stress in bend pipe (http://www.cfd-online.com/Forums/openfoam/92507-measuring-wall-shear-stress-bend-pipe.html)

 liguifan September 16, 2011 00:43

Measuring wall shear stress in bend pipe

My geometry is a bifurcation and on of the vessel is bent. I want to measure the wall shear stress along the bent vessel. The wall shear stress is already calculated. I only find a way to measure the wall shear stress along the straight pipe but no idea how to do it in bent pipe.

Cheers!

 Bernhard September 16, 2011 01:40

You can use the utility wallShearStress.

 liguifan September 16, 2011 01:46

Quote:
 Originally Posted by Bernhard (Post 324339) You can use the utility wallShearStress.
Hi Bernhard,

I think wallShearStress utility is for turbulent flow. My case is laminar flow and I want to plot the wall shear stress along the pipe. My code is to find laminar flow but don't know how to measure it.

Thanks for the hind anyway.

 Bernhard September 16, 2011 02:06

Of course you can still use that utility. I suppose it reads turbulenceProperties or RASProperties. You set it to laminar there. Otherwise you make your own version of the wallShearStress utility and update it for laminar flow. I think the first method will work, since the RASModels have a dummy laminar model included.

 Amir September 16, 2011 02:38

Quote:
 Originally Posted by Bernhard (Post 324339) You can use the utility wallShearStress.
Dear Bernhard,
I think this utility needs some modifications because it computes wall traction instead of wall shear stress, right?

 liguifan September 16, 2011 03:55

Quote:
 Originally Posted by Amir (Post 324342) Dear Bernhard, I think this utility needs some modifications because it computes wall traction instead of wall shear stress, right?
Hi Amir,

What modification have you done to measure the wall shear stress ?

Thanks

 liguifan September 16, 2011 03:59

Quote:
 Originally Posted by Bernhard (Post 324341) Of course you can still use that utility. I suppose it reads turbulenceProperties or RASProperties. You set it to laminar there. Otherwise you make your own version of the wallShearStress utility and update it for laminar flow. I think the first method will work, since the RASModels have a dummy laminar model included.
Hi Bernhard,

I will try it later today. However, i still don't understand how to plot wall shear stress along a bent pipe.

Have you got any idea for that?

Thanks

 Amir September 16, 2011 05:08

Quote:
 Originally Posted by liguifan (Post 324358) Hi Amir, What modification have you done to measure the wall shear stress ? Thanks
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,

 liguifan September 16, 2011 23:30

Can any one tell me the difference between wallShearStress and the definition?

For newtonian flow the wall shear stress is defined as mu*du/dy which is proportional to the normal velocity gradient to the wall
But in wallShearStress it is defined:
wallShearStress.boundaryField()[patchi] =
(
-mesh.Sf().boundaryField()[patchi]
/mesh.magSf().boundaryField()[patchi]
) & Reff.boundaryField()[patchi]; -- What does this code mean? why it calculated wall shear stress ?

The velocity gradient is defined as
-U.boundaryField()[patchi].snGrad(); -- This makes sense to me.
And mu*wallGradU is the definition one.

Can anyone explain?

 liguifan September 16, 2011 23:36

Quote:
 Originally Posted by Amir (Post 324369) 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,
Dear Amir,

To my knowledge, the wall shear stress is mu*velocity gradient. In the code of wallShearStress:
-mesh.Sf().boundaryField()[patchi]
/mesh.magSf().boundaryField()[patchi]
Do you mean this is the T(stress tensor)?

Why the say shear stress = t-(t.n)n ? If T is the shear tensor, isn't T's normal component T.n already the shear stress?

I am confused here.

 Amir September 17, 2011 07:37

Quote:
 Originally Posted by liguifan (Post 324480) Dear Amir, Thanks for your reply. To my knowledge, the wall shear stress is mu*velocity gradient. In the code of wallShearStress: -mesh.Sf().boundaryField()[patchi] /mesh.magSf().boundaryField()[patchi] Do you mean this is the T(stress tensor)? Why the say shear stress = t-(t.n)n ? If T is the shear tensor, isn't T's normal component T.n already the shear stress? I am confused here.
Dear Guifan,

T is stress tensor and n is unit normal vector, according to openFOAM definitions:
Code:

n=-mesh.Sf().boundaryField()[patchi] / mesh.magSf().boundaryField()[patchi]
and,
Code:

T=Reff.boundaryField()[patchi]
so t=T.n is:
Code:

            wallShearStress.boundaryField()[patchi] =             (                 -mesh.Sf().boundaryField()[patchi]                 /mesh.magSf().boundaryField()[patchi]             ) & Reff.boundaryField()[patchi];
it's traction definition not shear force. in other words, it contains normal component, so I proposed:
Code:

shear stress= t - (t.n)n
Bests,

 liguifan September 18, 2011 08:21

Quote:
 Originally Posted by Amir (Post 324505) Dear Guifan, T is stress tensor and n is unit normal vector, according to openFOAM definitions: Code: n=-mesh.Sf().boundaryField()[patchi] / mesh.magSf().boundaryField()[patchi] and, Code: T=Reff.boundaryField()[patchi] so t=T.n is: Code:             wallShearStress.boundaryField()[patchi] =             (                 -mesh.Sf().boundaryField()[patchi]                 /mesh.magSf().boundaryField()[patchi]             ) & Reff.boundaryField()[patchi]; it's traction definition not shear force. in other words, it contains normal component, so I proposed: Code: shear stress= t - (t.n)n Bests,
Dear Amir,

I found that the tangetient component of traction tensor is t-(t.n)n as you decribed.

For the code stuff:
Is this the right thing:
forAll(real_wall_shear_stress.boundaryField(),patc hi)
{
wallShearStress.boundaryField()[patchi] =
(
-mesh.Sf().boundaryField()[patchi]
/mesh.magSf().boundaryField()[patchi]
) & Reff.boundaryField()[patchi];[/CODE]
real_wall_shear_stress.boundaryField()[patchi]= wallShearStress-(wallShearStress&(mesh.Sf().boundaryField()[patchi] /mesh.magSf().boundaryField()[patchi]))&(mesh.Sf().boundaryField()[patchi]/mesh.magSf().boundaryField()[patchi])
}
the right results since mesh.Sf().boundaryField()[patchi] /mesh.magSf().boundaryField()[patchi] is the "n"

Please let me know if there is something wrong.

Btw, why the tangential component of t is not t&n but t-(t&n)&n ?

Thanks again!

 Amir September 18, 2011 08:42

Quote:
 Originally Posted by liguifan (Post 324553) Dear Amir, Thanks for the reply. I found that the tangetient component of traction tensor is t-(t.n)n as you decribed. For the code stuff: Is this the right thing: forAll(real_wall_shear_stress.boundaryField(),patc hi) { wallShearStress.boundaryField()[patchi] = ( -mesh.Sf().boundaryField()[patchi] /mesh.magSf().boundaryField()[patchi] ) & Reff.boundaryField()[patchi];[/CODE] real_wall_shear_stress.boundaryField()[patchi]= wallShearStress-(wallShearStress&(mesh.Sf().boundaryField()[patchi] /mesh.magSf().boundaryField()[patchi]))&(mesh.Sf().boundaryField()[patchi]/mesh.magSf().boundaryField()[patchi]) } the right results since mesh.Sf().boundaryField()[patchi] /mesh.magSf().boundaryField()[patchi] is the "n" Please let me know if there is something wrong. Btw, why the tangential component of t is not t&n but t-(t&n)&n ? Thanks again!
There are few errors in this part of code:
First of all: I'm not sure that inner product is overloaded for 2 variables which one of them is scalar and another is vector, so it's better to use:
Code:

t-(t&n)n
As you know, t&n retrieves projection of vector t on normal vector n, so the tangential component would be
Code:

t-(t&n)n
Another tip; OpenFOAM can not compile such successive terms (as I know; because I'm new in developing); I developed a code for that which may help (it's not the best one as I said before):
Code:

                  volTensorField gradU=fvc::grad(U);                   volTensorField T=mu*(gradU+gradU.T());                   volVectorField nn             (                 IOobject                 (                     "nn",                     runTime.timeName(),                     mesh,                     IOobject::NO_READ,                     IOobject::NO_WRITE                 ),                           mesh,                           vector::zero             );         forAll(nn.boundaryField(), patchI)         {             nn.boundaryField()[patchI] =             (                 -mesh.Sf().boundaryField()[patchI]                 /mesh.magSf().boundaryField()[patchI]             );         }                                   forAll(wallShearStress.boundaryField(), patchI)         {             wallShearStress.boundaryField()[patchI] =               nn.boundaryField()[patchI] & T.boundaryField()[patchI];         }                           forAll(normal.boundaryField(), patchI)         {             normal.boundaryField()[patchI] =                                   (nn.boundaryField()[patchI] & wallShearStress.boundaryField()[patchI])                                   *nn.boundaryField()[patchI];         }                 forAll(shear.boundaryField(), patchI)         {                           shear.boundaryField()[patchI] =                           wallShearStress.boundaryField()[patchI]-normal.boundaryField()[patchI];         }
Here, shear variable is what you need and wallShearStress is previous definition.
Obviously, you can change some part to use other stress tensor objects.

Bests,

 liguifan September 19, 2011 19:23

Quote:
 Originally Posted by Amir (Post 324555) There are few errors in this part of code: First of all: I'm not sure that inner product is overloaded for 2 variables which one of them is scalar and another is vector, so it's better to use: Code: t-(t&n)n As you know, t&n retrieves projection of vector t on normal vector n, so the tangential component would be Code: t-(t&n)n Another tip; OpenFOAM can not compile such successive terms (as I know; because I'm new in developing); I developed a code for that which may help (it's not the best one as I said before): Code:                   volTensorField gradU=fvc::grad(U);                   volTensorField T=mu*(gradU+gradU.T());                   volVectorField nn             (                 IOobject                 (                     "nn",                     runTime.timeName(),                     mesh,                     IOobject::NO_READ,                     IOobject::NO_WRITE                 ),                           mesh,                           vector::zero             );         forAll(nn.boundaryField(), patchI)         {             nn.boundaryField()[patchI] =             (                 -mesh.Sf().boundaryField()[patchI]                 /mesh.magSf().boundaryField()[patchI]             );         }                                   forAll(wallShearStress.boundaryField(), patchI)         {             wallShearStress.boundaryField()[patchI] =               nn.boundaryField()[patchI] & T.boundaryField()[patchI];         }                           forAll(normal.boundaryField(), patchI)         {             normal.boundaryField()[patchI] =                                   (nn.boundaryField()[patchI] & wallShearStress.boundaryField()[patchI])                                   *nn.boundaryField()[patchI];         }                 forAll(shear.boundaryField(), patchI)         {                           shear.boundaryField()[patchI] =                           wallShearStress.boundaryField()[patchI]-normal.boundaryField()[patchI];         } Here, shear variable is what you need and wallShearStress is previous definition. Obviously, you can change some part to use other stress tensor objects. Bests,
Dear Amir,

Thanks for the correction.

This code works however the results are a little bit different from it should be in my case. After a little bit research. I found that the definition of Shear tensor is T=2*mu*(gamma_hat)*D where D=1/2(gradU+gradU.T()).
gamma_hat is shear rate. For newtonian case , mu is independent of gamma_hat, for non-Newtonian case, mu is a function of gamma_hat.

In your code, I found "volTensorField T=mu*(gradU+gradU.T())" and there is a difference in gamma_hat(shear rate) term. Did you miss it or I did something wrong( please correct me if I am wrong).

Cheers!

 Amir September 19, 2011 22:14

Quote:
 Originally Posted by liguifan (Post 324767) Dear Amir, Thanks for the correction. This code works however the results are a little bit different from it should be in my case. After a little bit research. I found that the definition of Shear tensor is T=2*mu*(gamma_hat)*D where D=1/2(gradU+gradU.T()). gamma_hat is shear rate. For newtonian case , mu is independent of gamma_hat, for non-Newtonian case, mu is a function of gamma_hat. gamma_hat=sqrt(2.0)*mag(symm(gradU)) for Newtonian case. In your code, I found "volTensorField T=mu*(gradU+gradU.T())" and there is a difference in gamma_hat(shear rate) term. Did you miss it or I did something wrong( please correct me if I am wrong). Cheers!
Dear Guifan,

Your definition is wrong; here, viscosity is a function of shear rate, it's not a multiplication term! :eek:

The differences maybe due to coarse grid near boundaries or schemes for gradients.

Bests,

 liguifan September 19, 2011 22:28

Quote:
 Originally Posted by Amir (Post 324775) Dear Guifan, Your definition is wrong; here, viscosity is a function of shear rate, it's not a multiplication term! :eek: The differences maybe due to coarse grid near boundaries or schemes for gradients. Bests,
Dear Amir,

Thanks for the correction. I misunderstood the definition.

I try to finer my mesh and see what happened next.

Regards

 liguifan September 23, 2011 06:06

Dear Amir,

I tried and your code to get some wall shear stress plots.

In published paper, they normally define wall shear stress as the way you did.

After some comparison, I found that my wall shear stress is quite low than what they did on paper. There are still more than 20% difference between my plots and their plots after I multiple a factor to my plots.

Have you got any experience with these kind of problem? I am stuck with it for quite a while.

From the other method:The plots are totally different. Do you have any idea with this?

Any idea would be appreciated:)

Thanks

 lintao September 23, 2011 09:07

thx u very much. it helps a lot.

 Amir September 23, 2011 09:15

Quote:
 Originally Posted by liguifan (Post 325343) Dear Amir, I tried and your code to get some wall shear stress plots. In published paper, they normally define wall shear stress as the way you did. After some comparison, I found that my wall shear stress is quite low than what they did on paper. There are still more than 20% difference between my plots and their plots after I multiple a factor to my plots. Have you got any experience with these kind of problem? I am stuck with it for quite a while. From the other method:The plots are totally different. Do you have any idea with this? Any idea would be appreciated:) Thanks
Dear Guifan,

First of all, note that this relation for shear stress we discussed about is valid just for incompressible flow; for compressible cases, another term should be added.
As you know, in many papers, wall traction is reported instead of wall shear stress, so I suggest you check OpenFOAM utility without changes and see what will happen.
Ensure you have reached grid independence solution by examining wall shear stress of boundaries.
Another suggestion; there is another utility for evaluating velocity gradient @ boundaries (wallGradU), obviously it can compute grad(U) more precisely which you can also use that in your code.
Also try high order schemes for gradient and others.

Bests,

 itsme_kit February 13, 2012 10:26

Quote:
 Originally Posted by liguifan (Post 324337) My geometry is a bifurcation and on of the vessel is bent. I want to measure the wall shear stress along the bent vessel. The wall shear stress is already calculated. I only find a way to measure the wall shear stress along the straight pipe but no idea how to do it in bent pipe. Any hind would be helpful. Cheers!
Hi
Can you tell me how to measure the wall shear stress?
I'm confused why my wall shear stress is zero and only a tiny part in inlet is non-zero
I am modelling a 3D laminar straight pipe flow by using star ccm

All times are GMT -4. The time now is 21:30.