CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > CONVERGE

CONVERGE udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 20, 2022, 01:18
Exclamation CONVERGE udf
  #1
New Member
 
Join Date: Jun 2022
Posts: 1
Rep Power: 0
Drag is on a distinguished road
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.
Drag is offline   Reply With Quote

Old   June 22, 2022, 15:58
Default
  #2
New Member
 
Vigneshwar Ravisankar
Join Date: Apr 2019
Posts: 26
Rep Power: 7
rvigneshwar is on a distinguished road
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.
rvigneshwar is offline   Reply With Quote

Reply

Tags
boundary cells, udf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 16:46.