|
[Sponsors] |
June 3, 2008, 09:50 |
UDF - C_STRAIN_RATE returns 0
|
#1 |
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); } |
|
|
|
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 |