• No results found

STATIC_INTEGER

In document BulkConfigurator_V11 (Page 61-86)

Appendix A: Tieback Simulation Model Classes (Checkout View)

STATIC_INTEGER

Type: General Purpose Integer Constant Parameters:

Parameter Value Description

VALUE Any positive or negative integer, or zero

Example Use: Local/Remote Interlock Status

Parameterization:

Parameter Value Description

VALUE 1 Always Remote Status

Example Rulebook Entry:

Note: The value of this static integer remains at 1, and the Digital Input remains true.

The user cannot change the value of this point (except by overriding the I/O point in the cross reference table).

CIN

1CST:PB1_LOCAL.FBCIM

PB1_LOC

MOTOR LOCAL/REMOTE STATUS (1=REMOTE)

LATCH

Type: Set/Reset Latching Block (“flip-flop”) Parameters:

Parameter Value Description

SET 0/1 Set latch

RESET 0/1 Reset latch

SET_DOM SET_PRIORITY/

RESET_PRIORITY

Set/Reset Dominance (if both signals are true, which dominates – default = reset dominant)

MA 0/1 Man/Auto

OUT 0/1 Output

OUTR 1/0 Inverse Output

Example Use: Motor Run Start/Stop Command with Feedback Status

Parameterization:

Parameter Value Description

SET Leave blank (connected in cross reference)

RESET Leave blank (connected in cross reference)

Example Rulebook Entry:

Note: The first rule defines the latch block, connects the SET (i.e. Start command) parameter, and feeds back the latch output status OUT to the running status feedback. The second rule connects the stop command to the RESET parameter.

COUT CIN

I/A Field I/A

1MCC:XU6P13ST.COUT XU6P13M 1MCC:XU6P13_M.CIN

MOTOR

AND, OR

Type: Logic Blocks, with four inputs Parameters:

Parameter Value Description

INP[0] 0/1 First input

INP[1] 0/1 Second input

INP[2] 0/1 Third input

INP[3] 0/1 Fourth input

INV_INP[0] 0/1 Invert first input

INV_INP[1] 0/1 Invert second input

INV_INP[2] 0/1 Invert third input

INV_INP[3] 0/1 Invert fourth input

MA 0/1 Man/Auto

OUT 0/1 Output

Example Use: Fan run command with Local Lockout

Parameterization:

Parameter Value Description

INP[0] Leave blank (set in cross reference)

INP[1] Leave blank (set in cross reference)

INP[2] Unused

INP[3] Unused

INV_INP[0] 0 Default

INV_INP[1] 1 Invert local lockout

INV_INP[2] Unused

INV_INP[3] Unused

COUT CIN

I/A Field I/A

1PHFAN:XUPHF.COUT XUPHF 1PHFAN:XUPHF_M.CIN

PENTHOUSE

Example Rulebook Entry:

Note: The AND block feeds back running status if Run Command is true and Local Lockout is not true.

FCTGEN

Type: Function Generator Parameters:

Parameter Value Description

IN Any FP number Input x-coordinate to interpolate TABLE DYNAMIC_DOUBLE[0] Name of table array previously defined

(see DYNAMIC_DOUBLE)

HI_OUT Any FP number High output limit

LO_OUT Any FP number Low output limit

MA 0, 1 Man/Auto

MANSET Any FP number Value of output when in Manual

OUT Any FP number Output value

HI_LIM 0, 1 Flag to indicate high limit reached

LO_LIM 0, 1 Flag to indicate low limit reached

Example Use: Temperature as a function of Pressure

AIN AIN

Field I/A

1HC:PI512.POINT

Hydrocarbon Pressure

Hydrocarbon Temperature PT512

F(x)

1HC:TI512.POINT PRESS_VS_TEMP

TT512

Parameterization:

Parameter Value Description

IN PT512 Pressure variable

TABLE PRESS_VS_TEMP[0] Table array that relates temperature vs.

pressure

HI_OUT (optional, can leave blank)

LO_OUT MA MANSET

OUT Assigned in Cross Reference table

HI_LIM LO_LIM

