Показаны сообщения с ярлыком fluent. Показать все сообщения
Показаны сообщения с ярлыком fluent. Показать все сообщения

пятница, 20 июля 2012 г.

CX_Find_Cell_With_Point and 3ddp (Fluent)

There is a function CX_Find_Cell_With_Point. It's not listed in official documentation but it works well when you need to find a cell which contains specified point. Otherwise one must use very slow dumb search or develop  some sofisticated search algorithms. But there is a glitch with its use. As it's undocumented, there is no guarantee that it even compiles.
`CX_Find_Cell_With_Point' does not work with double precision (3ddp) Fluent solver!
That's true for Fluent 6.2.16 on lnamd64 (at least). With 3ddp it always returns NULL.

And if you're here for example, here is a code:

#include "udf.h"
#include "surf.h"
#include "para.h"
 
void some_function()
{
    cell_t c;
    Thread *t;
    CX_Cell_Id cx_cell;
    CX_Cell_Id *cx_cell_ptr;
    real pt[3];
 
    CX_Start_ND_Point_Search(); /* call this before actual search */
                                /* perhaps it'll do some initializations */
    for (k = 0; k < 1000; k ++) {
        /* fill pt[3] with data */
        pt[0] = 0.0; pt[1] = 0.0; pt[2] = k / 1000.0;
 
        /* perform search */
        cx_cell_ptr = CX_Find_Cell_With_Point(pt);
        if (cx_cell_ptr) {   /* function can return NULL if no cell was found */
            cx_cell = *cx_cell_ptr;
            c = RP_CELL(&cx_cell);  /* get cell number */
            t = RP_THREAD(&cx_cell);  /* get cell thread */
 
            /* ... do your calculations ... */
 
        } else {
            /* no cell was found */
        }
 
    }
 
    /* It's a good practice to clean up */
    CX_End_ND_Point_Search();
}
 

пятница, 13 июля 2012 г.

another fluent 3ddp parallel benchmark

Another fluent 3ddp benchmark on Phenom II X6 1090T.
Unfortunatelly I don't remember what case was used.

procs; time per iteration; wall time; cpu time

smpi:
1 4.577 457.661 457.330
2 2.488 248.802 496.820
3 1.792 179.155 536.430
4 1.475 147.455 587.010
5 1.221 122.108 605.510
6 1.081 108.132 632.970
7 2.314 231.399 1202.540

nmpi:
5 1.569 156.866 669.320 nmpi
6 1.253 125.323 648.960 nmpi
7 3.235 323.487 1728.310 nmpi