|
[Sponsors] |
June 28, 2005, 02:51 |
How to get each cell value into a text file
|
#1 |
Guest
Posts: n/a
|
Dear All,
I am considering mixing of two components inside a 2D-closed geometry where I move its sidewall to trigger internal recirculation. I want to calculate deviation change of concentration with time to evaluate mixing intensity. However, I don't know how to get a value of cell concentration cnd cell grid size from each cell into a file for deviation calculation. Is there a function in Fluent that helps calculating deviation? If anyone knows, please help me. |
|
June 28, 2005, 10:14 |
Re: How to get each cell value into a text file
|
#2 |
Guest
Posts: n/a
|
To put each cell centroid, species mass fractions and cell volume into a text file, try to compile and then hook as an execute at end UDF something like the following:
DEFINE_EXECUTE_AT_END(All_Out) { Domain *dom= Get_Domain(1); /* returns fluid domain pointer */ int index0=0; int index1=1; real c0; real c1; real cv; Thread *c_thread ; real x[ND_ND]; cell_t c; FILE *fp; /* define a local pointer fp of type FILE */ fp = fopen("data.txt","a"); /* open a file named data.txt in append mode and assign it to fp */ thread_loop_c(c_thread, dom) /*loops over all cell threads in domain*/ { begin_c_loop(c, c_thread) /* loops over cells in a cell thread */ { c0=C_YI(c,c_thread,index0); c1=C_YI(c,c_thread,index1); cv=C_VOLUME(c,c_thread); C_CENTROID(x,c,c_thread); fprintf(fp, "%g %g %g %g %g\n", x[0], x[1], c0, c1, cv); } end_c_loop(c, c_thread) } fclose(fp); /* close the file pointed to by fp */ } |
|
June 28, 2005, 10:35 |
Re: How to get each cell value into a text file
|
#3 |
Guest
Posts: n/a
|
Dear Peter, Thank you very much for your kind help. I will try to understand the program first and then use it in my simulation.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
wmake compiling new solver | mksca | OpenFOAM Programming & Development | 14 | June 22, 2018 07:29 |
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh | gschaider | OpenFOAM Community Contributions | 300 | October 29, 2014 19:00 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |
Warning 097- | AB | Siemens | 6 | November 15, 2004 05:41 |