CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   StrainRate definition 141 vs 15 (https://www.cfd-online.com/Forums/openfoam-solving/58312-strainrate-definition-141-vs-15-a.html)

floooo September 25, 2008 10:37

Hello, I compared nonNewton
 
Hello,

I compared nonNewtonian results.
The pressure is not the same with 1.4.1 and with 1.5 version of OpenFoam.
When I take n=1 => newtonian flow the results are the same.
It due to the strainRate calculation.
First I had these lines in BirdCarreau in the fonction calcNu()

Info
<< "max(strainRate): " << max(strainRate()).value()
<< " min(strainRate): " << min(strainRate()).value()
<< endl;

During the caluclation OpenFoam prints line like this one.
max(strainRate): 2027.15 min(strainRate): 1.46869

when I calculate :
max(strainRate)1.4.1/max(strainRate)1.5=1,414..
min(strainRate)1.4.1/min(strainRate)1.5=1,414..

And sqrt(2)=1,4142

I searched where is the definition of strainRate.
I found it in viscosityModel.C
in OpenFoam 1.4.1
return mag(fvc::grad(U_));
in OpenFoam 1.5
return mag(symm(fvc::grad(U_)));
This is not the same

Can someone help me ?

Florian

lzw2003 October 9, 2008 05:03

Hi, I am a beginner. I hav
 
Hi,

I am a beginner. I have some quesitons with Cross PowerLaw,I want to check the problem,
But I do not know how to print strainRate(mag(fvc::grad(U_))),can you tell me ?

Thanks!

floooo October 10, 2008 09:02

if you add Info << "max(
 
if you add

Info
<< "max(strainRate): " << max(strainRate()).value()
<< " min(strainRate): " << min(strainRate()).value()
<< endl;

in the powerlow.C file it will print the max and min value of the strainRate.

sbercan November 18, 2008 03:46

Hello; I am also trying to
 
Hello;

I am also trying to use a non-Newtonian model, and I was also looking at the definition of strain rate, and my question is what U_ stands for?

Thanks.

floooo November 19, 2008 03:22

In Viscosities Model all const
 
In Viscosities Model all constants are imported with a "_"

if you look in the "Member Functions" part of a viscosity model

k_(powerLawCoeffs_.lookup("k")),
n_(powerLawCoeffs_.lookup("n")),
nuMin_(powerLawCoeffs_.lookup("nuMin")),
nuMax_(powerLawCoeffs_.lookup("nuMax")),

I think U_=U

kerstin November 19, 2008 04:40

Hi Florian, Indeed the defi
 
Hi Florian,

Indeed the definition of strain rate is not the same.

The more general definiton used for strain rate in rheology books fpr 3D flows is

strain rate = sqrt( 2* (D:D) )
And D = 1/2 * (grad(U) + grad(U).T)

This "D" is the deformation gradient tensor (the symmetric part of the velocity gradient tensor).

The velocity gradient Tensor L= grad(U).T can be decomposed in a symmetric part and unsymmetric part. And the unsymmetric part is called rotation velocity tensor. The unsymmetric part doesn't contribute to fluid volume deformation. This is the reason why D is usually preferred.

You can calculate both definitons and if I didn't make something wrong now after one page of tensor calculations, I get the following (with the definition of mag(T) according ProgrammersGuide)

[ mag(symm(grad(U)))]^2 = [ mag(grad(U))] ^2 +
2* dUy/dx*dUx/dy
+ 2* dUz/dx*dUx/dz + 2* dUz/dy*dUy/dz

Ux, Uy and Uz are the components of velocity vector in each direction...

So indeed this is different. So I would prefer the definition I have given above because this is the widest spread in rheology books. But I didn't look up what Fluent or CFX use so far...but who cares what Ansys does? ;-)

And a rheologist would say, that calculation of a scalar strain rate for a 3D complex flow and using a model fitted to a measurement in simple shear flow is dangerous...but I think it's the best choice available...

Kerstin

ehsan November 19, 2008 05:26

I started working with OpenFoa
 
I started working with OpenFoam. Doing so, a question arose for me, as I write here:

For compressible rarefied flow, it is suggested to use rhocentralFoam routine. I like to know whether it can solve very low Mach flow? I see the examples of this routine are mostly high Mach number flows. Does it an all speed flow solver?

Sincerely,
Ehsan

floooo November 20, 2008 04:00

Kerstin => Thanks ehsan =>
 
Kerstin => Thanks

ehsan => I advise you to post your question in a new topic.
Or to use the search Utility and post your question in a topic which is about rhocentralFoam.
The subject of this topic is "StrainRate definition 1.4.1 vs 1.5"

Florian

eugene November 20, 2008 09:09

My mistake. The common defi
 
My mistake.

The common definition for shear rate in fluid mechanics is indeed:

sr = sqrt(0.5 * D:D), where D = grad(U) + grad(U).T()

In OpenFOAM, skew(T) = 0.5*(T + T^t) and mag(T) = sqrt(T:T), so

sr = sqrt(0.5 * 4* skew(U):skew(U))
sr = sqrt(2) * mag(skew(U))

The current implementation is incorrect. I will submit a bug report. Thanks for catching it!

floooo November 20, 2008 11:14

skew(T) = 0.5*(T - T^t) symm(
 
skew(T) = 0.5*(T - T^t)
symm(T) = 0.5*(T + T^t)

with T = grad(U)

I think the good definition is :

sr = sqrt(2) * mag(symm(fvc::grad(U)))

Florian

JonW December 6, 2010 08:08

glopal change in shear rate for 1.7.x
 
Hello there
Just an additional comment to the above
I am using OF 1.7.x and I have made a "glopal" change to the shear rate. What I did is as follows: (of course replace my username with yours in path, if you want to repeat)

cd /home/jonelvar/OpenFOAM/OpenFOAM-1.7.x/src/transportModels/incompressible/viscosityModels/viscosityModel

gedit viscosityModel.C

Change...
return mag(symm(fvc::grad(U_)));
...to...
return sqrt(2.0)*mag(symm(fvc::grad(U_)));

cd /home/jonelvar/OpenFOAM/OpenFOAM-1.7.x/src/transportModels/incompressible/

wmake libso

Hope this is of help

openfoammaofnepo August 16, 2014 18:19

Dear Eugene,

In OpenFOAM, how to calculate the principal compressive strain rate? I would like to extract this quantity but did not find it in the OpenFOAM classes?

Thank you very much if you can give me some hints.

OFFO

JonW August 18, 2014 01:40

Dear OFFO

I recently published a paper in which I derivatived the above equation for shear rate (see Section 3.1). It applies for incompressible material only.
As I understand from your post, you want to do the same for compressible material?
If so, you could follow the steps done in this paper and see where it gets you. You might have to implement it your self into OpenFOAM.

the paper is...
JE Wallevik, Effect of the hydrodynamic pressure on shaft torque for a 4-blades vane rheometer, International Journal of Heat and Fluid Flow, 2014

Cheers
J.

user_of_cfx November 16, 2015 10:20

Quote:

Originally Posted by kerstin (Post 201478)
strain rate = sqrt( 2* (D:D) )
And D = 1/2 * (grad(U) + grad(U).T)

This "D" is the deformation gradient tensor (the symmetric part of the velocity gradient tensor).

I want to model a viscosity model in which the viscosity depends on the shear strain. I was wondering if OF calculates that, or if there is a way to relate shear strain with velocity (or any other parameter calculated by the OF solver) in any way? Looks like D might be a good candidate to use for this purpose?

On a related note, how stable would a solution be if I used an integral in the viscosity equation? i.e. if I just wanted to set he shear strain equal to the integral of shear rate in dt?

JonW November 16, 2015 13:04

hello christa

This is possible, just use the correct solver (i.e. a non-Newtonian solver) as a template when programming your new OF solver.

Regarding your integration thingi, I have done this and published in
Wallevik, J.E., Thixotropic investigation on cement paste: Experimental and numerical approach. J. Non-Newtonian Fluid Mech. 132 (2005) 86-99.

At least in my case, integration did not pose any stability problems. But you have to be careful about memory footprint which can be huge.
In my phd (in the old days), I did overcome this and wrote about it in my thesis, see p.171, download:
http://ntnu.diva-portal.org/smash/re...=1&dswid=-1320

A Fortran code is available in
http://www.vvpf.net/download.html (note, download version 1.0)

Please note that I am following British Standard BS 5168:1975 "Glossary of rheological terms", so I use the term "shear rate" and not "shear strain" or "strain rate", see more about this issue in...

Wallevik, J.E. (2014), Effect of the hydrodynamic pressure on shaft torque for a 4-blades vane rheometer, International Journal of Heat and Fluid Flow, DOI: 10.1016/j.ijheatfluidflow.2014.06.001.
http://www.sciencedirect.com/science...42727X14000812

cheers
J.

user_of_cfx November 17, 2015 08:22

Quote:

Originally Posted by JonW (Post 573582)
Please note that I am following British Standard BS 5168:1975 "Glossary of rheological terms", so I use the term "shear rate" and not "shear strain" or "strain rate", see more about this issue in...

Hi Jon,

Thanks for your reply. I had a look through your excellent thesis, but I think there is a confusion about what I am after (which is the story of all my searches so far). What I am looking for is not the shear rate (let me call this gamma dot), but the shear strain, which I'll call gamma. From the paper I have been looking at (I am trying to replicate the work of another paper using OF) I understand gamma to be the integral of gamma dot in time (essentially it's a fluid version of deformation, delatl/L, and is unitless), which is why I asked if I can create a viscosity model in OF where I can use the existing shear rate (sr()) and integrate in time to calculate the gamma value I am after. Or maybe the strain is calculated by OF already, in which case I would be grateful if someone could point me to the file where this calculation happens, as I cannot find it.

I hope this is clearer now?

JonW November 17, 2015 10:01

Hi there again,
I see what you mean. I am pretty sure that this is not in OF. You have to program it your self

I just send you the paper you asked, and it might be a use after all, for your problem.
If you look at Eq. (8) in the paper (see also eq 9.3 p. 210 in the phd thesis), you have a Gamma which I am using. What I am working on is fading memory. But you could let it have full memory (alpha = 1) and put I = shear rate (i.e. dot-gamma) and you would be calculating deformation. In the FORTRAN source code this is named Gamma (in viscous.f90).

Anyway, if you do use this approach, memory (as in RAM) can be a problem very quickly, but the integration trick in my phd thesis I mentioned above can solve this.

J.

user_of_cfx November 17, 2015 12:08

Again thanks a lot. I had not reached that part with the fading memory.

I saw the trick with the exponentials that you used though, looks quite clever.

I was thinking something a lot simpler (and probably not as accurate), like storing the deformation value of t' and then adding the newly calculated deformation to it. Something along the lines of:

gamma(t) = gamma(t')+gamma_dot(t')*deltaT_

I can see however, that if I don't do this properly it can result in massive memory leaks.

However, you really have set me in the right direction with respect to the rheological model. Now to implement it all in C++ ... :D

Many thanks again!

andy_pr June 27, 2017 13:11

Hi,

So I take it that sr = sqrt(2) * mag(symm(fvc::grad(U))) is the second invariant of the strain rate tensor? If I wanted the strain rate tensor do I use 2 * symm(fvc::grad(U)) ?

Thanks,

A.

JonW June 27, 2017 13:36

Quote:

Originally Posted by andy_pr (Post 655059)
Hi,

So I take it that sr = sqrt(2) * mag(symm(fvc::grad(U))) is the second invariant of the strain rate tensor? If I wanted the strain rate tensor do I use 2 * symm(fvc::grad(U)) ?

Thanks,

A.

yes
strain rate tensor = (grad(U) + grad(U)^T)
rate of deformation tensor = 0.5 * (grad(U) + grad(U)^T)

Example of use of the latter in OpenFOAM, see Section 2.5 in
https://doi.org/10.1016/j.cemconres.2017.02.007

If you are interested in shear rate and why it is, see Section 3.1 in
https://doi.org/10.1016/j.ijheatfluidflow.2014.06.001

About "symm", see Section 1.3.9, equation (1.31) in the ProgrammersGuide.pdf (of 2.3.1 version), which is in you doc directory (if you type 'foam').
See also the table in Section 1.4.1. Should be similar section numbers in OF 4.1.

J.


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