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

UDF for adding an energy source term to a porous zone

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 6, 2018, 06:43
Default UDF for adding an energy source term to a porous zone
  #1
New Member
 
Mike
Join Date: Feb 2018
Posts: 1
Rep Power: 0
mtfowen is on a distinguished road
Hello!

I am using a porous zone to represent a heat exchanger in a 3D simulation and am trying to write a UDF to add an energy source term to the conservation equation as the flow passes through the zone.

In order to calculate the source term I need to know:

a) the mass flow rate entering the cell / zone
b) the temperature of the fluid at the zone inlet
c) the area of the cell face at the zone inlet

I will use the DEFINE_SOURCE macro as follows:

#include "udf.h"
DEFINE_SOURCE(heat_source,cell,thread,dS,eqn)
{
real source;

source= xyz;

dS[eqn] =0.0;
return source;
}

Any suggestions as to how I can extract the necessary information in this macro?

I know for example that for (c) I can use:

F_AREA(Avect, face, thread)
NV_MAG(Avect)

Is there a way to identify the face and face thread in the DEFINE_SOURCE macro or will I need a separate macro for this?

Thanks in advance.
mtfowen is offline   Reply With Quote

Reply

Tags
energy source term, energy source udf, udf and programming


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
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 09:17
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 13:59
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 13, 2000 23:03
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 11, 2000 03:43


All times are GMT -4. The time now is 08:00.