-
-
July 5, 2020 at 8:22 am
pavan
SubscriberHi Guyz,
I am trying to calculate the intensity of DO radiation on the dpm particles that are injected from inlet along the trajectories. For that reason I used below mentioned udf in which irradiation(W/m2) in before the timestep started and irradiation after the time step is completed is used with trapezoidal rule to integrate the intensity (j/m2)
#include "udf.h"
#include "dpm.h"
DEFINE_INIT(rad_init,domain)
{
/* if memory for the particle variable titles has not been
* allocated yet, do it now */
if (NULLP(user_particle_vars)) Init_User_Particle_Vars();
/* now set the name and label */
strcpy(user_particle_vars[0].name,"rad_virus");
strcpy(user_particle_vars[0].label,"Rad Virus");
strcpy(user_particle_vars[1].name,"rad_virus-0");
strcpy(user_particle_vars[1].label,"Rad Virus 0");
}
DEFINE_DPM_SCALAR_UPDATE(rad_virus,cell,thread,initialize,tp)
{
Injection *I;
Particle *p;
cell_t c;
Thread *t;
if (initialize)
{
TP_USER_REAL(tp,0) = 0.;
TP_USER_REAL(tp,1) = c->DO_IRRAD;
}
else
{
/* use a trapezoidal rule to integrate the melting index */
TP_USER_REAL(tp,0) += 0.001 * .5 * (TP_USER_REAL(tp,1) + c->DO_IRRAD);
/* save current fluid viscosity for start of next step */
TP_USER_REAL(tp,1) = c->DO_IRRAD;
}
}
But it is throwing error C2223: left of '->DO_IRRAD' must point to struct/union
Please Help
-
July 6, 2020 at 10:55 am
Rob
Forum ModeratorWhere is DO_IRRAD defined?
-
July 6, 2020 at 11:04 am
pavan
SubscriberI have seen in one blog. But please can you share me the macro how to get the irradiation in cell
-
July 6, 2020 at 3:24 pm
Rob
Forum ModeratorIt'll have been defined somewhere in the code. Have a look in the UDF manual.
-
July 6, 2020 at 3:47 pm
pavan
SubscriberI had gone through UDF manual but I am not able to find it.
-
- The topic ‘UDF to calculate the radiation intensity on dpm particles’ is closed to new replies.
-
6144
-
1906
-
1442
-
1308
-
1022
© 2026 Copyright ANSYS, Inc. All rights reserved.