CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   java injector creation (https://www.cfd-online.com/Forums/star-ccm/68320-java-injector-creation.html)

bramv101 September 15, 2009 09:30

java injector creation
 
I am trying to create a java script to automate the creation of an injector coupled to a lagrangian phase. However this script is a recorded macro from a previous simulation with other names for the region and injector part.
How do I modify this script so it will ask to select this part that will serve as my injector.
See characters in RED where I am pointing to the older names....

Great thx


//injector 0 ---------------------------------------------------------------------------------------------------
Injector injector_0 =
simulation_0.get(InjectorManager.class).createInje ctor();

injector_0.setPresentationName("1.0");

injector_0.setInjectorType(PartInjector.class);

Region region_0 =
simulation_0.getRegionManager().getRegion("HEALED_BODY_1 ");

Boundary boundary_0 =
region_0.getBoundaryManager().getBoundary("inlet");

injector_0.getPartGroup().setObjects(boundary_0);

injector_0.setLagrangianPhase(lagrangianPhase_0);

InjectorMassFlowRate injectorMassFlowRate_0 =
injector_0.getInjectorValues().get(InjectorMassFlo wRate.class);

((ConstantScalarProfileMethod) injectorMassFlowRate_0.getMethod()).getQuantity(). setValue(6.0E-6);

kyle September 15, 2009 09:58

I believe there is a section in the manual called "prompting for user input"

you may want to read that

bramv101 September 15, 2009 10:40

Problem is already went through it :).
Providing an interactive dialog seems the best for me, but i have no idea how to implement a part selection into this.


All times are GMT -4. The time now is 15:20.