CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Errors at partitioned boundaries

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2021, 06:13
Default Errors at partitioned boundaries
  #1
New Member
 
Wang Changjun
Join Date: Mar 2018
Posts: 5
Rep Power: 8
Wang Changjun is on a distinguished road
Recently, I have found that the "begin_c_loop_int_ext" didn't work in my UDF at partitioned boundaries. Who can help me or tell me what should I do? For example, when I used the UDF as below, the UDM-0 didn't change!

thread_loop_c(t, d)
{
begin_c_loop_int_ext(c, t)
{
if (C_PART(c, t) != myid)
{
C_UDMI(c, t, 0) = 1.0;
}
}
end_c_loop_int_ext(c, t)
}

Last edited by Wang Changjun; September 15, 2021 at 08:23.
Wang Changjun is offline   Reply With Quote

Old   September 16, 2021, 06:08
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
code seems to be correct
what will happen for this case?
Code:
thread_loop_c(t, d)
{
begin_c_loop_int_ext(c, t)
{
if (C_PART(c, t) != myid) C_UDMI(c, t, 0) = 1.0;
else  C_UDMI(c, t, 0) = 2.0;
}
end_c_loop_int_ext(c, t)
}
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   September 16, 2021, 06:54
Default
  #3
New Member
 
Wang Changjun
Join Date: Mar 2018
Posts: 5
Rep Power: 8
Wang Changjun is on a distinguished road
Thank you for your reply!

As introduced in Fluent Customization Manual: "For interior cells, the partition ID is the same as the compute node ID. For exterior cells, the compute node ID and the partition ID are different". So, if the macro begin...end_c_loop_int_ext(c, t) work, the UDM-0 of the exterior cell of a partitioned zone would be 1.0. But the result is the UDM-0 value of the entire computational domain is zero in parallel computing.

I tested the functionality of the macro begin...end_c_loop_int_ext(c, t) because in my program I wanted a UDM of a cell at the boundary of a partition zone to have an effect on the cells adjacent to that cell once the UDM reached a specific value. According to the introduction of the macro begin...end_c_loop_int_ext(c, t) in Fluent Customization Manual, this idea is achievable. But it didn't actually work. Just like the UDM values are calculated separately between each partition zone (the loop is in DEFINE_ADJUST macro).

If you have any experience or advice, hopefully you can help me. Lastly, I'm sorry for my poor English and I hope my presentation makes sense to you.
Wang Changjun is offline   Reply With Quote

Old   September 16, 2021, 07:56
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
your code should work from my point of view, based on manual.

but I'm not sure about the concept of your simulation:
partitioning is random (in most cases) so exterior cells (according to my knowledge, which is not that big actually) could be inside domain as well

if your code worked, you would get udmi = 1 on each boundary between partitions, and that boundaries are random

is that what you want?
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   September 16, 2021, 08:31
Default
  #5
New Member
 
Wang Changjun
Join Date: Mar 2018
Posts: 5
Rep Power: 8
Wang Changjun is on a distinguished road
Yes, although the code is only a simple test.

In short, the UDM value of a cell in the computing domain is determined by adjacent cells. If this macro (begin_c_loop_int_ext) works normally, there should be no problem with my current program. However, it is now found that the calculation of UDM value is abnormal at the boundary of the partition. After some testing, I found that this macro did not work at the partition boundary according to the manual. Just like the initial code, the UDM value in the cell at the partition boundary has not changed.
Wang Changjun is offline   Reply With Quote

Old   September 16, 2021, 09:52
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by Wang Changjun View Post
As introduced in Fluent Customization Manual: "For interior cells, the partition ID is the same as the compute node ID. For exterior cells, the compute node ID and the partition ID are different". So, if the macro begin...end_c_loop_int_ext(c, t) work, the UDM-0 of the exterior cell of a partitioned zone would be 1.0. But the result is the UDM-0 value of the entire computational domain is zero in parallel computing.
The expected result is that interior cells have UDM-0 value 0, and exterior cells have UDM-0 value 1. Cells close to a boundary are exterior for one partition and interior for another, so which value they have depends on which node you are asking this question.

How did you determine that the UDM-0 value of the entire computational domain is zero in parallel computing? By default, you see only interior cells, so if you use normal methods (for example just plot UDM-0 over your entire domain), you would get a value of 0 everywhere.

Exterior cells are only used to communicate values to/from other partitions, they are meant to be used for post-processing, so you won't see them with the default methods.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Old   February 26, 2023, 05:56
Default
  #7
New Member
 
Join Date: Aug 2019
Posts: 12
Rep Power: 6
lolno is on a distinguished road
i've faced an issue with accessing udmi outside of current partition mesh. The C_UDMI will return 0 whenever i tried to access C_UDMI stored in the boundary partition mesh (neighborhood cell). Do you found a fix for this issue yet?
lolno is offline   Reply With Quote

Reply

Tags
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
courant number increases to rather large values 6863523 OpenFOAM Running, Solving & CFD 22 July 5, 2023 23:48
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 04:13
[blockMesh] Errors at boundaries between hex blocks CoolHand OpenFOAM Meshing & Mesh Conversion 2 February 19, 2014 19:08
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 14:09
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58


All times are GMT -4. The time now is 10:54.