|
[Sponsors] |
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: 14 |
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: 1,965
Rep Power: 27 |
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). |
|
|
|
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 |