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

calculating tau

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By MNoCeZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2018, 08:57
Default calculating tau
  #1
New Member
 
Join Date: Sep 2017
Posts: 12
Rep Power: 8
MNoCeZ is on a distinguished road
Hello together,

i want to calculate the stress tensor with the following definition:

\tau_{ij}=2\mu \left(\frac{1}{2}\left(\frac{\partial u_{i}}{\partial x_{j}}+\frac{\partial u_{j}}{\partial x_{i}}\right)-\frac{1}{3}\frac{\partial u_{k}}{\partial x_{k}}\delta_{ij}\right)

my first approach:

calcTau = 2 *mu *(gradU + gradU.T()+1/3*diag(U));

the problem is diag(U), because it does not return the required format?

I would be very grateful for your help.
MNoCeZ is offline   Reply With Quote

Old   May 14, 2018, 12:46
Default
  #2
Member
 
Alejandro Valeije
Join Date: Nov 2014
Location: Spain
Posts: 52
Rep Power: 11
alexvaleije is on a distinguished road
Hi

I'm not 100% sure, because I'm taking code that I wrote years ago, but give it a try to this:

twoSymm(fvc::grad(U))

In another thread, I have also found this definition, in case you want to try:

UEqn.diag()

Regards,
Alex
alexvaleije is offline   Reply With Quote

Old   May 15, 2018, 07:36
Default
  #3
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 77
Rep Power: 15
EmadTandis is on a distinguished road
Hello
you can use "tr(fvc::grad(U)) I" instead of diag(U). fvc::div(U) is correct as well but the first is better since it is calculated more correctly at boundaries.

Last edited by EmadTandis; May 15, 2018 at 22:37.
EmadTandis is offline   Reply With Quote

Old   May 16, 2018, 03:20
Default
  #4
New Member
 
Join Date: Sep 2017
Posts: 12
Rep Power: 8
MNoCeZ is on a distinguished road
Hello,

i solved it with:
Quote:
Tau = 2 *mu *(gradU + gradU.T()-(1/3.0)*diag_gradU);
where diag_gradU is
Quote:
volTensorField diag_gradU = gradU;

forAll(diag_gradU,cellI)
{
diag_gradU[cellI].xy()=0;
diag_gradU[cellI].xz()=0;
diag_gradU[cellI].yx()=0;
diag_gradU[cellI].yz()=0;
diag_gradU[cellI].zx()=0;
diag_gradU[cellI].zy()=0;
}
Zhiheng Wang likes this.
MNoCeZ 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
calculating the viscous stress tensor tau for viscous dissipation heating dgadensg OpenFOAM Programming & Development 5 January 17, 2023 15:20
Questions on dynamicTopoFvMesh danvica OpenFOAM Running, Solving & CFD 80 April 16, 2019 16:58
DPMFoam - Serious Error --particle-laden flow in simple geometric config benz25 OpenFOAM Running, Solving & CFD 27 December 19, 2017 20:47
Problems in calculating the fluid traction on the current structure frame in 3D models fw407 OpenFOAM Running, Solving & CFD 0 August 6, 2008 12:04
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 17:27


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