# how to get such mass fraction

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

 April 12, 2005, 02:37 how to get such mass fraction #1 handou Guest   Posts: n/a hello. now, i am modeling a heat transfer flow. i want to get the mass fraction of the fluid in a certain temperature range. how can i deal with this problem? thanks.

 April 12, 2005, 04:44 Re: how to get such mass fraction #2 rom Guest   Posts: n/a the follwing udf can be run in interpreted mode and computes the fluid mass within tmin and tmax (K). good luck rom #include "udf.h" #define Tmin 1200 #define Tmax 1500 DEFINE_ON_DEMAND(get_fraction) { Domain *d; cell_t c; Thread *t; real mf,mft; mf=0; mft=0; d = Get_Domain(ROOT_DOMAIN_ID); thread_loop_c(t,d) { begin_c_loop(c,t) { if((C_T(c,t)>=Tmin) && (C_T(c,t)<=Tmax)) mft += C_R(c,t)*C_VOLUME(c,t); mf += C_R(c,t)*C_VOLUME(c,t); } end_c_loop(c,t) } printf("\nfluid mass = %f kg",mf); printf("\nfluid mass within temperature range = %f kg",mft); }

 April 12, 2005, 06:57 Re: how to get such mass fraction #3 handou Guest   Posts: n/a oh, thank you, rom. this really help me a lot

 April 12, 2005, 09:22 Re: how to get such mass fraction #4 handou Guest   Posts: n/a hi, rom. i try to use this udf on my computer.it can be compiled successfully. but, when i try to execute it from "execute on demand" panel, there is no reaction at all. i want to know where is the result printed to? thanks!

 April 12, 2005, 09:59 Re: how to get such mass fraction #5 rom Guest   Posts: n/a Sometime Fluent doenst get the printf command right. I tested the udf on my machine (WinXP Fluent6.2) and it worked. You can substitute the "printf" with "Message". This usually solves the problem but then the udf will not longer run in interpreted mode so you will have to compile it first. good luck rom

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post Attesz CFX 7 January 5, 2013 04:32 Lilly FLUENT 3 July 25, 2011 05:00 saii CFX 2 September 18, 2009 08:07 paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14 mike CFX 1 March 19, 2008 08:22

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