Cell number from UDF
Hello,
I am writing a parallel UDF code for a deforming mesh problem. Basically I want to update the cells of a boundary at every time step. This update is based on a matrix which I read into my code. Each element of this matrix corresponds to a cell centre in the boundary that needs to be updated. My problem is since the mesh is updating at each time step, it's coordinates change. As such, I cannot identify the cells and read the matrix values for a particular cell. I was wondering if it possible to write the cell ID to a file? Or could you kindly give me any other suggestions? Best, R |
Hallo,
I've recently thought about similar problem. You may use UDM to store the cell's ID and then use it to get the required element of the matrix. Several steps are required: 1. store the cell's number and its coordinates (if required) in UDM, you may also save these data in a text for analysis how to order the elements in the matrix (DEFINE_ON_DEMAND). 2. use the stored ID's from UDM to access the matrix elements during iterations. That's it, good luck and have a nice day. Regards, Maks |
Hi Maks,
Thank you for the reply. I will implement it. What is actually the macro for extracting the cell ID. I saw somewhere there is C_ID(cell_t c,Thread*t), but I am not quite sure if this exists as I could not locate it in the fluent udf manual. Could you kindly let me know? Best, R |
I'm not sure, You may define Your own indexing based for example on the coordinates. May be looping is also always done in the same order. You may check it. It also states in the help that
Quote:
Regards, Maks |
All times are GMT -4. The time now is 12:04. |