|
[Sponsors] |
July 1, 2022, 08:59 |
Export profile data in CSV file
|
#1 |
Senior Member
Zese
Join Date: Sep 2013
Posts: 102
Rep Power: 12 |
Dear all
I am experiencing a complicated situation for which I have no solution. I am trying to do optimization in Matlab and in every loop I need the transient velocity profiles in csv for every timestep. It is long but I have to explain it widely. in every loop of optimization, I do transient simulation with a source term until convergence then I capture the new frequency of the flow which is changing during every loop of optimization. Then I read a new journal file with the new time step for exporting profiles for each time-step and continues it for one period. First I try that by defining execute command in fluent which is like this in journal file: (cx-gui-do cx-set-list-tree-selections "NavigationPane*List_Tree1" (list "Solution|Calculation Activities|Execute Commands")) (cx-gui-do cx-set-integer-entry "Execute Commands*IntegerEntry1(Defined Commands)" 1) (cx-gui-do cx-activate-item "Execute Commands*IntegerEntry1(Defined Commands)") (cx-gui-do cx-set-list-selections "Execute Commands*Table2*DropDownList10" '( 1)) (cx-gui-do cx-activate-item "Execute Commands*Table2*DropDownList10") (cx-gui-do cx-set-toggle-button2 "Execute Commands*Table2*CheckButton6" #t) (cx-gui-do cx-activate-item "Execute Commands*Table2*CheckButton6") (cx-gui-do cx-activate-item "Execute Commands*PanelButtons*PushButton4(Define Macro)") (cx-gui-do cx-activate-item "Define Macro*PanelButtons*PushButton1(OK)") (cx-gui-do cx-activate-item "MenuBar*WriteSubMenu*Profile...") (cx-gui-do cx-set-list-selections "Write Profile*List3(Surfaces)" '( 7)) (cx-gui-do cx-activate-item "Write Profile*List3(Surfaces)") (cx-gui-do cx-set-list-selections "Write Profile*List9(Values)" '( 9)) (cx-gui-do cx-activate-item "Write Profile*List9(Values)") (cx-gui-do cx-set-list-selections "Write Profile*List9(Values)" '( 9 10)) (cx-gui-do cx-activate-item "Write Profile*List9(Values)") (cx-gui-do cx-activate-item "Write Profile*PanelButtons*PushButton1(OK)") (cx-gui-do cx-set-file-dialog-entries "Select File" '( "velocity_%t.csv") "Profile Files (*.csv *.prof )") (cx-gui-do cx-set-text-entry "Execute Commands*Table2*TextEntry11" "macro-1") (cx-gui-do cx-activate-item "Execute Commands*PanelButtons*PushButton1(OK)") then I pushed Run calculation and the journal was writing. after the calculation was completed I stopped journal. This was written for 10 time-steps. the problem is that when I change the time step to 20 in journal file, it just write profiles for 10 time steps. when I go to journal file to see what was the problem I found that there is a command repeated during the calculation for 10 times. (cx-gui-do cx-activate-item "Write Profile*PanelButtons*PushButton1(OK)") this is related to the execute command. if I delet it no profile data is written. it must be repeated based on timesteps. Do you know what I can do? |
|
July 1, 2022, 09:20 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 66 |
The line that you are tinkering with which you think is a problem is a button press of the "OK" button when you define the profile which is of course necessary to close that particular window.
Btw what you have is a macro, not what most people will consider a journal file. I highly recommend to learn to write journal files using TUI commands and not a recorded macro of button presses. If you take this macro into a GUI-less environment for example, it won't work at all. Any time I see a cx-gui-do it makes me cringe. If you want a hint on how to go about learning how to do this... just type write profile into the command window and work your way through the text prompt system. |
|
July 1, 2022, 11:32 |
|
#3 | |
Senior Member
Zese
Join Date: Sep 2013
Posts: 102
Rep Power: 12 |
Quote:
Thanks for your reply. Do you know how I can run fluent in TUI mode? |
||
July 2, 2022, 11:33 |
|
#4 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 66 |
I don't know what you're asking. All Fluent sessions have a TUI. It's the same window as where all the text get's printed. You can type commands into it no matter what mode you are in. You don't need to do anything except use it. Just don't touch your mouse. Unplug it if that is too difficult a temptation.
If you want a no GUI mode and that has only a TUI then there's a number of ways. You can pass the -nogui flag to launch options or you can run Fluent in batch mode. But it's not necessary. |
|
July 2, 2022, 13:17 |
|
#5 | |
Senior Member
Zese
Join Date: Sep 2013
Posts: 102
Rep Power: 12 |
Quote:
I solved it by TUI journal file |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 18:13 |
OpenFoam "Permission denied" and "command not found" problems. | iyidaniel@yahoo.co.uk | OpenFOAM Running, Solving & CFD | 11 | January 2, 2018 06:47 |
SparceImage v1.7.x Issue on MAC OS X | rcarmi | OpenFOAM Installation | 4 | August 14, 2014 06:42 |
Trouble compiling utilities using source-built OpenFOAM | Artur | OpenFOAM Programming & Development | 14 | October 29, 2013 10:59 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 10:57 |