CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   strain rate magnitude (https://www.cfd-online.com/Forums/fluent-udf/90818-strain-rate-magnitude.html)

rakadit July 21, 2011 05:58

strain rate magnitude
 
Dear All!

what is the correct definition for finding strain rate magnitude?

in Fluent. in Flunent ,STRAIN-RATE-MAG(c,t) is defined as:

strain_rate_mag(c,t) = sqrt[[C_DUDX(c,t)*(C_DUDX(c,t)+C_DUDX(c,t))+C_DUDY(c,t)* (C_DUDY(c,t)+C_DVDX(c,t))+C_DUDZ(c,t)*(C_DUDZ(c,t) +C_DWDX(c,t))]+ [C_DVDX(c,t)*(C_DVDX(c,t)+C_DUDY(c,t))+C_DVDY(c,t)* (C_DVDY(c,t)+C_DVDY(c,t))+C_DVDZ(c,t)*(C_DVDZ(c,t) +C_DWDY(c,t))]+ [C_DWDX(c,t)*(C_DWDX(c,t)+C_DUDZ(c,t))+C_DWDY(c,t)* (C_DWDY(c,t)+C_DVDZ(c,t))+C_DWDZ(c,t)*(C_DWDZ(c,t) +C_DWDZ(c,t))]];

is the above definition correct .please elaborate on this?

Thanks ,

Rakesh

Amir July 21, 2011 15:42

Hi,
the compact form is:
\sqrt{2*D:D}
which is:
\sqrt{2*DijDij} ; i,j=1,2,3 (two inner products)
D : strain rate tensor

rakadit July 23, 2011 03:18

starin rate
 
Dear Sir,
Thanks for your quick response.
it would be great help If you elaborate a liitle more.

is sqrt(Dij Dij) =sqrt(e11^2+e12^2+e13^2+e21^2+......and so on).
here e11 etc.means 9 strain rate components.

but then how is it equivalent to the relation given in Fluent manual as S^2=delu/delx*(e11)+delu/dely*e12)+delu/delz*(e13)+................and so on.


Thanks ,

Rakesh

Amir July 23, 2011 04:43

Dear Rakesh,
In Mathematics, the magnitude of a second order tensor is defined as \sqrt{T:T}, but here, as you said, we have a convention for shear strain magnitude in which an extra constant coefficient is multiplied, so:
strain rate magnitude= \sqrt{2*D:D}=\sqrt{2*D^{2}_{11}+2*D^{2}_{12}+...}
Note that it is equivalent with FLUENT manual interpretation: (after some manipulations)
s=\sqrt{2u^{2}_{x}+2v^{2}_{y}+2w^{2}_{z}+(u_{z}+w_{x})^{2}+(u_{y}+v_{x})^{2}+(w_{y}+v_{z})^{2}}


Amir

rakadit July 26, 2011 11:05

Dear Sir,

Thank you very much.


Rakesh

Unneoetech September 20, 2012 05:00

The term you mention is usually defined as the shear rate. Is in Fluent the shear rate and the strain rate equal for Non-Newtonian flow?

Amir September 20, 2012 10:26

Quote:

Originally Posted by Unneoetech (Post 382719)
The term you mention is usually defined as the shear rate. Is in Fluent the shear rate and the strain rate equal for Non-Newtonian flow?

Dear friend,

These are two different concepts. Strain rate contains both shear and normal rates; you can consider strain rate as rate of deformation where the shear rate is just one part of that.
The strain rate tensor is extracted from gradient of velocity field while the fluid type just affects the constitutive relation (relation between stress and rate of strain) so these definitions can be used for each type.

Bests,

Unneoetech September 20, 2012 10:37

Hi Amir,

That is just what I found out a couple of seconds ago :) It is also described in the Fluent manual in Section 30.4
http://hpce.iitm.ac.in/website/Manua...219.htm#217910
Quote:

Strain Rate (in the Derivatives... category) relates shear stress to the viscosity. Also called the shear rate ( in Equation 8.4-17), the strain rate is related to the second invariant of the rate-of-deformation tensor . Its unit quantity is time-inverse. In 3D Cartesian coordinates, the strain rate,, is defined as Eq. (30.4-30)

