CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Compute shear stress interFoam (https://www.cfd-online.com/Forums/openfoam-post-processing/61393-compute-shear-stress-interfoam.html)

idrama March 26, 2010 06:56

Hey Foamers,

does anybody know a book or paper where the formula in wallShearStress.C is mathematically derived? I need something which I can cite it in my scientific work (I must guarantee that it work).

Furthermore, does anybody know a justifaction that I can use this formular even for two-phase flows, especally, in VOF?

Cheers in advanced!

idrama April 15, 2010 03:46

Hey folks!

I have used interFoam with an k-e-model. I modified wallShearStress.C that the material property directory is reading correctly. Now I need to know if the formular is still valid.

cheers

andboje April 16, 2010 06:53

Hi
I am trying to implement calculations of the shear stress in an interFoam case, simulating injection moulding.
I have been looking at the threads on this forum trying to figure out how to do this. In this thread it seems that something similar is done, but being new to the world of OpenFOAM I am looking for some more basic instructions.
Where do I implement the c++ code? Do I have to create new files or modify existing ones?
If someone has done shear stress implementation, I would much appreciate some help. For instance if you have a case where this is done I could take a look at, not nessesarily interFOAM. The same goes for the wallShearStress utility.

Best Regards
Anders

Daniele111 June 8, 2010 17:20

Hi
In Ras turbolent model, if i use wallShearStress tool, the result is normalised?

Best regards

idrama June 9, 2010 02:08

What you mean by "normelised"? If you mean that the calculated vectors have the length one, then No :eek: !. The vectors are actually tensor of rank 1, i.e. the vectors points in the direction to where forces acts and the magnitude of them are force acting.

Cheers

Daniele111 June 9, 2010 07:56

No, i would know if is there rho or not in the result

Best regards

Daniele111 June 25, 2010 07:00

Hi
How can I calulate the wallShearStress runtime?
Thanks

Daniele111 June 25, 2010 09:04

Can I use sampleDict to sample wallShearStress on bottom? I do:
1)blockMesh
2)simpleFoam
3)wallShearStress
4)sample -latestTime

but in my set directory output file of whall shear stress is 0 everywhere...

Peter85 September 16, 2010 16:22

Hi@all,

this week, I simulated a channel flow using rhoSimpleFoam with k-Omega-SST-Modell. To validate the results, I need to calculate the friction coefficient cf(Tau_wall / (0.5*roh_0*U_0^2).

There are now 2 possibilities to get Tau_wall.
First by taking the wall shear stress computed by the WallShearStress postprocessing tool. (Simply taking the magnitude of the wallshearstresses as Tau_wall). The second approach is to use the wallGradU tool, and compute the cf as described above by Santos. Surprisingly, the results were quite different (diffference of more than 10 Percent).

Is anybody able to explain the value differences?
My guess is that the shear stresses calculated by the wallshearstress tool are not exact. Is that true?

Thanks,

Peter

jiejie February 27, 2011 18:45

Quote:

Originally Posted by philippose (Post 186008)
Hi,


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

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

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])

Philippose

HI Philippose

I have tried both laminar flow and turbulent flow wss as you suggested for the same simulation. How come the wss calculated by the two methods vary so much from each other?

Do you need to multiple rho*nu for the turbulent case?

Thanks

Sergio13 April 11, 2011 12:17

Hello Guys
I am also very new to OpenFoam and CFD, and I was wondering how can I calculate the Viscous Stresses (say in a given point of the fluid).

In addition, note that instead of RAS, I am using a LES Turbulence model.

Thanks for your help

Sergio

David* June 23, 2011 09:33

There are so much unanswered questions in here, so I try to answer two of them:
Quote:

Originally Posted by Daniele111 (Post 262277)
No, i would know if is there rho or not in the result

At least for incompressible cases, rho is excluded, so you have to multiply the results from wallShearStress by your density.


Quote:

Originally Posted by Daniele111 (Post 264521)
Can I use sampleDict to sample wallShearStress on bottom? I do:
1)blockMesh
2)simpleFoam
3)wallShearStress
4)sample -latestTime

but in my set directory output file of whall shear stress is 0 everywhere...

The trick is to use
Code:

surfaces
(
        type        patch;
        patchName  bottom;
)

in your sampleDict.

Hope that helps someone!

oort January 14, 2012 07:55

Hello

So if we run the wallShearStress utility we must multiply the values by the rho?

For instance in my case i'm simulating water flow in a tube with spacers and after running the wallShearStress it gives me as in the figure.

The value of maximum magnitude of "displayed" wall shear stress is near 0.00043 (in unknown units...). If I multiply by the density of water (near 996 kg/m³) its gives 4.3 (in unkown units).

Is this new units Pascal?

Thanks,

Duarte Silva


http://www.carloscompleto.com/images/wss.png

idrama January 14, 2012 09:35

Yes, according to the wallShearStress.C code you must multiply by rho to obtain pascal. But to be sure, open the dictionaries wallShearStress in the time directories by using a editor and take a look at the dimension line. Here you can get the dimension of the data. Just do an dimension analysis and you will see that the data have to be multiplied by the density.

Elise August 28, 2012 08:12

Quote:

Originally Posted by philippose (Post 186008)
Hi,
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.

Philippose

Ok, but what is the meaning of the x, y and z values? Is the wall shear stress normal to each face then the magnitude of those values with x,y and z cartesian contributions? : Magnitude is then the wall shear stress normal to each face

What does the quoted code means;
mesh.Sf/mag(mesh.Sf) ; what does this term do? : gives a unit vector normal to the boundary element
& (turbulence->R()() ; is this the lookup of the wall shear stress from the Reynolds stress? : Yes, Reynolds stress

Yosmcer May 10, 2013 08:54

I know this post is old, but it is the best one I found related to my problem.

I have a wall that is parallel to the X axis, flow is laminar.

I compute the wallShearStress, and have a result.

I use paraFoam to look at this with Paraview.

I plot over line the wallShearsStress by placing the line on the boundary.

I see that I have a value for the magnitude of the wallShearStress, and three others values, one for each direction.

As my face is parallel to the X axis, I expect to have a signed value in the X direction, a value approximating zero in the two other direction, and the absolute value of the X's direction value.

But I also have a Y direction value, so a normal compound to the face. And this value is not negligible (the z value is negligible, but no flow in this direction).
The magnitude is the vectorial sum of the X and Y values (without the sign).

[EDIT]
I think this is because the shears stress must equilibrate at edges. So there is a normal compound corresponding to the tangential one of the perpendicular face, and a continuity of this across the face.

http://www.codecogs.com/users/23287/...tress-0002.png

Image from : http://www.codecogs.com/reference/en...ear_stress.php

So, considering the AB face, there is a normal compound to this face at the points A and B, but opposite, so there must be a continuous field across the face, and the resulting shear stress in not totally tangential to the face.

Please, correct me if there is/are mistake(s).
[\EDIT]

sophie_l May 22, 2013 08:11

Hi Yosmcer,

I am using interFoam, however the wallShearStress utility is intended for single phase transport models. I modified it to include "incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.H" and etc., and I've modified the option file according to that of interFoam. The compiling is ok, but when I run it, error message pops out.

Quote:

Time = 0
Reading field U
Reading/calculating face flux field phi
Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian

--> FOAM FATAL ERROR:
request for volScalarField alpha1 from objectRegistry region0 failed
available objects of type volScalarField are
2
(
nu1
nu2
)

From function objectRegistry::lookupObject<Type>(const word&) const
in file /lv1/data/openfoam/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 139.
FOAM aborting
Don't know what solver you are using, but how did you compute the wallShearStress?

Could you shed some light on my problem please?

Many thanks in advance.
Sophie

Phicau May 22, 2013 10:15

Hi Sophie,

alpha1 is not in the object registry in this case. You have to do the same as with U, read it from the time folder.

Best,

Pablo

sophie_l May 22, 2013 10:40

Hi Pablo,

Thank you so much! I've got it solved.

Best,
Sophie

kmou December 9, 2013 12:45

Quote:

Originally Posted by andboje (Post 254919)
Hi
I am trying to implement calculations of the shear stress in an interFoam case, simulating injection moulding.
I have been looking at the threads on this forum trying to figure out how to do this. In this thread it seems that something similar is done, but being new to the world of OpenFOAM I am looking for some more basic instructions.
Where do I implement the c++ code? Do I have to create new files or modify existing ones?
If someone has done shear stress implementation, I would much appreciate some help. For instance if you have a case where this is done I could take a look at, not nessesarily interFOAM. The same goes for the wallShearStress utility.

Best Regards
Anders

Hi Anders,
I have the exact same issue and unfortunately did not understand how to do this as I am myself very new to C++ and OpenFOAM. I would like to calculate dU/dy for my fuel injection with interFoam and then the shear stresses.
I would appreciate your knowledge on this, if you did figure it out.
Thank you very much.


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