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

Measuring wall shear stress in bend pipe

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

Like Tree38Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 13, 2012, 19:02
Default
  #21
Member
 
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 15
liguifan is on a distinguished road
Can you post your bifurcation geometry as well as how you measure the WSS?



Quote:
Originally Posted by itsme_kit View Post
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
liguifan is offline   Reply With Quote

Old   February 14, 2012, 10:24
Default
  #22
Senior Member
 
Join Date: Jan 2012
Posts: 197
Rep Power: 14
itsme_kit is on a distinguished road
Quote:
Originally Posted by liguifan View Post
Can you post your bifurcation geometry as well as how you measure the WSS?
I uploaded some plots and you can have a look
I'm not sure how to measure WSS
I just created a scalar plot and then selected wall in parts and WSS in function

Appreciate any useful suggestion

Thanks
Attached Images
File Type: jpg 2.jpg (34.6 KB, 207 views)
File Type: jpg 3.jpg (28.5 KB, 202 views)
File Type: jpg 4.jpg (32.2 KB, 191 views)
File Type: jpg 5.jpg (32.3 KB, 164 views)
File Type: jpg 6.jpg (25.6 KB, 179 views)
itsme_kit is offline   Reply With Quote

Old   February 14, 2012, 18:50
Default
  #23
Member
 
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 15
liguifan is on a distinguished road
I think there is tool under filter is plot over intersection curve.
1) In property inspection field, choose the wall object (whoever the name you named it).
2) Use "Clip" to get rid of the part you do not want to measure.
3) Use "Plot over intersection curve" to plot the wall shear stress over the line which is the intersection of a plane and the wall.




Quote:
Originally Posted by itsme_kit View Post
I uploaded some plots and you can have a look
I'm not sure how to measure WSS
I just created a scalar plot and then selected wall in parts and WSS in function

Appreciate any useful suggestion

Thanks
liguifan is offline   Reply With Quote

Old   August 13, 2012, 09:11
Default
  #24
New Member
 
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 13
TianC is on a distinguished road
Hi guys,

Is there any way that you can output the wall shear stress at every calculated time step (to use this as a measure of convergence to a steady state)? I would like to incorporate it into the solver but not quite sure what the script would look like. Any help would be greatly appreciated.

Cheers,

Tian
TianC is offline   Reply With Quote

Old   August 13, 2012, 09:17
Default
  #25
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Hi,

Try this:
solve->monitor->surface .... wall fluxes (wall shear stress)

Bests,
amuzeshi likes this.
__________________
Amir
Amir is offline   Reply With Quote

Old   August 13, 2012, 13:42
Default
  #26
New Member
 
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 13
TianC is on a distinguished road
Quote:
Originally Posted by Amir View Post
Hi,

Try this:
solve->monitor->surface .... wall fluxes (wall shear stress)

Bests,
Sorry, where does this go? In the solver.C file? (I have made a new solver called mypisoFoam) I have been trying to incorporate an average wall shear stress calculator over the top surface of my simulation. I have added this to mypisoFoam.C:

// Print out average wall shear stress over topSurface
// // find the identification number (e.g. label) for our boundary of interest.
label topSurfacePatch = mesh.boundaryMesh().findPatchID("topSurface");
// if we don't have such a patch, warn the user
//
if (topSurfacePatch==-1)
{
Info << "Failure to find patch named topSurface for average wall shear stress calc."
<< endl;
}
else // calculate the result and do output
{
// the sum operator implicity loops over the boundary faces and stores the result in avgWSS

scalar avgWSS = 0.0;
avgWSS = sum(wallShearStress.boundaryField()[topSurfacePatch]);
reduce(avgWSS,sumOp<scalar>());
Info << "Monitor: at Time = " << runTime.timeName() << " -- Average wall shear stress over top surface= " << avgWSS <<" [kg/(m*s^2)] " ;
}

When compiling with wmake, the following message appears:

