|
[Sponsors] |
December 12, 2007, 12:45 |
UDF for writing txt. file
|
#1 |
Guest
Posts: n/a
|
in a UDF, what is the command to write the value of a variable in a txt. file ???
|
|
December 12, 2007, 15:25 |
Re: UDF for writing txt. file
|
#2 |
Guest
Posts: n/a
|
Hi,
this UDF writes the Temperature of each cell of a fluid domain (with ID 12) to a text file. Greg -------------------------------------------------- #include "udf.h" FILE *fout; DEFINE_ON_DEMAND(test) { Thread *t; Domain *domain; cell_t c; domain = Get_Domain(1); t=Lookup_Thread(domain,12); fout = fopen("test.txt", "w"); begin_c_loop(c,t) { fprintf(fout, "Temperature at %d: %g \n",c,C_T(c,t)); } end_c_loop(c,t) fclose(fout); } |
|
December 13, 2007, 07:19 |
Re: UDF for writing txt. file
|
#3 |
Guest
Posts: n/a
|
Thanks a lot
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 14:06 |
pisoFoam compiling error with OF 1.7.1 on MAC OSX | Greg Givogue | OpenFOAM Programming & Development | 3 | March 4, 2011 18:18 |
[Gmsh] Compiling gmshFoam with OpenFOAM-1.5 | BlGene | OpenFOAM Meshing & Mesh Conversion | 10 | August 6, 2009 05:26 |
Regarding FoamX running Kindly help out | hariya03 | OpenFOAM Pre-Processing | 0 | April 18, 2008 05:26 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |