|
[Sponsors] |
June 20, 2022, 01:18 |
CONVERGE udf
|
#1 |
New Member
Join Date: Jun 2022
Posts: 1
Rep Power: 0 |
I am using CONVERGE 3.0, and have a question about the UDF for the cells attached to a boundary. From the UDF documents, we can use the function of CONVERGE_boundary_iterator_create to iterate over all cells associated with a boundary. But how can I get the property in each individual boundary cell? For example, if I hope to calculate one parameter for one cell that is a function of the boundary cell temperature, what should I do? I tried using "temperature[<iter>]", but I guess the iterator here is different from the one created using "CONVERGE_boundary_iterator_create" function.
Also, can we get the contact area for a cell with the wall? Thanks in advance. |
|
June 22, 2022, 15:58 |
|
#2 |
New Member
Vigneshwar Ravisankar
Join Date: Apr 2019
Posts: 26
Rep Power: 7 |
Hi Drag,
Sorry for the late response. Boundary cells can be accessed with the following for loops, the first loop will loop over the boundary IDs and the second loop will loop over each node of that boundary. CONVERGE_mesh_t mesh = <get mesh> CONVERGE_boundary_t bound; CONVERGE_iterator_t mb_it; CONVERGE_mesh_boundary_index_iterator_create(mesh, &mb_it); for(CONVERGE_index_t i = CONVERGE_iterator_first(mb_it); i != -1; i = CONVERGE_iterator_next(mb_it)) { bound = CONVERGE_mesh_boundary(mesh, i); CONVERGE_iterator_t b_it; CONVERGE_boundary_iterator_create(bound, &b_it); for(CONVERGE_index_t j = CONVERGE_iterator_first(b_it); j != -1; j = CONVERGE_iterator_next(b_it)) { // Access boundary node j of boundary i } CONVERGE_iterator_destroy(&b_it); } CONVERGE_iterator_destroy(&mb_it); Regarding accessing the boundary values, you can use variable_name[j] to access that variable (example temperature[j]). If you don't want to run all the boundary IDs you can remove the 1st loop and replace the bound variable with a specific boundary ID. bound = CONVERGE_mesh_boundary(mesh, specific_bound_id) And for accessing the cell area at the boundary, use can use the following variable: CONVERGE_precision_t* boundary_face_area Let me know if the response was useful. If you have further issues with UDF, contact our respective support office: support@convergecfd.com(US) supportEU@convergecfd.com(EU) support.in@convergecfd.com(IN) We can look at your case and directly help building the UDF for you. |
|
Tags |
boundary cells, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for vapor pressure | anuarun | Fluent UDF and Scheme Programming | 13 | June 23, 2024 14:12 |
How can I find the CONVERGE UDF manual | baibai1995 | CONVERGE | 1 | August 18, 2020 18:11 |
Replicating Scalable Wall Function with a UDF | yousefaz | FLUENT | 0 | August 4, 2017 03:30 |
UDF programming | fullmonty | FLUENT | 5 | June 30, 2011 03:40 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 05:03 |