Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

UDF to get particle concentration into a volume and inject new particles

    • matti956
      Subscriber

      Hi all,


      I am rather good at fluent, however there is a field that I have never really had to use, UDFs. I've had a look at tutorials, and it is not very clear, to be honest. But let me explain my problem first.


      Basically I want to maintain a fixed particles concentration in a cell zone (I have 5 cell zones in my whole fluid domain). The particles move from one to the other. What I want to do is to "get" the particles concentration in cell zone "A", have it subtracted to a fixed value, and then after few calculations, output this value as the number of particles to be injected back into the model.


      I would think the function below would be the solution, but honestly I do not know how to put everything together.


      C_STORAGE_R(c,t,SV_DPMS_CONCENTRATION)


      My model is unsteady!


      Any help would be appreciated!

    • Amine Ben Hadj Ali
      Ansys Employee

      You need to do that on Lagrangian side by removing particles from one region and injecting new one in other region.

    • matti956
      Subscriber

      Hello!


      Thank you for your answer. I do not really understand what you are saying tho. The number of particles leaving cell zone A is varying with time, therefore I have to compute at every time step either the number of particles leaving the cell zone and inject it back into it, or calculate the concentration of particles in that cell zone, make quick maths to get the number of particles that I have to inject back.


      Either way, I am pretty sure I need to set a UDF. But again, although I am ok with Fluent itself, I am quite new to particles simulations.


      By the way, if that can help, I am not using any multiphase model. Only DPM.


      Many thanks!

    • Amine Ben Hadj Ali
      Ansys Employee

      DPM is multi phase. Even if you want to get the concentration well balanced you will need to inject new particles, remove other particles or at least modifiy the particles or particles number per parcel to get the balanced concentration.


      This is not a simple step and we cannot help here on this open community. What I can say yes you can access the dpm concentration (eulerian) variable via a cell macro (please have a look into the manual /  Macros to access source terms on CFD cells for the DPM model)

    • matti956
      Subscriber

      I'm still really confused. I do not know why Ansys didn't include a way of keeping the particles concentration constant in a cell zone by automatically injecting the appropriate amount of particles if some have left the zone. But ok I will try to find a way. Thank you!

    • Amine Ben Hadj Ali
      Ansys Employee

      You raised the question on the ANSYS Customer Portal. This thread will be locked.


       

Viewing 5 reply threads
  • The topic ‘UDF to get particle concentration into a volume and inject new particles’ is closed to new replies.