For some components it is possible to specify an EbsScript function instead of one or more default values, in which the corresponding value is calculated.
This function must have the name "evalexpr" and assign the desired value to a real variable "evalexpr". The names of these default values usually begin with an "E" (examples: EMATT, EALPH12, EFCWIND).
Before this possibility existed, only one default value of a component could be replaced by a function or formula with the help of ADAPT / EADAPT.
For some KernelExpressions, some additional internal values from the current calculation step are available. They can be accessed with functions from this unit. For example, they can be listed with the function ksGetInternals.
function evalexpr:REAL;
begin
evalexpr:=0.01;
end;
For the “Kernel expressions“, there are some special data types and functions that can be found in the EbsScript interface unit @KernelExpression:
Name |
Purpose |
Arguments |
Return value |
Example |
keGetComp |
returns the component just calculated (as “ebscomp”) |
- |
ebsComp: |
function evalexpr: REAL; var eComp:ebscomp; begin eComp:=keGetComp; for i:=0 to (n-1) do begin if (keGetInternalVar("PHIINC", r)) then begin r:=keGetInternal("TAVER"); end; |
keGetInternals |
yields a field with additional internal quantities available for calculating the specification value (component-specific) |
- |
array of InternalValue |
|
keGetInternal | returns the value of one of these additional variables as a function value, in the event of an error, the value specified under on_error_return. |
1: STRING: 2: REAL |
REAL: Value of the internal variable | |
keGetInternalVar |
allows the query of a value of one of these additional quantities and yields back the status of this query |
1: STRING: 2: REAL |
BOOLEAN: |
|
keGetItNo |
yields the number of the actual iteration step | - | INTEGER: | |
keGetKernelExpression |
returns a reference to the currently calculated ebs value (updates will not take effect until the next simulation) |
- |
ebsVar |
|
keGetIndicatedValue |
Returns the specified values of components 45 without returning from the calculation status (for use in expressions)
|
1.INTEGER: |
REAL: Value of component 45 |
|
keGetIndicatedValueByObject |
returns the value of the components 45 for the given reference (EBSCOMP45) without returning from the calculation status (for use in expressions) |
1: EBSCOMP45 the reference to Comp. 45 2: REAL: on_error_return (optional ) |
REAL: Value of component 45 |
|
keGetIndicatedValueByObjectVar |
returns the value of the components 45 for the given reference (EBSCOMP45) and the calculation status |
1: EBSCOMP45 the reference to Comp. 45 2: REAL: Value of component 45 |
BOOLEAN: Status of execution true, if successful, otherwise false |
|
keGetIndicatedValueVar |
returns the specified values of components 45 and returns the calculation status |
1.INTEGER: 2: REAL: |
BOOLEAN: Status of execution true, if successful, otherwise false |
|
Procedures: |
|
|
|
|
keSetComment |
Output of comments, that are displayed in the error list |
1.STRING: |
- |
|
keSetError |
Output of errors, that are displayed in the error list.
|
1.STRING: 2.BOOLEAN: |
- |
|
keSetWarning |
Calling keSetError with abortCalculation = true will abort the running simulation |
1: STRING: |
- |
Component number, followed by the available internal variables
7: T_WALL VF
9: T_WALL
10: T_WALL VF
11: COSPHI H2P GENF
12: TARGET ACTUAL CORRECTION ERRORLEVEL
39: TARGET ACTUAL CORRECTION ERRORLEVEL
69: TARGET ACTUAL CORRECTION ERRORLEVEL
20: T_WALL
21: RATCOS TBED
83: ROTSPEED
89: PH2O_FLUEGAS XASH_FLUEGAS T_FLUEGAS P_FLUEGAS M_FLUEGAS
T_WALL THLAY CSASH DIAASH
DISTASH FUELTYPE M_FUEL_WAF PERCCOKE CSCOAL
DIACOAL DISTCOKE SOOTCONT ETA_FLUEGAS
CP_FLUEGAS LAMBDA_FLUEGAS LAMBDA_FIN WIDTH_FGDUCT DEPTH_FGDU
CT RHO_FLUEGAS RHOIN_FLUEGAS RHOOUT_FLUEGAS
90: RCATOS TBED TAD_FLUEGAS_KELVIN TOUT_FLUEGAS_KELVIN
113: PHIINC PHITRAN TAVER TAMB DNI VWIND AWIND
116: PHIINC PHITRAN TAVER TAMB DNI VWIND AWIND
119: T_WALL T_FLUID
120: TAVER TAMB VWIND AWIND
121: RSHEIGHT RSAZIM RDNI VWIND AWIND
126: T_BWALL T_OWALL
160: T_WALL
function evalexpr:REAL;
// result must be in m³/m³ if FCON=1, in mg/Nm³ if FCON=2
var myComp:ebsComp21;
begin
myComp:=ebscomp21(keGetComp());
if (myComp.ALAM < 1.1 and Fluegas.T > 1000 ) then begin
evalexpr:=Fluegas.T-1000;
end else begin
evalexpr:=0.0;
end;
end;
function evalexpr:REAL;
var
eVar:ebsvar; eComp:ebscomp;
eComp83:ebscomp83;
str, strName:string;
ar:array of InternalValue;
i,n:integer;
r,g,x:real;
begin
eComp := keGetComp;
eComp83 := ebscomp83(ecomp);
eVar := keGetKernelExpression;
getName (eVar, strName);
ar := keGetInternals;
n := Length(ar);
str := printToString (strName," (",n);
keGetInternalVar ("ROTSPEED", r);
g := r / ecomp83.REVN;
if keGetItNo() = 6 then begin
str := printToString (str,") ROTSPEED is ",r, " ", g," ", log(g),"\n");
print (str);
end;
if (g > 1.0) then begin
x := 0.99;
println ("x1:", x);
evalexpr := x;
end else begin
x := ((0.0367 * log(g)) + 0.9898);
println ("x2:", x);
evalexpr := x;
end;
end;