|
[Sponsors] |
How to check value at every cell when applied udf |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 22, 2023, 14:25 |
How to check value at every cell when applied udf
|
#1 |
Member
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 3 |
Can I check our UDF line by line in fluent whether is it correct or not?
Can I get the value at every iteration whatever equation add in the UDF so that we can easily check it either our UDF is working properly or not? Can I add the breaks in particular line in UDF. So that we can check it? |
|
July 23, 2023, 10:06 |
|
#2 |
Member
Odisha
Join Date: Jan 2020
Posts: 59
Rep Power: 6 |
'Yes' to all three of your questions.
The fluent compiler checks your UDF line by line and displays any errors present in it. You can print whatever value you want using the 'Message' statement. And yes, you can insert 'break' commands wherever you want. It's a good programming practice when you're trying to debug your code. |
|
July 23, 2023, 10:49 |
|
#3 |
Member
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 3 |
Thank you for your reply. but the break command could not be used in the UDF reason is that the UDF code is called from the solver, and it operates within a specific context set by the solver. Using break to exit a loop would disrupt the solver's control flow and could lead to unexpected behavior or crashes.
There are any method to check the UDF code? |
|
July 23, 2023, 20:49 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
1. You may print into console variables to check which part of code works well. Message() macro
2. You may hook fluent.exe process from visual studio (for windows) and debug regularly
__________________
best regards ****************************** press LIKE if this message was helpful |
|
July 24, 2023, 01:50 |
|
#5 |
Member
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 3 |
Dear AlexanderZ,
Could you please describe the second option how can I use it. and give a example. |
|
July 25, 2023, 20:55 |
|
#6 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A UDF to calculate energy per a cell and then returns new CO2 content in a cell. | visitor | Fluent UDF and Scheme Programming | 54 | April 11, 2021 23:29 |
UDF in case with DPM modle | POSTHU | Fluent UDF and Scheme Programming | 0 | March 3, 2021 08:21 |
Fluent UDF wrong number of cells in parallel - correct in serial | dralexpe | Fluent UDF and Scheme Programming | 7 | May 17, 2018 09:26 |
how to comliled UDF on one of two fluid cell zones | lshwanbb | Fluent UDF and Scheme Programming | 0 | December 16, 2017 21:41 |
Cells with t below lower limit | Purushothama | Siemens | 2 | May 31, 2010 22:58 |