Thanks for your fast answer!

Amir September 20, 2012 10:44

Quote:

Originally Posted by Unneoetech (Post 382791)
Hi Amir,

That is just what I found out a couple of seconds ago :) It is also described in the Fluent manual in Section 30.4
http://hpce.iitm.ac.in/website/Manua...219.htm#217910
Quote:

Strain Rate (in the Derivatives... category) relates shear stress to the viscosity. Also called the shear rate ( in Equation 8.4-17), the strain rate is related to the second invariant of the rate-of-deformation tensor . Its unit quantity is time-inverse. In 3D Cartesian coordinates, the strain rate,, is defined as Eq. (30.4-30)

Thanks for your fast answer!

Yes I've seen that.
What I said was the definition in continuum mechanics but in FLUENT some definitions have changed! e.g., wall shear stress is wall traction!

Bests,

wanna88 September 25, 2012 04:52

Quote:

Originally Posted by Unneoetech (Post 382791)
Hi Amir,

That is just what I found out a couple of seconds ago :) It is also described in the Fluent manual in Section 30.4
http://hpce.iitm.ac.in/website/Manua...219.htm#217910
Quote:

Strain Rate (in the Derivatives... category) relates shear stress to the viscosity. Also called the shear rate ( in Equation 8.4-17), the strain rate is related to the second invariant of the rate-of-deformation tensor . Its unit quantity is time-inverse. In 3D Cartesian coordinates, the strain rate,, is defined as Eq. (30.4-30)

Thanks for your fast answer!

Hi,

So is that means in the Fluent, the strain rate equal to shear rate?

Thank you.

Regards,
Naimah

rembe January 10, 2013 07:43

mean shear rate
 
Hi,

I'm not a expert in fluid mechanics. Can you tell me the difference between the strain rate magnitude:


http://www.cfd-online.com/Forums/vbL...66aad1f8-1.gif

and the mean strain rate:

Sij=1/2*(dUi/Dxj+dUj/dxi)

I need th correct formulation in the SMAGORINSKY-model.

Thank you very much
Michael

Kanarya August 17, 2014 17:37

Dear Amir,
I would like to calculate in UDF daviatoric part of strain rate tensor so definition of it as following:
S_prime_ij=S_ij - S_mm*kronecker_delta_ij/3,
so the part of kronecker_delta_ij is confused me…I must again calculate the magnitude if the S_prime as you explained in this thread or it is different?
thanks in advance!
Quote:

Originally Posted by Amir (Post 317181)
Dear Rakesh,
In Mathematics, the magnitude of a second order tensor is defined as \sqrt{T:T}, but here, as you said, we have a convention for shear strain magnitude in which an extra constant coefficient is multiplied, so:
strain rate magnitude= \sqrt{2*D:D}=\sqrt{2*D^{2}_{11}+2*D^{2}_{12}+...}
Note that it is equivalent with FLUENT manual interpretation: (after some manipulations)
s=\sqrt{2u^{2}_{x}+2v^{2}_{y}+2w^{2}_{z}+(u_{z}+w_{x})^{2}+(u_{y}+v_{x})^{2}+(w_{y}+v_{z})^{2}}


Amir


Amir August 18, 2014 08:33

Quote:

Originally Posted by Kanarya (Post 506377)
Dear Amir,
I would like to calculate in UDF daviatoric part of strain rate tensor so definition of it as following:
S_prime_ij=S_ij - S_mm*kronecker_delta_ij/3,
so the part of kronecker_delta_ij is confused me…I must again calculate the magnitude if the S_prime as you explained in this thread or it is different?
thanks in advance!

Hi,

No, this is quite straight-forward! Just substitute the S_mm term with sum of the diagonal components.
i.e., S_mm=S11+S22+S33

kronecker_delta_ij=0, where i/=j
kronecker_delta_ij=1, where i==j

Bests,

Kanarya August 19, 2014 09:01

thanks Amir!
I am trying to define tensor in UDF but sth is wrong with the code or udf...
PHP Code:

real puixj[ND_ND][ND_ND];
puixj[0][0]= C_DUDX(c,t);
puixj[1][0]= C_DVDX(c,t);
puixj[0][1]= C_DUDY(c,t);
puixj[1][1]= C_DVDY(c,t);

