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

UDF - C_STRAIN_RATE returns 0

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 3, 2008, 09:50
Default UDF - C_STRAIN_RATE returns 0
  #1
Grzegorz
Guest
 
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);

begin_c_loop(c,t)

{

real strain_rate = C_STRAIN_RATE_MAG(c,t);

real volume = C_VOLUME(c,t);

if (strain_rate > k && strain_rate < j)

{

temp += volume;

}

}

end_c_loop(c,t)

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

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
CrankNicholson returns wrong dimensions and sound speed when mesh is moving lillberg OpenFOAM Bugs 6 May 4, 2009 18:53
DNS always returns to laminar initial solution kat Main CFD Forum 10 September 9, 2007 10: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:42.