# new-parameter :surface integral of velocity

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 December 5, 2013, 20:18 new-parameter :surface integral of velocity #1 Member   Negin Nazarian Join Date: Jan 2012 Location: San Diego Posts: 61 Rep Power: 5 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

 December 6, 2013, 03:16 #2 Senior Member   Join Date: Nov 2013 Posts: 689 Rep Power: 9 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).

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post EVBUCF OpenFOAM Native Meshers: snappyHexMesh and Others 14 August 20, 2012 04:31 jbjiang FLUENT 0 November 2, 2011 15:54 ouafa Open Source Meshers: Gmsh, Netgen, CGNS, ... 7 May 21, 2010 12:43 Venkatesh V FLUENT 3 October 10, 2008 16:18 Kali Sanjay Phoenics 0 November 6, 2006 07:10

All times are GMT -4. The time now is 20:30.

 Contact Us - CFD Online - Top