CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF for bubble diameter in two phases, help!! (https://www.cfd-online.com/Forums/fluent/48546-udf-bubble-diameter-two-phases-help.html)

edgar h June 19, 2008 20:37

UDF for bubble diameter in two phases, help!!
 
Hello everyone, I am simulating a stirred tank in two phases (gas-liquid) using the model euler-euler and model k-e for dispersed phase. my problem is that I want to use a model for the bubble diameter of the gas phase. Here is what model of the bubble diameter: d_b = 1.4*(sigma/rho)^0.6*e^04 sigma = surface tension of the liquid phase; rho = density of the liquid phase; e = Turbulent kinetic energy dissipation rate of the liquid phase

Option first: #include "udf.h" #define g_c 9.81 // gravitational acceleration [m/s2] #define sigma 0.07197 // suface tension [kg/s2] #define domain_ID 2 // primary phase DEFINE_PROPERTY(custom_diameter_bubble, c, t) { cell_t c; Thread *t; Domain *d = Get_Domain(domain_ID); real rho_l, tked, d_bubble; thread_loop_c(c, d) { begin_c_loop(c, t) { rho_l = C_R(c, t);// get cell liquid phase density [m3/kg] tked = C_D(c, t);// get cel liquid phase Turbulent kinetic energy dissipation rate [m2/s3] d_bubble = 1.4*pow(sigma/rho_l,0.6)*pow(tked,-0.4); } end_c_loop(c, t) } return d_bubble; }

//////////////////////////////////////////////////////////// Option second: #include "udf.h"

#define g_c 9.81 // gravitational acceleration [m/s2] #define sigma 0.07197 // suface tension [kg/s2] #define domain_ID 2 // primary phase

DEFINE_ADJUST(adjust_variables, domain) { Thread *t; cell_t c; domain = Get_Domain(domain_ID); thread_loop_c(t, domain)

{

begin_c_loop(c, t)

{

C_UDMI(c, t, 0) = C_R(c, t);

C_UDMI(c, t, 1) = C_D(c, t);

}

end_c_loop(c, t)

} }

DEFINE_PROPERTY(custom_diameter_bubble, c, t) { cell_t c; Thread *t; real rho_l, tked, d_bubble;

rho_l = C_UDMI(c, t, 0); tked = C_UDMI(c, t, 1); d_bubble = 1.4*pow(sigma/rho_l,0.6)*pow(tked,-0.4);

return d_bubble; }

I have tried without any success, someone has an idea of how to implement the model? In both options send an error (acces violation) after of Interpreted UDF. Thanks in advance by your help!!



All times are GMT -4. The time now is 02:40.