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

new-parameter :surface integral of velocity

Register Blogs Community New Posts Updated Threads Search

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

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"

DEFINE_EXECUTE_AT_END(ach,f,t,d,dt,w,v)
{
face_t f; Thread *t; Domain *d; real NV_VEC(A);
/* Integrate w velocity. */
real flow_time = CURRENT_TIME;
real dt = CURRENT_TIMESTEP;
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 */
thread_loop_f(t,d)
{
begin_f_loop(f,t)

if (w<=0)
{
ACHt_in= w * NV_MAG(A)/16 ;
sum_ACHt_in +=ACHt_in;
ACHt_it=sum_ACHt_in*dt/flow_time;
}
else
{
ACHt_out= w * NV_MAG(A)/16;
sum_ACHt_out +=ACHt_out;
ACHt_ot=sum_ACHt_out*dt/flow_time;
}
if (v<=0)
{
ACHs_in= v * NV_MAG(A)/16 ;
sum_ACHs_in +=ACHs_in;
ACHs_it=sum_ACHs_in*dt/flow_time;
}
else
{
ACHs_out= v * NV_MAG(A)/16;
sum_ACHs_out +=ACHs_out;
ACHs_ot=sum_ACHs_out*dt/flow_time;
}

end_f_loop(c,t)
}

}


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.
Cheers,
Negin
nenazarian is offline   Reply With Quote

Old   December 6, 2013, 03:16
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
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

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
[snappyHexMesh] Layers don't fully surround surface EVBUCF OpenFOAM Meshing & Mesh Conversion 14 August 20, 2012 05:31
Text command for report surface integral jbjiang FLUENT 0 November 2, 2011 15:54
[Gmsh] boundaries with gmshToFoam‏ ouafa OpenFOAM Meshing & Mesh Conversion 7 May 21, 2010 13:43
Surface Integral - Mass Flow Rate Venkatesh V FLUENT 3 October 10, 2008 17: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 17:11.