Making dependency list for source file mypisoFoam1.C
SOURCE=mypisoFoam1.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/turbulenceModels/incompressible/turbulenceModel -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/transportModels -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/transportModels/incompressible/singlePhaseTransportModel -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/finiteVolume/lnInclude -IlnInclude -I. -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/mypisoFoam1.o
mypisoFoam1.C: In function ‘int main(int, char**)’:
mypisoFoam1.C:175: error: ‘wallShearStress’ was not declared in this scope
/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/readPISOControls.H:3: warning: unused variable ‘nOuterCorr’
/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/readPISOControls.H:15: warning: unused variable ‘transonic’
make: *** [Make/linux64GccDPOpt/mypisoFoam1.o] Error 1

The problem appears to be that it can't find wallShearStress as a variable. How do I make it calculate/read this?

Cheers

Tian
TianC is offline   Reply With Quote

Old   August 13, 2012, 14:37
Default
  #27
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Oh, sorry about previous post, that was a forum conflict!
But in openFoam it seems that the original utility compute wall traction instead of wall shear stress and I posted the revised form you can easily embed it in your solver and assess its changing. (note that it's a revised utility now which can be used in this form as a utility or you can put in your desired code with few manipulation)
see the attachment ...
(the error of your code is that you haven't defined wall shear stress yet)
Attached Files
File Type: zip shear.zip (2.2 KB, 158 views)
epi_c likes this.
__________________
Amir
Amir is offline   Reply With Quote

Old   August 13, 2012, 18:04
Default
  #28
New Member
 
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 13
TianC is on a distinguished road
Thanks a lot for your reply Amir. Does the old wallShearStress function not actually give wall shear stress then? In your utility it requires a tau file in the 0 directory and therefore gives the resulting error message:

--> FOAM FATAL IO ERROR:
cannot find file

file: /gpfs/home/eng/mauiie/OpenFOAM/mauiie-2.1.0/run/project/cavity2D/solverTest/0/tau at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting

Is this a file used by the RAS solvers? It appears that this utility is designed for RAS not LES. With the old utility it was possible to make some alterations to the script (mainly changing RAS to LES wherever it occurred) and the utility would just as well with an LES case. Is this possible also with this solver?

Also, how would you embed the function into the solver? Would you simply copy and paste it in? Or would you do something more a long the lines I started with?

Sorry for all the questions, I am a bit new to OpenFOAM. Please bear with me
TianC is offline   Reply With Quote

Old   August 14, 2012, 06:26
Default
  #29
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by TianC View Post
Does the old wallShearStress function not actually give wall shear stress then?
No, as I said it leads to wall traction instead of wall shear stress. (you can easily check the formulation)
Quote:
Originally Posted by TianC View Post
In your utility it requires a tau file in the 0 directory and therefore gives the resulting error message:

--> FOAM FATAL IO ERROR:
cannot find file

file: /gpfs/home/eng/mauiie/OpenFOAM/mauiie-2.1.0/run/project/cavity2D/solverTest/0/tau at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting
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)
Quote:
Originally Posted by TianC View Post
Is this a file used by the RAS solvers? It appears that this utility is designed for RAS not LES. With the old utility it was possible to make some alterations to the script (mainly changing RAS to LES wherever it occurred) and the utility would just as well with an LES case. Is this possible also with this solver?
It's the general from and you can set it for any solver appropriately.
Quote:
Originally Posted by TianC View Post
Also, how would you embed the function into the solver? Would you simply copy and paste it in? Or would you do something more a long the lines I started with?
Sure, I did it for a simple code which uses moving reference frame; but note that according to the code, there must be initializing files additional to the current one in 0 folder where you can change them according to your purpose from IOobject control .... (see the attachment) it's just a template; you can change the IOobject.
Attached Files
File Type: zip test.zip (3.3 KB, 83 views)
Haier and TianC like this.
__________________
Amir
Amir is offline   Reply With Quote

Old   August 15, 2012, 07:23
Default
  #30
New Member
 
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 13
TianC is on a distinguished road
Thank you again for your help so far.

I've managed to incorporate the wall shear stress into my solver now (after some modifications to createFields.H).

Ideally what I want is to output an average of wall shear stress over the top surface of my simulation into a log file (for every deltaT). I have put this script in at the end of my script:

// Print out average wall shear stress over topSurface
// // find the identification number (e.g. label) for our boundary of interest.
label topSurfacePatch = mesh.boundaryMesh().findPatchID("topSurface");
// if we don't have such a patch, warn the user
//

if (topSurfacePatch==-1)
{
Info << "Failure to find patch named topSurface for average wall shear stress calc."
<< endl;
}
else // calculate the result and do output
{
// the sum operator implicity loops over the boundary faces and stores the result in avgWSS

scalar avgWSS = 0.0;
avgWSS = sum(mag(shear.boundaryField()[topSurfacePatch]));
reduce(avgWSS,sumOp<scalar>());
Info << "Monitor: at Time = " << runTime.timeName() << " -- Average wall shear stress over top surface= " << avgWSS <<" [kg/(m*s^2)] " ;
}

It is now outputting the sum of over all of that patch. The only thing I need to know is how to say divide by the total number of points on that face??(this is because I need the average not the sum)

Cheers

Tian
TianC is offline   Reply With Quote

Old   August 15, 2012, 07:31
Default
  #31
New Member
 
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 13
TianC is on a distinguished road
Also, the script that gives a line break would be very useful
TianC is offline   Reply With Quote

Old   August 15, 2012, 08:55
Default
  #32
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by TianC View Post
It is now outputting the sum of over all of that patch. The only thing I need to know is how to say divide by the total number of points on that face??(this is because I need the average not the sum)
Have you taken a look over patchAverage utility? (postProcessing->patch->patchAverage)
As you can see; you'll need to compute patch area there (not the numbers!):

scalar area = gSum(mesh.magSf().boundaryField()[patchI]);

Quote:
Originally Posted by TianC View Post
Also, the script that gives a line break would be very useful
use endl (see the above utility (patchAverage))

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   August 15, 2012, 09:53
Default
  #33
New Member
 
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 13
TianC is on a distinguished road
Quote:
Originally Posted by Amir View Post
Have you taken a look over patchAverage utility? (postProcessing->patch->patchAverage)
As you can see; you'll need to compute patch area there (not the numbers!):

scalar area = gSum(mesh.magSf().boundaryField()[patchI]);
Thank you again Amir, your help is greatly appreciated.

Why should it be over the patch area rather than the number of points on that patch? Since the shear utility outputs a vector at every point on the patch, surely the more points you have (i.e. a finer resolution of mesh) the greater the sum of these vectors will be. So it is by dividing by the number of points that you would achieve the average.

Cheers,

Tian
TianC is offline   Reply With Quote

Old   August 15, 2012, 10:47
Default
  #34
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by TianC View Post
Why should it be over the patch area rather than the number of points on that patch? Since the shear utility outputs a vector at every point on the patch, surely the more points you have (i.e. a finer resolution of mesh) the greater the sum of these vectors will be. So it is by dividing by the number of points that you would achieve the average.
The resolution is not the concern but the mesh grading is. If you have equal-size faces, you'll achieve the same result. But generally, your formulation doesn't lead to the average value physically because it doesn't contribute the weighting! these are the formulations:
- your formulation: (1/N)*sum(shear)
- The correct formulation: (1/area)*sum(shear*area)

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   August 15, 2012, 11:25
Default
  #35
New Member
 
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 13
TianC is on a distinguished road
Ah, I see... I did not realise the calculated values were weighted by the size of the cells!

Looking over the script I have an understanding of all aspects except, why do you write this:
volTensorField T=mu*(gradU+gradU.T());

T you say is the stress tensor which is the Jacobian of the velocity (i.e. gradU) and I assume you multiply by mu because it's as good a stage as any to do so. However, why the "+gradU.T()"?

Cheers

Tian
TianC is offline   Reply With Quote

Old   August 15, 2012, 14:43
Default
  #36
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
Amir is on a distinguished road
Quote:
Originally Posted by TianC View Post
T you say is the stress tensor which is the Jacobian of the velocity (i.e. gradU) and I assume you multiply by mu because it's as good a stage as any to do so. However, why the "+gradU.T()"?
Tian
Because it's the constitutive equation! Take a look over basic fluid mechanic equation in a continuum media.
(T=2*mu*D) for incompressible flow
D : symmetric part of grad(U)

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   August 26, 2012, 05:02
Default
  #37
New Member
 
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 13
TianC is on a distinguished road
Hi again!

I seem to be getting far too high values out for wall shear stress. I have implemented a monitor in my solver, so that it outputs average wall shear stress over the top surface of my simulation. The code looks as follows:

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];
}

