CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Dpm (https://www.cfd-online.com/Forums/fluent-udf/167128-dpm.html)

hwet February 24, 2016 02:50

Dpm
 
Hi
Is it possible to call a DPM udf only for particles in a specific cell?

apparently if a UDF is called if a particle is in a particular cell, the UDF ends up being called for all the other particles as well?

So, its not called at all, or if called based on the cell property it is called for all the particles not just the one in that cell?

Or am i missing out something here.

`e` February 29, 2016 17:54

I'm not aware of a direct method, but you could loop through all particles and use a conditional if statement to restrict dealing with only particles residing in a certain cell. What are you trying to achieve overall?

hwet February 29, 2016 21:06

I was wrong, I got multiple print messages because the UDF was called every time step when the if condition for that cell was true.

So it was called multiple times for every cell.

The idea is to go through the calculation in the UDF only as a particle enters a new cell and not at every time step the particle is inside the cell to reduce the computational expense.

Is there a DEFINE_DPM macro which is only called once for every cell and not every particle time step?

I was thinking to run through all the code when values for particle properties at entry to current cell were available e.g. P_POS0(p), otherwise perform no calculation. But I am not sure how to implement this? Can it be checked that a certain property is available with Data_Valid_P() or is this idea totally wrong?

`e` February 29, 2016 22:24

There's no DPM macro called once per particle step per cell (very specific!). It could be worthwhile to see if checking P_POS0 == P_POS works. Otherwise, you could explore UDM on either the cell or particle; both of which might be more computationally costly compared with running a line of code at each particle time step within the cell.


All times are GMT -4. The time now is 15:49.