|
[Sponsors] |
Java code to get the current residuals values |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 8, 2018, 20:37 |
Java code to get the current residuals values
|
#1 |
New Member
Élio Pereira
Join Date: May 2018
Location: Lisbon
Posts: 2
Rep Power: 0 |
From the forum topic Java code to get the current time/iteration step, I learnt that the current iteration number can be accessed through the following command:
getActiveSimulation().getSimulationIterator().getC urrentIteration() I wonder if there's a similar command to get the current residual values ( Continuity, X-momentum, Y-momentum and Energy). I tried, for example, the following command for the continuity: getActiveSimulation().getSimulationIterator().getC urrentContinuity() but I wasn't successful. Star CCM+ doesn't aknowledge this one. Which commands should be used to get the current residuals values? |
|
May 12, 2018, 18:19 |
|
#2 | |
Senior Member
Sebastian Engel
Join Date: Jun 2011
Location: Germany
Posts: 567
Rep Power: 21 |
Quote:
Yes, sure there is way. However, you'll not find the residual values in the SimulationIterator class. Instead, you can get the latest resdiual value from their respective monitors. I don't recall the way to directly get the current residual value, but below is a working example. For more information and alternative way, check the java api guide to get an overview what the ResidualMonitor (or PlotableMonitor) class can do. Code:
import java.util.*; import star.common.*; import star.base.neo.*; import star.base.report.*; public class printConti extends StarMacro { public void execute() { Simulation sim = getActiveSimulation(); ResidualMonitor residualMonitor_0 = ((ResidualMonitor) sim.getMonitorManager().getMonitor("Continuity")); double[] conti = residualMonitor_0.getPlotYValues() ; sim.println("The current continuity residual is " + conti[conti.length-1]); } } Best regards, Sebastian |
||
May 14, 2018, 04:29 |
|
#3 |
New Member
Élio Pereira
Join Date: May 2018
Location: Lisbon
Posts: 2
Rep Power: 0 |
Thank you for your answer!
|
|
Tags |
code, current, macro, residuals, star ccm+ |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
I got code 1 error from ANSYS CFX | zlor1324 | CFX | 0 | March 11, 2014 20:22 |
max node values exceed max element values in contour plot | jason_t | FLUENT | 0 | August 19, 2009 12:32 |
exact face values | RubenG | Main CFD Forum | 0 | June 22, 2009 12:09 |
State of the art in CFD technology | Juan Carlos GARCIA SALAS | Main CFD Forum | 39 | November 1, 1999 15:34 |
What kind of Cmmercial CFD code you feel well? | Lans | Main CFD Forum | 13 | October 27, 1998 11:20 |