Professional Documents
Culture Documents
Version 3.2
March 2019
© 2019 AVEVA Group plc and its subsidiaries. All rights reserved.
No part of this documentation shall be reproduced, stored in a ret rieval system, or transmitted by any
means, electronic, mechanical, photocopying, rec ording, or otherwise, without the prior written
permission of AVEVA. No liability is assumed with respect to the use of the information contained herein.
Although precaution has been taken in the preparation o f this documentation, AVEVA assumes no
responsibility for errors or omissions. The information in this documentation is subject to change without
notice and does not represent a commitment on the part of AVEVA. The soft ware described in this
documentation is furnished under a license agreement. This soft ware may be used or copied only in
accordance with the terms of such license agreement.
ArchestrA, Aquis, Avantis, Citect, DYNSIM, eDNA, EYESIM, InBatch, InduSoft, InStep, Int elaTrac,
InTouch, OASyS, PIPEPHASE, PRiSM, PRO/II, PROV ISION, ROMeo, SIM4ME, SimCentral, SimSci,
Skelta, SmartGlance, Spiral Software, Termis, WindowMaker, WindowViewer, and Wonderware are
trademarks of AVEVA and/or its subsidiaries. An extensive listing of AVEVA trademarks can be found at:
https://sw.aveva.com/legal. All other brands may be trademarks of their respective owners.
Publication date: Monday, March 18, 2019
Contact Information
AVEVA Group plc
High Cross
Madingley Road
Cambridge
CB3 0HB. UK
https://sw.aveva.com/
For information on how to cont act sales, customer training, and technical support, see
https://sw.aveva.com/contact.
Acknowledgements
CSPARSE
To analyze and report proper variable specification, SimCent ral Simulation Platform makes use of
CSPARSE, a library of direct methods for sparse linear systems by Timothy Davis. CSPARSE is free
software and is distribut ed under the GNU Lesser General Public License
(http://www.gnu.org/licenses/lgpl.html) as published by the Free Software Foundation.
The source code for CSPARSE is available at
http://people.sc.fsu.edu/~jburkardt/c_src/csparse/csparse.html.
KLU
SimCent ral Simulation Platform us es KLU as its linear equation solver. KLU is an open-source solver
package with a focus on solving sparse linear systems of equations. Timothy A. Davis distributes K LU as
part of the SuiteSparse software (http://www.suitesparse.com) under the GNU Lesser General Public
License and a University of Florida copyright.
SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Contents
Acknowledgements .................................................................................................................. 3
Chapter 1 Introduction to Model Writing............................................................................. 7
Chapter 2 Getting Started..................................................................................................... 9
Chapter 3 Roles ................................................................................................................... 11
Filtering Capabilities by Role.................................................................................................... 11
Opening the Roles Manager .............................................................................................. 11
Creating or Modifying a Role .............................................................................................. 11
Creating a Quick Filter for a Role ........................................................................................ 12
Viewing a Hidden Model, Submodel or Port .............................................................................. 13
Version 3.2 5
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Contents
6 Version 3.2
SimSci™ SimCentral™ Simulation Platform Model Writing Guide
C HAPTER 1
Introduction to Model Writing
Model Writing Characteristics and Advantages
SimCent ral Simulation Platform offers you the following characteristics and advant ages:
Allows you to modify existing Model Ty pes and create custom Model Types for new processes
Allows you to organize models in Model Libraries so that you can share them with other us ers
Allows you to define variables and equations in models that represent chemical proc ess equipment.
Version 3.2 7
SimSci™ SimCentral™ Simulation Platform Model Writing Guide
C HAPTER 2
Getting Started
This section provides a high-level overview on using SimCentral Simulation Plat form to write custom
models. It refers to the various concepts and topics in this document.
For information on building simulations, refer to the SimCent ral Simulation Platform Simulation Building
Guide.
Defining Your Role
Based on your Filtering Capabilities by Role on page 11, you can begin writing Models or creating
Simulations. When you select a Role, certain elements will be filtered out of the UI. You can creat e a
custom Role or switch Roles using the Role Manager.
Writing Models
You can write custom Models and save them to a Model Library in the Repository.
Understanding the Model Writing Components
The Model Library is where SimCentral Simulation Platform stores Model Types, Fluid Types, Port
Types, and Curve Types. The Model Library is housed within a Repository that is specific to your user
account on your local machine. You can access one or more Model Libraries to build a single simulation.
One of the key benefits of a Model Library is that you can work with other people to create and share
custom, company-specific Model Types that contain propriet ary equations. See Model Library on page
15 for more information.
The Model Editor is where you create and modify Model Types representing process equipment,
controls, and other mathematical relationships. You can create custom, company -specific Model Types
that include proprietary equations and save them to Model Libraries stored in the Repository. The Model
Editor allows you to define variables and equations in Model Types that mathematically represent
chemical process relationships. See Model Editor (on page 21) for more information.
The Port Editor is where you create and edit Port Types, which are used inside Model Types to define
how the model can be connected to other models on the Canvas. If you create new Model Types, you
can use the Port Type included with SimCentral to define input and output ports used for process stream
connections. If no suitable Port Type exists, you can create a new P ort Type. When y ou edit a P ort Type,
you can specify a name, variables and their types, the Canvas connection (line) style to use, and a
description. The variables defined in the Port Type define the specific information that will be transferred
between models when they are connected on the Canvas. See Port Editor on page 51 for more
information.
The Fluid Editor is where you modify Fluid Types representing the fluids used in your simulation. A Fluid
Type describes the thermodynamic behavior assigned to model instances in a simulation. You can copy
existing Fluid Types and edit them to create custom Fluid Types that include the default conditions of the
fluid and the equations of state that represent the fluid properties, and save them to Model Libraries
stored in the Repository or to a Simulation -specific Model Library. See Fluid Editor in the SimSci
SimCent ral Simulation Platform Simulation Building Guide for more information.
The Curve Editor is where you create independent and dependent variables that you can use for a pump
performance curve. A curve is tabular data with interpolations bet ween the points defined. The
independent variable(s) that you define are on the horizontal axis; for example, flow. The dependent
variable(s) that you define are plotted on the chart; for example, head or efficiency. See Curve Editor in
the SimSci SimCentral Simulation Platform Simulation Building Guide for more information.
Version 3.2 9
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Getting Started
10 Version 3.2
SimSci™ SimCentral™ Simulation Platform Model Writing Guide
C HAPTER 3
Roles
This chapter describes how you can select a specific role and filter out content that is not relevant to you.
In This Chapter
Filtering Capabilities by Role ......................................................................................................... 11
Viewing a Hidden Model, Submodel or Port .................................................................................... 13
If you select a task-specific role, the capabilities of SimCentral Simulation Platform outside of the role will
be filtered out.
When you create a role, it is saved in the <drive>:\ProgramData\SimSci\Custom directory, and will be
retained if you uninstall and reinstall SimCentral Simulation Platform.
Version 3.2 11
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Roles
12 Version 3.2
Roles SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Note: If you do not see the options shown above, first select an existing Quick Filter from the
drop-down at the top of the Quick Filter dialog.
2. Select the role for which you want to view a model, submodel or port, and ensure that the
checkbox is checked.
Version 3.2 13
SimSci™ SimCentral™ Simulation Platform Model Writing Guide
C HAPTER 4
Model Library
About the Model Library
The Model Library is where Model Types, Fluid Types, and Port Types are stored. The Model Library is
housed within the Repository on your local machine. You can access one or more Model Libraries to
build a single Simulation. One of the key benefits of a M odel Library is that you can work with other
people to create and share custom, company-specific Model Types that contain proprietary Equations.
The information housed in the Model Library is current and always accessible by you and those working
within the same Repository.
Concepts
Multiple people can contribute to a Model Library
Standard Model Libraries store SimSci-designed Model Types, Fluid Types, and Port Types shipped
with the product, and those that you customize or create from scratch
You can access multiple Model Libraries to build a single Simulation
You can copy a Model Type, Fluid Type, or Port Type from one Model Library to another
Changes you make are aut omatically saved to the Model Library in the Repository, and are
automatically propagated to all Simulations that use them
Actions
Create, delete, rename, copy and paste a Model Type, Port Type or Fluid Type
Import and Export a Model Library
Add a Model, Fluid or Port Type to a Simulation
In This Chapter
Managing Model Libraries ............................................................................................................. 16
Importing and Exporting Model Libraries ........................................................................................ 16
Managing Model, Fluid, and Port Types ......................................................................................... 17
Writing Documentation .................................................................................................................. 19
Showing and Hiding Model Libraries .............................................................................................. 20
Version 3.2 15
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Library
Activity Directions
Renaming a Model Library Right -click a Model Library and select Rename
Library.
Deleting a Model Library Right -click a Model Library and select Delete
Library.
16 Version 3.2
Model Library SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Activity Directions
Exporting a Model Library Right -click a Model Library, and then click Export
Library. Choose a location and filename for the
exported XML file.
2. Define the folder where you want to export the library to, give the Model Library a name, and click
Save.
Activity Directions
Creating Model Types Right -click a blank space in the Model Library
pane, and then click Create New Model.
Creating Port Ty pes Right -click a blank space in the Model Library
pane, and then click Create New Port.
Version 3.2 17
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Library
Activity Directions
Creating Fluid Types Right -click a blank space in the Model Library
pane, and then click Create New Fluid.
Renaming Model, Fluid and Port Types Right -click the Type you wish to rename, and then
click Rename. Enter a new name, and press
Enter.
Deleting Model, Fluid and Port Types Right -click the Type you wish to delet e, and then
click Delete.
Reordering Model, Fluid and Port Types Click and drag a Model Type, Fluid Type or Port
Type to a new location in the Model Library
Adding Model Ty pes to a simulation Click and drag the Type ont o the simulation
Canvas.
Changing the order of the Model, Fluid and Port Click and drag the Type to the desired position.
Types
Copying Model, Fluid and Port Types to Another Click and drag the Type in the source Model
Model Library Library and drag it to the destination Model Library
Copying Model, Fluid and Port Types to the Same Click a Model Type, Fluid Type or Port Type,
Model Library press the CTRL key and drag the Model
Replacing a Model on the simulation Canvas with From the Model Library, click and drag the Model
another Model Type Type on top of the model on the Canvas. Click
Ye s when prompted.
Note s: When you make a change to a Model Type, Fluid Type or Port Type, it is automatically saved to
the Model Library and, subsequently, the Repository. Since the Model Library you are working in may be
accessible by a number of users, it is important to ensure that you do not delete a Model Type, Fluid Type
or Port Type that may be referenced in ot her simulations.
Model, Port and Fluid Types that have a bad status will have a red exclamation (!) badge overlaid on
them in the Model Library. You can still drag and drop the type onto the canvas and work with a model as
you normally would. If you correct the error(s) associated with the type, the badge will disappear.
18 Version 3.2
Model Library SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Writing Documentation
If you are running SimCentral Simulation Plat form with the Model Writing role, you can write Model
Library and model-specific documentation, and save what you write with your Model Libraries and
models. If you are running SimCent ral Simulation Platform with the Simulation Building role, you will be
able to view the documentation, but not edit it.
It is important to note that any documentation you write in the documentation editor will not be mirrored in
the online help shipped with SimCentral Simulation Plat form; documentation you write is direct ly saved
with the Model Library or model you choose to edit.
To view or modify Model Library or model-specific help:
1. Right -click on one of the Model Libraries or models shipped with SimCent ral Simulation Platform and
select Help.
The Help dialog displays:
1. To edit the help, ensure that you the Model Writing mode is enabled, and click the Pencil icon.
Version 3.2 19
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Library
2. Make your changes in the Help Editor. You can change the font, style and layout of the
documentation you write in addition to adding links and images.
3. Click the Save icon.
4. Close the editor.
The next time you load the Model Library or model, the help you wrote will display.
20 Version 3.2
SimSci™ SimCentral™ Simulation Platform Model Writing Guide
C HAPTER 5
Model Editor
About the Model Editor
The Model Editor is where you create and modify Model Types representing process equipment,
controls, and other mathematical relationships. You can create custom, company -specific Model Types
that include proprietary Equations and save them to Model Libraries stored in the Repository. The Model
Editor allows you to define variables and Equations in Model Types that represent chemical process
models.
Concepts
You can define new Model Types using the Model Editor if no suitable model exists
You can modify an existing SimSci Model Type to make slight changes to fit your specific
requirements
Model Types are stored in Model Libraries
You can build complex Model Types out of smaller Model Types by adding them as submodels
Changes you make to a Model Type are automatically propagated to all simulations in which the
Model Type is used
Changes you make to a Model Type are automatically saved
Actions
Import an icon and associate it with a Model Type
Add variables based on Variable Types which define their units of measure
Define how variables are automatically specified for Proc ess, Fluid Flow and Dynamics simulation
Modes
Add equations that define mathematical relationships
Add a Model Type as a submodel to make more complex Model Types
Add a Port to a Model Type to define how the Model Type connects to other Model Types
Add time derivative equations so that you can model dynamic behavior
Add enumerated parameters and conditions to create optional or configurable Model Type behavior
Version 3.2 21
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
In This Chapter
Opening the Model Editor .............................................................................................................. 22
Adding a Variable to a Model Type or Port Type ............................................................................. 22
Adding an Equation to a Model Type .............................................................................................. 23
Adding a Real Parameter to a Model Type ..................................................................................... 24
Managing Enumerat ed Paramet ers ................................................................................................ 24
Tearing Variables in an Equation ................................................................................................... 25
Changing Variable Properties Using Conditions .............................................................................. 25
Connecting P arameters (Configuring a Fluid State Submodel) ......................................................... 27
Connecting V ariables .................................................................................................................... 28
Connecting P orts .......................................................................................................................... 29
Defining Favorite Variables and Parameters ................................................................................... 30
Defining Invariant Parameters and Variables .................................................................................. 30
Defining Global Parameters and Variables ..................................................................................... 31
Returning to Previously Specified Invariant Values .......................................................................... 31
Adding a Model Type as a Submodel ............................................................................................. 32
Assigning a Default Fluid Ty pe to a Model ...................................................................................... 32
Using Fluid Type Parameters as Default Values ............................................................................. 33
Clearing a Default Enumerated or Fluid Type Parameter ................................................................. 33
Adding a Port to a Model Type....................................................................................................... 33
Adding a Multi-Port ....................................................................................................................... 34
Connecting to a Model with Multiple Ports ...................................................................................... 34
Adding a Condition to a Model Type............................................................................................... 38
Adding Multiple Thermodynamics Components to a Model .............................................................. 39
Creating Custom Messages .......................................................................................................... 40
Operators for Custom Messages ................................................................................................... 41
Examples and Limitations of Logical Statements for Custom Messages ........................................... 42
Associating an Icon with a Model Type........................................................................................... 43
Defining a Conditional Icon ............................................................................................................ 44
Hiding a Model or Port .................................................................................................................. 45
22 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
12. Check the (Process Mode), (Fluid Flow Mode) or (Dynamics Mode) check boxes if
you want to specify the variable for a Simulation Mode. Unchecked boxes are calculated.
13. Define if any of the simulation mode specifications should be locked. When locked, the specification
cannot be changed the simulation is built. You can lock any of the specification settings by clicking
the arrow next to the check box and selecting Lock Specification.
If the variable is an array you can select Lock Specification or Lock at least one Specification.
14. Enter a De scription of the variable to help ot hers understand what the variable is.
Note: You cannot change the Variable Units. Variable Units are defined by the Variable Ty pe and, to
ensure consistency of all equations that use them, cannot be changed. The units are listed to document
the internal UOM that is used by the equations. The units are displayed as a matter of convenienc e so
you know what they are when you write an equation.
When the Variable Type is valid, the variable Status will change from red to green.
Version 3.2 23
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
7. Define the equation Formula, using variables and real parameters. Equations must be written to use
the internal units of the Variable Ty pe that is listed in the Units column in the Variables section.
8. Enter a Description of the equation that can help you diagnose the problem if the equation does not
solve.
When the expression syntax is valid, the equation Status will change from red to green. See Operators
and Functions on page 55 for more information.
Example: Adding a Time Derivative Equation
You can use the function der() to write differential equations. The example demonstrat es how to add a
time derivative equation to a Model Type.
1. Expand the Variables section, and add a variable; for example, X.
2. Expand the Equations section and enter the Formula der(X) = 1-X. After the equation is created,
SimCent ral Simulation Platform automatically creates a dXdt variable in the Variables section.
3. Drag the Model Type onto the Canvas, expand the Simulation Manager view, and verify that the
model is solved. X should equal 1 and dXdt should equal 0.
24 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Version 3.2 25
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
16. In the Property Inspector, Keyword View or Simulation Manager, change the Variable Type and note
that the PV value's UOM will change dy namically.
26 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
In this example, the Model Type represents a process equipment, like a valve, containing an input
port, an output port, and a "fluid state" submodel so that it links to thermodynamic calculations.
2. Expand the Models section.
3. Drag and drop the FluidState Model onto the Models section to make it a submodel.
4. Expand the Ports section.
8. Add a new connection (the Type will automatically be set to Parameter) with the following From and
To connections:
From: Port1.FluidType
To: Port2.Fluid Type
This connection propagates the value of the FluidTy pe parameter from the input port to the output
port.
Version 3.2 27
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
9. Add another connection (the Ty pe will automatically set to Parameter) with the following From and
To parameters:
From: Port1.FluidType
To: <Submodel_name>.FluidType
This connection propagates the value of the FluidTy pe parameter from the input port to the
FluidState submodel where it defines what thermodynamic calculations will be used.
You can now add the model to a simulation and the Fluid State submodel will use the Fluid Type of the
upstream model.
Connecting Variables
You can connect two variables so that they behave as a single variable called a Variable Connection.
The specification status and badges of the connected variables will always be the same, making it easier
to specify your simulation and to find specification changes. The solver will treat the connected variables
as one variable, reducing the number of equations to solve to make the simulation run faster.
If two variable connections share a common variable, then all three variables act as one connected
variable. Many variable connections may be made to connect any number of variables in a model and its
ports and submodels.
Variable Connection Model Input Checks
When you add a variable connection in the Model Editor, the connection you create must satisfy the
following requirements or a red bad status indicator will appear next to the connection:
Both variables must be of the same Variable Type
Both variables be scalar or bot h must be array with the same dimension.
If you connect variables that are dimensioned over a Fluid Type component list, the Fluid Types can
be different, but the component names in each Fluid Type must match. The components in the Fluid
Types can be in different orders.
Variable Connection Attribute Rules
The variables that you connect will have different attributes in the variables section of the Model Editor.
The following rules are used to select a common set of attributes for the connected variable:
If any of the variables are specified, then all of the connected variables will be specified.
If any of the variables are required, then all of the connected variables will be required.
If any of the variables are specified, then that variable's default value will be used.
If no variable is specified, then the largest of the default values will be us ed.
The smallest of the maximum values will be used.
The largest of the minimum values will be used.
If the smallest of the maximum values is less than the largest of the minimum values, the largest of
the maximum values will be used and the smallest of the minimum values will be used.
The following display attributes remain unique:
Each connected variable will follow its individual Favorites attribute
Each connected variable will dis play its individual Description
The From and To order of variable connections does not matter.
28 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Connecting Ports
You can connect two ports within a Model Type by using a Port Connection. When you connect two
ports, all the variables and parameters in one port are connected to the corresponding variables and
parameters in the other port as a set of variable and parameter connections.
When you add a port connection in the Model Editor, both ports must be of the same Port Type or a red
bad status indicator will appear next to the connection.
You can iterate over port connections in a Model Type that contains a series of submodels of the same
type. For example, the following Pipe (from the Pipe in the optional Transient Flow library) contains an N
number of Wall and Flow submodels with ports that connect by using the following iterative port
connections.
Normally, the Model Editor does not allow you to create two port connections with the same definition
(that is, the same From and To ports). However, the Model Editor allows you to do this if you specify a
Condition for the identical port connections.
To connect two ports:
1. Edit or create a new Model Type.
2. Expand the Connections section.
3. Add a new connection and select Port as the Type.
4. Select the Condition, if applicable. See Adding a Condition to a Model Type on page 38 for more
information.
5. In the From and To column, enter the names of the ports.
6. If the port connection uses an iterator, ent er the Start and End values.
Version 3.2 29
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
4. Click the Favorite icon to flag the variable for Simulation Builders.
30 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
On the Mini Inspector and the Properties Inspector, the Global badge appears next to global
parameters and variables. The color of this badge indicates the tracking status of t he global parameter or
variable for the associated model instance. If the badge is colored, the model instance tracks and uses
the global value. If the badge is blank, the model instance maintains its own value separate from the
global value.
You can turn on or turn off the tracking for a global parameter or variable by using the P roperties
Inspector for a model instance. Pleas e see Changing the Tracking for Global Parameters and Variables
in the SimSci SimCentral Simulation Platform Simulation Building Guide for more information.
If you have more than one Model Type that contains a parameter or variable that you want to define as a
global parameter or variable, you should define that parameter or variable as a global parameter or
variable in all the Model Types. Otherwise, the global parameter or variable won't track across to the
model instances that are based on a Model Type that does not include the global definition for that
parameter or variable.
Currently, you can define only Real and Enum erat ed parameters as global parameters.
To define a parameter as an Global parameter:
1. Ensure that the Model Writing role is selected. See SimCentral Roles.
2. Open the Model Editor for the desired Model Type.
3. Expand the Parameters section.
Version 3.2 31
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
32 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
When you add the model to the Canvas, SimCentral Simulation Platform sets the value of the model
variable to the value that you specify in the Fluid Editor for the Fluid Type parameter. It uses the values
from the Fluid Type that you specify as the default Fluid Type for the Model Type.
Note that different Fluid Types have different parameters. All Fluid Types have the
FluidType.Temperature and FluidType.Pressure parameters, which are the starting values of the Fluid
Type.
To use a Fluid Type parameter as a default value:
1. Open the Model Editor for the Model Type.
2. Expand the Variables section.
3. In the Default column for the desired variable, type the system name of the Fluid Type parameter
and then press Enter.
Or
Version 3.2 33
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
Adding a Multi-Port
You can define a port as a multi-port, and connect multiple streams to the same input or output port; for
example, when working with a mixer or drum model.
To define a port as a multi-port:
1. Create a model or edit an existing one.
2. Expand the Ports section.
1. Edit an existing port, or add a new one.
2. Click the Connections drop-down, and select Multiple.
3. Give the port a De scription.
When you connect a model to the port, the port will contain the variables from the connected model.
34 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
2. Drag a Mixer onto the Canvas that is configured with an "in" multi-port. For information on
multi-ports, refer to to Adding a Multi-P ort on page 34.
3. Connect the first and second Source mod els to the Mixer.
Version 3.2 35
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
4. Drag a Sink model onto the canvas, and connect it to the Mixer.
36 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Version 3.2 37
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
SimCent ral Simulation Platform evaluates conditions when you first place a Model Type on a Flowsheet,
when you change a parameter value, and when you modify a Model Type in the Model Editor.
Some Model Types may have a complex system of conditions to accou nt for the various configurations of
variables, equations, submodels, ports, and connections that the Model Type must support. For these
Model Types, you can simplify the system of conditions by using nested conditions. A condition is nested
when you use it as part of the expression of another condition. You can use the same conditional
operators that you use for compound conditional expressions, such as AND, OR, and NOT.
For example, you can write a conditional expression as FlowType== Compressible AND Isentropic,
where Isentropic is a nested condition. For this condition to be true, the FlowType parameter must be set
to Compre ssible and the Isentropic condition must also be true.
38 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
7. To set the default enumeration value, select a value from the Default drop-down list. The list is
populated from the values you entered in step 5.
8. Enter a De scription of the parameter.
9. Expand the Conditions section.
Version 3.2 39
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
10. Beside each parameter, click the Value drop-down menu, expand Fluids and select a fluid.
11. In the Model Edit or, expand the Variables section.
40 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
The custom messages use logical statements to determine when they appear on the Canvas. These
logical statements require a strict syntax and support a limited number of operat ors. See Operators for
Custom Messages on page 41 and Examples and Limitations of Logical Statements for Custom
Messages on page 42 for more information.
To create a custom message:
1. Open the Model Editor.
2. Expand the Me ssage s area.
3. Click Add Custom message . A new custom error message appears in the list.
4. If y ou want the message to be a warning instead of an error, in the Severity column, select Warning.
5. Optionally, in the Condition column, select the predefined condition under which the message
should appear. See Adding a Condition to a Model T ype on page 38 for more information.
6. Optionally, in the Name column, change the name of the custom message. Note that this appears in
the tooltip for the error or warning badge.
7. In the Te st column, type the logical statement that defines when the custom message appears on
the Canvas.
8. In the Me ssage column, type the message text that will appear in the tooltip for the error or warning
badge.
9. In the De scription column, type text that describes the custom message. You may want to include
information on the situations in which you ex pect the message to appear and why you need the error
or warning.
Operator Description
<> The values on either side of the operator must not be equal.
< The first value must be less than the second value.
> The first value must be greater than the second value.
<= The first value must be less than or equal to the second value.
>= The first value must be greater than or equal to the second value.
The following table lists the logical operators that you can use in the logical statements. They must
appear between two independent relational statements. Note that these operators are not case
sensitive.
Version 3.2 41
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
Operator Description
AND Both the first relational statement and the second relational statement must be
true
&&
OR Either the first relational statement or the second relational statement must be true
||
You can enclose relational statements in parentheses for readability. You cannot use braces or
brackets in place of parentheses.
You cannot enclose logical operators in parentheses.
You must separate logic al operators from relational statements by using either blank spaces or
parentheses.
Variables names and logical operators are not case sensitive.
Note that a green badge appears in the Status column when the syntax for your logical statement is
correct.
42 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
The following example directly sets the Test value to true for a defined condition so that the model gives
a warning when it is in the specified condition:
The following example appends a variable name with the .specified suffix to give a warning when the
variable is specified.
The following examples are simple error and warning messages that uses only relational operators.
The following examples use both relational operators and logical operat ors.
Version 3.2 43
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Editor
To associate an icon:
1. From the editor you are in, expand the Icon section.
44 Version 3.2
Model Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
7. Repeat steps 4-6 for any other conditions which have unique icons.
When the condition occurs, the icon will change on the Canvas.
Version 3.2 45
SimSci™ SimCentral™ Simulation Platform Model Writing Guide
C HAPTER 6
Groups
About Groups
A Group is a collection of related variables and parameters. Groups appear on the Mini Inspector and
provide a way for you to organize the variables and parameters within the Mini Inspector so that you can
quickly locate the variables and parameters that you are most interested in.
Concepts
The order in which the Groups appear on the Mini Ins pector is the same as the order in which the
Groups appear on the Model Editor
Only Model Writers can create and configure Groups
Model Writers can add both variables and parameters to a Group
If a model does not contain Groups, you will see a flat list of the favorite variables and parameters on
the Mini Inspector
If a model contains Groups, on the Mini Inspector, you will see a collapsible and expandable section
for each Group and the variables and parameters appear under their associated Groups
Many models in the standard Model Libraries include a default set of Groups
The Property Inspector sorts variables and parameters by Groups only if you sort the view based on
the Group value
Actions
Create a Group
Rename a Group
Reorder the Groups
Add a variable to a Group
Add a parameter to a Group
Delet e a Group
Sort the Property Inspector by Groups
In This Chapter
Creating and Configuring a Group.................................................................................................. 47
Adding Variables and Parameters to a Group ................................................................................. 48
Adding Submodel Variables and Parameters to a Group ................................................................. 48
Version 3.2 47
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Groups
6. If there is more than one Group in the Groups area, select your new Group and then use the
following buttons to move your Group in the list:
o Move First
o Move Up
o Move Down
o Move Last
48 Version 3.2
Groups SimSci™ SimCentral™ Simulation Platform Model Writing Guide
If you configure a submodel as an array of submodels in its parent model and you add scalar variables
and parameters from that submodel to a Group, the scalar variables and parameters from eac h
submodel array element appear in the Group under an expandable and collapsible node that has the
name of the scalar variable or parameter.
If you want the parameters and variables from the submodels to appear in the same Group as your
parameters and variables from the parent model, you must create that same Group in the submodels.
To add submodel parameters and variables to a Group in the parent model:
1. Open the Model Editor for the submodel.
2. Expand the Groups area.
Tip: Groups that exist only in the submodels always appear at the bottom of the list of Groups in the
Mini Inspector. If you want to move a Group from a submodel up or down in the list, you can can
create an empty Group of the same name in the parent model and move that Group up or down in
the list of Groups.
5. Expand the Parameters area and locat e the parameters that you want to add to the Group.
6. In the Group list for those parameters, select the Group.
The submodel parameters now appear in the Mini Inspector for the parent model, under the specified
Group.
7. Expand the Variables area and locate the variables that you want to add to the Group.
8. In the Group list for those variables, select the Group.
The submodel variables now appear in the Mini Inspector for the parent model, under the specified
Group.
Version 3.2 49
SimSci™ SimCentral™ Simulation Platform Model Writing Guide
C HAPTER 7
Port Editor
About the Port Editor
The Port Editor is used to create and edit Port Types, which are used inside Model Types to define how
the model can be c onnected to other models in a simulation. If you create new Model Types, you can use
the Port Type included with SimCentral Simulation Platform to define input and output ports used for
process stream connections. If no suitable Port Type exists, you can create a new Port Type. When you
edit a Port Type, you can specify a name, variables and their types, the Canvas connection (line) style to
use, and a description. Once a Port Type is defined you can then add ports to Model Ty pes using the
Model Editor. Ports are saved in Model Libraries whic h are stored in the Repository.
Concepts
Port Types define the variables that will be transferred between models when a connection is made
on the Canvas
The Port Editor allows you to define process stream connections between models
You can add Port Ty pes to Model Types (using the Model Editor) to define the connections that can
be made to a model
You can create a new Port Type or modify an existing standard Port Type to make slight changes so
it fits your specific requirements
Connections between models on the Canvas can only be made bet ween ports of the same type
Port Types are stored in Model Libraries
Changes you make to a Port Type are automatically saved
Actions
Create a new Port Type
Add and specify Variable Ty pes used by the port
Define characteristics specific to Port Types (name, line style, etc.)
Import an icon file and associate it with a Port Type
Version 3.2 51
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Port Editor
In This Chapter
Opening the Port Editor ................................................................................................................. 52
Adding a Variable to a Model Type or Port Type ............................................................................. 52
Associating a New Icon with a Model Type, Fluid Type, or Port Type ............................................... 53
Defining Connector Prefix Naming and Numbering ......................................................................... 54
12. Check the (Process Mode), (Fluid Flow Mode) or (Dynamics Mode) check boxes if
you want to specify the variable for a Simulation Mode. Unchecked boxes are calculated.
13. Define if any of the simulation mode specifications should be locked. When locked, the specification
cannot be changed the simulation is built. You can lock any of the specification settings by clicking
the arrow next to the check box and selecting Lock Specification.
52 Version 3.2
Port Editor SimSci™ SimCentral™ Simulation Platform Model Writing Guide
If the variable is an array you can select Lock Specification or Lock at least one Specification.
14. Enter a De scription of the variable to help ot hers understand what the variable is.
Note: You cannot change the Variable Units. Variable Units are defined by the Variable Ty pe and, to
ensure consistency of all equations that use them, cannot be changed. The units are listed to document
the internal UOM that is used by the equations. The units are displayed as a matter of convenienc e so
you know what they are when you write an equation.
When the Variable Type is valid, the variable Status will change from red to green.
Version 3.2 53
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Port Editor
54 Version 3.2
SimSci™ SimCentral™ Simulation Platform Model Writing Guide
C HAPTER 8
Operators and Functions
This chapter includes information on condition operators, mathematical equation operators and
mathematical functions.
In This Chapter
Condition Operators ...................................................................................................................... 55
Equation Operat ors ....................................................................................................................... 55
Equation Functions ....................................................................................................................... 56
Flow Square Root ......................................................................................................................... 59
Condition Operators
When you add or modify a new Model Type condition, you can write a basic expression using the
following conditional operators.
Condition Expression
= Equals
==
or Or
||
not Not
and And
&&
Equation Operators
You can write a basic expression using the following operators.
Version 3.2 55
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Operators and Functions
Operator Description
+ Add
- Subtract
* Multiply
/ Divide
= Equals
^ To the power of
Equation Functions
The following table describes some of the basic mathematical functions used by equations. If applicable,
click on the functions for additional information about each one.
56 Version 3.2
Operators and Functions SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Version 3.2 57
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Operators and Functions
sum(portarray[ Returns an array the size of Assuming that MTotal1 and M are
].vararray) vararray, where each element variables dimensioned to a
is the value of a specific element fluidtype.CompList containing
of vararray summed over all the three elements C1, C2, and C3;
portarray elements. and MultiInPort is a port which
has two input streams, S1 and S2.
Typically used in equations that
need to sum component In that case, this equation
flowrates over a collection of
streams connected to an input or MTotal1 =
sum(MultiInPort[].M)
output port.
will be expanded as follows:
MTotal1[C1] =
sum(MultiInPort[S1].M[C1] +
MultiInPort[S2].M[C1])
MTotal1[C2] =
sum(MultiInPort[S1].M[C2] +
MultiInPort[S2].M[C2])
MTotal1[C3] =
sum(MultiInPort[S1].M[C3] +
MultiInPort[S2].M[C3])
58 Version 3.2
Operators and Functions SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Version 3.2 59
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Operators and Functions
Graph
60 Version 3.2
SimSci™ SimCentral™ Simulation Platform Model Writing Guide
A PPENDIX A
Model Writing Best Practices
This section contains best practices you may want to follow when writing new models.
In This Appendix
Writing Models for B ackwards Mode Transition ............................................................................... 61
Writing Equations for Robust Solving ............................................................................................. 62
Where:
Sig = Signal to the controller, fraction
A = Current valve position, fraction
TC = Time Constant, seconds
The variables A and Sig have the following definition in the variables section of the Model Editor:
Name Type Units Process Spec Fluid Flow Dynamics Spec Dynamic
Spec
This will only work correctly if the transition back to Process Mode is made at steady state condition when
Sig is equal to A. If the transition back to Process Mode is made during transient (not at steady state)
conditions, the valve Cv will be sized in Process Mode by using variable A, which will be at an arbitrary
condition.
Example: A Model with Good Backwards Mode Transition
Change the default specifications in Process Mode and Fluid Flow Mode so that variable A is specified
rather than Sig:
Version 3.2 61
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Model Writing Best Practices
Name Type Units Process Spec Fluid Flow Dynamics Spec Dynamic
Spec
In this case, the variable A used for calculating the valve Cv in Proc ess Mode will always be the expected
value set by the user.
Best Practice Recommendation
Use the dynamic state parameter or a variable algebraically related as the specified variable in Process
Mode so that the transition back to Process Mode works even if made during a transient. Do not use
variables linked through the der() function. Snaps hots are not needed if this process is followed.
Fk = CpCv/1.4 (3)
P*X = DP (4)
When the solver attempts to solve these equations, it iterates until the residual error, as defined by the
left hand side of the equation minus its right hand side, is less than a typical convergence tolerance of
-6
about 10 .
In the case of equation 1, the left hand side, or 3600 * W, is about 100,000 for typical industrial valve
flowrates in SimCent ral Simulation Platform units of kg/hr, while equations 2-4 have values on the order
of 1 to 100. The overall set of equations is difficult to solve as some equations are impacted more than
other equations to changes in the ot her variables.
Example: Re-Written Equation
By moving 3600 to the denominator or the right hand side, you do not change the solution, but merely
scale the equation so it is consistent with the other equations. You also preserve the significanc e of the
numbers as 3600 is a known conversion from seconds to hours.
With the above modification, the simulation converges in 4 iterations, compared with 45 iterations in the
non-scaled c ase. It is not advisable to plac e variables in the denominators due to t he potential of dividing
by zero.
62 Version 3.2
Model Writing Best Practices SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Version 3.2 63
SimSci™ SimCentral™ Simulation Platform Model Writing Guide
A PPENDIX B
Glossary of Terms
The following terms are used in SimCentral, the product documentation, or the online help.
A
Application Ribbon
A horizontal ribbon that contains tabs to invoke P rocess, Fluid Flow and Dynamics simulation actions; set
simulation view preferences; and display the product help.
Auto Solve
The automatic solution of portions of a simulation when sufficient information is available.
B
Badge
A symbol next to a SimCentral object that describes its state to the user. For ex ample, in the P roperties
Inspector and Simulation Manager, objects like model instances, variables, and equations have badges
to indicate an error status with tooltips that describe the nature of the error.
C
Calculated Variable
A variable with a value that is not specified by the user and with its specification box unchecked. The
solver determines the value of calculated variables.
Canvas
The graphical representation of the Flowsheet on which models are placed and co nnected to build a
simulation.
Client
The computer us ed to run the user interfac e and that connects to the server computer.
Condition
An object defined by the Model Writer within the Model Editor which evaluates a boolean expressi on
composed of parameters. When conditions are used in a simulation, they describe the variables,
equations, and submodels that are used by the model instance based on parameter selections made by
the Simulation Builder.
Connection
An object that provides the numeric al equivalence of variables that it connects. Connections between
model Instances wit h the same Port Type define variable streams that represent the material flowing
between the models. See Variable Connections and Paramet er Connect ions.
Connection Model
A library model that looks like a connector on the Canvas. Typical connection models are Pipes and
Streams.
Version 3.2 65
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Glossary of Terms
Connector
The graphical representation of a connection on the Canvas.
D
Description
Descriptive text provided by the Model Writer for models and their parameters, variables, and equations,
or by the Simulation Builder for model instances placed on the Canvas. Descriptions can normally be
viewed by mouse-over tooltips.
Dynamic Attribute
A variable attribute for a Dynamic simulation. Possible values are state variables, operated on by the
der() function, and time-derivative variables creat ed by the der() operator.
Dynamics Mode
A Simulation Mode that solves both algebraic and time -derivative equations over successive integration
time steps.
E
Editor
See Model Editor, Port Editor, and Fluid Editor.
Enumerated Parameter
A type of parameter wit h text-based options that are selectable by the Simulation Builder.
Equation
An object that describes the mathematical relationship of variables and real parameters. Model Writers
add equations to Model Types through the Model Editor. Simulation Builders may also create
Flowsheet-level equations using the Simulation Manager.
External
An object defined by the Model Writer within the Model Editor that defines an external DLL in which
variable relationships reside.
F
Fluid Editor
A configuration editor used by Simulation B uilders to modify the fluids used by a simulation.
Fluid Flow Mode
A pressure-driven steady state Simulation Mode. Fluid Flow Mode is defined by the collec tion of variable
specifications which typically invoke a simultaneous net work solution.
Fluid State (Instance)
An instance of a Fluid State submodel whose variables represent the thermodynamic state of that fluid
instance through values such as temperature, pressure, and enthalpy.
Fluid State (Model Type)
A Model Type that represents fluid behavior. Used as a submodel in process equipment Model Ty pes.
Fluid Type
A Fluid Type describes the thermodynamic behavior assigned to model instances in a simulation.
66 Version 3.2
Glossary of Terms SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Free Variable
See Calc ulated Variable.
G
Grid
Visible, equally-s paced vertical and horizontal lines on the Canvas that can be used to align objects.
Group Box
An area within the Roles Manager, Properties Inspector, and editors to which columns are dragged to
group data. When empty, the Group Box reads "group by area" and "Drag a field here to group by that
field."
Guide Lines
A vertical or horizontal line that appears on the simulation Canvas when a model instance being moved
is adjacent to another. Used to help align model ins tances with one another.
H
History Manager
An editor that allows you t o define the frequency and quantity of simulation dat a that you want to save for
historical reference.
I
Icon
The graphical symbol that defines the appearance of all Model Types, Port Types, and Fluid Types on
the Canvas.
Integer Parameter
A Parameter that contains integer values. Integer parameters, such as the number of ports, are used to
configure models.
Invariant Attribute
A Variable and Parameter attribute that indicates the value does not change when you revert a
simulation to an earlier snapshot.
K
Keyword View
The detailed information pane of the Simulation Manager, which allows modification of a selected object.
L
Library
See Model Library.
M
Manager
See Simulation Manager, UOM Manager, Snapshot Manager, and Role Manager.
Mode
The solution mode of a simulation that includes a collection of predefined variable specifications and, in
some cases, special solvers.
Version 3.2 67
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Glossary of Terms
Model Editor
The configuration editor used by Model Writers to define Model Types.
Model (Instance)
The mathematical relations hips defined by a Model Type composed of paramet ers, variables, and
equations that define a specific unit operation, such as a valve or pump that exists within a Flowsheet.
Model Library
A collection of Model Types, Fluid Types, Curve Types, and Port Types residing in the Repository, or a
single simulation-specific Model Library residing with a simulation.
Model Library (Display)
A UI component that displays Model Libraries, shapes, and referenc es that can be dragged onto the
Canvas.
A paramet er that contains integer values. Integer parameters can be used to configure a model, such as
defining how many ports it has.
The act of writing a Model Type.
N
Not Solved Variable Attribute
A Variable attribute that indicates that the variable is invalid, stale, or otherwise incorrect and should not
be used. Not solved variables are indic ated in grey strike-through text.
P
Parameter
An object that repres ents the static values of a simulation. Model Writers can add parameters using the
Model Editor and Simulation Builders can add parameters through the Simulation Manager. See Real
Parameter, Enumerated Parameter, Integer Parameter and Fluid Type.
Parameter Connection
A parameter connection is defined in the Model Editor to directionally transfer parameter values through
port connections. Parameter connections of a special parameter type called FluidTy pe are used to
transfer fluid information to connected models.
Parameter Connection
A way of connecting parameters across ports and submodels to trans fer parameter values, such as Fluid
Types.
Port Editor
The configuration editor used by Model Writers to define Port Ty pes.
Port Type
A defined collection of variables that define the stream connection information bet ween model instances
connected by identical Port Types.
Process Mode
Process Mode performs steady state simulations to create and improve process design
Profile
An object which graphically displays scalar and vector data.
68 Version 3.2
Glossary of Terms SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Properties Inspector
A model instance property view accessed through the Canvas or Simulation Manager that allows
Simulation Builders to inspect and configure model instances.
Q
Quick Filter
A disposable Simulation Manager filter created for the immediat e search of an object in the Sim ulation
Manager. Save it if you want to use it again.
R
Real Parameter
A parameter that contains real numerical values (not integers or enumerations) and is defined using
Variable Types. Real parameters can be used in equations, but are treated as a fix ed value. A typical real
parameter could be Pi with the value 3.14159.
Repository
The storage location of simulations, Model Libraries, and Variable Types on the server to which all
SimCent ral users of that server have access.
Repository Manager
The UI component that displays simulations in the Repository.
Required Variable Attribute
A variable attribute for which a Simulation Builder must provide a numerical value.
Reset Snapshot
A function that resets only the calculated values of a previously captured Snapshot. The variable
specifications and real parameters of the simulation being reset are not changed.
Revert Snapshot
A function that reverts the variable specifications, both specified and calculated variable values, and real
parameter values of a previously captured Snapshots.
Ribbon
A set of controls at the top of the UI where common user operations are grouped.
Role
Your role wit hin SimCentral. You can select Model Writing, which is the creation and modification of
Model Types, or Simulation Building, which is the use of existing Model Types within a simulation.
Additional roles may be defined in the Role Manager.
Roles Manager
A manager used to modify default roles and add new roles.
S
Scenario Manager
An editor that allows you to manually script, automatically record and run simulation actions.
Set By User Variable Attribute
A Variable attribute that is set when the Simulation Builder enters a value for a specified variable.
Version 3.2 69
SimSci™ SimCentral™ Simulation Platform Model Writing Guide Glossary of Terms
Shapes
Primitive drawing objects, such as squares or circles, that can be dragged from the Shapes Model
Library to the Canvas.
SimCentral Button
The SimCentral Button contains options to create, import, open, rename, copy, delete, and export
simulations.
SimCentral Server
The computer us ed to host the solver and the Repository.
Simulation
A collection of Flowsheets and their connected model instanc es that define a process.
Simulation Building
The act of building a simulation using existing Model Ty pes.
Simulation Canvas
See Canvas.
Simulation Manager
A hierarchical view of a simulation that allows the Simulation B uilder to explore and modify the simulation
and its objects.
Snapshot
The collection of simulation dat a saved with the simulation that defines the variable specifications,
variable values, and real parameter values. A Snapshot is used to reset or revert a simulation state as it
existed at the point that it was saved.
Snapshot Manager
The UI component that lets you manage existing simulations and capture new ones.
Solver
The soft ware component that solves the mathematical relationships of a simulation.
Specified Variable
A variable with a value specified by the Simulation Builder and with its specification box checked. The
solver does not change the value of specified variables.
State Variable
A Variable with the dynamic attribut e "State Value," whose value is calculated by the evaluation and
integration of its time derivative.
Status Bar
The single line display at the bottom of the user interface which provides system status information.
Submodel
A Submodel is a model which is part of another model, such as a Fluid State submodel. Typically,
submodels are defined so that they can be reused across many different models.
T
70 Version 3.2
Glossary of Terms SimSci™ SimCentral™ Simulation Platform Model Writing Guide
Theme
A collection of text, background, and highlighting colors that can be selected per user preference.
Themes include Dark, Light, and Windows.
Thermo Type
The implementation that SimCentral uses to determine the Fluid State's properties, such as SimSci
Thermodynamics, an external DLL, or a named set of Equations in the Fluid State Submodel.
Trend
An object which graphically displays the time-dependent behavior of a variable during a dynamic
simulation.
Types
See Model Types, Variable Types, Port Types, and Fluid Types.
U
UOM Categories
A sortable grouping of relat ed Variable Types for the purpose of updating their display UOM in a UOM
Slate.
UOM Manager
A manager used to create and manage UOM Slates.
UOM Slate
A collection of UOM settings for all Variable Types, typically representative of a specific count ry or
industry. SI is a standard UOM Slate which comes with SimCentral.
V
Version 3.2 71