|
[Sponsors] |
April 26, 2015, 12:53 |
Writing UDF to represent drag equations
|
#1 |
New Member
Join Date: Jan 2015
Posts: 11
Rep Power: 11 |
Hello,
I am new with using UDF. I tried to write one to represent the drag equations in the attached file for 3 phase flow (1 liquid and 2 solid). I tried to write one similar (below) to that provided in section 2.4.2 DEFINE_EXCHANGE_PROPERTY in UDF manual [UDF for customizing the default Syamlal drag law in Fluent] , but it doesn't work. It seems that I have a problem with defining inputs [I got error when defining the solid fraction Es]. /************************************************** ************* UDF for customizing the default Syamlal drag law in Fluent ************************************************** **************/ #include "udf.h" #define pi 4.*atan(1.) #define diam2 0.000163 DEFINE_EXCHANGE_PROPERTY(custom_drag,cell,mix_thre ad,s_col,f_col) { Thread *thread_l, *thread_s; real x_vel_l, x_vel_s, y_vel_l, y_vel_s, abs_v, slip_x, slip_y, rho_l, rho_s, mu_l, reyp, afac, bfac, void_l, vfac, fdrgs, taup, k_g_s; /* find the threads for the gas (primary) */ /* and solids (secondary phases) */ thread_l = THREAD_SUB_THREAD(mix_thread, s_col);/* gas phase */ thread_s = THREAD_SUB_THREAD(mix_thread, f_col);/* liquid phase*/ /* find phase velocities and properties*/ x_vel_l = C_U(cell, thread_l); y_vel_l = C_V(cell, thread_l); x_vel_s = C_U(cell, thread_s); y_vel_s = C_V(cell, thread_s); slip_x = x_vel_l - x_vel_s; slip_y = y_vel_l - y_vel_s; rho_l = C_R(cell, thread_l); rho_s = C_R(cell, thread_s); mu_l = C_MU_L(cell, thread_l); void_l = C_VOF(cell, thread_l);/* gas vol frac*/ k_g_s =(6 / 27) * (3.6*Es / pow(El,2.0) + pow (El,2.0)) + (0.11 + ( 2*K /(3 * pow(Vs, 2.0)))); return k_g_s; } I got the error : Es: undeclared variable Can any one give me instructions about my mistakes and how to write a correct one. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to Mix AIR and WATER | Elvis1991 | FLUENT | 12 | December 1, 2016 12:28 |
Writing UDF (DEFINE_PROFIL) for two surfaces | Geisel | Fluent UDF and Scheme Programming | 5 | June 21, 2010 08:38 |
About UDF for pressure Drag | mkrao | FLUENT | 2 | February 8, 2009 05:51 |
Actual drag force from dimensionless equations | slaxmi | CFX | 10 | September 14, 2007 19:20 |
Inviscid Drag at subsonic, subcritical Mach # | Axel Rohde | Main CFD Forum | 1 | November 19, 2001 12:19 |