|
[Sponsors] |
Automated png generation for scenes from autosaved files |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 12, 2015, 05:29 |
Automated png generation for scenes from autosaved files
|
#1 |
New Member
Adrian Bürger
Join Date: Jun 2015
Location: Karlsruhe, Germany
Posts: 6
Rep Power: 11 |
Hello everyone,
I'm pretty new to the topic of CFD as well as to the software STAR-CCM+, and I hope that somebody in this forum can help me solve my problem: Over the last two weeks, I ran a simulation that in addition to the autosaves files generated png pictures from a specific scene. Now I realized that I would need the visualization of additional scenes, and I could get them from the autosaved files. But since there are several hundred saved files, I would not want to open every file and generate the pngs by hand, but would like to use a builtin-function (if there is one for this task) or a script for this (while I do not know exactly how to script STAR-CCM+). Does someone of you know an elegant solution for this, or can point out to me how this could be achieved? Any suggestions are highly appreciated! Thank you very much for your help! |
|
June 15, 2015, 09:26 |
|
#2 |
Member
kris
Join Date: May 2014
Posts: 73
Rep Power: 12 |
Hello,
This is what you could do - 1- open one of the files. 2- record a java macro and to all the things you want to do i.e. open a scene, display parts, save the PNG, and save the sim file. (and any other operations that you want to do on all the files) 3- use batch commad to open each sim file and run the above java macro. the batch command goes something like this installation directory\starccm+ -batch javafile.java simfile.sim installation directory is where your starccm+is installed. in notepad, write the above command for all your files and save it as .bat file. double click this and it will be done. you could also use a "loop" within the batch file to loop all your files, if you are good at that. hope this helps !! |
|
June 16, 2015, 11:34 |
|
#3 | |
New Member
Adrian Bürger
Join Date: Jun 2015
Location: Karlsruhe, Germany
Posts: 6
Rep Power: 11 |
Quote:
The main, relevant part now looks something like this Code:
import subprocess for k in list_of_files: p = subprocess.Popen([ \ "/opt/CD-adapco/STAR-CCM+9.06.011-R8/star/bin/starccm+", \ "-batch", \ "/path/to/macro1.java,/path/to/macro2.java", \ "/path/to/file" + k]) p.communicate() It works like a charm! You just saved me a lot of time, thank you very much! |
||
June 18, 2015, 01:27 |
|
#4 |
Member
kris
Join Date: May 2014
Posts: 73
Rep Power: 12 |
Cool. but you can use the following code instead of using python script.
for /f "delims=|" %%f in ('dir /b yourfolder\*.sim') do C:\Program Files\CD-adapco\STAR-CCM+9.04.009\star\bin\starccm+ -batch %%f location\javamacro.java copy paste that code into a notepad file. Edit the bold part with your values and save the file as .bat double click this file. And you are done. This will run the specified macro on all *.sim files in "Your Folder". |
|
June 24, 2015, 02:43 |
|
#5 | |
New Member
Adrian Bürger
Join Date: Jun 2015
Location: Karlsruhe, Germany
Posts: 6
Rep Power: 11 |
Quote:
|
||
Tags |
scenes, scripting |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Looking for UDF files of the tutorial "Simulation of Wave Generation in a Tank" | seucj | Fluent UDF and Scheme Programming | 12 | August 21, 2015 06:52 |
automated generation of DPM injection points | Wouter | FLUENT | 5 | March 10, 2006 03:45 |
Latest News in Mesh Generation | Robert Schneiders | Main CFD Forum | 1 | February 18, 2000 01:48 |
Latest new in mesh generation | Robert Schneiders | Main CFD Forum | 0 | February 16, 2000 08:12 |
Latest news in mesh generation | Robert Schneiders | Main CFD Forum | 0 | March 2, 1999 05:07 |