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

Loop Journal Routine

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2020, 14:33
Default Loop Journal Routine
  #1
Member
 
j
Join Date: Apr 2020
Posts: 34
Rep Power: 0
buckngnr11 is on a distinguished road
I got some useful help yesterday automating some operations in Fluent. The journal attached does what I need, but I want to loop it to run "x" times. If I add a do loop and put this existing code inside, can I simply read the journal file and it will execute x number of times? Also, line 30 exports the cas and data file. Instead of saving "Eff_150-2.cas", I want to replace the 2 with "x" where x is the current iteration in the loop. What's the correct code to make this happen?
Attached Images
File Type: jpg Screen Shot 2020-04-27 at 2.27.23 PM.jpg (134.6 KB, 9 views)
buckngnr11 is offline   Reply With Quote

Old   April 27, 2020, 19:37
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
Quote:
Originally Posted by buckngnr11 View Post
I got some useful help yesterday automating some operations in Fluent. The journal attached does what I need, but I want to loop it to run "x" times. If I add a do loop and put this existing code inside, can I simply read the journal file and it will execute x number of times? Also, line 30 exports the cas and data file. Instead of saving "Eff_150-2.cas", I want to replace the 2 with "x" where x is the current iteration in the loop. What's the correct code to make this happen?
you may use this template, remove last 3 lines of your code and put it inside the loop, change x value to any value you want.
Code:
(do ((i 1 (+ i 1)))((> i x))  ;;; change x to number of times, you want code to be executed
***PUT YOUR CODE HERE line 1 to 28 "including" ***
   (ti-menu-load-string (format #f "file write-case-data "Eff_150-~a.cas" \n" i))
)
buckngnr11 likes this.
__________________
best regards


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

Old   April 27, 2020, 21:41
Default Issue
  #3
Member
 
j
Join Date: Apr 2020
Posts: 34
Rep Power: 0
buckngnr11 is on a distinguished road
I put that together and I get an error at the save file part. I attached a picture. Is there a certain way I need to save my cas and data beforehand or is a separate problem?
Attached Images
File Type: png Screen Shot 2020-04-27 at 9.39.45 PM.png (25.9 KB, 4 views)
buckngnr11 is offline   Reply With Quote

Old   April 27, 2020, 22:27
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
this is issue with forum messages, command is:
Code:
(ti-menu-load-string (format #f "file write-case-data \"Eff_150-~a.cas\" \n" i))
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ 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
Need help setting up chtMultiRegion OskarT OpenFOAM Pre-Processing 1 September 25, 2019 15:51
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 02:09
NACA0012 geometry/design software needed Franny Main CFD Forum 13 July 7, 2007 15:57
user subroutine error CFDUSER CFX 2 December 9, 2006 06:31
user defined function cfduser CFX 0 April 29, 2006 10:58


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