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

Compute shear stress interFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree46Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2015, 19:02
Default compute shear strees
  #41
New Member
 
jafar
Join Date: Jul 2014
Posts: 16
Rep Power: 11
bagherij is on a distinguished road
Dear all
I am beginner in openfoam, i am working on creeping flow around cylinder between two plate, how can i compute shear stress, tau, (and compare with yield stress tau0) ?
which and where should i add line code?

i want to display the points where tau>tau0 ,how can i display that?

Best regards
Jafar
bagherij is offline   Reply With Quote

Old   June 17, 2015, 06:42
Default compute shear stress in interfoam
  #42
New Member
 
arash
Join Date: Jan 2015
Posts: 14
Rep Power: 11
arash.heidarian is on a distinguished road
Hi fomers..:
I have completed a case with interfoam and I am interested in adding shear stress to my output files.
I checked the last posts but i didn't figure out where to add this equation in my solver.
volScalarField shearRate = mag(fvc::grad(U));
I would be really thanks full if any one help!
arash.heidarian is offline   Reply With Quote

Old   June 17, 2015, 07:39
Default
  #43
Member
 
David GISEN
Join Date: Jul 2009
Location: Germany
Posts: 68
Rep Power: 16
David* is on a distinguished road
Hi bagherij and arash.heidarian,

I would recommend to you to perform this calculations with the ParaView calculator, as it is easier for the start.

If you still want to compute the shear stress on-the-fly within OpenFOAM, I'd suggest you to look at the coded function object, which you can include in your controlDict, see: http://www.openfoam.org/version2.0.0...me-control.php

Best regards,
David
David* is offline   Reply With Quote

Old   April 15, 2016, 03:41
Default
  #44
New Member
 
Stefan
Join Date: Oct 2015
Posts: 24
Rep Power: 10
StefanW is on a distinguished road
Hi guys,

i just created a similar thread according the topic:
calculation of wall shear stresses in multiphase depending on mesh size?

http://www.cfd-online.com/Forums/ope...tml#post595106

Maybe it is also interesting for you and you can help me to solve the problems

Thank you in advance

Stefan
StefanW is offline   Reply With Quote

Old   April 19, 2016, 04:19
Default calcFvcGrad - U - shear stress profile
  #45
Senior Member
 
Ananthakrishnan.A.S
Join Date: Feb 2012
Location: Mumbai (Bombay), India
Posts: 157
Rep Power: 16
Ananthakrishnan is on a distinguished road
Send a message via Skype™ to Ananthakrishnan
Hi,

I am trying to get the shear stress profile in a cross section using stress = mu * (du/dr). Solver used is simpleFoam.

I used the readymade tool " calcFvcGrad " on the U field which gave me 8 velocity gradients!!! But the shear stress reproduced using one of the U fields matches at the wall with the value given by "wallShearStress" tool.

My doubt is what are the 8 gradients referring to. Also please let me know if the method i followed to obtain shear stress is flawed in any manner.

I have attached the file generated by calcFvcGrad (I have added shear stress calculation in the same file)

My geometry is a concentric annulus as show below in which i need the shear stress profile in a cross section.



Thanks a lot
Regards
AK
Attached Files
File Type: xlsx Ug0.xlsx (13.6 KB, 25 views)
Ananthakrishnan is offline   Reply With Quote

Old   January 24, 2017, 02:29
Default
  #46
Senior Member
 
A. Min
Join Date: Mar 2015
Posts: 305
Rep Power: 12
alimea is on a distinguished road
Quote:
Originally Posted by hartinger View Post
Hi Giovanni,

the stuff i posted wasn't correct, do it like that:

volTensorField gradU = fvc::grad(U);

// stress tensor
volTensorField tau =
- mu * (gradU + gradU.T());

Excuse me,
what's the meaning of "gradU.T()" in mathematics? is it inner product of gradU and T tensor?
could you plz introduce me a source to give me a list of definition of these type of programing?
alimea is offline   Reply With Quote

Old   January 24, 2017, 03:08
Default
  #47
Member
 
David GISEN
Join Date: Jul 2009
Location: Germany
Posts: 68
Rep Power: 16
David* is on a distinguished road
Quote:
Originally Posted by alimea View Post
Excuse me,
what's the meaning of "gradU.T()" in mathematics? is it inner product of gradU and T tensor?
could you plz introduce me a source to give me a list of definition of these type of programing?
It is the Transpose of gradU according to the OF Programmer's Guide, see https://openfoamwiki.net/index.php/O...s_Guide_Errata
David* is offline   Reply With Quote

Old   January 24, 2017, 03:12
Default
  #48
Senior Member
 