Note: In this example, the user sets the value of PT512. The corresponding temperature feedback depends on the table look up using this value. See STATIC_DOUBLE to configure table array.

Example Rulebook Entry:

Enter a function generator directly into the Model flowsheet or add it in the DSS GUI.

RLIMIT

Type: Rate Limit Block.

Parameters:

Parameter Value Description

IN Any FP Input value or point to be rate-limited

RTYPE LINEAR,

FIRST_ORDER

Rate limit type: linear or first-order lag RATE Any FP >= 0.0 Ramp rate, in Units/second. If RTYPE =

FIRST_ORDER, then RATE is first-order lag time constant Tau (steady-state reached in approximately 3 * Tau)

K_IN Any FP or point Scalar on input value B_IN Any FP or point Bias on input value HI_OUT Any FP or point High output limit LO_OUT Any FP or point Low output limit MA 0, 1 or integer point Man/Auto status

MANSET Any FP or point Value of output when in Manual

OUT Any FP Output value

HI_LIM 0, 1 Flag to indicate high limit reached

LO_LIM 0, 1 Flag to indicate low limit reached

Example Use #1: Control Valve with open and closed limit switch feedback

Parameterization:

Parameter Value Description

IN Assigned in Cross Reference table

RTYPE LINEAR Linear rate limit

RATE 5 5%/second; full travel in 20 seconds

K_IN Scalar on input value

B_IN Bias on input value

HI_OUT 100 High output limit when output reaches 100%

LO_OUT 0 Low output limit when output reaches 0%

Example #1 Rulebook Entry:

Note: This example illustrates the power of the rulebook and its ability to create a model and connect several I/O points at the same time.

Interpret the first line as follows: for all flow control valves FY*, create a rate limit block and call it FV*.

In the second and third lines, the algorithm searches for the same flow control, but

“overwrite” is set to XRef only, which does not redefine the rate limit block created in the first line, but connects the Low and High Limit outputs of the (already created) rate limit block to the Closed and Open Limit Switch digital inputs, respectively. Ensure loop identifier consistency (224 in this example in the figure above) for all three I/O points.

CIN CIN 1FP:ZSC224.CIN

CLOSED LIMIT SW ITCH

OPEN LIMIT SW ITCH

1FP:ZSO224.CIN

Setting HI_OUT = 100 and LO_OUT = 0 causes the block output flags to trigger when OUT = 100% and 0%, respectively. If the limit switches trigger before the valve shuts tight or wide-open, then set the limit settings inside the range, 2% and 98%, for example.

Example Use #2: Flow/Pressure/Temperature Control Valve with Analog Feedback

Parameterization:

Parameter Value Description

IN Assigned in Cross Reference table

RTYPE FIRST_ORDER_LAG Response with first order lag

RATE 3 3 second time constant (approx 9 seconds to

steady-state)

K_IN Scalar on input value

B_IN Bias on input value

HI_OUT (leave blank – auto scaling will handle – see

Note)

LO_OUT (leave blank – auto scaling will handle –

See Note)

AIN 1FP:FI224.POINT

Flow: 0 to 225 GPM

I/A Field I/A

AOUT 1FP:FY224.OUT

RLIMIT

IN OUT

FV224 Flow

Control Valve, 0-100%

Example #2 Rulebook Entry:

Note: In this example, the “XRef Auto Scale” checkbox is ticked. This selection

automatically scales the feedback to the Analog Input such that 0% input equates to the AIN’s LSCALE parameter, and 100% equates to HSCALE (MIN SCALE and MAX SCALE in the Cross Reference table). This functionality is achieved by automatically creating an equation entry in the table, rather than pasting into the FROM SYMBOL column:

The auto scaling equals:

MIN SCALE + VALUE (0-100%)*(MAX SCALE – MIN SCALE) / 100

The user can make custom equations in the cross reference table, however, only include one entry in the FROM SYMBOL column or the EQUATION column, not both (which causes a run time error message when attempting to load the cross reference table).

Example Use #3: Same as Example #2, except engineer desires to calculate

