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

PB: Saving mass fraction of species on two points with an udf

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 22, 2009, 03:26
Default PB: Saving mass fraction of species on two points with an udf
  #1
New Member
 
biget.a
Join Date: Jul 2009
Location: Nancy
Posts: 3
Rep Power: 9
biget.a is on a distinguished road
Hello, I'm new on this forum. I use fluent and i have some problems.
I'm working with an unbaffled stirred tank. I would evaluate the mixing time. I'm working in monophasique, and i use species. In my domain, i make a patch with species (O2 in the domain of H20). I create few points in my domain for evaluate the mass fraction of my species. I work with unsteady formulation.
For saving the results, i write an udf. My problem is that i would integrate two results' points in my results' file. I have procede as follow. I don't understand why the two results have the same value at each time step.

#include <udf.h>
DEFINE_EXECUTE_AT_END(Capture_donnees)
{
int zone_ID1=12; /*ID of my first point*/
int zone_ID2=15; /* ID of my second point*/
real C1; real C2;
Domain *d= Get_Domain(1);
Thread *t=Lookup_Thread(d,zone_ID1);
Thread *t2=Lookup_Thread(d,zone_ID2);

cell_t c; cell_t c2;
FILE *fp=fopen("Donnees_species.txt","a");

thread_loop_c(t,d) {C1=C_YI(c,t,1);}
/* C_YI(c,t,i) represents species mass fraction. The species index i is the order of species listed in the selected species list (in material panel)
In our case: 0 => N2, 1 => O2 and 2 => H2O */

thread_loop_c(t2,d) {C2=C_YI(c2,t2,1);}

fprintf(fp,"%f %f\n",C1,C2);
fclose(fp);
}

Can anyone help me and tell me how to procede for saving in the same udf (execute at end) the same quantity for more than one ID zone.
biget.a is offline   Reply With Quote

Old   July 23, 2009, 01:55
Default hi
  #2
New Member
 
reza
Join Date: Jul 2009
Posts: 6
Rep Power: 9
vatovato is on a distinguished road
i didnt exactly undrestand whats your problem.but if you want to save mass fraction in 2 points during the time its better to do the following procedure
solve monitors surface
in this way yon can monitor and save mass fraction in many points during the time as you want and writting udf to save data is not nessecary
vatovato is offline   Reply With Quote

Old   July 23, 2009, 03:06
Default
  #3
New Member
 
biget.a
Join Date: Jul 2009
Location: Nancy
Posts: 3
Rep Power: 9
biget.a is on a distinguished road
Thank you for your reply. Effectively it is very more easy with the Surface Monitor function.
Have a nice day.
biget.a is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
about Mass Fraction Jaloha CFX 0 June 16, 2008 12:42
mass fraction of species Ahmed FLUENT 0 April 18, 2007 11:57
UDF for Species mass fraction daniel FLUENT 3 June 22, 2005 08:40
Gradient of species mass fraction zhou FLUENT 0 July 19, 2004 17:36
New at Species Transport- Please Help.. Julie FLUENT 10 August 23, 2002 11:56


All times are GMT -4. The time now is 22:22.