CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   volTensorField (https://www.cfd-online.com/Forums/openfoam-programming-development/236951-voltensorfield.html)

ulugbey June 23, 2021 09:53

volTensorField
 
Hi,

I have the following code in OpenFoam:
Quote:

volTensorField tauMC("tauMC", (!inviscid)*turbulence->muEff()*dev2(fvc::grad(U)().T())); // Deviatoric Part of Stress Tensor
I can't understand how I should interpret this expression? Could you please explain the terms in this expression?

Best regards

Tobermory June 24, 2021 08:24

Okay, let's break it down. The main part of the line is:
Code:

volTensorField tauMC("tauMC", <expression>);
This is declaring a volTensorField object tauMC, and initialising it with its name and its contents, where the latter is calculated from the <expression>.

The <expression> is made up as follows: firstly, the deviatoric strain rate (see https://cpp.openfoam.org/v8/TensorI_8H_source.html)
Code:

dev2(fvc::grad(U)().T()))
multiplied by the effective (laminar + turbulent) viscosity
Code:

turbulence->muEff()
multiplied by an expression that is either zero if the flow is inviscid or 1 if the flow is not inviscid:
Code:

(!inviscid)
So overall, it calculates the shear stress, setting it to zero if the inviscid flag is set.

ulugbey June 24, 2021 14:43

Thanks a lot for the detailed explanation. I have now follow-up questions.


Where can I set muEff()?
What is the difference between nuEff() and muEff()?
Why does Temperature(T) appear in the following formulation of deviatoric strain rate?
Code:

dev2(fvc::grad(U)().T()))
Best regards

Tobermory June 24, 2021 17:56

Ok, you have a huge amount of reading to do, and to get anywhere with OpenFOAM you are going to have to learn to do your own research. Google is always useful, but also try and get to grips with the Doxygen pages, eg
https://cpp.openfoam.org/v8/. Search on there, and you will quickly find what muEff and nuEff are.

Tracking down the .T() will be more difficult, but I already gave you a link to the Tensor.H class ... maybe take a look in there?

I can easily answer your questions (time pernmitting) ... but it's a better strategy all round to help you answer your own questions, so take this as a challenge - any good luck my friend.


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