# DEFINE_GRID_MOTION with calculation of wall shear stress

 Register Blogs Members List Search Today's Posts Mark Forums Read

July 8, 2014, 11:06
DEFINE_GRID_MOTION with calculation of wall shear stress
#1
New Member

AFM
Join Date: Nov 2013
Posts: 14
Rep Power: 12
Hi all;

I need to use a DEFINE_GRID_MOTION based on the magnitude of wall shear stress on the wall of my mesh. I tried the next code:

Quote:
 #include "udf.h" #include "dynamesh_tools.h" #include "mem.h" DEFINE_GRID_MOTION(cambio_malla,domain,dt,time,dti me) { Thread *tf = DT_THREAD(dt); face_t f; Node *v; real vel, tau, area, visc; cell_t c0; Thread *ct0; real t11, t12, t13, t21, t22, t23, t31, t32, t33; real T1, T2, T3, T; real NV_VEC(dz); real A[ND_ND]; int n; SET_DEFORMING_THREAD_FLAG(THREAD_T0(tf)); NV_S(dz,=,0); /*Init the deformation vector as a zero-vector*/ begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v = F_NODE(f,tf,n); /*Coordinates of the nodes*/ F_AREA(A,f,tf); /*Area vector of the face, in order to use the vector A_j=A n_j*/ visc=C_MU_T(c0,ct0); /*Viscosity of the fluid*/ t11=visc*(C_DUDX(c0,ct0)); /*Definition of the components of the viscous stress tensor t_ij*/ t12=0.5*visc*(C_DUDY(c0,ct0)+C_DVDX(c0,ct0)); t13=0.5*visc*(C_DUDZ(c0,ct0)+C_DWDX(c0,ct0)); t21=0.5*visc*(C_DUDY(c0,ct0)+C_DVDX(c0,ct0)); t22=visc*(C_DVDY(c0,ct0)); t23=0.5*visc*(C_DVDZ(c0,ct0)+C_DWDY(c0,ct0)); t31=0.5*visc*(C_DUDZ(c0,ct0)+C_DWDX(c0,ct0)); t32=0.5*visc*(C_DVDZ(c0,ct0)+C_DWDY(c0,ct0)); t33=visc*(C_DWDZ(c0,ct0)); T1 = t11*A[0]+t12*A[1]+t13*A[2]; /*Definition of the components of the force as T_i = t_ij A_j*/ T2 = t21*A[0]+t22*A[1]+t23*A[2]; T3 = t31*A[0]+t32*A[1]+t33*A[2]; T = sqrt(pow(T1,2)+pow(T2,2)+pow(T3,2)); /*Magnitude of the force vector*/ area = sqrt(pow(A[0],2)+pow(A[1],2)+pow(A[2],2)); /*Magnitude of the area vector*/ tau = T/area; /*Magnitude of the wall shear stress*/ vel=0.0158*pow((3.584*tau-1),1.5); /*Correlation for velocity of deformation of the bed as a function of the wall shear stress*/ if (NODE_Z(v)<0.001 && NODE_POS_NEED_UPDATE(v)) /*Condition for the deformation of the bed*/ { NODE_POS_UPDATED (v); dz[2]=vel; /*The bed only moves in the Z direction, as a vertical movement*/ NV_S(dz,*=,dtime); NV_V(NODE_COORD(v), -=,dz); /*New positions of the nodes*/ } } end_f_loop(f,tf); } }
However, when I compile the code, fluent sends two warnings:

Quote:
 Warning: c0 may be used uninitialized in this function. Warning: ct0 may be used uninitialized in this function.
Finally, when I run the simulation, fluent shows the next errors:

NODE XX: Process YYYYYYY: Received signal SIGILL (XX is a number from 0 to 19, I am running the simulation on a 20-nodes linux machine, and YYYYYYY is the number of the process assigned to the node XX).

NODE 999999: Process ZZZZ: Received signal SIGILL (ZZZZ is another number, but I haven't the node 999999).

MPI Application rank 1 exited before MPI_Finalize() with status 2. The fluent process could not be started.

Thanks a lot.

 July 10, 2014, 03:12 #2 New Member   AFM Join Date: Nov 2013 Posts: 14 Rep Power: 12 Anybody has any idea about that?

 Tags grid motion, udf, wall shear stress