|
[Sponsors] |
January 24, 2013, 10:20 |
write UDF results to .txt file
|
#1 |
Member
CC
Join Date: Jun 2011
Posts: 73
Rep Power: 15 |
Hi all,
I want see what is interpreted by fluent when I change the wall law in a UDF... If I use a printf command I see the values printed on the screen and it is working well. When I try use a fprintf command to write them on a txt file I get some errors and it is not working... My UDF is: /*------------------------------------*/ #include"udf.h" FILE *fp DEFINE_WALL_FUNCTIONS(wall_law,f,t,c0,t0,wf_ret,yP lus,Emod) { real wf_value; real M[ND_ND]; real Q[ND_ND]; int a,b; F_CENTROID(M,f,t); C_CENTROID(Q,c0,t0); a=THREAD_ID(t0); b=THREAD_ID(t); switch (wf_ret) { case UPLUS_LAM: wf_value=yPlus; break; case UPLUS_TRB: wf_value=log(yPlus)/KAPPA+log(Emod)/KAPPA; break; case DUPLUS_LAM: wf_value=1.0; break; case DUPLUS_TRB: wf_value=1./(KAPPA*yPlus); break; case D2UPLUS_TRB: wf_value=-1./(KAPPA*yPlus*yPlus); break; default: printf("Wall function return value unavailable\n"); } fprintf(fp, "%f %f %i %i %i %f %f %f %f\n", M[0], Q[0], a, b, wf_ret, wf_value, yPlus, Emod, KAPPA) return wf_value; } /*-----------------------------*/ I'm a beginner on this. Please, anyone can help me... |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 06:18 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 11:57 |
2.0.x on Mac OSX | niklas | OpenFOAM Installation | 74 | March 28, 2012 17:46 |
ParaView Compilation | jakaranda | OpenFOAM Installation | 3 | October 27, 2008 12:46 |
Results saving in CFD | hawk | Main CFD Forum | 16 | July 21, 2005 21:51 |