CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   DEFINE_PROFILE for wall shear stress (http://www.cfd-online.com/Forums/fluent/110903-define_profile-wall-shear-stress.html)

IndrajitW December 24, 2012 14:29

DEFINE_PROFILE for wall shear stress
 
Hi all,
I wish to provide a user defined wall shear stress and for that I am using DEFINE_PROFILE macro. In that I am using the F_PROFILE(f,t,i)= 2*C_U(c,t0)+0.07;
However I am getting a segmentation violation error. Is my way of defining F_PROFILE wrong?
Regards,
Indrajit

msaeedsadeghi December 25, 2012 01:46

May you please share full UDF to check?

IndrajitW December 25, 2012 02:01

Hi,
Here's the UDF part of DEFINE_PROFILE for shear stress:
DEFINE_PROFILE(shear_stress, t, pos)
{ face_t f;
cell_t c;
Thread *t0,*pt;
real a=0,r=20,s=20,p=0;
real vel_val[3],VOF_NORMAL[3];
real con_line_vel,z,stress;

begin_f_loop(f,t)
{ c= F_C0(f,t);
t0=THREAD_T0(t);
pt=THREAD_SUB_THREAD(t0,1);
if(C_VOF(c,pt)!=1 && C_VOF(c,pt)>0.5)
{ a=1;
vel_val[0]=C_U(c,t0);
vel_val[1]=C_V(c,t0);
vel_val[2]=C_W(c,t0);
VOF_NORMAL[0]=C_UDMI(c,t0,0);
VOF_NORMAL[1]=C_UDMI(c,t0,1);
VOF_NORMAL[2]=C_UDMI(c,t0,2);
con_line_vel=NV_DOT(vel_val,VOF_NORMAL);
z=NV_MAG(C_UDSI_G(c,t0,0));
if(con_line_vel>0)
{ stress=-((BETA*vel_val[0])+(SIGMA*2))*r/13;
F_PROFILE(f,t,pos)=stress;
r=r-1;
p=2;
}
else if (con_line_vel<0)
{ stress=((BETA*vel_val[0])+(SIGMA*2))*r/13;
F_PROFILE(f,t,pos)=stress;
r=r-1;
p=1;
}
}
This F_PROFILE is responsible for segmentation violation error.Even C_UDSI_G gives me the same error but I feel if I hook it after few iterations it might get sorted. However what about the F_PROFILE?
Reagrds,
Indrajit

msaeedsadeghi December 25, 2012 03:38

There are so many errors in it. Have asked fluent to save UDSI_G? If no, you can not use this code.
set/solve/expert/....

IndrajitW December 25, 2012 04:31

I have asked fluent to save UDSI_G by set/solve/expert....Since the UDF compiles I am sure there aren't any syntax errors. As also I have checked by commenting certain parts and expect for the F_PROFILE Part I do not get segmentation violation. What else do you think could be wrong??I feel theres something wrong with F_PROFILE.
Regards,
Indrajit


All times are GMT -4. The time now is 00:26.