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 Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2020, 10:12
Default Getting the value of a report into my macro
  #1
New Member
 
Lisa Weck
Join Date: Jun 2020
Posts: 4
Rep Power: 6
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, 11:13
Default P.s.
  #2
New Member
 
Lisa Weck
Join Date: Jun 2020
Posts: 4
Rep Power: 6
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

Old   May 9, 2022, 08:03
Default
  #3
New Member
 
Emre
Join Date: Sep 2020
Posts: 7
Rep Power: 6
emrebnc is on a distinguished road
Quote:
Originally Posted by d_mato View Post
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.
Hello Lisa I dont know the answer to your original question but you can find the overall calsses and methods by clicking Help > Java API.
If you have found the answer to your original question i would love to hear it.
emrebnc 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
Starccm+ Report Java macro error lzw STAR-CCM+ 6 October 9, 2019 21:30
Macro to generate CSV by reading report values ashmrao STAR-CCM+ 6 October 7, 2019 05:29
fvOptions npatricia OpenFOAM 6 May 23, 2018 06:21
timestep extraction for macro manuc Tecplot 0 August 10, 2016 13:20
Java Macro with a condition on a Report Mark_89 STAR-CCM+ 0 August 21, 2013 08:05


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