CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

strain rate in UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 20, 2004, 11:25
Default strain rate in UDF
  #1
Paulina
Guest
 
Posts: n/a
Can anyone tell me how to define in Fluent 6.1.18 a strain rate in UDF?

I have read the UDF manual Fluent book, but I only have found:

C_CRITICAL_STRAINB_RATE(c,t).

I have used it in my udf, but I got an error:

"error:>(greater-than) :invalid argument [2]: wrong type [not a number] error object:nan".

In UDF manual I have found a definition for velocity derivatives but without strain rate.

I have checked that Fluent calculate strain rate during calculation using Mixture model, but how can I name "strain rate" in UDF?

Should I construct it from velocity derivatives or it should be used one name or symbol?

Thanks for any help

Paulina
  Reply With Quote

Old   April 20, 2004, 11:34
Default Re: strain rate in UDF
  #2
2L
Guest
 
Posts: n/a
I think you should try with C_STRAIN_RATE_MAG(c,t) if you want to access strain rate from your UDF.
  Reply With Quote

Old   April 20, 2004, 11:36
Default Re: strain rate in UDF
  #3
Paulina
Guest
 
Posts: n/a
Hi 2L,

Thank you for so quickly response.

I will try it.

Best regards

Paulina
  Reply With Quote

Old   April 20, 2004, 11:42
Default Re: strain rate in UDF
  #4
Paulina
Guest
 
Posts: n/a
Hello 2L once again!

I have included in the UDF: #include "mem.h" for C_STRAIN_RATE_MAG(c,t).

Should I put something else or it is correct?

Paulina
  Reply With Quote

Old   April 21, 2004, 03:54
Default Re: strain rate in UDF - please help
  #5
Paulina
Guest
 
Posts: n/a
Dear 2L,

I have written in the UDF the strain rate

as you told me:

"C_STRAIN_RATE_MAG(c,t)",

but I have got an error:

"Error:> (greater-than):invalid argument [2]:

wrong type [not a number],

Error Object: nan"

Maybe have you got another advice?

I also have tried to put under strain rate

the velocity derivative as following:

strain rate = sqrt(S*S) = sqrt[[C_DUDX(c,t)*(C_DUDX(c,t)+C_DUDX(c,t))]+[C_DUDY(c,t)*(C_DUDY(c,t)+C_DVDY(c,t))]+[C_DUDZ(c,t)*(C_DUDZ(c,t)+C_DWDZ(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))]];

and of course: #include "mem.h"

But the result was negative too, the same as above.

If you know how can I ascribe the strain rate propertly in UDF, could you help me please?

Thanks in advance

Regards

Paulina
  Reply With Quote

Old   April 21, 2004, 04:18
Default Re: strain rate in UDF - please help
  #6
2L
Guest
 
Posts: n/a
Hello !

In my case, I used the VOF model and I wanted simply to define a power law viscosity. I have pasted here my code for viscosity. Hope it can help you.

Good luck !

#include "udf.h" DEFINE_PROPERTY(viscosity, c, t) {

real visco;

visco = K*pow(C_STRAIN_RATE_MAG(c,t),n-1.);

return visco; }

  Reply With Quote

Old   April 24, 2004, 12:28
Default Re: strain rate in UDF - please help
  #7
Paulina
Guest
 
Posts: n/a
Hello,

Thank you for your advice.

I tried your suggestion,but it didn't work.

I am still looking for a proper symbol for strain rate.

I have tried to calculate the value of the strain rate

from the following equation,

where strain rate has defined as:

strain_rate(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))]];

But I have got also an error:

"line 287: strain_rate: no function prototype,

Error: Set_Thread_Variables: wta(real)

Error Object: ((constant . 1) (profile " " " "))

Maybe have you got any suggestions?

Once again thanks for answer.

Best regards

Paulina

  Reply With Quote

Old   November 19, 2014, 05:09
Default vorticity rate/strain rate
  #8
Member
 
Qureshi M Z I
Join Date: Sep 2013
Posts: 81
Rep Power: 13
m zahid is on a distinguished road
i want to write the UDF of the ratio

scale of voticity rate/scale of strain rate

if anybody have an idea about UDF, please share this

thanks
m zahid is offline   Reply With Quote

Old   November 19, 2014, 07:05
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
I have a great idea:

A = scale of vorticity rate;
B = scale of strain rate;
return(A/B);

You just have to write the first two lines yourself.
Please share your attempts to write this udf, so we can comment on it. That will work much better.
pakk is offline   Reply With Quote

Old   November 19, 2014, 12:04
Default hi
  #10
Member
 
Qureshi M Z I
Join Date: Sep 2013
Posts: 81
Rep Power: 13
m zahid is on a distinguished road
thanks pakk, after writing i will share UDF for your review.
m zahid is offline   Reply With Quote

Old   November 19, 2014, 19:19
Default hi
  #11
Member
 
Qureshi M Z I
Join Date: Sep 2013
Posts: 81
Rep Power: 13
m zahid is on a distinguished road
hi, pakk, do u know the difference between "scale of strain rate" and strain rate. In CFD, word "Scale" is very common with various quantities, such as length scale, time scale or scale of vorticity etc if u know the meaning of "scale" regarding CFD, please share this.

thanks
m zahid is offline   Reply With Quote

Old   November 20, 2014, 04:06
Default
  #12
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
You are the one who wants the UDF. I can not tell you what you want to have. Maybe you want the magnitude? I don't know. You tell me!

If you don't know what you mean with your words, how should I know? Go back to the person who gave you these words.

By the way: it would have made more sense if you would have asked the question about the meaning of "scale of strain rate" before you asked us to make the UDF.
pakk 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
UDF to measure Mass Flow Rate a.lynchy Fluent UDF and Scheme Programming 31 October 4, 2018 15:10
strain rate magnitude ahmadbakri STAR-CCM+ 1 June 3, 2010 14:03
UDF for the critical rate of strain. cryogenicT FLUENT 0 March 25, 2010 16:52
UDF for critical strain rate to extinction Birute Bunkute FLUENT 1 March 25, 2010 16:40
strain rate at arbitrary position in a cell K. Kevala FLUENT 0 February 4, 2004 18:14


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