|
[Sponsors] |
May 22, 2021, 18:11 |
java macro to set angle of attack
|
#1 |
New Member
Georg
Join Date: Dec 2020
Posts: 10
Rep Power: 6 |
Hi everyone,
I am trying to script a macro that lets me set the angle of attack in my simulation through the command line before running it, but I am struggling to wrap my head around the -jvmargs option. To be precise, I would like to change the value 14.0 in the following line of the macro to an arbitrary value that I can input from the command line -> scalarGlobalParameter_0.getQuantity().setValue(14. 0); Would this be the proper way to parse a "newaoa" value of 10 deg to the macro? -> starccm+ -power -batch change_aoa.java -jvmargs -Dnewaoa=10.0 -np 1 testsim.sim And how would I need to change the line from the macro to use that new aoa? Does anybody here have some experience with similar cases? I would really appreciate the help BR! |
|
May 23, 2021, 10:16 |
fixed it
|
#2 |
New Member
Georg
Join Date: Dec 2020
Posts: 10
Rep Power: 6 |
I figured it out now and thought I'd post a minimum working example for anyone stumbling over the same problem in the future:
Code:
// Simcenter STAR-CCM+ macro: change_aoa.java // Written by Simcenter STAR-CCM+ 16.02.009 package macro; import java.util.*; import star.common.*; import star.base.neo.*; public class change_aoa extends StarMacro { public void execute() { execute0(); } private void execute0() { Simulation simulation_0 = getActiveSimulation(); ScalarGlobalParameter scalarGlobalParameter_0 = ((ScalarGlobalParameter) simulation_0.get(GlobalParameterManager.class).getObject("aoa")); String newaoa = System.getProperty("newaoa"); Double x = Double.parseDouble(newaoa); scalarGlobalParameter_0.getQuantity().setValue(x); Units units_0 = ((Units) simulation_0.getUnitsManager().getObject("deg")); scalarGlobalParameter_0.getQuantity().setUnits(units_0); } } Code:
starccm+ -power -podkey <podkey> -licpath <licpath> -batch change_aoa.java -jvmargs -Dnewaoa=8 testsim.sim |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to access java files in sub-directory | abraum | STAR-CCM+ | 3 | July 11, 2012 03:46 |
how to plot attack angle along with impeller span direction at leading edge | wildli | FLUENT | 0 | August 31, 2010 15:47 |
convegence problem with high angle of attack | littlelz | CFX | 2 | October 28, 2009 07:07 |
introducing angle of attack on ICEMCFD HEXA | icem beginner | FLUENT | 2 | December 6, 2008 16:34 |
Proper output of angle of attack in CFX post | Kevin | CFX | 3 | October 18, 2006 13:18 |