Videos > How to extract global DPM reports using UDF and Report Definitions
Oct 21, 2025

How to Extract Global DPM Reports Using UDF and Report Definitions

Hello, in this video, I'd like to demonstrate how to extract DPM (Discrete Phase Model) information from a transient simulation. This approach is primarily for transient simulations, but adjustments may be necessary for steady-state runs with steady DPM tracking. The method varies depending on the application and the number of time steps you are using for your DPM relative to the flow time steps.

Model Setup

For this model, DPM is defined as points with a diameter of 50 microns and an initial velocity of 0.5 m/s. The output is configured to capture:

  • The average velocity of all particles in the domain
  • The total mass of particles in the domain

These metrics are reported over time, with a report definition updated at each simulation time step. The model allows particles to interact with walls and transition into a wall film or VOF (Volume of Fluid). The volume of fluids model transition is enabled for water, allowing DPM to become VOF based on local properties and conditions, as well as the Eulerian wall film for phase transition between DPM and the Eulerian wall film.

Visualization

Initially, particles are injected, as shown in blue. The U-shaped tube is not yet filled with particles at the beginning of the simulation. To determine metrics like average velocity or particle count, or to use a user-defined property, follow these steps:

Using User-Defined Functions (UDF)

  1. Enter the script phase and create user variables in the UDF.
  2. Enable user-defined functions.

If you have ValueCAD, you can contact our team for assistance. In this example, a UDF with a define adjust function is used. This function updates every flow cycle at the first iteration, resetting UDMs (User-Defined Memories) to zero. UDMs track particle mass, velocity, and count, enabling the calculation of average properties.

Updating UDMs

The DPM scalar update runs every particle iteration. It checks if the tpUserReal (particle user-defined memory) is below the flow time. If so, it updates tpUserReal to match the flow time, ensuring the code runs only once per flow time step. This prevents multiple executions within a single flow time step.

The UDMs are updated on a cell basis, incrementing each UDM for each cell by the desired property (mass, velocity, count). The Adjust UDF uses six UDMs, with three carrying values from UDM 0, 2, and 4, while the UDM is reset to zero to avoid continuous incrementing from previous time steps.

The UDF processes a subdomain loop, thread loop, and cell loop to define UDMs for every cell in the domain. This transfers information from particles to cells using user-defined memories, allowing Fluent report definitions to extract particle data.

Results

The UDM5 value represents the sum of particles before UDM4 is reset to zero. In this example, the sum is 26,462 particles, matching the solver's tracked particle count. Report definitions can also be created for total particle mass, using a volume sum of user memory 1, which stores particle masses before UDM0 is reset.

Average particle mass and velocity can be computed and visualized. For average velocity, an expression sums all UDM3 values (velocity magnitude of each particle) and divides by the particle count (sum of UDM5).

For more information, please contact us at Ozen Engineering, Inc.

Thank you for watching!

[This was auto-generated. There may be mispellings.]

How to extract global DPM reports using UDF and Report Definitions Hello, for this video I'd like to show how to extract DPM information from a transient simulation.

This approach may work for transient simulations; however, there may be some adjustments if you are doing a steady-state run with steady DPM tracking. It varies depending on the application and how many time steps you are doing with your DPM relative to the flow time steps.

This shows a workflow on how to obtain DPM reports for your whole set of particles. For this model, I have DPM as you can see here defined as points with a diameter of 50 microns, initial velocity of 0.5 m/s. The output is defined here.

We want to be able to capture things like what's the average velocity of all the particles in my domain, or what is the total mass of particles in my domain, and I want to report it over time. I want to create a report definition that gets updated every time step that I run my simulation.

To do that, and also I should mention that this model allows for particles to interact with the walls and turn into a wall film or VOF.

I have the volume of fluids model transition enabled for water, so DPM can become VOF, basically, can turn into VOF, depending on the local properties and the local conditions, as well as the Eulerian wall film that allows the phase transition between DPM and the Eulerian wall film.

I should also show how this looks like. So basically, we have particles that were injected here. So this is showing the particles in blue, and I can make sure this is transparent so we can visualize the particles.

So the particles that were injected, so this is still in the beginning of my simulation. I haven't really filled this U-shaped tube yet with particles.

If I want to know what's the average velocity of all the particles in my domain, or what's the count, or if you have a user-defined property, for example, for your particle, you can also use that same idea.

To do that, we have to first of all go into the script phase and in the UDF I've created user variables here, and we also have to enable the user-defined functions, which I will show later. If you have ValueCAD, you can speak to our team. So I'm using a UDF here with a define adjust.

So this define adjust, basically what it does, it updates every flow cycle at the first iteration. It will update my UDMs to zero. So the UDMs that actually track things like the particle mass, particle velocity, and particle count, so that I can get the average properties.

So in here is where this is the DPM scalar update that gets run every particle iteration.

So basically, for this, what I'm doing is I take the current time, current flow time, and I check if the tpUserReal, which is the particle user-defined memory, if it's below the flow time, I will make sure that I update the tpUserReal to the flow time to be equal to the flow time, so that this code doesn't run more than once at a specific flow time.

That means if you have multiple particle time steps within a flow time step, this code should run only once because of this condition here that I've specified. This is where we update the UDMs on the cell base and increment each UDM for each cell by the property I want to evaluate here.

I have particle mass, particle velocity, and particle count.

So basically, it's one particle being counted for UDM 4. And going back again to the Adjust UDF, so for the Adjust UDF, you have the basically the six UDMs, so three of those UDMs basically take up the value of the previous UDM of UDM 0, 2, and 4, and basically, they carry those values while the UDM is basically recycled and set up to zero.

So the reason why we have to set these UDMs to zero is because if we don't, basically, it will continuously increment the values from the previous time steps. So we have to basically reset it to zero every time step.

Note that this UDF basically goes through a subdomain loop and basically goes through a thread loop and then a cell loop to basically define the UDMs at every cell that we have in our domain.

So it's basically a way to move information from the particles into the cells using user-defined memories, and then once we have that stored in the cells, we can use report definitions within Fluent to extract information about the particles themselves.

This is the result of the UDM5 value of the UDM4 before UDM4 is reset to zero. This is what I'm doing. Basically, this is just the sum of particles. I can compute that, and you can see that I have 26,462 particles.

This is already defined, so if I go back to my previous iteration, I actually have, so the solver reports the number of tracked particles, which is exactly the same as what my UDF and my report definition is giving me, 26,462 and 26, 462. I can also create a report definition for the total mass of particles.

Basically, for the total mass of particles, I have this report definition here, which is just a volume sum.

So just a simple sum of the user memory 1, which stores the values of the masses of each particle, and you can visualize that, so we can see that in the UDF itself, where UDM1 is being used, it's basically taking up the value of the UDM0 before the UDM0 is recycled, is set to 0 for all cells.

So basically, I can also compute to see what the average mass of the particles are. So this is the total mass of all the particles that are within my domain. I can also visualize the velocity, so the average velocity of my particles here.

So this is showing after running from zero until a certain time step, you can see how the velocity of the particles look like. So this is basically using an expression, and I can visualize that here.

So for average velocity, I've defined an expression, which basically takes the sum of all the UDM3, which I can go back here and visualize. The UDM3 is equal to UDM2, and UDM2 is basically the velocity magnitude of each individual particle.

This basically tells me what's the sum of all the velocities of all the particles, and then we have to divide by the number of particles that we have, so that's basically the sum of UDM 5. Please contact us at https://ozeninc.com/contact for more information. Thank you for watching!