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

Overwriting files with PyFluent/TUI commands

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 1, 2023, 03:25
Default Overwriting files with PyFluent/TUI commands
  #1
New Member
 
Join Date: Jun 2023
Posts: 6
Rep Power: 2
dgnidovec is on a distinguished road
Hello everybody!

I am dealing with multi-scale-modelling as a project for my master thesis. I already have a fluent journal file scripts written and then running these scripts though terminal with python. Since the nature of the modelling is such that there is a lot of iterating through the same case (same .cas file), the method with running the journal file code provided below sequentially is kind of slow:
```
pwd
/file/confirm-overwrite yes
/file/read-case TransientUDF.cas.h5
/file/read-data transient_state_5.dat.h5
/solve/set/time-step 0.02
/solve/dual-time-iterate 1 150
no # answers no to the question "Create new file?"
yes # answers yes to the question "Confirm overwrite?"
/file/write-data "transient_state_6.dat.h5"
yes
/exit ok

```
In order to make my model faster, I discovered pyansys package, more exactly ansys.fluent.core. I managed to convert basically the whole journal file in your function calls, except, I really can’t find how to deal with overwriting output files. By default, it creates new file if there already exists one, but I want my files to be overwritten. In journal file I simply input “no” or “yes” statements as the answer to the prompts that are raised in fluent. I tried pyfluent journaling in order to store python commands of my TUI input, but it stored everything, but answers to prompts raised... Therefore I still don't know how to tell fluent with ansys.fluent.core to overwrite existing files when executing the "solve" command.

Sicne the nature of using ansys.fluent.core python package is quite similar to writing TUI commands, there migght be someone that knows how to deal with overwriting files in the other way than just answering "no" and "yes".

I kindly ask for your feedback; it would help a lot in the progress of my master thesis! Thanks in advance.

Best regards
dgnidovec 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
[Gmsh] Meshing 3D volume from STL/STEP Files (Gmsh) jgross OpenFOAM Meshing & Mesh Conversion 6 July 15, 2022 05:11
How to convert .trn files to .cgns files cyln CFX 5 October 20, 2018 23:25
How to run a series of Fluent journal files in order? jyoung79 FLUENT 2 September 22, 2014 08:52
Writing Case and Data Files Using Journal/Scheme Files svp Fluent UDF and Scheme Programming 0 April 5, 2011 11:04
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 20:51


All times are GMT -4. The time now is 08:39.