Engineering Units instead of auto scaling. When the valve reaches 80% open, the rated flow measures 200 GPM

Parameterization:

Parameter Value Description

IN Assigned in Cross Reference table

RTYPE FIRST_ORDER Response with first order lag

RATE 3 3 second time constant (approx 9 seconds to

steady-state)

K_IN 2.5 Scalar on input value

B_IN 0 Bias on input value

HI_OUT 250

LO_OUT 0

The XRef Auto Scale checkbox should not be ticked, and instead the user should specify K_IN and B_IN to give the desired rated flow:

K_IN = 200GPM / 80% (rated flow) B_IN = 0 (no flow for closed valve) Example #3 Rulebook Entry:

It is not strictly necessary to specify HI_OUT and LO_OUT, as signal limiting also occurs in the cross reference table (signal limited to a maximum of 225 GPM).

Example Use #4: Jog Valve

Parameterization:

Parameter Value Description

IN (see Note below) Assigned in Cross Reference table

RTYPE LINEAR Linear rate limit

RATE 5 5%/second; full travel in 20 seconds

K_IN Scalar on input value

B_IN Bias on input value

HI_OUT 100 High output limit when output reaches 100%

LO_OUT 0 Low output limit when output reaches 0%

CIN CIN 1FP:ZSC301.CIN

CLOSED LIMIT SW ITCH

OPEN LIMIT SW ITCH

1FP:ZSO301.CIN

Example #4 Rulebook Entry:

Note: In this two-step model, Open and Close command points are bulk-created and an equation simulates a jog valve in the Rate Limit block. The syntax of the equation follows:

V301.IN = IF(V301R = 1, 100, IF(V301L = 1, 0, V301.OUT)) Translating to:

“If Raise Command is true, then rate limit input is 100%, else if Lower Command is true, then rate limit input is 0%, else input = current position.”

Equation syntax is very powerful and many types of models can be economically-created. See standard DSS documentation for MISCEQTN to find more

information on valid equation syntax.

PID

Type: General Proportional plus Integral plus Derivative Math Block (uses PID control algorithm)

Parameters:

Parameter Value Description

SP Any FP, point Setpoint

PV Any FP, point Process Variable

KP Any FP Proportional Gain

KI Any FP Integral Gain

KD Any FP Derivative Gain

HI_OUT Any FP High output limit

LO_OUT Any FP Low output limit

MA 0, 1 or integer point Man/Auto status

MANSET Any FP or point Value of output when in Manual

OUT Any FP Output value

HI_LIM 0, 1 Flag to indicate high limit reached

LO_LIM 0, 1 Flag to indicate low limit reached

Algorithm:

Error = SP – PV

Proportional = Kp * Error d/dt Integral = Kp * Ki * Error

d/dt Deriv = PV – Deriv / (Period + 1/Kd) Derivative = Kp * Kd *(PV – Deriv) Out = Proportional + Integral + Derivative Example Use #1: Tank with Level Control Valve and Pumps

Parameterization:

Parameter Value Description

SP Connected to Level Control valve output in

Cross Reference table (0 – 100%)

PV 45 * (XU5P57A +

XU5P57B)

Flow out tank = 45% * Pump A and/or B run status (90% maximum)

KP Leave blank for integral-only action

KI 0.01 Adjust to obtain desired fill/drain rate

KD Derivative Gain

HI_OUT 100 High output limit

LO_OUT 0 Low output limit

Example#1 Rulebook Entry