for(
j=0;j<ND_ND;j++)
{
for(
i=0;i<ND_ND;i++)
{
Og[i][j]=0.5*(puixj[i][j]-puixj[j][i]); //Og is the rotation tensor
}


when I am putting random number to i or j it gives some results which is wrong!For example;even Og[25][20] is giving some result ....
do you know what is the problem here?
thanks in advance!
Quote:

Originally Posted by Amir (Post 506466)
Hi,

No, this is quite straight-forward! Just substitute the S_mm term with sum of the diagonal components.
i.e., S_mm=S11+S22+S33

kronecker_delta_ij=0, where i/=j
kronecker_delta_ij=1, where i==j

Bests,


Amir August 19, 2014 10:40

Quote:

Originally Posted by Kanarya (Post 506621)
when I am putting random number to i or j it gives some results which is wrong!For example;even Og[25][20] is giving some result ....
do you know what is the problem here?
thanks in advance!

I guess, proper definition of the Og tensor as Og[ND_ND][ND_ND] and an initialization of this tensor may fixed this issue! However, I wonder how your UDF may lead to such error during the calculation!
Actually, forcing wrong indices to a matrix may result in previously saved and irrelative data in the memory.

Bests,

Kanarya August 21, 2014 06:52

Hi Amir,
thanks for the answer!
But I am still getting weird values ...
For example I trying to define kronecker delta like:
PHP Code:

for(jj=0;jj<ND_ND;jj++)
{
for(
ii=0;ii<ND_ND;ii++)
{
if (
ii==jj)
    
delta[ii][jj]=1;
else
    
delta[ii][jj]=0;
}
}
and print 
it out with:
Message("delta: %g/n",delta[ii][jj]); 

the result is always "0"
Do you have any idea what is wrong with it?
thanks in advance!
Quote:

Originally Posted by Amir (Post 506659)
I guess, proper definition of the Og tensor as Og[ND_ND][ND_ND] and an initialization of this tensor may fixed this issue! However, I wonder how your UDF may lead to such error during the calculation!
Actually, forcing wrong indices to a matrix may result in previously saved and irrelative data in the memory.

Bests,


Amir August 21, 2014 07:48

Quote:

Originally Posted by Kanarya (Post 507006)
Hi Amir,
thanks for the answer!
But I am still getting weird values ...
For example I trying to define kronecker delta like:
PHP Code:

for(jj=0;jj<ND_ND;jj++)
{
for(
ii=0;ii<ND_ND;ii++)
{
if (
ii==jj)
    
delta[ii][jj]=1;
else
    
delta[ii][jj]=0;
}
}
and print 
it out with:
Message("delta: %g/n",delta[ii][jj]); 

the result is always "0"
Do you have any idea what is wrong with it?
thanks in advance!

Hi,
You need to put the Message command inside your loop, not out of that!
Moreover, this is "\n" not "/n".

Bests,

Kanarya August 21, 2014 08:48

thanks Amir,
it seems it is fine now:)
Best!
Quote:

Originally Posted by Amir (Post 507013)
Hi,
You need to put the Message command inside your loop, not out of that!
Moreover, this is "\n" not "/n".

Bests,


Kanarya August 25, 2014 14:28

Hi Amir,
I have problem with convergence now.
It seems residuals are fine but the simulation is stopped.
PHP Code:

Updating solution at time levels N and N-1.
 done
.
  
iter  continuity       u-gas     u-solid       v-gas     v-solid       uds-0       uds-1    vf-solid     time/iter
9481 solution is converged
  9481  7.9111e-04  1.2569e-06  8.8861e-08  6.0119e-07  7.8996e-09  2.7750e-07  2.6720e-07  3.6096e-07  0
:00:02  100
Re
0
reyp
0
  9482  2.0487e-03  1.0965e-05  1.4955e-05  3.5806e-06  3.8082e-06  2.1239e-04  2.2740e-04  1.4775e-05  0
:00:02   99
Re
0
reyp
0
  9483  1.8130e-03  4.3936e-06  4.6505e-06  1.4881e-06  1.1923e-06  7.8683e-06  6.0966e-06  7.5522e-06  0
