CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   How to acquire the value of field function in macro (https://www.cfd-online.com/Forums/star-ccm/169985-how-acquire-value-field-function-macro.html)

huecu588755 April 21, 2016 07:13

How to acquire the value of field function in macro
 
Hi everyone
I am trying to use the macro java to do a transient simulation. I want to using the value of the field function in the code and I don't know how to acquire the value.

Owain_Parry April 24, 2016 14:46

Hi,

Example below, the value of the "Current Value" report is passed to the Java variable "curVal" which is of type double. Beware that the value is passed to your macro only when the command below runs within your macro, if it changes then you need to ensure you have the latest value.

curVal = simulation_0.getReportManager().getReport("Current Valve").getReportMonitorValue();

Hope that helps, let me know if you need further help.


All times are GMT -4. The time now is 03:24.