CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Lambda-2 criterion

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree24Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 9, 2012, 14:16
Default Lambda-2 criterion
  #1
Member
 
Mike
Join Date: Apr 2011
Location: Canada
Posts: 83
Rep Power: 14
saeedi is on a distinguished road
Hi there,

Does any one know how to calculate Lambda-2 criterion?
I read the original paper by Adrian but I could not fully get it.
I know how to calculate Q-criterion and I have done it for some cases but for Lambda-2 I have problem.

I'd appreciate if you guide me about this.
saeedi is offline   Reply With Quote

Old   April 10, 2012, 07:22
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,150
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Dear saeedi,

the lambda 2 criterion simply concerns the definition of the scalar lambda2 and how turbulent structures can be visualized by proper isosurfaces of lambda2 (like for the Q criterion). Hence, the real difference with the scalar Q is how you compute the scalar lambda2.

This is defined as the second (in magnitude) eigenvalue of the matrix:

S_{ik} S_{kj} + \Omega_{ik} \Omega_{kj}

where:

S_{ij} = \frac{1}{2} \left( \frac{\partial u_i}{\partial x_j} + \frac{\partial u_j}{\partial x_i}\right)

\Omega_{ij} = \frac{1}{2} \left( \frac{\partial u_i}{\partial x_j} - \frac{\partial u_j}{\partial x_i}\right)

This requires the construction of the characteristic cubic equation and its resolution in order to obtain lambda2 (that is, lambda2 is the second solution of the cubic characteristic equation).

For coherent structures the matrix above can be related to the opposite of the pressure Hessian matrix. As this matrix is real and symmetric, it has two positive eigenvalues when the pressure is at minimum. As a consequence, the matrix above has two negative eigenvalues and lambda2 is certainly negative (for coherent structures). How much negative you have to pick its isosurfaces is (for what i understand) related to the visual appealing of your images (like for the Q criterion)

I still have to seriously use and check it (so it comes without any warranty) but, some time ago, i made a routine for the computation of lambda2 in Fluent (you find it attached). It is very rudimental but i remember it did the job. Also, it is basically C so you can clearly adapt the core part to your needs (Fluent related parts are very understandable also for non-Fluent users)

Once you got lambda2, you just need to pick some negative isosurface and you're done

Hope it helps
Attached Files
File Type: c lambda2.c (2.6 KB, 1578 views)
solefire, QBeast, Hosein and 15 others like this.
sbaffini is offline   Reply With Quote

Old   April 10, 2012, 07:39
Default
  #3
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,760
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Hi,
Paolo wrote a complete explanation, I just add that the relevant paper for the lambda-2 criterion is :
http://journals.cambridge.org/action...ine&aid=353418

furhtermore, you can read the dedicated section in the book of Lesiuer.

Just as practical suggestion coming from my experience:

1) a threshold value lamba2 =0 is not useful for many flows, for example in confined turbulence. Too structures are identified, I suggest to use a slight greater value

2) identification of vortical structure with such a criterion is "static", does not imply the coherence of the identified structures.
FMDenaro is offline   Reply With Quote

Old   April 10, 2012, 09:14
Default
  #4
Member
 
Mike
Join Date: Apr 2011
Location: Canada
Posts: 83
Rep Power: 14
saeedi is on a distinguished road
Hi Paolo and Flippo,

Great and clear answers. I almost got it. Thank you so much.

one question: Paolo, so the above matrix is -1 times pressure hessian ?
I mean in theory we can also calculate pressure hessian and choose the negative of the second aigen value?

one more question: Flippo, Could you please explain the point (2) a bit more?

P.S. : I am the one who asked about LES filters last week and you two guided me on it. I wrote the routine for dynamic smagorinsky and it is working nicely. Now I am going to add more sophisticated models.
saeedi is offline   Reply With Quote

Old   April 10, 2012, 09:22
Default
  #5
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,760
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by saeedi View Post
Hi Paolo and Flippo,

Great and clear answers. I almost got it. Thank you so much.

one question: Paolo, so the above matrix is -1 times pressure hessian ?
I mean in theory we can also calculate pressure hessian and choose the negative of the second aigen value?

one more question: Flippo, Could you please explain the point (2) a bit more?

P.S. : I am the one who asked about LES filters last week and you two guided me on it. I wrote the routine for dynamic smagorinsky and it is working nicely. Now I am going to add more sophisticated models.

The definition of what is a "coherent structure" is quite vague ...but it is somehow related to that fact that the life of a vortical structure must be at least greater than the characteristic turnover time. Therefore, once identified some vortices with the lamba2 criterion you have just a snaphot at a fixed time. What happens to this vortices after some time? Some will be dissipated rapidly, others can be considered "coherent" beacause will survive for sufficient time. Hence, identification is only the first step...
For example, you could explore the spectral energy content in time and discovering if some energy peak remains relevant for some time period.
FMDenaro is offline   Reply With Quote

