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

Magnitude of a tensor

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By rudolf.hellmuth

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 19, 2013, 10:06
Default Magnitude of a tensor
  #1
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 14
mmkr825 is on a distinguished road
Dear all,
I would like to share your opinion on my doubt.

- The rate of strain tensor is written as(if i have not understand wrongly):

E=symm(grad(U))=1/2[grad(U)+grad(U)^T].......................(1)

- According to linear algebra the magnitude of any tensor S is:

|S|=sqrt(2S:S) .........................(2)

- According to Eq. (2) the magnitude of rate of strain tensor is:

|E| = sqrt(2E:E). ..............................(3)

= sqrt(2*(E_ij*E_ij))...................... (4)

- In OpenFOAM notation the magnitude of rate of strain tensor can be written as:

|E|=sqrt(2*symm(grad(U))).......................(5)

But for the testing purpose i defined a Tensor Q as [1 0 0 0 0.8 0 0 0 0.5]. According to Eq. (2), it's magnitude is 1.944222. But the OpenFOAM is giving 1.3747727.
So the definition of the magnitude of tensor according to OpenFOAM is:

|S| = sqrt(S:S)=sqrt(S_ij*S_ij)...........................(6)
Which contradicts Eq. (2).

Can any one clarify my doubt and how to write rate of strain tensor in OpenFOAM notation. Thanks in advance.

yours
Mallikarjuna Reddy
mmkr825 is offline   Reply With Quote

Old   February 20, 2013, 10:54
Default
  #2
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19
fumiya is on a distinguished road
Hi,

As you wrote, the magnitude of a tensor is defined in OpenFOAM as eq.(6).
This is also described in the programmer's guide p-16.

Fumiya
fumiya is offline   Reply With Quote

Old   February 20, 2013, 12:17
Default
  #3
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 14
mmkr825 is on a distinguished road
Hi Fumiya
Thanks for quick response. But in most of the books the shear rate is written as
|E| = sqrt(2E:E)

where rate of strain tensor is: E=symm(grad(U))=1/2[grad(U)+grad(U)^T]

So according to OpenFOAM notation, the shear rate will be

|E| = sqrt(E:E) = sqrt(magSqr(symm(fvc::grad(U))))

Could you please clarify whether this notation is correct or not.

Thanks
Mallikarjuna Reddy
mmkr825 is offline   Reply With Quote

Old   February 20, 2013, 17:32
Default
  #4
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
I don't understand why the magnitude of tensor should be twice its double contraction?
As a simple oppose example I can name vectors which are first order tensor and its magnitude would be sqrt(Ux^2+Uy^2+Uz^2). Still you may have shear stress right as:
|E| = sqrt(E:E) = sqrt(2*magSqr(symm(fvc::grad(U))))
anishtain4 is offline   Reply With Quote

Old   February 9, 2015, 10:06
Default
  #5
Member
 
Rudolf Hellmuth
Join Date: Sep 2012
Location: Dundee, Scotland
Posts: 40
Rep Power: 14
rudolf.hellmuth is on a distinguished road
I have the same question here.

In viscosityModel.C, strain rate is defined as
Code:
Foam::tmp<Foam::volScalarField> Foam::viscosityModel::strainRate() const
{
    return sqrt(2.0)*mag(symm(fvc::grad(U_)));
 }
In TensorI.H, symmetric part is defined as
Code:
template<class Cmpt>
inline SymmTensor<Cmpt> symm(const Tensor<Cmpt>& t)
{
    return SymmTensor<Cmpt>
    (
        t.xx(), 0.5*(t.xy() + t.yx()), 0.5*(t.xz() + t.zx()),
                t.yy(),                0.5*(t.yz() + t.zy()),
                                       t.zz()
    );
}
Unfortunately, I couldn't find where mag(symmTensor T) is defined. However, the programmer's guide (v2.3.1) defines tensor magnitude as
mag(T) = sqrt(T : T) .
By trusting the programmer's guide, shouldn't the strain rate be defined as
E = mag(symm(grad(U))) ,
instead of
E = sqrt(2.0)*mag(symm(grad(U))) ?
Why is this sqrt(2) there?
rudolf.hellmuth is offline   Reply With Quote

Old   August 14, 2015, 19:36
Default Sqrt(2)
  #6
Member
 
Join Date: Aug 2012
Posts: 68
Blog Entries: 1
Rep Power: 14
Nucleophobe is on a distinguished road
Quote:
Originally Posted by rudolf.hellmuth View Post
Why is this sqrt(2) there?
Greetings, Rudolf.

I'm a few months late here, but I think you have asked an important question. I worked this out once before but forgot my conclusion, so it's worth revisiting.

First, consider the definition of the (scalar) strain rate in 2D:
gamma_dot = U/y

Now, we would like a way to calculate the scalar strain rate in 3D tensor notation which will give us the same result. For instance, imagine a Couette flow, where:
Code:
grad(U) =  
0    U/y    0
0    0      0
0    0      0
Therefore, the strain rate tensor is equal to:
Code:
E = 1/2[grad(U)+grad(U)^T]
E = 
0            0.5 * U/y    0
0.5 * U/y    0            0
0            0            0
If we compute sqrt(E:E), we get:
Code:
sqrt(E:E)
= sqrt( (0.5 * U/y)^2 + (0.5 * U/y)^2)
= sqrt( 0.5 * (U/y)^2)
= sqrt(2)/2 * U/y
That's not right, because it doesn't agree with the 2D result (U/y). What we want is sqrt(2 E:E):
Code:
gamma_dot = sqrt(2 E:E)
= sqrt( 2 * ((0.5 * U/y)^2 + (0.5 * U/y)^2) )
= sqrt( (U/y)^2)
= U/y
So, at least based on this sanity check, it looks like the OpenFOAM definition for the scalar strain rate is correct. Does that make sense?

