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

7.2 Cells and Faces in a Partitioned Mesh

Some terminology needs to be introduced to distinguish between different types of cells and faces in a partitioned mesh. Note that this nomenclature applies only to parallel coding in ANSYS FLUENT.



Cell Types in a Partitioned Mesh


There are two types of cells in a partitioned mesh: interior cells and exterior cells (Figure  7.2.1). Interior cells are fully contained within a mesh partition. Exterior cells on one compute node correspond to the same interior cells in the adjacent compute node. (Figure  7.1.2). This duplication of cells at a partition boundary becomes important when you want to loop over cells in a parallel mesh. There are separate macros for looping over interior cells, exterior cells, and all cells. See Section  7.5.5 for details.

Figure 7.2.1: Partitioned Mesh: Cells
figure



Faces at Partition Boundaries


There are three classifications of faces in a partitioned mesh: interior, boundary zone, and external (Figure  7.2.2). Interior faces have two neighboring cells. Interior faces that lie on a partition boundary are referred to as "partition boundary faces.'' Boundary zone faces lie on a physical mesh boundary and have only one adjacent cell neighbor. External faces are non-partition boundary faces that belong to exterior cells. External faces are generally not used in parallel UDFs and, therefore, will not be discussed here.

Figure 7.2.2: Partitioned Mesh: Faces
figure

Note that each partition boundary face is duplicated on adjacent compute nodes (Figure  7.1.2). This is necessary so that each compute node can calculate its own face values. However, this duplication can result in face data being counted twice when UDFs are involved in operations that involve summing data in a thread that contains partition boundary faces. For example, if your UDF is tasked with summing data over all of the faces in a mesh, then as each node loops over its faces, duplicated partition boundary faces can be counted twice. For this reason, one compute node in every adjacent set is assigned by ANSYS FLUENT as the "principal'' compute node, with respect to partition boundary faces. In other words, although each face can appear on one or two partitions, it can only "officially'' belong to one of them. The boolean macro PRINCIPAL_FACE_P(f,t) returns TRUE if the face f is a principal face on the current compute node.



PRINCIPAL_FACE_P


You can use PRINCIPAL_FACE_P to test whether a given face is the principal face, before including it in a face loop summation. In the sample source code below, the area of a face is added to the total area only if it is the principal face. Note that PRINCIPAL_FACE_P is always TRUE for the serial version.

figure   

PRINCIPAL_FACE_P can be used only in compiled UDFs.

Example

begin_f_loop(f,t)
 if PRINCIPAL_FACE_P(f,t)  /* tests if the face is the principle face
                              FOR COMPILED UDFs ONLY */
 {
   F_AREA(area,f,t);   /* computes area of each face  */
   total_area +=NV_MAG(area);  /* computes total face area by 
                                  accumulating  magnitude of each 
                                  face's area  */
 }
end_f_loop(f,t)



Exterior Thread Storage


Each thread stores the data associated with its cells or faces in a set of arrays. For example, pressure is stored in an array and the pressure for cell c is obtained by accessing element c of that array. Storage for exterior cell and face data occurs at the end of every thread data array, as shown in Figure  7.2.3.

Figure 7.2.3: Exterior Thread Data Storage at End of a Thread Array
figure


next up previous contents index Previous: 7.1.1 Command Transfer and
Up: 7. Parallel Considerations
Next: 7.3 Parallelizing Your Serial
Release 12.0 © ANSYS, Inc. 2009-01-14