Error in computing Residence Time with P_TIME0 macro

    • c.bruno

      Hello everyone,

      I would like to compute the residence time of blood in my CFD simulations (steady state). 

      I know I can use the DPM model but I would like to have a spatial distribution of the residence time to do something like this in post-processing:

      I have read that I can use these macros: P_TIME0 and P_TIME, so I wrote a udf but when running my simulation at the first iteration I get abnormal exit which I think is due to the udf.

      This is my udf:

      I am not sure if I can use P_TIME0 and P_TIME in a define_execute_at_end function. I have tried to use define_dpm_source but I couldn't understand how to return the values or save them in S. Also, I do not know if the pointer p to the particle is correctly used in my udf.

      Does anybody know how to solve this?

      Thank you!

    • SRP


      For more details on define_dpm_source please refer to fluent customization manual: 2.5. Discrete Phase Model (DPM) DEFINE Macros (ansys.com)

      If you are not able to access the link, please refer to this forum discussion: https://forum.ansys.com/forums/topic/using-help-with-links/#latest

      Thank you


    • DrAmine
      Ansys Employee

      I think you need to use the approach of "Mean Age of Air" with UDS if you want a spatial distribution.

      Your UDF is wrong as you are trying to use Particle related variables in Eulerian Sense.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.