Daisy
Subscriber

Hi,

I was trying to use a UDF for drag. However, whenever I am trying to enable the UDMIs it gives error as follows

Node 0: Process 3124: Received signal SIGSEGV.

#include "udf.h"
//#include "math.h"
{
//#if !RP_HOST
float x_vel_w,x_vel_a,y_vel_w,y_vel_a,z_vel_w,z_vel_a,slip_x,slip_y,slip_z,abs_v;
float alpha_w,alpha_a,rho_w,rho_a,mu_w,mu_a,diam,drag;
float diam_w,CD,drags;

/* find the threads for the water (primary) */
/* and gas (secondary phases) */

/* find water phase velocities*/

/* find air phase velocities*/

/* find slip velocities air-water*/
slip_x = x_vel_w - x_vel_a;
slip_y = y_vel_w - y_vel_a;
slip_z = z_vel_w - z_vel_a;

/* to compute volume fraction in cells */

/* to compute density and viscosity in cells */

/* compute slip velocity */
abs_v = sqrt((slip_x*slip_x) + (slip_y*slip_y) + (slip_z*slip_z));   /* air-water slip velocity */

/*pair interaction*/

/*compute Reynold’s number water as continuous*/
re = (rho_w*abs_v*diam)/mu_w;
/* air-water*/
etov = 9.81*(rho_w-rho_a)*(diam*diam)/0.072;

/* to compute the drag coefficient C_D*/
adrag = (24.0/re)*(1.0+(0.15*pow(re,0.687)));     /* air-water slip velocity */
bdrag = (8.0*etov)/((3.0*etov)+12.0);

{
}
else
{
CD = bdrag;
}

/*slag-water*/

drags = (3.0*CD*(1.0- alpha_a)*rho_w*alpha_w*alpha_a*abs_v)/(4.0*diam);   /*air-water interaction*/
/*water as continuous phase*/
drag = MAX(drags, 0.0001);

/*UDMI*/

C_UDMI(cell, mix_thread,1) = drag;           /*interaction air-water*/

return drag;
//#endif

==============================================================================

The fl process could not be started.