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

how to get such mass fraction

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
mass fraction of species Lilly FLUENT 5 March 13, 2022 17:52
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 21:14
CFX Solver Memory Error mike CFX 1 March 19, 2008 07:22


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