CFD Online Logo CFD Online URL
Home > Forums > FLUENT

UDF - C_STRAIN_RATE returns 0

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

LinkBack Thread Tools Display Modes
Old   June 3, 2008, 08:50
Default UDF - C_STRAIN_RATE returns 0
Posts: n/a
Hello! I have problem with macro C_STRAIN_RATE(c,t). I wrote an UDF and I'm using this macro. The problem is that FLUENT returns zero. If I replace C_STRAIN_RATE(c,t) with C_U(c,t) (velocity component) UDF work well. Do you have any idea what is wrong?

#include "udf.h" #include "mem.h"

FILE *fout;

void Strain_Rate_Distribution(Domain *domain, int id) {

cell_t c;

Thread *t = Lookup_Thread(domain, id);

real j,k;

int i,n = 3;

real tau_max = 500000;

for (i = 1; i <= n; i++)


real temp = 0.0;

j = i * (tau_max/n);

k = (i-1) * (tau_max/n);



real strain_rate = C_STRAIN_RATE_MAG(c,t);

real volume = C_VOLUME(c,t);

if (strain_rate > k && strain_rate < j)


temp += volume;




fprintf(fout,"%g - %g %g\n", k,j,(temp/0.000075190329)*100);

} }

DEFINE_ON_DEMAND(strain_rate_distribution) {

Domain *domain;

domain = Get_Domain(1);

fout = fopen("strain_rate_distribution.out", "w");

Strain_Rate_Distribution(domain, 2);

fclose(fout); }
  Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
CrankNicholson returns wrong dimensions and sound speed when mesh is moving lillberg OpenFOAM Bugs 6 May 4, 2009 17:53
DNS always returns to laminar initial solution kat Main CFD Forum 10 September 9, 2007 09:20
Foamsystemcheck returns an error on my linux anosh OpenFOAM Installation 1 January 21, 2006 15:49

All times are GMT -4. The time now is 05:28.