The EbsScript standard unit @KernelInterface pools functions from the standard units @KernelScripting and @KernelExpression that are available independent of the current calculation domain (e.g. KernelScript or KernelExpression). These functions can be called by any EbsScripts during a simulation or validation.
By means of the function “kiGetMode“, you can determine in which iteration mode the application currently is and if at all.
Name |
Purpose |
Arguments |
Return value |
Example |
kiGetMode |
global status of current calculation |
- |
Mode |
println (enumtostring (kigetmode ())); |
kiGetFinishingReason |
enables an analysis of why the calculation is terminated in the last iteration step |
- |
FinishingReasonEnum |
if (kiGetFinishingReason() = FinishingReasonConvergency) then begin |
kiGetItNo |
number of actual iteration step |
- |
integer | istep := kiGetItNo(); |
kiSignalNotConverged | prevent simulation from stopping upon convergence in this iteration step | - | - | kiSignalNotConverged(); |
kiSetError |
setting errors to appear in the error-bar calling kiSetError with 3. parameter = true results in an abort of the running simulation |
1: ebsData: line or component |
- | kiSetError (Kernel_Scripting, "hallo", false); |
kiSetWarning | setting warnings to appear in the error-bar |
1: ebsData: line or component |
- | kiSetWarning (Kernel_Scripting, "hallo"); |
kiSetComment | setting comments to appear in the error-bar |
1: ebsData: line or component |
- | kiSetComment (Kernel_Scripting, "hallo"); |
kiGetIndicatedValueVar | accessing value of value-indicators (component 45) with status returned | 1: FIND: Integer 2: value: Real |
Boolean | brc1 := kiGetIndicatedValueVar ( 22, val1); |
kiGetIndicatedValue | accessing value of value-indicators (component 45) without status returned (for use in expressions) | 1: FIND: Integer 2: on_error_return: Real = 0.0 |
Real | val1 := kiGetIndicatedValue ( 22, -1.0); |
kiGetIndicatedValueByObjectVar | accessing value of value-indicators (component 45) with status returned | 1: object: ebscomp45 2: value:Real |
Boolean | brc2 := kiGetIndicatedValueByObjectVar( Value_indicator, val2); |
kiGetIndicatedValueByObject | accessing value of value-indicators (component 45) without status returned (for use in expressions) | 1: object: ebscomp45 2: on_error_return: Real = 0.0 |
Real | val2 := kiGetIndicatedValueByObject( Value_indicator, -1.0); |
Three functions for getting current accuracy of simulation (global max. relative deviation of pressure/enthalpy/mass flow wrt. previous iteration step; result -1 indicates no value present yet) | ||||
kiGetCurrentAccuracy | get just current convergency for a single physical quantity | physValue: PhysValue | Real | var physValue: PhysValue; isat: IterationStepAccuracyType; a_isat: array of IterationStepAccuracyType; physValue := PhysValueH; val1 := kiGetCurrentAccuracy ( physValue ); isat := kiGetAccuracyCurrentStep (); a_isat := kiGetAccuracyTrend (); println (val1, " ", isat.enthalpy , " ", isat.iteration_step, " ", High (a_isat)); |
kiGetAccuracyCurrentStep | get current convergency | - | IterationStepAccuracyType | |
kiGetAccuracyTrend | get convergency trend (current convergence at end of array) | - | array of IterationStepAccuracyType | |
kiGetGlobalMaxTimeInterval | get maximal global (model) operation-time in seconds - tThis function is only useful for calls from the time series (or manually adjusted) | - | Real | val2 := kiGetGlobalMaxTimeInterval(); |
kiGetSunData | returns the sun values currently used in the calculation | isun: integer | SunDataType, defined in Unit KernelInterface | sdt := kiGetSunData (1): |
kiGetWindData | returns the wind values currently used in the calculation | iwdata: integer | WindDataType, defined in Unit KernelInterface | wdt := kiGetWindData (1): |