Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.

Ansys Learning Forum Forums Discuss Simulation Fluids Regarding UDF Reply To: Regarding UDF

ritwik
Subscriber
#include "udf.h"
int i;
/*Adsorption*/
DEFINE_ADJUST(adsorption,d)
{
Thread*t; cell_t c; real E,A,P;
thread_loop_c(t,d)
{
begin_c_loop (c,t)
{
real tem=C_T(c,t);
P=C_P(c,t)+RP_Get_Real("operating-pressure");
E=3080+18,9*tem;
A=8,31429*tem*log(1.47E9/P);
C_UDSI(c,t,i)=71.6*exp(-A*A/(E*E));
}
end_c_loop(c,t)
}
}
DEFINE_ADJUST(q_ads, d)
{
Thread *t;cell_t c; real dt;
thread_loop_c(t,d){ /*q_ads is the UDF name i am defining*/
begin_c_loop(c,t){
dt = RP_Get_Real("physical-time-step")/*int i is number of UDS*/
C_UDSI(c,t,i)=C_UDSI(c,t,i)+0.15.*dt*(C_UDSI(c,t,i)-C_UDSI(c,t,i));}
end_c_loop(c,t)
}
}
I am allocating 2 UDS and 4 UDM
After go through the manual, i modified the UDF. Can you please tell me, where i have gone wrong?

[bingo_chatbox]