How to Export Automatic Pseudo-Time Step (pseudo_dt) Value to Text File via Fluent Scheme Journal?

Options
Alex921
Alex921 Member Posts: 5 **

I am running transient CFD simulations using the automatic pseudo-time stepping method in ANSYS Fluent. Currently, I have the solver verbosity set to 1, so I can see the pseudo-time step value (pseudo_dt) printed in the console during iterations.

Now, I want to automatically export the current pseudo_dt value to a text file (named Automatic-flow-pseudo-dt.txt) inside the FLTG folder at each iteration or time step, using a Scheme journal script.

I tried the following journal snippet to write the pseudo_dt value:

Edit
(define (write-Automatic-flow-pseudo-dt)
(begin
(define port (open-output-file "Automatic-flow-pseudo-dt.txt"))
(for-each
(lambda (x)
(begin
(display x port)
(newline port)
)
)
get-solver-variable "pseudo_dt"
)
(close-output-port port)
)
)
However, this writes #F to the file instead of the actual numeric value.

What I want:

A proper Scheme function that retrieves the current pseudo_dt solver variable.

Writes the value to FLTG/Automatic-flow-pseudo-dt.txt as a formatted string, e.g.:

Automatic flow pseudo-dt = 6.812478e-02 s
Preferably, the file should be overwritten or appended at each call
Ideally, how to integrate this function in the simulation workflow (e.g., called every iteration or timestep)

Tagged: