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

Problem on succesive simulation runs and dpm file naming

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2022, 11:06
Default Problem on succesive simulation runs and dpm file naming
  #1
New Member
 
Fatih
Join Date: Jan 2022
Posts: 3
Rep Power: 4
fatihgulec is on a distinguished road
I try to run a transient particle simulation and sample particles at the outlet several times with a journal file as given below in Fluent. My final aim is to have several sample files (.dpm) at the end. To this end, I used the do-loop but I couldn't make it work. However, without using the do function, the code works fine for one simulation run.

I have two questions:

1) How can I make this code work? When I run this code, first I get the warning "Warning: An error or interrupt occurred while reading the journal file. Some commands may not have been completed." on Fluent GUI and then "Error: eof inside list, Error Object: ()" in the console.

2) I want to change the dpm sample file which is generated automatically by Fluent, when I run the "/report/dpm-sample" command in the last row. How can I change the file name for each trial in the loop below? For example: outlet_1.dpm, outlet_2.dpm etc.,.. I looked through the TUI command list, but the commands to write a file are related with data case files.

Thank you in advance,

Journal File:

Code:
(define numbOfIterations 2); Define number of max. iterations per time step

(define delta_t 0.06); Define time step size [s]

(define no_t_s 2); Number of time steps

(do ((x1 1 (+ x1 1))) ((> x1 3)) ; define count - variable , start value and increment, define stop condition

/solve/initialize/initialize-flow y y ; do the Initialization, y y to discard the old data and clear history

/report/dpm-sample injection-0 injection-1 () outlet () () n n ; start sampling

/solve/set/time-step delta_t ; set the time step

/solve/dual-time-iterate no_t_s numbOfIterations; Perform unsteady iterations for a specified number of time steps

/report/dpm-sample );
fatihgulec is offline   Reply With Quote

Old   March 31, 2022, 22:36
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
you have typo, you forgot bracket after do
Code:
(do ((x1 1 (+ x1 1))) ((> x1 3))
(
code
)
personally I recommend you to use following format
Code:
(ti-menu-load-string (format #f "TUI COMMAND HERE"))
in that case all variables inside must be changed with ~a
example
Code:
(ti-menu-load-string (format #f "solve/set/time-step ~a" delta_t))
fatihgulec likes this.
__________________
best regards


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

Old   April 4, 2022, 12:19
Default
  #3
New Member
 
Fatih
Join Date: Jan 2022
Posts: 3
Rep Power: 4
fatihgulec is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
you have typo, you forgot bracket after do
Code:
(do ((x1 1 (+ x1 1))) ((> x1 3))
(
code
)
personally I recommend you to use following format
Code:
(ti-menu-load-string (format #f "TUI COMMAND HERE"))
in that case all variables inside must be changed with ~a
example
Code:
(ti-menu-load-string (format #f "solve/set/time-step ~a" delta_t))
Thank you for your answer. I added the parentheses for do but nothing changed. Should I use a scheme file instead of journal maybe?
fatihgulec is offline   Reply With Quote

Old   April 5, 2022, 01:50
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
show code you are using, and log with errors
__________________
best regards


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

Old   April 5, 2022, 08:08
Default
  #5
New Member
 
Fatih
Join Date: Jan 2022
Posts: 3
Rep Power: 4
fatihgulec is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
show code you are using, and log with errors
The problem was not about the parantheses but about the commands in the do loop. So, I used the structure as you suggested (given below) and it works perfectly now. Thank you so much!

Code:
(define numbOfIterations 100); Define number of max. iterations per time step
(define delta_t 0.06); Define time step size [s]
(define no_t_s 150); Number of time steps
(define no_trial 50); Number of trials


(do ((x1 1 (+ x1 1))) ((> x1 no_trial))
	(ti-menu-load-string (format #f "/solve/initialize/initialize-flow y y")) ;Initialization, y y to discard the old data and clear history
	(ti-menu-load-string (format #f "/report/dpm-sample injection-0 injection-1 () outlet () () y n")) ; start sampling
	(ti-menu-load-string (format #f "/solve/set/time-step delta_t")) ; set the time step
	(ti-menu-load-string (format #f "/solve/dual-time-iterate no_t_s numbOfIterations")); Perform unsteady iterations for a specified number of time steps
	(ti-menu-load-string (format #f "/report/dpm-sample")); stop sampling
	( display x1)
)
But my second problem about dpm file naming still continues. I want to change the dpm sample file which is generated automatically by Fluent, when I run the "/report/dpm-sample" command in the last row. How can I change the file name for each trial in the loop below? For example: outlet_1.dpm, outlet_2.dpm etc.,.. I looked through the TUI command list, but the commands to write a file are related with data case files.
fatihgulec is offline   Reply With Quote

Reply

Tags
dpm in fluent, file name, journal file, loop


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
spray simulation with heat transfer using DPM Tensian Fluent Multiphase 1 June 7, 2016 04:57


All times are GMT -4. The time now is 19:49.