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

DEFINE_GRID_MOTION with calculation of wall shear stress

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 8, 2014, 11:06
Default DEFINE_GRID_MOTION with calculation of wall shear stress
  #1
New Member
 
AFM
Join Date: Nov 2013
Posts: 14
Rep Power: 10
Entwistle is on a distinguished road
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.

Someone, please, could help me?

Thanks a lot.
Entwistle is offline   Reply With Quote

Old   July 10, 2014, 03:12
Default
  #2
New Member
 
AFM
Join Date: Nov 2013
Posts: 14
Rep Power: 10
Entwistle is on a distinguished road
Anybody has any idea about that?
Entwistle is offline   Reply With Quote

Reply

Tags
grid motion, udf, wall shear stress

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Measuring wall shear stress in bend pipe liguifan OpenFOAM 70 December 9, 2015 03:49
What is wall shear stress and shear strain rate? warlocklw Main CFD Forum 2 May 21, 2012 06:16
Wall shear stress GamFlu Main CFD Forum 0 June 11, 2011 04:33
UDF for wall slipping HFLUENT Fluent UDF and Scheme Programming 0 April 27, 2011 12:03
relationship between wall shear stress and TKE winter FLUENT 0 December 11, 2007 17:11


All times are GMT -4. The time now is 03:09.