|
[Sponsors] |
March 21, 2017, 11:21 |
Cell number from UDF
|
#1 |
New Member
Rakesh
Join Date: Jan 2014
Location: Delft
Posts: 13
Rep Power: 12 |
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 |
|
March 23, 2017, 09:33 |
|
#2 |
Member
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 10 |
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 |
|
March 23, 2017, 10:00 |
|
#3 |
New Member
Rakesh
Join Date: Jan 2014
Location: Delft
Posts: 13
Rep Power: 12 |
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 |
|
March 23, 2017, 10:12 |
|
#4 | |
Member
KirMaks
Join Date: Aug 2016
Posts: 34
Rep Power: 10 |
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 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
decomposePar no field transfert | Jeanp | OpenFOAM Pre-Processing | 3 | June 18, 2022 13:01 |
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops | avinashjagdale | OpenFOAM Meshing & Mesh Conversion | 53 | March 8, 2019 10:42 |
foam-extend_3.1 decompose and pyfoam warning | shipman | OpenFOAM | 3 | July 24, 2014 09:14 |
Cluster ID's not contiguous in compute-nodes domain. ??? | Shogan | FLUENT | 1 | May 28, 2014 16:03 |
FvMatrix coefficients | shrina | OpenFOAM Running, Solving & CFD | 10 | October 3, 2013 15:38 |