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

Compilation error in UDF for gas-solid fluidized bed

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 9, 2012, 21:05
Default 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
ahmadimo is on a distinguished road
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)
     }
}
When I try to interpret this UDF I get an error that "non-integer subscript expression: unsigned char." on the following line:

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
ahmadimo is offline   Reply With Quote

Old   June 14, 2012, 04:32
Default
  #2
Member
 
laurentb's Avatar
 
Laurent B
Join Date: Jun 2009
Location: Lille, FRANCE
Posts: 70
Rep Power: 17
laurentb is on a distinguished road
http://www.cfd-online.com/Forums/flu...face_loop.html
laurentb 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
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


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