|
[Sponsors] |
UDF for adding an energy source term to a porous zone |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 6, 2018, 07:43 |
UDF for adding an energy source term to a porous zone
|
#1 |
New Member
Mike
Join Date: Feb 2018
Posts: 1
Rep Power: 0 |
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. |
|
Tags |
energy source term, energy source udf, udf and programming |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 11:57 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 14, 2000 00:03 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 11, 2000 04:43 |