|
[Sponsors] |
December 16, 2007, 10:27 |
UDF mass flow rate
|
#1 |
Guest
Posts: n/a
|
Hi, I'm new in fluent and i have a big project to make for university. I need to make a UDF in fluent which gives me the mass flow rate of a fluid that travels through a plane. I know you can do this with "report" and then surface integrals. But there are several flows passing through the plane. One major flow, and some secondary flows (which are in the opposite directions). So i have a criteria on which i can base which flows i want. But how do you turn this into an UDF. I've been reading through the manual, but up untill now, haven't found anything that would suit this problem. I think it's a very basic UDF, but for a newbie it's quite difficult . Any help would be welcome!
|
|
December 18, 2007, 08:13 |
Re: UDF mass flow rate
|
#2 |
Guest
Posts: n/a
|
Hi,
you could iterate through all the faces of the plane and add the products of face_velocity*density*face_area only of those faces where the face_velocity is positive (or negative, depends on your problem). You can get the face_area with BOUNDARY_FACE_GEOMETRY macro. You will find help in UDF manual how to get values at faces and how to iterate through faces. Regards, Greg |
|
December 22, 2007, 10:29 |
Re: UDF mass flow rate
|
#3 |
Guest
Posts: n/a
|
Thanks for this reply. I've been trying to write the UDF with the help of the manual, but there isn't much explanation in the manual about the basic functions. Could somebody have a look at my code and give some suggestions or tell me where i can find a list of the basic functions used with some explanation. This is my code so far
#include "udf.h" DEFINE_ON_DEMAND(massflow_hor) { Thread *t; cell_t c; face_t f; real sum_massflow=0., A; begin_f_loop(f,t) if(C_U(c,t)>0){ sum_massflow += C_U(c,t) * C_R(c,t) * F_AREA(A,f,t); } end_f_loop(f,t) printf("the massflow is: %g",sum_massflow); } Could somebody give me some suggestions, how i can compute the massflow through a plane that i want. E.G. that i can give an input which plane i want this function to work in. Also the AREA function gives an error, the A is defined wrongly. thanks for your help. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass flow rate not conserved in turbomachine, interface defined wrong? | wildli | FLUENT | 3 | September 15, 2022 13:19 |
Mass flow rate: calculation v/s computation | beguxa | FLUENT | 5 | December 2, 2018 22:02 |
UDF to measure Mass Flow Rate | a.lynchy | Fluent UDF and Scheme Programming | 31 | October 4, 2018 15:10 |
Mass Flow Rate | student87 | CFX | 4 | January 2, 2010 05:45 |
mass flow rate entering and exiting a cell | samir bensaid | FLUENT | 0 | July 4, 2007 06:37 |