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

udf problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 12, 2016, 12:58
Default udf problem
  #1
New Member
 
SARA
Join Date: Jul 2016
Posts: 2
Rep Power: 0
SARAHAVASHI is on a distinguished road
hello everyone
i want to write a udf which explains the zeta potential by temprature as this equation :zeta potantial=-0.2*temprature-78.2
and then i want to replace it into this udf instead of ...
can anybody tell me how to write this and add to this part please
thank u a lot
#include "udf.h"

DEFINE_PROFILE(slip_ncond_x,face_thread,i)
// x velocity for non conductive wall
{
face_t f;
cell_t neig;
Thread *cell_thread;
Domain *domain = Get_Domain(1);
real vel,normal_magnitude,E_normal_x,E_normal_y,E_repai red_x,E_repaired_y;
real NV_VEC(A);
real mu=0.001003;
real eps0=8.85e-12;
real eps=80.1;
real zeta_p=..........;

//cell_thread=THREAD_T1(face_thread);
cell_thread=THREAD_T0(face_thread);

begin_f_loop(f,face_thread)
{
neig=F_C0(f,face_thread);
// Repair E component values............................................ .................................................. ...
F_AREA(A,f,face_thread);
//Message("x is %g\n", A[0]);

normal_magnitude=pow( pow(A[0],2)+pow(A[1],2),0.5);

if ( NULL != THREAD_STORAGE(cell_thread,SV_UDS_I(0)) && NULL != T_STORAGE_R_NV(cell_thread,SV_UDSI_G(0)) )
{
E_normal_x=ND_DOT(-C_UDSI_G(neig,cell_thread,0)[0],-C_UDSI_G(neig,cell_thread,0)[1],0,A[0],A[1],0)/pow(normal_magnitude,2)*A[0];
E_normal_y=ND_DOT(-C_UDSI_G(neig,cell_thread,0)[0],-C_UDSI_G(neig,cell_thread,0)[1],0,A[0],A[1],0)/pow(normal_magnitude,2)*A[1];

E_repaired_x=-C_UDSI_G(neig,cell_thread,0)[0]-E_normal_x;
E_repaired_y=-C_UDSI_G(neig,cell_thread,0)[1]-E_normal_y;
}
else
E_repaired_x = 0 ;
//.................................................. .................................................. ........................
F_PROFILE(f,face_thread,i)=-eps0*eps*zeta_p*E_repaired_x/mu;
}
end_f_loop(f,face_thread)
}
SARAHAVASHI is offline   Reply With Quote

Reply


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 07:05
Problem with DPM simulation with particles injection and EXECUTE_AT_THE_END UDF. Ari Fluent UDF and Scheme Programming 4 May 31, 2016 09:51
udf loading problem santu Fluent UDF and Scheme Programming 1 May 22, 2015 16:47
Vaporization pressure UDF property problem? lehoanganh07 Fluent UDF and Scheme Programming 1 September 13, 2014 11:59
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 07:56


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