Old   April 10, 2012, 09:31
Default
  #6
Member
 
Mike
Join Date: Apr 2011
Location: Canada
Posts: 83
Rep Power: 14
saeedi is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
The definition of what is a "coherent structure" is quite vague ...but it is somehow related to that fact that the life of a vortical structure must be at least greater than the characteristic turnover time. Therefore, once identified some vortices with the lamba2 criterion you have just a snaphot at a fixed time. What happens to this vortices after some time? Some will be dissipated rapidly, others can be considered "coherent" beacause will survive for sufficient time. Hence, identification is only the first step...
For example, you could explore the spectral energy content in time and discovering if some energy peak remains relevant for some time period.
Ok. Got it. Or we can provide the variation of the same contours over time (like animation) and qualitatively see which ones remains. This will show us coherent structures qualitatively. right?
saeedi is offline   Reply With Quote

Old   April 10, 2012, 09:40
Default
  #7
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,760
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
yes, someway once identified (and marked) a vortex, you should follow in its evolution for a period of time greater than the turnover time, assessing if it is coherent or disappears ...
A statistical analysis of coherence can be found in:
Jeong J, Hussain F, Schoppa W, Kim J. Coherent structures near the wall in a turbulent channel flow. Journal of Fluid Mechanics 1997; 332: 185–214.
FMDenaro is offline   Reply With Quote

Old   April 10, 2012, 11:01
Default
  #8
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,150
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Dear saeedi,

