DPM particle tracking with eulerian multiphase flow and UDF

  • Last Post 27 August 2019
Twain posted this 11 July 2019

Hello there,

i am encountering some problems with my simulation, hopefully someone can help me sorting things out

I am modeling a multi phase eulerian flow through a porous zone, with velocity inlet, pressure outlet, SIMPLE algo and UDFs controlling the fluid flow.                           
(2 liquid, 1 gas)                           
the UDF descrbies e.g. viscouse resistance and the masstransfer between the 2 liquid zones,                           
which results in  volumefractions of those 2 liquids 'mixing' over the porous zone                           
Now i would like to track some particles through the domain and view their distribution.                           
Therefore i used DPM, particle tracking, with injection from the inlet durface.                           
    The result indicates the particles go through the porous media - but they do not seem to 'mix' as heavily as the volumefraction of the phases.                       
    So my question is:       

    In this case, do i need to       

          a) somehow assain those UDF to the injection?       
         Where as liquid 1 and 2 enter the porous zone through (surface) inlet - at first i thought this would "make"          the injected particles follow accordingly     
                        [from Limitations on Using the Discrete Phase Model with Other ANSYS Fluent Models
                            [" ...  When using the DPM model with the Eulerian multiphase model, the tracked particles rely only on the primary phase to compute drag, heat, and mass transfer.
                            Also, any DPM related source terms are applied to the primary phase. Particle tracking relative to a secondary phase is not provided. ... "]

                    If adding UDFs is nessecary, what is the recommended way of doing so?       
                    (ecspecially, as there are  UDFs for each luiqid phase)                              

                   b) use an other type of particle?       
                        e.g. inert ones?   
I hope i was able to describe the problem, even without any pictures atm.                            
Thanks in advace for your help!                           

BR Twain!


edit: formating

Order By: Standard | Newest | Votes
abenhadj posted this 11 July 2019

If massless or inert particles without coupling you can track with the phase you want as beta feature. In all other case you need to copy the velocity field into the one of primary phase and then switch back. Not easy. We are working on extending Eulerian multiphase compatibility.

Best regards, Amine

Twain posted this 18 August 2019

Thanks for your respnes, sorry it took some time for me.

As the problem still exists, someone here might be of help


Atm. I am injecting massless particles via file injection.

Now  i need to change their x and y velocities via an UDF.

(later changing to a value, which is written into an UDM)


I gave multiple macros a chance, e.g.:




sadly without success.


Right  now, i am with:

  Thread *t;
  cell_t c;
    Particle *p;
    Injection *Ilist, *I;
    Ilist = Get_dpm_injections();

    loop(I, Ilist)
                P_VEL(p)[0]=5;   //fixed values for testing


but this does not work either.

I am on Win 10, compiling the UDF with Visual Studio 2019 works, so does loading into fluent.


It can not be that hard, adjusting velocity vectors of these particles, can it?




Looking definitly forward for some help here


Thanks in advance,

best regards,






abenhadj posted this 19 August 2019

Try Scalar Update DPM macro.

Best regards, Amine

Twain posted this 19 August 2019

Thanks for your response.


i get a situation like on the attached/insert picture:

I) net edges

II) particle track

So I am able to change the velocities, but this does not have the intended effect on the particle trajectory.

Fluent manual:

" During ANSYS FLUENT execution, the DEFINE_DPM_SCALAR_UPDATE function is called at the start of particle integration (when initialize is equal to 1) and then after each time step for the particle trajectory integration. "


Is scalar update the way to go? If so, what needs to be kept in mind for this to work as desired?


Thanks again!

BR Twain


edit: insert image

thanks, did not know this, hope this helps

Attached Files

abenhadj posted this 19 August 2019

ANSYS Staff do not look into attachments. Please insert your picture. Scalar Update is used to modify particle states and properties and to free particles to a certain velocity.

Best regards, Amine

Twain posted this 24 August 2019

Hey there,


any ideas on my updated post?

(inserted image )


Thank in advance,



abenhadj posted this 27 August 2019

Yes that is the right macro to affect particle trajectory. There are other possibilities like providing a body force. That is your task to identify the right approach.

Best regards, Amine