matus
Subscriber

#include "udf.h"
DEFINE_EXECUTE_AT_END(source_calculation)
{
Domain *d=Get_Domain(1);
int zone_id=11;
Thread *t = Lookup_Thread(d,zone_id);
cell_t c;
real dt=CURRENT_TIMESTEP;
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,1)=pow(10,5);
if(NNULLP( THREAD_STORAGE(t, SV_P)))
{
if (C_P(c,t)>C_UDMI(c,t,1))
{
C_UDMI(c,t,2)=1;
}
else
{
C_UDMI(c,t,2)=100;
}
C_UDMI(c,t,0)=C_UDMI(c,t,0)+(C_UDMI(c,t,2)*dt);
}
end_c_loop(c,t)
}
}
}