CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

new-parameter :surface integral of velocity

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

LinkBack Thread Tools Display Modes
Old   December 5, 2013, 20:18
Default new-parameter :surface integral of velocity
Negin Nazarian
Join Date: Jan 2012
Location: San Diego
Posts: 61
Rep Power: 7
nenazarian is on a distinguished road

I need to define air exchange rate in each node by integrating y and z velocity on a face surface. For that purpose, I have wrote the following UDF

/************************************************** *********************/
/* UDF for computing the magnitude of ACH */
/************************************************** *********************/
#include "udf.h"

face_t f; Thread *t; Domain *d; real NV_VEC(A);
/* Integrate w velocity. */
real flow_time = CURRENT_TIME;
real w= F_W(f,t) ; real v= F_V(f,t) ;

real sum_ACHt_in=0.; real sum_ACHs_in=0.;
real sum_ACHt_out=0.; real sum_ACHs_out=0.;
real ACHt_in, ACHt_out, ACHt_it, ACHt_ot;
real ACHs_in, ACHs_out, ACHs_it, ACHs_ot;
/*cell_t c;*/

d = Get_Domain(1); /* mixture domain if multiphase */

if (w<=0)
ACHt_in= w * NV_MAG(A)/16 ;
sum_ACHt_in +=ACHt_in;
ACHt_out= w * NV_MAG(A)/16;
sum_ACHt_out +=ACHt_out;
if (v<=0)
ACHs_in= v * NV_MAG(A)/16 ;
sum_ACHs_in +=ACHs_in;
ACHs_out= v * NV_MAG(A)/16;
sum_ACHs_out +=ACHs_out;



However, I am confused on how to access and output this parameter in each node after calculation.
Also, is it possible to use sampling option for time averaging this parameter?

I would appreciate your help.
nenazarian is offline   Reply With Quote

Old   December 6, 2013, 03:16
Senior Member
Join Date: Nov 2013
Posts: 1,134
Rep Power: 15
pakk will become famous soon enough
Use user defined memories (UDM) for your variables.
For example, if you want to access ACHs_ot, replace it by F_UDMI(f,t,0).
pakk 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
Layers don't fully surround surface EVBUCF OpenFOAM Native Meshers: snappyHexMesh and Others 14 August 20, 2012 04:31
Text command for report surface integral jbjiang FLUENT 0 November 2, 2011 15:54
boundaries with gmshToFoam‏ ouafa Open Source Meshers: Gmsh, Netgen, CGNS, ... 7 May 21, 2010 12:43
Surface Integral - Mass Flow Rate Venkatesh V FLUENT 3 October 10, 2008 16:18
Velocity in Porous medium : HELP! HELP! HELP! Kali Sanjay Phoenics 0 November 6, 2006 07:10

All times are GMT -4. The time now is 15:43.