// Print out average wall shear stress over topSurface
// find the identification number (e.g. label) for our boundary of interest.
label topSurfacePatch = mesh.boundaryMesh().findPatchID("topSurface");
// if we don't have such a patch, warn the user


if (topSurfacePatch==-1)
{
Info << "Failure to find patch named topSurface for average wall shear stress calc."
<< endl;
}
else // calculate the result and do output
{
// the sum operator implicity loops over the boundary faces and stores the result in avgWSS

scalar area = gSum(mesh.magSf().boundaryField()[topSurfacePatch]);
scalar avgWSS = gSum(mag(shear.boundaryField()[topSurfacePatch]))/area;
// reduce(avgWSS,sumOp<scalar>());
Info << "Monitor: at Time = " << runTime.timeName() << " -- Average wall shear stress over top surface= " << avgWSS <<" [kg/(m*s^2)] " << "Area = " << area << " [m^2] ";
}

The values I am getting out are far too high for my simulation, for example average wall shear stress of 40 where mean velocity is magnitude 1. I have searched through the code trying to work out where the issue is occurring. Do you have any suggestions please?

Cheers,

Tian
TianC is offline   Reply With Quote

Old   August 26, 2012, 05:21
Default
  #38
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Tian,

I think (am certain) that the error is in the following line:

