[Fluent Inc. Logo] return to home search
next up previous contents index

7.4 Parallelization of Discrete Phase Model (DPM) UDFs

The DPM model can be used for the following parallel options:

When you are using a DPM-specific UDF (see Section  2.5), it will be executed on the machine that is in charge of the considered particle, based on the above-mentioned parallel options. Since all fluid variables needed for DPM models are held in data structures of the tracked particles, no special care is needed when using DPM UDFs in parallel FLUENT with the exception of when you are writing in parallel to a sampling output file. In this case, you are not allowed to use the C function fprintf. Instead new functions are provided to enable the parallel file writing. Each node writes its information to separate files, which are put together and sorted upon closure of the file by FLUENT. The new functions can be used with the same parameter lists as the C function fprintf. The sorting of the files in parallel requires the specification of an extended parameter list. Information can be placed at the top of the file that will not sorted by using the function par_fprintf_head:

par_fprintf_head("x-coordinate y-coordinate z-coordinate\n")

This function will place the string "x-coordinate y-coordinate z-coordinate" at the top of the file.

Information is put on the nodes using the function par_fprintf:

par_fprintf("%d %d %e %e %e\n", p->injection->try_id, p->part_id,
P_POS(p)[0], P_POS(p)[1], P_POS(p)[2];

Here, the additional parameters p->injection->try_id and p->part_id are required for the sorting in parallel. The output written to the node-specific file of these two parameters will be removed. In serial, these sorting parameters are not required and the function call is instead the following:

par_fprintf("%e %e %e\n", P_POS(p)[0], P_POS(p)[1], P_POS(p)[2];

An example that utilizes these macros can be found in Section  2.5.8.

Note that if you need to access other data such as cell values, then for the parallel options except Shared Memory, you will have access to all fluid and solver variables. When you choose the Shared Memory option, however, you will have access only to the variables defined in the macros SV_DPM_LIST and SV_DPMS_LIST. These macro definitions can be found in dpm.h.

next up previous contents index Previous: 7.3 Parallelizing Your Serial
Up: 7. Parallel Considerations
Next: 7.5 Macros for Parallel
© Fluent Inc. 2006-09-13