Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Error in computing Residence Time with P_TIME0 macro

    • cibi
      Subscriber

      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
      Ansys Employee

      Hi,

      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: /forum/forums/topic/using-help-with-links/#latest

      Thank you

      Saurabh

    • Amine Ben Hadj Ali
      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.

      • cibi
        Subscriber

        Thank you!

        I have used Mean Age of Air and it worked

    • Amine Ben Hadj Ali
      Ansys Employee

      Super!

Viewing 3 reply threads
  • The topic ‘Error in computing Residence Time with P_TIME0 macro’ is closed to new replies.