Note: This example is another illustration of models combination, as well as an example of an equation in a parameter field. The first line in the rulebook defines the tieback model for motors (as previously described in the example for

DYNAMIC_INTEGER. The second line defines the tank model. The level

control valve LY5T27 “fills” this tank and the pump motor status XU5P27A and B define the “drain:”

OUT = KI * (SP – PV) or

LEVEL = KI * (LY5T27 – 45*(XU5P27A + XU5P27B))

The equation for PV in the rulebook contains a ‘#’ character; which is necessary to tell the rules processing to paste in substitute strings, rather than a literal paste (i.e. $2 is pasted literally). After processing, here is what the PID model entry looks like in the Model worksheet:

Example Use #2: Same as above, but suppose that the level control valve is in one control compound and the tank level indication is in another:

Level control valve I/O point: 5TH02_MUDWSH:LY5T57.OUT

Tank level indication I/O point: 5T57_MUDWSH:LI5T57.POINT

different compounds, same loop ID

If the rulebook entry in Example #1 above was used as-is, the output from the tank model would not be entered in the cross reference table, since the analog input is in a different compound from the analog output. To remedy this limitation, add another entry:

Note the following:

Rule #2: removed “Control In Tag” (because the tag is in a different compound – the rule would be unsuccessful for tying back the analog input because it wouldn’t be found).

Rule #3: moved the “Control In Tag” here from Rule 2, and “Filter using In Tag” is checked.

Rule #3: Model Name repeated from Rule 2, however “Overwrite” is set to “XRef” in Rule 3. This algorithm means that the model object defined by Rule 2 is not overwritten, but its output is used to tie back to the analog input.

SUM

Type: Sums two signals. Each input signal can be scaled.

Parameters:

Parameter Value Description

IN[0] Any FP, point First input

IN[1] Any FP, point Second input

K_IN[0] Any FP Scalar on first input

K_IN[1] Any FP Scalar on second input

B_IN[0] Any FP Bias on first input

B_IN[1] Any FP Bias on second input

HI_OUT Any FP High output limit

LO_OUT Any FP Low output limit

MA 0, 1 or integer point Man/Auto status

MANSET Any FP or point Value of output when in Manual

OUT Any FP Output value

HI_LIM 0, 1 Flag to indicate high limit reached

LO_LIM 0, 1 Flag to indicate low limit reached

Example: Split Range Control Valves and Flow Feedback

Parameterization:

Parameter Value Description

IN[0] Leave blank – connected in cross reference

table

IN[1] Leave blank – connected in cross reference

table

Note: This model is configured with two rules: the first to define the SUM block and connect the “A” valve, the second to connect the “B” valve. The first rule also connects to the single flow transmitter feedback. In Rule 2 that “Overwrite” is set to “XRef;” this ensures that the model defined in Rule 1 is not overwritten; only the cross reference entries are connected. The “XRef Auto Scale” is selected so that 0 – 100% on the input automatically scales to high and low scale engineering units of the analog input.

TIMER

Type: Time delay on, time delay off, pulse timer

AIN

Parameters:

Parameter Value Description

START 0,1 Start timer

PRESET Any FP Timer setting (seconds)

TYPE PULSE

EXTENDED PULSE ON DELAY

STORED ON DELAY OFF DELAY

Type of timer

MA 0,1 Man/Auto

OUT 0,1 Timer output

ACCUM FP Stored timing value

TIMING 0,1 Timing in progress

The various types of timers are illustrated by the figures below:

Example: Igniter Insert

COUT CIN

I/A Field I/A

5IGN:IGNA1_INS.COUT 5IGN:IGNA1_TRV.COUT

TIMER Insert

Igniter

Igniter Inserting IGNA1

Off-delay

Parameterization:

Parameter Value Description

START Leave blank – connected in cross reference

table

PRESET 10 Igniter takes 10 seconds to insert

TYPE OFF_DELAY Inserting signal stops 10 seconds after Insert signal is false

Example Rulebook Entry

LEADLAG

Type: Process Lead/Lag Parameters:

Parameter Value Description

IN Any FP, point Process input

KLAG Any FP, point Lag time constant

KLEAD Any FP Lead time constant

K_IN Any FP Scalar on input

B_IN Any FP Bias on input

HI_OUT Any FP High output limit

LO_OUT Any FP Low output limit

MA 0, 1 Man/Auto status

MANSET Any FP or point Value of output when in Manual

OUT Any FP Output value

HI_LIM 0, 1 Flag to indicate high limit reached

LO_LIM 0, 1 Flag to indicate low limit reached

Example: Pressure Control Valve

Parameterization:

Parameter Value Description

IN Leave blank, will be connected in cross

reference table

KLAG 10 10 second time constant (reaches steady-state

in approximately 30 seconds)

KLEAD Not used

Example Rulebook Entry

I/A Field I/A

5E01:PY5E01.OUT VESSEL

E01 PRESSURE CONTROL

PTE01

AOUT LEADLAG AIN

5E01:PI5E01.OUT VESSEL E01 PRESSURE

MISCEQTN

Type: General purpose miscellaneous equation block Parameters:

Parameter Value Description

OUT[0] Equation Any valid Dynsim equation

OUT[1]

The MISCEQTN equation syntax is identical to the Microsoft Excel application. The following types of operations are supported:

Operator Description Operator Specified

Operator Description Operator

Operator Description Operator

1These equation types are valid only with the Power Industry Libraries.

The operands of equations and arguments of operators can be constants or valid Dynsim point names. For example, a MAX equation can be of the form MAX(2.,3.) or

MAX(2.,HDR1.P). In this second example HDR1.P might be the pressure of a header object named HDR1.

Some of the operators need some additional discussion is provided below.

EQFF

EQFF is an operator for combining flow coefficients of resistances in series in a flow path. If two resistances, K1 and K2, are in series in a flow path, the equivalent resistance can be calculated from the equation:

2

CINTRP1

CINTRP1 is used for linear interpolation of a monotonic function. The first argument is the independent variable used in the interpolation. The second argument is the zero’th element of an Dynsim vector point to be used for interpolation. The Dynsim point array elements must be in the following format

Element 0 = number of x/y pairs in the table x3 = 300, y3 = 275) that we need to use for linearly interpolating. We will use the vector point ETABLE to hold the table for use with the CINTRP1 operator. The elements of ETABLE would then be:

ETABLE[0] = 3

ETABLE can then be used in a CINTRP1 equation such as CINTRP1(237.,ETABLE[0])

The table provided to CINTRP1 must be monotonic.

H_PTX, R_PH, T_PH, S_PH

These functions are used to get fluid properties at a given thermodynamic condition using the Power Industry Library fluid types. They cannot access the SIM4ME™ Portal

Thermodynamics methods. H_PTX returns the enthalpy at a given pressure, temperature and vapor quality. R_PH returns the density and a given pressure and enthalpy. T_PH returns the temperature at a given pressure and enthalpy. S_PH returns the entropy at a given pressure and enthalpy. In all cases the fluid type must be specified by the integer value for that fluid type. The pressure, temperature, quality and enthalpy arguments can be entered as constants or valid Dynsim point names.

Custom for OTS Engineers Type: User defined

Parameters: None

Purpose: The model classes and input parameters that an OTS engineer typically uses are different than the model classes available in the Bulk Configurator. For this reason the “Custom” model option is provided to allow the OTS engineer to use the rulebook to bulk-generate cross reference table entries to models he or she has already created. Since the OTS engineer has already created the detailed plant models via the DSS user

interface, no models will be bulk-created when the "Custom" rule is applied).

The Model Engine combo box in the rulebook will contain an additional item called

“Any” and will be in italic font. The purpose of this selection is to save the user from having to figure out which model engine and/or flowsheet contains an existing DSS model object instance (e.g. "PUMP: P123" contained in "Dynsim2" model engine located on flowsheet "Water System").When “Any” is selected the Bulk Configurator will automatically fill in the cross reference "To Engine" or "From Engine" fields with the correct model engine for the referenced Dynsim model name and parameter name.

Because the Custom Rulebook entry does not create new models, an error will occur if there is no model object instance to match the supplied regular expression. When this occurs, the offending rows will be highlighted red in the cross reference table, and will not be processed upon "Send to DSS." A message detailing the row and model name will be output to the status window for each row the error occurred on, and the message box will display a warning to alert the user.

The user can input Model In Param and Model Out Param fields of his choice and may even choose to leave them blank.

Example Rulebook Entry

Appendix B: Using Regular Expressions with the

In document BulkConfigurator_V11 (Page 61-86)

Related documents