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

Macro for parametric study in STAR CCM+

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By marmot

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 1, 2016, 18:40
Default Macro for parametric study in STAR CCM+
  #1
New Member
 
Join Date: Jun 2015
Location: Great Britain
Posts: 16
Rep Power: 10
cfdblender is on a distinguished road
I need to do a parametric study in STAR CCM+. The study will have anything between 50 and 150 runs. In each run, several parameters of the CAD model geometry will change, then the new model is remeshed, simulation run.

Obviously, doing this by hand would be very inefficient.

I'd like to use a macro that will read the parameters for each run from an Excel (or .csv) file, then remesh, run simulation and perhaps even save some key numerical results to another spreadsheet.

Does anyone have macro that does something similar to this?

Thanks in advance!
cfdblender is offline   Reply With Quote

Old   July 4, 2016, 08:40
Default
  #2
Senior Member
 
kevin alun
Join Date: Sep 2011
Location: Germany
Posts: 106
Rep Power: 14
marmot is on a distinguished road
People make a living off of that, but really just record yourself changing the design parameters, once that is changed its just one command to mesh and one command to run, writing out results, below are some basic java commands that are helpful for writing out data from a simulation,

Simulation sim = getActiveSimulation();
String filePath = sim.getSessionDir().toString();
String simName = sim.getPresentationName();

ArrayList<Double> someValue = new ArrayList<Double>();
ArrayList caseNameList = new ArrayList(); (define a list of case names probably related to your design changes or read from csv file)

For loop
//Changing design parameters,
mesh
run
get a value
aValue = avgReport.getValue(); (assuming you created an AvgReport variable)

someValue.add(aValue);
end the loop

FileWriter fstream;
BufferedWriter reportfile = null;

try{
fstream = new FileWriter(filePath + File.separator+simName+caseName+"SomeValue"+".csv" );
reportfile = new BufferedWriter(fstream);
reportfile.write(caseName+","+"ValueType");
reportfile.write("\r\n");
for loop
reportfile.write(caseNameList.get(i).toString() + "," + someValue.get(i).toString());
reportfile.write("\r\n");
end loop

reportfile.close();
}catch {something here}
cfdblender and bikooo3878 like this.
marmot is offline   Reply With Quote

Old   July 5, 2016, 13:08
Default
  #3
New Member
 
Join Date: Jun 2015
Location: Great Britain
Posts: 16
Rep Power: 10
cfdblender is on a distinguished road
Thank you, marmot! That is brilliant!
cfdblender is offline   Reply With Quote

Reply

Tags
macro, parametric study, star ccm+


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
problem when imported geometry from 3D CAD to star ccm, TAREK GANAT STAR-CCM+ 1 May 21, 2013 22:15
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 04:04
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 04:38
error in star ccm maurizio Siemens 3 October 16, 2007 05:17
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15


All times are GMT -4. The time now is 11:16.