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

not looping correctly

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Siba11

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2023, 14:56
Unhappy not looping correctly
  #1
New Member
 
Join Date: Jun 2022
Posts: 27
Rep Power: 3
Mars35 is on a distinguished road
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.
Attached Files
File Type: c e210 demand.c (605 Bytes, 4 views)
Mars35 is offline   Reply With Quote

Old   April 4, 2023, 15:31
Default some update
  #2
New Member
 
Join Date: Jun 2022
Posts: 27
Rep Power: 3
Mars35 is on a distinguished road
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.
Mars35 is offline   Reply With Quote

Old   April 5, 2023, 02:08
Default
  #3
Member
 
Odisha
Join Date: Jan 2020
Posts: 59
Rep Power: 6
Siba11 is on a distinguished road
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.
Mars35 likes this.
Siba11 is offline   Reply With Quote

Old   April 5, 2023, 10:59
Default
  #4
New Member
 
Join Date: Jun 2022
Posts: 27
Rep Power: 3
Mars35 is on a distinguished road
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,
Mars35 is offline   Reply With Quote

Reply


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
How looping over cells works in FLUENT UDFs? Cooper24 Fluent UDF and Scheme Programming 2 August 10, 2022 05:17
Fluent UDF wrong number of cells in parallel - correct in serial dralexpe Fluent UDF and Scheme Programming 7 May 17, 2018 08:26
SIMPLER Code Temperatures not coming correctly Dharma Vedula Main CFD Forum 5 July 5, 2017 21:34
Looping over all faces within a boundary condition (turbulent inlet development) Sevex OpenFOAM Programming & Development 5 September 8, 2016 13:58
interFoam running blowing up sandy13 OpenFOAM Running, Solving & CFD 2 May 5, 2015 07:16


All times are GMT -4. The time now is 00:02.