|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Join Date: May 2010
Posts: 9
Rep Power: 14 ![]() |
Hi everybody,
let’s say I have a set-up which takes 1hour to run. So in theory, when I leave work at 5pm and come back next morning at 8am, the system could have ran a dozen of simulations. So is there a possibility to start the next simulation once the previous one is done (something like a “batch-run”)??? Regards, Dora |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Oliver Lauer
Join Date: Mar 2009
Location: Coburg
Posts: 57
Rep Power: 16 ![]() |
You can run Star-CCM+ in batch mode ( -batch file.java).
Imagine a file called run.java containing something like: // STAR-CCM+ macro: run.java package macro; import java.util.*; import java.io.*; import javax.swing.*; import star.common.*; import star.base.neo.*; import star.vis.*; import star.base.report.*; import star.flow.*; public class run extends StarMacro { public void execute() { execute0(); } private void execute0() { try { Simulation simulation_0 = getActiveSimulation(); simulation_0.getSimulationIterator().run(); simulation_0.saveState(simulation_0.getSessionPath ()); } catch (Exception e) { JOptionPane.showMessageDialog( null, e.toString() ); } } } then you could run starccm+ -batch run.java file.sim. You could add some of these command lines in a batch script. Have fun Oliver |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Join Date: May 2010
Posts: 9
Rep Power: 14 ![]() |
Hi Oliver,
thanks for your reply. Somehow Im a bit confused as Im not comfortable with this macro stuff. Let's say the files I have are: Version_01.sim Version_02.sim Version_03.sim Do I than to open Version_01.sim, click the marco file button to generate a java file and put the text below?? // STAR-CCM+ macro: run.java package macro; import java.util.*; import java.io.*; import javax.swing.*; import star.common.*; import star.base.neo.*; import star.vis.*; import star.base.report.*; import star.flow.*; public class run extends StarMacro { public void execute() { execute0(); } private void execute0() { try { Simulation simulation_0 = getActiveSimulation(); simulation_0.getSimulationIterator().run(); simulation_0.saveState(simulation_0.getSessionPath ()); } catch (Exception e) { JOptionPane.showMessageDialog( null, e.toString() ); } } } But were would the connection to the Version_02.sim and Version_03.sim be? Im confused. Please advise. Thank you!! again |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Member
Oliver Lauer
Join Date: Mar 2009
Location: Coburg
Posts: 57
Rep Power: 16 ![]() |
You create a file run.java containing the posted text with an editor of your choice.
Then you prepare all your simulation cases in a way that they only need to be started and save them. At last you create a batch file where you write something like starccm+ -batch run.java Version_01.sim starccm+ -batch run.java Version_02.sim starccm+ -batch run.java Version_03.sim The details for this batch file depend on the OS you use. Usually you can see in the GUI how CCM+ is started on your machine. run.java automatically finds out path and name of the simulation, runs it and saves the results with the same name. |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Ryne Whitehill
Join Date: Aug 2009
Posts: 312
Rep Power: 17 ![]() |
Alternatively you can look into a queuing system, which is external to STAR-CCM+.
e.g. : http://www.platform.com/workload-man...ance-computing I am sure you can find some free/open source project to do the same thing. |
|
![]() |
![]() |
![]() |
![]() |
#6 | |
New Member
Join Date: Jun 2010
Posts: 3
Rep Power: 14 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#7 |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 54
Rep Power: 2 ![]() |
Hello, any update on that? does this still works on 2022.1 or similar versions?
I cannot manage to make it run. I can execute the program but does not open the window and then I cannot manage to make it run the simulation. I'm on windows 10 if that helps Thanks |
|
![]() |
![]() |
![]() |
![]() |
#8 |
Senior Member
|
Previously to do a batch run we have to set up a micro. We can still get batch run macro from Star-CCM+ support. But now Star-CCM+ have added node under "Tools" called "Simulation Operations". With simulation operations you can design your own algorithm from set of commands like meshing, running physics, setting different parameter value, clear solution etc. Try exploring this option.
|
|
![]() |
![]() |
![]() |
![]() |
#9 | |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 54
Rep Power: 2 ![]() |
Quote:
What I would like to do is to prepare like 3-4 *.sim files and execute them one after the other automatically. I only have 1 power license and this way would allow me to run various 3-4h simulations overnight |
||
![]() |
![]() |
![]() |
![]() |
#10 |
Senior Member
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 392
Rep Power: 15 ![]() |
The simpliest way I can see - is to use the command line.
|
|
![]() |
![]() |
![]() |
![]() |
#11 | |||
Senior Member
Join Date: Apr 2009
Posts: 144
Rep Power: 15 ![]() |
Quote:
1) Make sure your sims have batch autosave enabled (in File>Autosave). 2) Place all your sims and macros in the same folder. 3) Create a text file that contains the following text, and rename its extension from .txt to .bat If you have macros you'd like to run for each sim, use: Quote:
Quote:
4) Change 17.02.008 to your version (if different), installation directory (if different), the number after -np for the number of cores you want to use (note: these are all on local host), and obviously the names of macros and sims. 5) Open command prompt and change directory to your folder. This is easiest done by opening the folder, clicking in the address bar, typing cmd, and hitting enter. 6) Run batch file by typing its name and hitting enter. 7) If you want to terminate current sim or whole batch job, press Ctrl+C. If you want to view current sim, open Star-CCM+, right-click on your sim in Servers window and connect (then disconnect when done). |
||||
![]() |
![]() |
![]() |
![]() |
#12 | |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 54
Rep Power: 2 ![]() |
Quote:
![]() To be fair, I managed to execute it and I saw starccm was running on the task manager but I didn't know what it was doing... the connect to the server I did not know and that all now makes sense. |
||
![]() |
![]() |
![]() |
![]() |
#13 |
Senior Member
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 392
Rep Power: 15 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#14 |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 54
Rep Power: 2 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#15 | |
New Member
Join Date: Oct 2022
Posts: 1
Rep Power: 0 ![]() |
Quote:
Code:
"C:\Program Files\Siemens\17.02.008-R8\STAR-CCM+17.02.008-R8\star\lib\win64\intel20.1vc14.2-r8\lib\starccm+.exe" starccm+ -server -power -podkey MYPODKEY -licpath 1999@flex.cd-adapco.com -np 2 -batch run Star.sim I always get this error message: Code:
Unable to start Simcenter STAR-CCM+. Invalid file type. Check arguments and their order. Usage: starccm+ [-server] [<options> ...] [<simfile>] |
||
![]() |
![]() |
![]() |
![]() |
#16 | |||
Senior Member
Join Date: Apr 2009
Posts: 144
Rep Power: 15 ![]() |
Quote:
Before: Quote:
Quote:
|
||||
![]() |
![]() |
![]() |
![]() |
#17 | |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 54
Rep Power: 2 ![]() |
Quote:
Also, can I add a "Simulation Operation" that calls a Macro? this way I can control when each macro is executed. Thanks |
||
![]() |
![]() |
![]() |
![]() |
#18 | |
Senior Member
Join Date: Apr 2009
Posts: 144
Rep Power: 15 ![]() |
Quote:
The batch macro is called when launching the simulation. Whatever you do in the macro is what's done to the simulation. The batch process (in this case) does not automatically run, mesh, or save; so, the macro must do this (except saving, you can also do this automatically via a tick mark in File>Autosave). The macro you pass to the batch process can call other macros & execute sim ops (which themselves can call macros). It's macros all the way down, yo. So, in your case, just have the batch macro execute your sim op. There's also a "run" batch command; however, it's equivalent to hitting run, and I don't think it executes sim ops (never tried it). |
||
![]() |
![]() |
![]() |
![]() |
#19 | |
Member
Marc Ricart
Join Date: Jul 2022
Posts: 54
Rep Power: 2 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#20 | |
Senior Member
Join Date: Apr 2009
Posts: 144
Rep Power: 15 ![]() |
Quote:
So, you must have been asking whether you can call macros within the batch macro itself? If so, then the answer is yes (as previously stated). |
||
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unable to run OF in parallel on a multiple-node cluster | quartzian | OpenFOAM | 3 | November 24, 2009 13:37 |
serial run fine, but parallel run diverged | phsieh2005 | OpenFOAM Running, Solving & CFD | 2 | October 6, 2009 08:33 |
How to run InterFoam in steay state | waynezw0618 | OpenFOAM Running, Solving & CFD | 0 | November 10, 2008 07:08 |
Windows 64-bit, Distributed Parallel Run Issues... | Erich | CFX | 3 | March 28, 2006 16:36 |
Restatring run | Tim | CFX | 2 | March 3, 2006 11:54 |