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

Getting the value of a report into my macro

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2020, 09:12
Default Getting the value of a report into my macro
  #1
New Member
 
Lisa Weck
Join Date: Jun 2020
Posts: 4
Rep Power: 2
d_mato is on a distinguished road
Hallo everybody,


I am new to this forum and this is my first question:
How do I get the value of a report or function into my macro?
So far I have tried this:


Code:
package macro;

import java.util.*;

import star.common.*;
import star.base.neo.*;
import star.base.report.*;

public class try_and_error extends StarMacro {

  public void execute() {
    execute0();
  }

  private void execute0() {

    Simulation simulation_0 = 
      getActiveSimulation();

    StepStoppingCriterion stepStoppingCriterion_0 = 
      ((StepStoppingCriterion) simulation_0.getSolverStoppingCriterionManager().getSolverStoppingCriterion("Maximum Steps"));

    stepStoppingCriterion_0.setMaximumNumberSteps(49);
    simulation_0.getSimulationIterator().run();

    old_room = simulation_0.getReportManager().getReport("T_room_supply_report").getReportMonitorValue();
    //double old_room = 295.0; //This workes fine
    double correction = 0.1;

    String str_new_room = String.valueOf(old_room + correction);

    UserFieldFunction userFieldFunction_0 = 
      ((UserFieldFunction) simulation_0.getFieldFunctionManager().getFunction("T_room_supply"));

    userFieldFunction_0.setDefinition(str_new_room);
  }
  }
This produces the warning: "Cannot find symbol..."
The goal is to reset a boundarycondition after some iterations, and use its previous value and some report to calculate the new value.
Thanks for reading my post and for any help and advice!
d_mato is offline   Reply With Quote

Old   June 17, 2020, 10:13
Default P.s.
  #2
New Member
 
Lisa Weck
Join Date: Jun 2020
Posts: 4
Rep Power: 2
d_mato is on a distinguished road
Also, it would help a lot to know where i can find an overview over all the ccm+-classes and methods, that can be used in a macro.
d_mato is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Starccm+ Report Java macro error lzw STAR-CCM+ 6 October 9, 2019 20:30
Macro to generate CSV by reading report values ashmrao STAR-CCM+ 6 October 7, 2019 04:29
fvOptions npatricia OpenFOAM 6 May 23, 2018 05:21
timestep extraction for macro manuc Tecplot 0 August 10, 2016 12:20
Java Macro with a condition on a Report Mark_89 STAR-CCM+ 0 August 21, 2013 07:05


All times are GMT -4. The time now is 00:58.