CFD Online Logo CFD Online URL
Home > Forums > FLUENT

Problem calcualting the mass flow entering each cell

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

LinkBack Thread Tools Display Modes
Old   May 31, 2012, 15:24
Default Problem calcualting the mass flow entering each cell
New Member
Join Date: May 2012
Posts: 2
Rep Power: 0
javiercran is on a distinguished road
I have tried to calculate the mass flow entering inside a cell (for a DEFINE_SOURCE macro) with a loop over the faces of the cell but I have problems of "non-integer subscript expression: unsigned char".
This is my code

#include "udf.h"
#include <mem.h>
//near peak operating point
real Ft; //Ft source term
real T01; //Inlet Total temperature
real T02; //Outlet Total temperature
real cp; //variable which will store the specific heat of air
real x[ND_ND]; //array for storing the centroid position
real pi=3.1416;
real omega=16043*2*pi/60;
real r;
face_t f;
real massflow=0;
real volume;
Thread *f_thread;
int n;

c_face_loop(c,t,n)//line 21 the one which gives problems
f_thread = C_FACE_THREAD(c,t,n);
if(F_FLUX(f,f_thread)>0)// only calculate the massflow entering

C_CENTROID(x,c,t);//we store in x the centroid position of each cell
r=x[1];// the radial position is the y-coordinate of the cell centroid
r = x[1];
return Ft;

I need your help because I cant see the mistake I am doing.
javiercran is offline   Reply With Quote


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
Target Mass Flow Rate Nitin FLUENT 9 June 17, 2017 10:30
Problem of mass conservation in multispecies flow in porous media and T gradient pilou FLUENT 0 January 31, 2011 09:19
CFX-Post: problem with mass flow Markus CFX 5 February 19, 2005 18:30
Target mass flow rate Saturn FLUENT 0 December 10, 2004 05:18
Problem on boundry of two phase flow youngan CFX 0 June 30, 2003 02:32

All times are GMT -4. The time now is 02:47.