|
[Sponsors] |
April 4, 2023, 15:56 |
not looping correctly
|
#1 |
New Member
Join Date: Jun 2022
Posts: 27
Rep Power: 4 |
Hello all,
I was trying to write the data from fluent into a file. However, it seems there is repeated face ID and some random format going on in the middle of the file. I am not sure what is wrong because it was working fine before. Maybe because I use define_on_demand this time? Can anyone take a look at my code? Thank you! The face thread is a curved wall in 3d. |
|
April 4, 2023, 16:31 |
some update
|
#2 |
New Member
Join Date: Jun 2022
Posts: 27
Rep Power: 4 |
Hi guys,
So I use Message() to print the values on Console, there is no weird formatting, however, the face ID number is still be repeated 2-3 times. The total number of cells still makes sense tho. I am not sure if it's just my geometry, which the face thread (wall) is composed of 4 different faces. |
|
April 5, 2023, 03:08 |
|
#3 |
Member
Odisha
Join Date: Jan 2020
Posts: 59
Rep Power: 6 |
Hi. I'll share what comes to my mind. You can try implementing that.
1) I'm assuming you're using some latest version of fluent. If so, you need to parallelize your udf. The reason why the face ID is getting printed multiple times is because it's running on both host and compute node. 2) You can put the 'fopen' and 'fclose' line inside the loop as well. This will ensure that there is no error while writing to file. 3) I'm not sure what you're trying to write, but it's better to give the file "append" permission. Otherwise, it deletes the previous contents of the file, and prints only the latest info. |
|
April 5, 2023, 11:59 |
|
#4 |
New Member
Join Date: Jun 2022
Posts: 27
Rep Power: 4 |
Hello,
Thank you for the insight, I think you are correct about parallelizing the udf. I will look into that and update if there is good news Best, |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How looping over cells works in FLUENT UDFs? | Cooper24 | Fluent UDF and Scheme Programming | 2 | August 10, 2022 06:17 |
Fluent UDF wrong number of cells in parallel - correct in serial | dralexpe | Fluent UDF and Scheme Programming | 7 | May 17, 2018 09:26 |
SIMPLER Code Temperatures not coming correctly | Dharma Vedula | Main CFD Forum | 5 | July 5, 2017 22:34 |
Looping over all faces within a boundary condition (turbulent inlet development) | Sevex | OpenFOAM Programming & Development | 5 | September 8, 2016 14:58 |
interFoam running blowing up | sandy13 | OpenFOAM Running, Solving & CFD | 2 | May 5, 2015 08:16 |