according to my understanding of this matter you are correct and the reason for using such a matrix (instead of the negative of the pressure Hessian) is barely due to the lower order of the derivatives involved in it which, by the way, are also already available (see my routine, where i simply ask fluent for them). In contrast, pressure 2nd derivative should be computed on purpose (and in my case it wasn't an option).

However, i don't actually know if there are more intrinsic reasons for this (e.g., if the whole reasoning is still valid for compressible flows etc.), but doing what other people do usually is the best first step if you don't know what to do. Actually, i simply got the lambda2 definition from the Lesieur's book cited by Filippo and used it
sbaffini is offline   Reply With Quote

Old   April 10, 2012, 11:43
Default
  #9
Member
 
Mike
Join Date: Apr 2011
Location: Canada
Posts: 83
Rep Power: 14
saeedi is on a distinguished road
Good!
So much thanks to both of you
saeedi is offline   Reply With Quote

Old   April 26, 2012, 16:40
Default
  #10
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15
mm.abdollahzadeh is on a distinguished road
Hi Paolo

Thanks for your clear answer. i have used your UDF. but unfortunately it gives fatal error. could you please help me?

Best
Mehdi
mm.abdollahzadeh is offline   Reply With Quote

Old   April 26, 2012, 17:01
Default
  #11
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,150
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Dear mahdi,

sorry if it looks silly by i have first to ask you to do the following:

1 - go under /solve/set/expert and when asked to keep memory from being freezed answer yes

2 - compute, say, 5 time steps (just to be sure)

3 - add 1 user defined memory

4 - load the udf and interpret it

5 - use it under define on demand

6 - under the surface->isosurface GUI menu define an isosurface of user_defined_memory_0

This is for what concerns the basic functionality (which indeed i already tested and now i tested again, it works for me)... that is, it works. As i said, i still have to check its correctness, but it should be ok.

Of course, if you want to produce an animation, you have to call it at every time step you need an image, then the isosurface is automatically updated
sbaffini is offline   Reply With Quote

Old   April 27, 2012, 07:32
Default
  #12
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15
mm.abdollahzadeh is on a distinguished road
Dear Paolo

thanks for your quick reply. now it is working. I am begiiner in fluent

best
mehdi
mm.abdollahzadeh is offline   Reply With Quote

Old   May 1, 2012, 02:21
Default
  #13
New Member
 
Sony
Join Date: May 2010
Posts: 14
Rep Power: 15
SonyCFD is on a distinguished road
Dear Paolo,
I am using your UDF for Lambda2.
As per your guidelines, I followed till step 3.
But in step 4 I get an error as below -
undefined reference to `main'
ld returned 1 exit status

Could you please help me identify where I am possibly going wrong.
Thanks and Regards,

Last edited by SonyCFD; May 1, 2012 at 02:22. Reason: typo
SonyCFD is offline   Reply With Quote

Old   May 1, 2012, 11:00
Default
  #14
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,150
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Dear Sony,

i'm afraid i can't be of much help as i never had such error in interpreting the udf, on linux clusters in parallel as well as in serial on a windows machine.

However, could you say what is your Fluent configuration:

Linux/Windows - Serial/Parallel - 3d/3ddp

Also, is the udf in your working directory?

Another thing which usually bother me is using an udf written under windows (i admit it, i usually work on windows) on a linux machine, as i usually forget the dos2unix command, which is required to get it properly interpreted/compiled.
sbaffini is offline   Reply With Quote

Old   May 7, 2012, 13:15
Default
  #15
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15
mm.abdollahzadeh is on a distinguished road
Dear Paolo

Could you please guide me ? how can use reletive velocity in the your lambda2 udf. is it possible to modify that?

Best
Mehdi
mm.abdollahzadeh is offline   Reply With Quote

Old   May 7, 2012, 14:11
Default
  #16
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,150
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Dear mehdi,

i admit that i have little knowledge about the accessibility and nature of the relative velocity in the UDFs. However, let us assume you have this in some variable C_U_REL(c,t), C_V_REL(c,t) and C_W_REL(c,t).

What you have to do is to add a first subroutine to the code (a DEFINE_ON_DEMAND one) in which you copy your relative velocities in user defined scalar variables. Then what should change in the main code for lambda2 is that the velocity gradients have to be substituted with those of the user defined scalars.

Finally, you should call them in sequence when a new lambda2 iso-surface is needed.

The writing of the whole thing is probably more cumbersome than it appears at first sight; also, it is still necessary to check that all the variables are readily accessible.
However it should not be difficult; i would provide some code but i have no time at the moment and you can surely copy and paste pieces from the UDF manual or Fluent online resources.
mm.abdollahzadeh likes this.
sbaffini is offline   Reply With Quote

Old   May 21, 2012, 07:38
Default
  #17
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15
mm.abdollahzadeh is on a distinguished road
Dear Paolo

Thanks for your good advise.
I have claculated the relative velocities and define them in user defined scalers.
and then expect usuing the relative velocities gradient i use the gradient of these scalers ( relative velocites).

but again while running the Demand i get some Fatel error. I cheked after this eror the scalers for relative velocitires are correct and they are gettingg value.
mm.abdollahzadeh is offline   Reply With Quote

Old   May 21, 2012, 08:44
Default
  #18
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,150
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Dear mehdi,

generally speaking, the ACCESS VIOLATION error (which, i guess, is the one you're getting) is related to your UDF trying to access some variables which are not defined
and/or are not accessible for some other reason (e.g., the gradient of some variable after it has being freed or face variables for interior threads, etc.). Now, in order for the UDF to work correctly, you have to be sure that the accessed variables are actually accessible.

So, before going deep in the debug, i suggest you to delete from the UDF all the parts relative to the lambda2 criterion and leave only those concerning the definition of the relative velocities and the access to their gradients. My idea is that the problem you are facing is relative to that part.

Also, from the Fluent 14 Manual (i think it is available somewhere online too if you don't have one. I don't have others now so i can't check for you), you have two examples concerning the retrieval of gradients for user defined scalars. The first one is under Data Access Macros - > User Defined Memory Macros (Paragraph 3.2.10.6 of the UDF Manual for Fluent 14). The second one is under Detailed UDF Examples -> User Defined Scalars (Paragraph 8.2.5).

Hope it helps
sbaffini is offline   Reply With Quote

Old   May 22, 2012, 03:09
Default Lambda 2
  #19
New Member
 
Sony
Join Date: May 2010
Posts: 14
Rep Power: 15
SonyCFD is on a distinguished road
Dear Paolo,
sorry for the delayed response.
I am using Linux in parallel and I use 3ddp.

Now I have managed to get to step 5. I got rid of the compilation error.
However, in step 6, when I try to create iso-surface, the min and max value of user memory 0 are both zeros. Hence it cannot create, a surface.

Please advise. For memory - I have defined 1 UD Memory Locations and 0 UD Node Memory Locations

Many Thanks,
Sony

Quote:
Originally Posted by sbaffini View Post
Dear Sony,

i'm afraid i can't be of much help as i never had such error in interpreting the udf, on linux clusters in parallel as well as in serial on a windows machine.

However, could you say what is your Fluent configuration:

Linux/Windows - Serial/Parallel - 3d/3ddp

Also, is the udf in your working directory?

Another thing which usually bother me is using an udf written under windows (i admit it, i usually work on windows) on a linux machine, as i usually forget the dos2unix command, which is required to get it properly interpreted/compiled.
SonyCFD is offline   Reply With Quote

Old   May 22, 2012, 06:34
Default
  #20
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,150
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Dear Sony,

as a first guess i would say that there is something wrong with the velocity field and or derivatives used for lambda2. I am saying this because your settings seem correct and the UDF is correctly interpreted. As for mahdi, could you try to remove all the lambda2 related parts from the UDF and try to see if the UDM you use can receive, say, some of the derivatives?
sbaffini is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
problem with Min/max rho tH3f0rC3 OpenFOAM 8 July 31, 2019 10:48
Lamda 2 criterion for vortex identification Aindya FLUENT 5 April 3, 2017 23:39
question to courant criterion tH3f0rC3 OpenFOAM 6 May 16, 2011 05:32
convergence criterion Dominique FLUENT 5 November 24, 2006 03:36
Convergence criterion Moose Main CFD Forum 5 June 9, 2005 21:39


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