Pass current cell information to particle drag calculation

DEFINE_DPM_DRAG passes Re and particle pointer to the user. However, for my client, they want to add Mach number correction to the drag coefficient calculation. So, Cd=f(Re, Mach). Instead of Re and particle pointer, could fluent provide particle pointer AND the thread and cell number that the particle is in? So that, the client can caculate Re, Mach etc. From that, Cd=f(Re,Mach), where the functional form is user defined, can be calculated easily. Now as fluent is only providing Re, the client needs to loop over all the cells to figure out which cell the particle is in in order to calculate Mach number.
You can estimate the surrounding cell and thread in every routine where the particle pointer is passed to via the following lines:
cell_t c = RP_CELL(&(p->cCell));
Thread *t = RP_THREAD(&(p->cCell));
p->cCell points to some data structure from which the cell number and the thread pointer can be extracted.

Show Form
No comments yet. Be the first to add a comment!