|
[Sponsors] |
Compilation error in UDF for gas-solid fluidized bed |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 9, 2012, 21:05 |
Compilation error in UDF for gas-solid fluidized bed
|
#1 |
New Member
Amir Hossein Ahmadi Motlagh
Join Date: Jan 2012
Posts: 5
Rep Power: 14 |
Hi all,
I am simulating a 2D gas-solid fluidized bed using eulerian/eulerian plus granular flow theory. I have two user-defined memory variables (C_UDMI(0) and C_UDMI(1)) and want to calculate C_UDMI(1) for each cell in my domain using C_UDMI(0) of adjacent cells. I need to loop over all faces of a cell and find out if the solid mass flux is going into the cell or outside of it. If going into, then I will use the value of C_UDMI(0) of the adjacent cell to find out the C_UDMI(1) value. For this purpose I have written the following UDF: Code:
DEFINE_ON_DEMAND(on_demand_calc) { Domain *d; Thread *mix, *par_t, *tf, *t1; Thread **pt; cell_t c, c1; int n, m; d = Get_Domain(1); m = 0; mp_thread_loop_c (mix,d,pt) { par_t=pt[1]; /* solid phase */ begin_c_loop(c,par_t) { c_face_loop(c, par_t, n) { tf = C_FACE_THREAD(c, par_t, n); c1 = F_C1(tf, par_t); t1 = F_C1_THREAD(tf, par_t); if(F_FLUX(tf, par_t)<0) { C_UDMI(c, par_t, 1) += C_UDMI(c1, t1, 0); m += 1; } } if(m!=0) { C_UDMI(c, mix, 1) /= m; m = 0; } else { C_UDMI(c, mix, 1) = -1; } } end_c_loop(c,par_t) } } c_face_loop(c, par_t, n) I would appreciate if you could check the issue and advice if I am going the right way or I have errors in the way of accessing data in my UDF. Thanks Amir |
|
June 14, 2012, 04:32 |
|
#2 |
Member
Laurent B
Join Date: Jun 2009
Location: Lille, FRANCE
Posts: 70
Rep Power: 17 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
gas solid fluidizd bed with cfx | mohamad | CFX | 5 | July 28, 2010 16:15 |
how to define static bed height for fluidized bed | mohamad | CFX | 6 | July 28, 2010 15:46 |
gas solid fluidized bed with ansys cfx | mohamad | CFX | 0 | November 21, 2007 18:55 |
particle volume fraction in fluidized bed | gopinath bandari | CFX | 0 | October 6, 2006 04:26 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 13, 2001 00:19 |