Code:
scalar avgWSS = gSum(mag(shear.boundaryField()[topSurfacePatch]))/area;
where, if you want a area weighted average, you should do

Code:
scalar avgWSS = gSum(mag(shear.boundaryField()[topSurfacePatch]) * mesh.magSf().boundaryField()[topSurfacePatch])/area;
Kind regards,

Niels
TianC likes this.
ngj is offline   Reply With Quote

Old   August 26, 2012, 05:40
Default
  #39
New Member
 
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 13
TianC is on a distinguished road
Ahhh... That is so much better.

Thank you Niels you're a life saver!

Tian
TianC is offline   Reply With Quote

Old   August 26, 2012, 05:47
Default
  #40
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
No problem.

BTW: In stead of making the stress tensor yourself, you could benefit from the turbulence model by calling devReff(). The only thing to remember is that this tensor is also non-tangential with the wall, so you have to perform the same projection (as you already do) onto the boundary face.

The upside of using the turbulence model is that you do not have to implement turbulence model specific shear stress methods, because the turbulence model itself tells, how the shear stress is defined.

/ Niels
ngj is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32
2D wall shear stress yossarian88 STAR-CCM+ 0 February 21, 2011 13:12
relationship between wall shear stress and TKE winter FLUENT 0 December 11, 2007 17:11
Macro to set Wall Shear Stress Satish FLUENT 4 November 26, 2003 14:46
WALL SHEAR STRESS Min-Hua Wang CFX 0 April 3, 2002 17:40


All times are GMT -4. The time now is 11:27.