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

how to get such mass fraction

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 12, 2005, 02:37
Default 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.
  Reply With Quote

Old   April 12, 2005, 04:44
Default 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);

}
  Reply With Quote

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

Old   April 12, 2005, 09:22
Default 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!
  Reply With Quote

Old   April 12, 2005, 09:59
Default 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
  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
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
mass fraction of species Lilly FLUENT 3 July 25, 2011 05:00
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14
CFX Solver Memory Error mike CFX 1 March 19, 2008 08:22


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