CFD Online URL
[Sponsors]
Home > Forums > STAR-CCM+

Automatically starting a run

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 26, 2011, 05:07
Default Automatically starting a run
  #1
New Member
 
Join Date: May 2010
Posts: 9
Rep Power: 6
Dora is on a distinguished road
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
Dora is offline   Reply With Quote

Old   January 26, 2011, 07:23
Default
  #2
Member
 
Oliver Lauer
Join Date: Mar 2009
Location: Coburg
Posts: 57
Rep Power: 7
olauer is on a distinguished road
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
olauer is offline   Reply With Quote

Old   January 26, 2011, 08:15
Default
  #3
New Member
 
Join Date: May 2010
Posts: 9
Rep Power: 6
Dora is on a distinguished road
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
Dora is offline   Reply With Quote

Old   January 26, 2011, 09:00
Default
  #4
Member
 
Oliver Lauer
Join Date: Mar 2009
Location: Coburg
Posts: 57
Rep Power: 7
olauer is on a distinguished road
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.

olauer is offline   Reply With Quote

Old   January 26, 2011, 10:05
Default
  #5
Super Moderator
 
Ryne Whitehill
Join Date: Aug 2009
Posts: 313
Rep Power: 9
rwryne is on a distinguished road
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.
rwryne is offline   Reply With Quote

Old   January 27, 2011, 13:00
Default
  #6
New Member
 
Join Date: Jun 2010
Posts: 3
Rep Power: 6
WhoAmI is on a distinguished road
Quote:
Originally Posted by Dora View Post
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
If it is a simple problem i.e. varying velocity at the inlet or temperature on a wall at regular intervals, you can write a field function using floor or ceil functions and autosave option.
WhoAmI is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to run OF in parallel on a multiple-node cluster quartzian OpenFOAM 3 November 24, 2009 14:37
serial run fine, but parallel run diverged phsieh2005 OpenFOAM Running, Solving & CFD 2 October 6, 2009 09:33
How to run InterFoam in steay state waynezw0618 OpenFOAM Running, Solving & CFD 0 November 10, 2008 08:08
Windows 64-bit, Distributed Parallel Run Issues... Erich CFX 3 March 28, 2006 16:36
Restatring run Tim CFX 2 March 3, 2006 12:54


All times are GMT -4. The time now is 10:30.