A. Min
Join Date: Mar 2015
Posts: 305
Rep Power: 12
alimea is on a distinguished road
Quote:
Originally Posted by David* View Post
It is the Transpose of gradU according to the OF Programmer's Guide, see https://openfoamwiki.net/index.php/O...s_Guide_Errata
Thank you
But there was not operation on tensors. e.g. inner product, outer ,...

Regards
alimea is offline   Reply With Quote

Old   February 13, 2017, 02:04
Default
  #49
Member
 
Emery
Join Date: Feb 2017
Location: France.
Posts: 33
Rep Power: 9
TemC is on a distinguished road
Hi experts,

I am working with simpleFoam, with which I simulated the flow of an Hershel-Bulkley fluid. Now I wan to compute the shear strain rate. On this forum you suggested to do that this way:

volTensorField gradU = fvc::grad(U);

// stress tensor
volTensorField tau =
- mu * (gradU + gradU.T());

I'am a new foamer, so my question might seem stupid to you, but I really have to ask. Those preceeding equations, should I put them in my simpleFoam.C file? Or in my createField.H file?

Because when I put them into my createField.H file like in the attachment, I got an error saying : 'grad' was not declared in the scope of volTensorField gradU (tau).

The second question is should I initialize those tensor fields? With a command like:

dimensionedTensor("tau",dimensionset(...), tensor(...))


I hope you will find a couple of minutes to answer me. Thanks in advance.

Best regards.
Attached Images
File Type: png simpleFoam.PNG (36.0 KB, 201 views)
TemC is offline   Reply With Quote

Old   February 14, 2017, 08:05
Default
  #50
Member
 
Join Date: Jun 2016
Posts: 31
Rep Power: 9
tdof is on a distinguished road
Hi,

I can't help you with your question unfortunately, because I face a similar problem. I want to get the shear rate and possibly the shear rate dependent viscosity for non-Newtonian fluids, but I don't know where to put the lines of code you referred to. A little bit of help would be great.

Edit: Alright, I just found out that ParaView displays the viscosity nu, but Hyperview won't do it just as easily. Does anybody know how to get OpenFOAM to output the needed values?
tdof is offline   Reply With Quote

Old   March 3, 2017, 03:45
Default
  #51
Member
 
Emery
Join Date: Feb 2017
Location: France.
Posts: 33
Rep Power: 9
TemC is on a distinguished road
Hi "tdof",

Nonetheless thank you for you answer .

Have a good week.
TemC is offline   Reply With Quote

Old   March 13, 2017, 13:26
Default
  #52
New Member
 
Join Date: Oct 2016
Posts: 22
Rep Power: 9
Mahe88 is on a distinguished road
Hello,

I also have a question regarding wall shear stress for which I haven't found the answer yet. I am simulation airfoils and need the wall shear stress to identify the regions of detached flow.

I use the postProcessing Utility to compute the wall shear stress, however I am not quite sure in which coordinate system OpenFOAM gives me the values. Is it the local one from my blockMesh or is it the global one?

My flow direction is the x-Direction, y-Direction is upwards and z-Direction is empty since this is a 2D case. When I compute the wall shear stress OpenFoam gives me values for 0 and 1 direction. So far it makes for both the local and global coordinate system.
However the 0 value is almost always negative, which doesn't make sense for the global coordinate system. ( Flow on the airfoils surface would be against the flow direction)

Therefor I think wall shear stress is in the local coordinate system. can somebody confirm this please?

thanks!
Mahe88 is offline   Reply With Quote

Old   March 14, 2017, 02:52
Default
  #53
Member
 
David GISEN
Join Date: Jul 2009
Location: Germany
Posts: 68
Rep Power: 16
David* is on a distinguished road
I don't have the answer, just in case you have no starting point:
Try to understand this line
Code:
 ssp = (-Sfp/magSfp) & Reffp;
from https://github.com/OpenFOAM/OpenFOAM...lShearStress.C

using the OF Programmer's Guide.
David* is offline   Reply With Quote

Old   April 29, 2017, 18:40
Default
  #54
Member
 
Amir
Join Date: Jan 2017
Posts: 32
Rep Power: 9
albet is on a distinguished road
Hello,

I used interFoam to solve a two-phase flow, and I want to use the wallShearStress utility, but it works only for single-phase flow.
Could anybody help me how I can change the wallShearStress to be applicable for two-phase flow?

Regards,
Amir
albet is offline   Reply With Quote

Old   July 19, 2018, 11:28
Default
  #55
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 10
randolph is on a distinguished road
Quote:
Originally Posted by philippose View Post
Hi,
I just happened to browse through this dialogue regarding calculating wall shear stresses.

In the simple case, if you take laminar flow, the wall shear stress is calculated using the equation:

Tau (shear stress) = mu * (dU/dy)

In this equation, "mu" is the dynamic viscosity of the medium, and "(dU/dy)" is the change in velocity "U" with change in "y", which is the distance from the wall in a direction normal to the wall.

Now, in the case of incompressible solvers in openFOAM, the whole system is normalised with respect to the fluid density "rho".... so in this case, the dynamic viscosity (mu) is given by:

mu = nu * rho

Where "nu" is the kinematic viscosity, defined in the "transportProperties" dictionary, and "rho" would depend on the fluid you are working with.

Now, to implement this in openFOAM, there exists a class member called "snGrad". This directly gives you the gradient of velocity (dU/dy) normal to each face of the wall patches.

So, you would use:

wallShear = nu * rho * mesh.boundaryField()[patchID].snGrad()

This directly gives you the wall shear stress (assuming the "patchID" refers to a wall patch ofcourse). Here, you can read "nu" from the transportProperties dictionary, and you will have to define "rho" somewhere.

When the case is not laminar, but turbulent, then things look a bit different, which is why you may have gotten confused when you looked through the wallShearStress source-code.

In this case, the Reynolds Stress Tensor gives you the shear stress, but not necessarily normal to the face, and you need to resolve the tensor along the normal to the face in order to obtain the wall shear stress.

This is because in the case of turbulent simulations, the viscosity is not a constant, and is an effective value which is a result of the turbulence model, and the Reynolds Stress Tensor.

So, to calculate the wall shear stress in the case of a turbulent simulation, you need to do something like:

wallShear = (-mesh.Sf().boundaryField()[patchID]/(mag(mesh.Sf().boundaryField()[patchID])) ) & (turbulence->R()().boundaryField()[patchID])

The above equation will give you the wall shear stress with the velocity gradient resolved in the direction normal to each face in the patch.

Have a nice day!

Philippose
I think devReff()() should be used instead of R()()
randolph is offline   Reply With Quote

Old   October 11, 2018, 23:02
Smile hei
  #56
New Member
 
Li Yuanyuan
Join Date: Oct 2018
Posts: 2
Rep Power: 0
Miss Li is on a distinguished road
Quote:
Originally Posted by sven View Post
Hello,

in this thread you it is often mentioned to use something like "U.boundaryField()[patchi].snGrad()" to calculate a gradient. How do I do this? is this a command for bash or what do I have to do to use this function for calculating a gradient??
sorry,I want to look for problems that have been solved on CFD Online before, can you tell me how to search quickly.
thank you!
Miss Li is offline   Reply With Quote

Old   December 19, 2018, 12:14
Default
  #57
Member
 
Amir
Join Date: Jan 2017
Posts: 32
Rep Power: 9
albet is on a distinguished road
Quote:
Originally Posted by randolph View Post
I think devReff()() should be used instead of R()()
You are right.

Code:
wallShear = (-mesh.Sf().boundaryField()[patchID]/(mag(mesh.Sf().boundaryField()[patchID])) ) & (turbulence->devReff()().boundaryField()[patchID])
I checked it. This piece of code gives the values equal to wallShearStress utility.

Kind regards,
Amir
AUbuntu likes this.
albet is offline   Reply With Quote

Old   November 5, 2019, 09:56
Default
  #58
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 157
Rep Power: 7
calf.Z is on a distinguished road
Quote:
Originally Posted by David* View Post
Hi bagherij and arash.heidarian,

I would recommend to you to perform this calculations with the ParaView calculator, as it is easier for the start.

If you still want to compute the shear stress on-the-fly within OpenFOAM, I'd suggest you to look at the coded function object, which you can include in your controlDict, see: http://www.openfoam.org/version2.0.0...me-control.php

Best regards,
David
I am wondering how I can use paraview to calculate wallShearStress, thank you.
calf.Z is offline   Reply With Quote

Old   June 20, 2022, 04:15
Default
  #59
Lil
New Member
 
Lila
Join Date: Nov 2019
Posts: 7
Rep Power: 6
Lil is on a distinguished road
Hello,

I know that is an old post but i'm facing the same problem. Can anayone tell me when I can implement the wall shear stress equation in openfoam (.C or .H?)
Lil is offline   Reply With Quote

Reply


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
Interfoam Droplet under shear test case adona058 OpenFOAM Running, Solving & CFD 3 May 3, 2010 18:46
shear stress a.abbaspour FLUENT 3 March 23, 2010 09:50
Shear Stress Thomas FLUENT 0 January 13, 2008 15:10
About shear stress, need help!! Dong Wenchao FLUENT 1 August 23, 2006 07:38
Shear Stress RK CFX 0 January 24, 2005 07:11


All times are GMT -4. The time now is 18:17.