CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

bash script information

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 19, 2017, 06:44
Default bash script information
  #1
Member
 
Join Date: Apr 2014
Location: N/A
Posts: 47
Rep Power: 12
FluentStarter is on a distinguished road
Hey guys,

i'm running simulations on a grid and for that I need a bash-script. But unfortunatelly i'm encountering some problems while searching for information how to write this scripts.

For example. Up to now I use the following script to run the simulation. But the simulation doesn't stop when it reaches the maximum step quantity specified in my sim.-file. Which line do i have to add for this?



package macro;

import java.util.*;

import star.common.*;

public class macrotest extends StarMacro {

public void execute() {
execute0();
}

private void execute0() {

Simulation simulation_0 =
getActiveSimulation();

ResidualPlot residualPlot_0 =
((ResidualPlot) simulation_0.getPlotManager().getPlot("Residuals") );

residualPlot_0.open();

simulation_0.getSimulationIterator().run();


}
}
FluentStarter is offline   Reply With Quote

Old   January 19, 2017, 15:17
Default
  #2
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24
me3840 is on a distinguished road
This should stop with the stopping criterion if they are enabled, check that is the case. There's no need to open the residual plot in batch, you can take those lines out.

Also this is not a Bash script, this is Java.
me3840 is offline   Reply With Quote

Old   January 21, 2017, 09:55
Default
  #3
New Member
 
DL
Join Date: Jun 2016
Posts: 18
Rep Power: 10
underrelaxed is on a distinguished road
Quote:
Originally Posted by FluentStarter View Post
Hey guys,

i'm running simulations on a grid and for that I need a bash-script. But unfortunatelly i'm encountering some problems while searching for information how to write this scripts.

For example. Up to now I use the following script to run the simulation. But the simulation doesn't stop when it reaches the maximum step quantity specified in my sim.-file. Which line do i have to add for this?



package macro;

import java.util.*;

import star.common.*;

public class macrotest extends StarMacro {

public void execute() {
execute0();
}

private void execute0() {

Simulation simulation_0 =
getActiveSimulation();

ResidualPlot residualPlot_0 =
((ResidualPlot) simulation_0.getPlotManager().getPlot("Residuals") );

residualPlot_0.open();

simulation_0.getSimulationIterator().run();


}
}
If this is all the functionality you need in your macro, I would suggest a different approach using the standard Star-CCM+ commands one might use to submit via command line. This commands would be:

<INSTALL_PATH>/star/bin/starccm+ -np <# of cores> -batch <simulation filename> -licpath <port@licenseserver name>

Depending on your simulation needs and the configuration of your grid, use starccm+ -help to review additional options. I suspect you are using a job scheduler, so pay extra attention to the -batchsystem option. The above basic command typically is the last line of the script.

You indirectly stated that your shell is bash, but directly that you need a script in bash. #!/bin/bash will be the first line of the script. Make friends with your system administrator(s), as they should be able to help you build the guts of the script based on the details of the grid configuration.

Hope that helps and I didn't confuse you too much!
underrelaxed is offline   Reply With Quote

Old   January 21, 2017, 10:37
Default
  #4
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24
me3840 is on a distinguished road
Quote:
Originally Posted by underrelaxed View Post
<INSTALL_PATH>/star/bin/starccm+ -np <# of cores> -batch <simulation filename> -licpath <port@licenseserver name>
This should be:
<INSTALL_PATH>/star/bin/starccm+ -np <# of cores> -batch <java script or command> -licpath <port@licenseserver name> <simulation filename>

The -batch command takes an argument of a macro or one of the 'simple' commands like run or mesh. The sim filename is an argument to the starccm+ binary.
me3840 is offline   Reply With Quote

Old   January 22, 2017, 11:51
Default
  #5
New Member
 
DL
Join Date: Jun 2016
Posts: 18
Rep Power: 10
underrelaxed is on a distinguished road
Both commands will work, but me3840 comments are more complete.

I should have been more clear. The macro shared originally only solves the model, and the suggestion is to omit the macro. -batch without any macro or smart arguments (like mesh or run) defaults to run.
underrelaxed is offline   Reply With Quote

Old   January 23, 2017, 10:30
Default
  #6
New Member
 
Max
Join Date: Dec 2010
Posts: 4
Rep Power: 15
monkeymax is on a distinguished road
Both commands will work, but best practice (based on ~8 years of using STAR-CCM+) is that you should have the sim file as your last argument and any macro filename immediately preceeding that.
It matters less now than it used to (i.e. STAR-CCM+ cares a lot less these days about the order of the arguments) but is still good to apply this principle.
monkeymax is offline   Reply With Quote

Old   January 31, 2017, 11:17
Default
  #7
Member
 
Join Date: Apr 2014
Location: N/A
Posts: 47
Rep Power: 12
FluentStarter is on a distinguished road
Thanks guys!
FluentStarter 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
[ANSYS Meshing] Script Model - Mechanical USER1234 ANSYS Meshing & Geometry 33 September 25, 2015 09:19
libz.so.1: no version information available dmaz OpenFOAM Running, Solving & CFD 3 January 4, 2015 16:54
[ANSYS Meshing] Problem with Icem Script Krish ANSYS Meshing & Geometry 0 October 18, 2011 12:10
information from saved data files:Unsteady flow Atul FLUENT 5 July 27, 2008 20:05
TASCflow,problem with script and parallel mode Zbynek Hrncir CFX 0 October 2, 2001 07:30


All times are GMT -4. The time now is 22:57.