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.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

UDF to calculate the radiation intensity on dpm particles

    • pavan
      Subscriber

      Hi 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

    • Rob
      Forum Moderator

      Where is DO_IRRAD defined?

    • pavan
      Subscriber

      I have seen in one blog. But please can you share me the macro how to get the irradiation in cell

    • Rob
      Forum Moderator

      It'll have been defined somewhere in the code.   Have a look in the UDF manual. 

    • pavan
      Subscriber

      I had gone through UDF manual but I am not able to find it.

Viewing 4 reply threads
  • The topic ‘UDF to calculate the radiation intensity on dpm particles’ is closed to new replies.
[bingo_chatbox]