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

Heat source dependent on mass flow rate

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 3, 2016, 13:02
Question Heat source dependent on mass flow rate
  #1
New Member
 
diegovda
Join Date: May 2016
Posts: 10
Rep Power: 9
User12 is on a distinguished road
Hello,

I have some experience using fluent, but I am quite new at UDFs. I am trying to set a volumetric heat source which is dependent on the mass flow rate. I think I know how to implement a UDF for a volumetric heat source, but my problem begins when I want to calculate the mass flow rate in each centroid and use this value in the definition of the heat source.

Can anybody give me a clue?

Thank you very much!!
User12 is offline   Reply With Quote

Old   May 6, 2016, 03:24
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
With "mass flow rate" you mean density * velocity, right?

Do you have access to the Fluent manual? That gives info on how to access these variables in a UDF. (C_R(c,t) for density, and so on.)

Can you show how far you already got with the rest of the UDF? That gives a better idea on how much and what kind of help you need.
pakk is offline   Reply With Quote

Old   May 6, 2016, 06:32
Default
  #3
New Member
 
diegovda
Join Date: May 2016
Posts: 10
Rep Power: 9
User12 is on a distinguished road
Thanks for the answer.

Yes, it would proportional to velocity and density, but I think that in the case of defining it this way, the cell area should also be included. I explain myself.

My need is to define a heat source, q (W/m3), which is proportional to the flow rate, m (kg/s). Then, the easiest way to define it would be:

q (W/m3)= C (J/kg) * m (kg/s) * 1/Vcell (1/m3)

C is a constant and Vcell is the cell volume.

However, the only way I know to read the mass flow rate is through F_FLUX(f,t), which is a face variable. When I use this parameter in the macro DEFINE_SOURCE, i get a segmentation fault error, which I think is due to that this macro only deals with cell variables (not face variables).

Then, I tried to define the mass flow rate using density, velocity and area.

q (W/m3)=C (J/kg) * v (m/s) * rho (kg/m3) * A (m2)

I am stuck on this point, since I have two problems. 1) I don't know how to define the area. I think this would be again a face variable. 2) I can't see which is the area I need. I mean, which is the area that defines the amount of fluid inside the cell? Is it the area of a specific face? Is it the area normal to the velocity vector?

Here I paste the UDF I have been writing.



#include "udf.h"
#include "mem.h"

real U;
real V;
real VEL;
real RHO;

DEFINE_SOURCE(heat_source,thread,dS,eqn)
{
real source;

cell_t c;
Thread *t;

U=pow(C_U(c,t),2);
V=pow(C_V(c,t),2);
VEL=pow(U+V,0.5);
RHO=C_R(c,t);

source=20000*VEL*RHO*...; AREA IS MISSING


return source;
}


20000 is an arbitrary value for C. VEL is velocity magnitude, calculated through the squared radial and axial velocity components (axisymmetric simulation).

Regards
User12 is offline   Reply With Quote

Old   May 6, 2016, 07:22
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
My need is to define a heat source, q (W/m3), which is proportional to the flow rate, m (kg/s).
From a physical point of view, I don't understand this. Flow rate is always through some surface, and heat source is local. I think there you already have your 'missing surface'.
Suppose in your model the flow rate would be 1 kg/s, and the corresponding heat source would be 1 W/m3. If you then would look at half of your model (such that it splits the flow 50/50), the flow rate would be 0.5 kg/s, so the heat source in that half model would be 0.5 W/m3, but that does not make any sense: the heat generation per unit volume should not depend on how big the volume is you are looking at.

I don't know what you need to do, so I don't know what to change it to. Below are two options that make sense from a physical point of view, but that does not mean they describe your situation.

  • Total heat generated (W) can be proportional to the total mass in the system (kg). Then the heat source (W/m3) is proportional to the density (kg/m3).
  • Total heat generated (W) can be proportional to the magnitude of the linear momentum of your fluid (kg m/s). Then the heat source (W/m3) is proportional to density multiplied by the magnitude of the velocity (kg/m2.s).
pakk is offline   Reply With Quote

Old   May 9, 2016, 04:15
Default
  #5
New Member
 
diegovda
Join Date: May 2016
Posts: 10
Rep Power: 9
User12 is on a distinguished road
Thanks again for answering.

From your reasoning I could change my point of view and use a different approach for my problem.
User12 is offline   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 flow rate: calculation v/s computation beguxa FLUENT 5 December 2, 2018 21:02
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 06:42
Mass flow rate of phase in post mat_cfd CFX 0 September 3, 2013 07:55
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
Target mass flow rate Saturn FLUENT 0 December 10, 2004 04:18


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