:00:02   98
Re
0
reyp
0
# Divergence detected in AMG solver: uds-1 -> Increasing relaxation sweeps!

Divergence detected in AMG solveruds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Warning
An error or interrupt occurred while reading the journal file.
Some commands may not have been completed.

Halting due to end of file on input

Do you have any idea about it?
thanks in advance!
Quote:

Originally Posted by Amir (Post 507013)
Hi,
You need to put the Message command inside your loop, not out of that!
Moreover, this is "\n" not "/n".

Bests,


Kanarya August 29, 2014 17:53

Hi,
do you think the problem is coming form the tensor which I have posted in thread 14?
may opposite indices are giving the same result?
thanks in advance!
thanks in advance!
Quote:

Originally Posted by Kanarya (Post 507732)
Hi Amir,
I have problem with convergence now.
It seems residuals are fine but the simulation is stopped.
PHP Code:

Updating solution at time levels N and N-1.
 done
.
  
iter  continuity       u-gas     u-solid       v-gas     v-solid       uds-0       uds-1    vf-solid     time/iter
9481 solution is converged
  9481  7.9111e-04  1.2569e-06  8.8861e-08  6.0119e-07  7.8996e-09  2.7750e-07  2.6720e-07  3.6096e-07  0
:00:02  100
Re
0
reyp
0
  9482  2.0487e-03  1.0965e-05  1.4955e-05  3.5806e-06  3.8082e-06  2.1239e-04  2.2740e-04  1.4775e-05  0
:00:02   99
Re
0
reyp
0
  9483  1.8130e-03  4.3936e-06  4.6505e-06  1.4881e-06  1.1923e-06  7.8683e-06  6.0966e-06  7.5522e-06  0
:00:02   98
Re
0
reyp
0
# Divergence detected in AMG solver: uds-1 -> Increasing relaxation sweeps!

Divergence detected in AMG solveruds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Divergence detected in AMG solver
uds-1
Warning
An error or interrupt occurred while reading the journal file.
Some commands may not have been completed.

Halting due to end of file on input

Do you have any idea about it?
thanks in advance!


Kanarya September 1, 2014 06:45

Hi,
I am using tensors in udf so my question is:
should I initialize the tensors?or there is no need for it?
for example
PHP Code:

 for(j=0;j<ND_ND;j++)
{
for(
i=0;i<ND_ND;i++)
{
  
S12[i][j]=0.0;
}
}
and 
then 
for(j=0;j<ND_ND;j++)
{
for(
i=0;i<ND_ND;i++)
{
  
S12[i][j]=....calculate;
}


is it ok?
thanks in advance!

m zahid November 19, 2014 10:01

vorticity vs strain rate
 
hi, anybody know the difference in equation of vorticity and strain rate in CFD fluent. i want to write the UDF of vorticity in 3D.
if anybody know about this, please share this .
thanks

prasa July 10, 2018 08:12

Hi,
I know this conversation is very old, but the information here is very important.

I would like to know, shear stress for the incomprehensible fluid is given as following equation, by just removing the linear expansion terms?

s=\sqrt{(u_{z}+w_{x})^{2}+(u_{y}+v_{x})^{2}+(w_{y}+v_{z})^{2}}

Is it correct ?

arashfluid July 17, 2018 03:51

Gradient of strain rate
 
Hi friends,
How can I write gradient of strain rate (∇γ ̇) in udf?
Can anyone help me?
Thanks,

mdmtramper February 9, 2021 09:07

Hi, thanks for this :) Does anyone has a good reference for the derivation? Thanks!

mcanoenen September 23, 2021 02:33

Up
 
Could you please help about this as well. And could you possibly suggest me a tensor book for a beginner?

Quote:

Originally Posted by rembe (Post 401176)
Hi,

I'm not a expert in fluid mechanics. Can you tell me the difference between the strain rate magnitude:


http://www.cfd-online.com/Forums/vbL...66aad1f8-1.gif

and the mean strain rate:

Sij=1/2*(dUi/Dxj+dUj/dxi)

I need th correct formulation in the SMAGORINSKY-model.

Thank you very much
Michael


Regards,

mcanoenen


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