|
[Sponsors] |
April 12, 2005, 02:37 |
how to get such mass fraction
|
#1 |
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 |
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 |
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 |
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 |
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 |
|
|
|
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 |