Does anyone else have references that provide further comments on the definition of the scalar strain rate in 3D tensor notation? Is it common to define the magnitude of a tensor A as |A| = sqrt(2 A:A)?
Thanks,
-Nuc

P.S. See also this thread:
http://www.cfd-online.com/Forums/ope...1-vs-15-a.html
Nucleophobe is offline   Reply With Quote

Old   August 16, 2015, 09:57
Default
  #7
Member
 
Rudolf Hellmuth
Join Date: Sep 2012
Location: Dundee, Scotland
Posts: 40
Rep Power: 14
rudolf.hellmuth is on a distinguished road
This is still a mystery for me. I've got to the same point as you have. I cannot prove the equality in a reasonable way, just by the sanity check.

I've got to these relations with Einstein's notation:

mag(grad(u)) = sqrt( (du_i/dx_j)^2 )

mag(grad(E)) = 0.5 * sqrt( (du_i/dx_j + du_j/dx_i)^2 )
mag(grad(E)) = 0.5 * sqrt( (du_i/dx_j) ^2 + 2*(du_i/dx_j)*(du_j/dx_i) + (du_j/dx_i)^2 )

There is another thing, the more rational way of normalizing the shear rate at any reference frame is to use the second invariant of the strain rate tensor

II = tr(E·E) = tr(E²) = E:E

Last edited by rudolf.hellmuth; August 17, 2015 at 15:09.
rudolf.hellmuth is offline   Reply With Quote

Old   August 21, 2015, 13:52
Default
  #8
Member
 
Rudolf Hellmuth
Join Date: Sep 2012
Location: Dundee, Scotland
Posts: 40
Rep Power: 14
rudolf.hellmuth is on a distinguished road
I think that I might have figure out the confusion here.

The magnitude of a tensor is:
mag(T) = sqrt(T:T) = sqrt(tr(T·T))

In the case of the strain rate, that is valid as well. However, the strain rate tensor is used for obtaining a scalar named absolute shear rate G, which is used as an analogy to the unidimensional shear rate \dot{\gamma} = dv/dx used in viscosity tests. This is done because viscosity tests are always unidimensional, but the rheological properties are extrapolated to 3D cases. This is done from the energy dissipation function

phi = tau : grad(v)

where

tau = 2*mu*E

In simple shear flow

phi = mu*grad(v):grad(v) = mu*\dot{\gamma}*\dot{\gamma}

I have done the derivation of E:grad(v). It is lengthy, but it resulted in

E:grad(v) = E:E - 1/3*div(v)*div(v)

The second part of the right had side accounts the compressibility. It is zero in incompressible cases.

I think that they consider

phi = mu * (2*E:E) = mu * G*G

which yields

G = sqrt(2*E:E) = sqrt(2) * mag(symm(grad(v)))


I might be wrong in some of my statements. I haven't found any literature directly comparing G and E.

Rudolf
rudolf.hellmuth is offline   Reply With Quote

Old   December 12, 2018, 14:49
Default
  #9
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Hi,

I think I learned a lot from this post. However, my algorithm has not given good results and I do not know if it is because of the way I wrote the magnitude of my strain rate tensor.

I need to write S², where S is the magnitude of my strain rate tensor.

I wrote in this form:

Quote:

tmp<volTensorField> tgradU = fvc::grad(U());

volScalarField S = mag(symm(tgradU));

volScalarField S2 = srq(S);
Did I write in the correct way?

Because the magnitude result is a scalar and unfortunately I can not go with a scalar in a system of symmetric matrix operations. Ex: tmp<fvSymmTensorMatrix> tauEqn
I only get this operation if I multiply by a symmetric identity matrix, or have another form?
gu1 is offline   Reply With Quote

Old   October 23, 2024, 00:41
Default
  #10
Senior Member
 
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12
alimea is on a distinguished road
Hi guys

I also faced this issue and I don't know why the mag of a volSymmTensorField is calculated in this way.
I added some formulas to calculate the stress tensor in my solver. However, I faced the wrong values for stress tensor magnitude, when I got its contour in ParaView. Then I set the initial values for my stress tensor as (1 1 1 1 1 1), which its mag is 3, but ParaView shows me 2.45. So, the mag of a volSymmTensorField will be calculated as

HTML Code:
tau_tot = (tau_xx^2 + tau_yy^2 + tau_zz^2 + tau_xy^2 + tau_xz^2 + tau_yz^2)^0.5
not
HTML Code:
tau_tot = (tau_xx^2 + tau_yy^2 + tau_zz^2 + 2*tau_xy^2 + 2*tau_xz^2 + 2*tau_yz^2)^0.5
and I don't know why!
Note: when I redefined tau as a volTensorField, the problem will be solved, but I don't like to do it, because of inconsistency with openFoam notation.
Maybe I have to define a volScalarField named tauMag to show me the correct values of the magnitude of a volSymmTensorField.
alimea 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
Magnitude of the strain tensor didomenico OpenFOAM 1 August 7, 2011 04:02
Stresseq vs stress magnitude watashiwa OpenFOAM 1 October 14, 2010 13:02
curvature correction term, material derivative of a tensor volker OpenFOAM Programming & Development 7 June 3, 2010 09:08
About deformation gradient tensor ZHANG Main CFD Forum 0 June 18, 2007 13:51
second invariant of rate-of-strain tensor Chun Min Chew Main CFD Forum 3 December 10, 2003 12:34


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