02 SimulationStudio
02 SimulationStudio
Volume 2
REVISION HISTORY
2004-09 For Simulation Studio 4.0 (TRNSYS 16.00.0000)
2005-02 For Simulation Studio 4.0 (TRNSYS 16.00.0037)
2006-01 For Simulation Studio 4.2 (TRNSYS 16.01.0000)
2007-03 For Simulation Studio 4.2 (TRNSYS 16.01.0003)
2010-04 For Simulation Studio 4.3 (TRNSYS 17.00.0013)
2011-11 For Simulation Studio 5.2 (TRNSYS 17.01.0000)
2012-02 For Simulation Studio 5.3 (TRNSYS 17.01.0005)
2017-02 For Simulation Studio 5.4 (TRNSYS 18.01.0001)
COPYRIGHT
© 2004 - 2017 by CSTB
The software described in this document is furnished under a license agreement. This manual and the
software may be used or copied only under the terms of the license agreement. Except as permitted by
any such license, no part of this manual may be copied or reproduced in any form or by any means
without prior written consent from CSTB.
2–2
TRNSYS 18 – Simulation Studio
Werner Keilholz
Marc Campora
Werner Keilholz
Paul Sette
Auxiliary programmers
Dirk Ackermann
Nicolas Bus
Alexander Kinsinger
Bertrand Thomas
Laurent Wozniak
El-Houari Soussi
Sabine Taristas
Graphic design
Fabien Simon
TRNSYS Contributors
TRNSYS Contributors are listed in the TRNSYS main manual. Additional contributors who developed
components that have been included in the Standard Library are listed in Volume 4.
Contributors to the building model (Type 56) and its interface (TRNBuild) are listed in Volume 5.
2–3
TRNSYS 18 – Simulation Studio
TABLE OF CONTENTS
2. USING THE SIMULATION STUDIO 2–11
2.1. General Information 2–11
2.1.1. Hardware Requirements 2–11
2.1.2. Installation Procedure 2–11
2.1.3. Automatic check for updates 2–11
2.1.4. License Agreement 2–13
2.1.5. To Get Additional Information 2–13
2.1.6. How to Use this Manual 2–13
2.1.7. Terms 2–13
2.1.8. Getting Started 2–14
2.2. Simulation Studio Windows 2–15
2.2.1. Main Window 2–15
2.2.2. Assembly Panel Window 2–15
2.2.3. Direct Access Toolbar/Menu 2–15
2.2.4. Proforma Window 2–15
2.2.5. Toolbars 2–15
2.2.6. Specifying Required Information 2–16
2.3. Proforma 2–17
2.3.1. General Tab of the Proforma 2–17
2.3.2. Description Tab of the Proforma 2–19
2.3.3. Variables Tab of the Proforma 2–20
2.3.3.1. Variables button 2–20
2.3.3.1.1. Name 2–22
2.3.3.1.2. Dimension 2–22
2.3.3.1.3. Unit 2–23
2.3.3.1.4. Role 2–23
2.3.3.1.5. Type 2–23
2.3.3.1.6. Minimum 2–23
2.3.3.1.7. Bracket Box 2–24
2.3.3.1.8. Maximum 2–24
2.3.3.1.9. Default 2–24
2.3.3.2. Variable Information Window 2–24
2.3.3.2.1. Definition 2–26
2.3.3.3. Creating Cycles of Variables 2–26
2.3.3.4. Special Cards 2–28
2.3.3.5. Comments for Each Unit 2–29
2.3.4. The Files Tab of the Proforma 2–29
2.3.5. Inheriting from another model 2–31
2.3.6. Export as HTML 2–32
2.3.7. Export as Fortran/C++ 2–32
2.4. Assembly Panel 2–34
2.4.1. Moving Components and Connections 2–34
2.4.2. Deleting Components 2–35
2–4
TRNSYS 18 – Simulation Studio
2–5
TRNSYS 18 – Simulation Studio
2–6
TRNSYS 18 – Simulation Studio
2–7
TRNSYS 18 – Simulation Studio
2–8
TRNSYS 18 – Simulation Studio
Table of figures
Figure 2.1.3-1: Activation of automatic updates......................................................................... 2–12
Figure 2.1.3-2: Example of update screen ................................................................................. 2–12
Figure 2.2.5-1: Example of tool bar with active element. ........................................................... 2–16
Figure 2.3.1-1: First Chapter of the Proforma ............................................................................ 2–18
Figure 2.3.2-1: Abstract Section ................................................................................................ 2–20
Figure 2.3.3-1: Variables Tab of the Proforma........................................................................... 2–21
Figure 2.3.3-2: Variable table ..................................................................................................... 2–21
Figure 2.3.3-3: Variable Information Window............................................................................. 2–25
Figure 2.3.3-4: Click on the row header ..................................................................................... 2–26
Figure 2.3.3-5: Cycle management ............................................................................................ 2–27
Figure 2.3.3-6: Cycle description window .................................................................................. 2–28
Figure 2.3.3-7: Special Cards Section ....................................................................................... 2–29
Figure 2.3.4-1: File Tab of Proforma .......................................................................................... 2–30
Figure 2.3.5-1: “Sons” ................................................................................................................ 2–31
Figure 2.3.5-2: "Update Inheritance" window ............................................................................. 2–32
Figure 2.4.1-1: Sample Assembly Panel .................................................................................... 2–35
Figure 2.4.5-1: Direct Access Tool ............................................................................................. 2–36
Figure 2.4.5-2: Direct Access Menu with TYPE56b chosen ...................................................... 2–37
Figure 2.4.5-3: Direct Access Toolbar with type56b chosen ..................................................... 2–37
Figure 2.4.8-1: Focusing on a component ................................................................................. 2–39
Figure 2.4.16-1: Traced Component Model ............................................................................... 2–42
Figure 2.4.18-1: Locked Component Model............................................................................... 2–43
Figure 2.4.19-1: Control Cards Window ..................................................................................... 2–43
Figure 2.4.19-2: Component Order Window .............................................................................. 2–45
Figure 2.4.23-1: Error Manager - Messages tab ........................................................................ 2–47
Figure 2.4.23-2: Error manager - Units stats tab ....................................................................... 2–48
Figure 2.4.23-3: Error Manager – Types stats tab ..................................................................... 2–49
Figure 2.4.23-4: Error Manager – Lst file… tab ......................................................................... 2–50
Figure 2.4.24-1: Inputs Window ................................................................................................. 2–52
Figure 2.5.1-1: Example of Locked and Unlocked Variables ..................................................... 2–52
Figure 2.5.2-1: Variable Information Window............................................................................. 2–53
Figure 2.5.3-1: Special Cards Example ..................................................................................... 2–54
Figure 2.5.4-1: Dialog for input cycle. ........................................................................................ 2–55
Figure 2.5.6-1: External Files Example ...................................................................................... 2–56
Figure 2.5.6-2: Comment tab example ...................................................................................... 2–56
Figure 2.6.1-1: Connections Window – Classic tab ................................................................... 2–58
Figure 2.6.1-2: Connections Window – Table tab ...................................................................... 2–59
Figure 2.6.6-1: Default position for links .................................................................................... 2–61
Figure 2.6.6-2: User defined positions for links.......................................................................... 2–61
Figure 2.6.6-3: Connections Window – Table tab ...................................................................... 2–61
Figure 2.6.6-1: Equation Window ............................................................................................... 2–63
Figure 2.6.6-2: Complete Equation in Equation window ............................................................ 2–64
Figure 2.8.1-1: The File Menu .................................................................................................... 2–65
Figure 2.8.1-2: Wizard dialog box .............................................................................................. 2–66
Figure 2.8.1-3: The Open dialog window ................................................................................... 2–67
Figure 2.8.1-4: Save File As dialog box ..................................................................................... 2–68
Figure 2.8.1-5: Print dialog box .................................................................................................. 2–70
Figure 2.8.1-6: Control Cards Settings Tab ............................................................................... 2–72
Figure 2.8.1-7: Project Settings Tab .......................................................................................... 2–72
Figure 2.8.1-8: Directories Settings Tab .................................................................................... 2–73
Figure 2.8.1-9: The Setup Compiler Information Box ................................................................ 2–75
Figure 2.8.2-1: The Edit Menu ................................................................................................... 2–76
Figure 2.8.2-2: Component Properties Dialog Box .................................................................... 2–78
2–9
TRNSYS 18 – Simulation Studio
2–10
TRNSYS 18 – Simulation Studio
Processor: Pentium
Internal clock: 166 MHz or faster
RAM: 64 Mb or more
OS: NT4 or NT5, 2000, XP
Screen: 800x600 pixels (a 1024x768 monitor is recommended)
Hard Disk: 600 MB Free Hard Disk Space
When Simulation Studio is started for the second time, it will ask the user if he wishes the software to
check for updates automatically:
2–11
TRNSYS 18 – Simulation Studio
If the user clicks “Don’t check” the software will not automatically check for updates. If the user clicks
“Check automatically”, the software will attempt to connect to the Internet to check if updates are
available. This check will not be done more often than once a day.
It is also possible to check for updates manually, using the ?/Check for updates menu in simulation
Studio. This option is available even if ‘Don’t check’ has been selected.
If an update is found, a summary of the update is displayed. The user can then choose between the
following options:
- Skip this version: will not install the update and no longer proposes it to the user. New updates
will only be proposed again if an even newer update will be available.
- Remind me later: will not install the update, but proposes it again the next day.
- Install update: redirects to the Internet site where the update can be downloaded. Simulation
Studio should be closed before launching the installer after the download.
2–12
TRNSYS 18 – Simulation Studio
CSTB
BP 209
06 904 Sophia Antipolis
FRANCE
Tel: 33 4 93 956 700
Fax: 33 4 93 956 733
Email: [email protected]
2.1.7. Terms
Throughout this manual, and throughout the available on-line Simulation Studio help system, the terms
'component model', 'model', and 'component' will be used interchangeably. These three terms all describe
the TRNSYS representation of a piece of equipment or module. For TRNSYS purposes, a model is
represented by a subroutine or sub-program (written in FORTRAN, C, C++ or similar programming
2–13
TRNSYS 18 – Simulation Studio
languages) describing its operation. Examples of TRNSYS component models include a storage tank, a
solar collector, a weather processor, and a printer.
The terms 'assembly', 'assembly of models', 'project', and 'simulation' all refer to a set of component
models which are interconnected in such a way as to perform a set task. For example, the
interconnection of the weather processor model, the solar collector model, and the storage tank model in
such a way as to simulate the heating of water by the sun's energy is considered to be a project or
assembly. For TRNSYS purposes, assemblies of component models are represented by a TRNSYS input
file (the deck), a file listing the component models and their interactions.
The terms ‘MS’ and ‘Microsoft’ refer to Microsoft Corporation. The term ‘MS Windows’ refers to all
versions of Microsoft Windows products on which Simulation Studio operates including Windows 98-2,
Windows NT 4.0, Windows NT 5.0, Windows 2000, Windows XP, and Vista. The term ‘window’ refers to
any window within Simulation Studio or other products and does not refer to the Windows operating
system.
In general, the user will begin by making a New Empty Project from the File/New menu in the Main
Window menu bar, which creates a blank Assembly Panel window (titled "ProjectX.tpf", where X is the
current project index). The user will then select components using the Direct Access menu, one of the
drop down main menus, and place the components on the Assembly panel. Then, using the right mouse
button or menus, the user can select and change the parameters and initial input values, etc., delete,
copy or paste the components, etc. Finally, the user can link these components together and connect the
outputs of one component to the inputs of another component.
2) The parameters and initial values are defined for each component.
3) The necessary links between components are made and the internal connections from one
component’s outputs to another component’s inputs are completed.
The user will select Calculate (or press F8) in order to run the simulation. The results can be viewed and
printed using the Calculate/Open menu. Based on the results, adjustments can be made to the
components in the project in the Assembly Panel and more simulations can be run.
2–14
TRNSYS 18 – Simulation Studio
2.2.5. Toolbars
Many of the windows in the Simulation Studio program contain toolboxes associated with the window.
These toolboxes contain icons (tools) which will launch various applications in the Simulation Studio
2–15
TRNSYS 18 – Simulation Studio
program. Most of these tools, such as the Make Macro tool, work by selecting several items on the screen
and then clicking on the icon of the tool with the mouse. The active tool is characterized in the Simulation
Studio program appearing to be a depressed button while inactive tools appear to be extended buttons.
Refer to Figure 2.2.5-1.
Toolbars and menu items specific to each Simulation Studio window are discussed in detail in their
respective sections of this manual. In the figure above, the ‘arrow’ (or ‘select’) tool on the top-left side is
active.
In Simulation Studio windows, required information must be entered in one of several different formats:
input boxes, radio buttons, check boxes, and list boxes.
The left mouse button is used, as with most MS Windows programs, to select items or activate programs.
A single left mouse button click will "select" an icon.
Simulation Studio makes wide use of the right mouse button functionality. For example, to access the
parameters, inputs, outputs, etc. for a component icon located on the Assembly Panel, the best method is
to right-click on the icon. This will bring up a list of options which can then be selected by clicking the left
mouse button.
2–16
TRNSYS 18 – Simulation Studio
2.3. Proforma
The Proforma is a standard method of documenting component models. The Proforma file (or .TMF -
TRNSYS Model File) is the model documentation standard used in Simulation Studio. Each TRNSYS
component model has been broken down into the Proforma format and is stored in this format on the hard
disk. All components that are created or added to the Simulation Studio program must have a completed
Proforma in order to be used in a simulation project.
The Proforma files in Simulation Studio are composed of four tabbed panels containing all the information
required to facilitate the transfer of knowledge related to the model, and allowing the models to be used in
the correct format. The first panel contains general information related to the history and function of the
component model. The second panel of the Proforma contains a short description, a complete description
of the model and a plug-in (see below) path. The third panel contains a detailed description of each
variable (parameters, inputs, outputs and derivatives) necessary to define the model and its connections
to other components. The fourth and final panel contains connections and tools for working with files
associated with the model. This includes access to the source code and other description files (such as
MS Word documents) and the ability to associate external files with the model (such as data and output
files). These files can then be opened in the appropriate program by selecting their name and pushing the
Edit button on the right.
The Proforma file for a component model may be accessed in one of three ways: it may be viewed from
the Assembly panel by selecting a component and clicking the Assembly/Proforma... menu item in the
Assembly Panel window or by right-clicking on the component icon and selecting Proforma... from the
right click menu or by clicking the Proforma button ( ) in the component properties. The Proforma may
also be accessed by selecting menu item File/Open/Component. In either case, the Proforma is exactly
the same. The Proforma for a component model can be modified when accessed by editing the
Component and through the Assembly Panel.
If the user is about to create a new component (TRNSYS type), the Proforma can also be used to
generate a first version of the source code for the new component. The user should first fill in the entire
PROFORMA (especially the type number and the Variables Tab). Then, save the Proforma in a .TMF file.
Once saved, select File/Export as ... Fortran/C++ from the main window. This will open a standard "Save
As" dialog box which allows the user to save the generated Fortran or C++ source code in any directory.
2–17
TRNSYS 18 – Simulation Studio
The upper half of the first chapter of the Proforma file contains input boxes for generic information about
the component model:
Editor: Often, the person creating the Simulation Studio Proforma is not the original author and
so the name of the Editor may also be important.
Creation Date: This is the date of when the model was first written.
Last Modification: This is the date when the Proforma was mostly recently revised. This value is
set automatically but can be altered.
Model Type
Below these boxes are a row of radio buttons for entering the Model Type. Detailed models would include
the multi-zone building model, Type 56. Simplified models would include such things as curve fit readers
or the forcing function component.
2–18
TRNSYS 18 – Simulation Studio
Validation
Below this is a row of check boxes to determine the type of validation that was performed on this model.
This can be qualitative, numerical, analytical, experimental and ‘in assembly’ meaning that it was verified
as part of a larger system which was verified.
Icon
The lower left part of the General tab shows the icon that is associated with the component (note that the
image of this button contains the current model’s icon and may thus be different from the icon in the
above figure).
Clicking on the icon will open the Icon Editor which is Microsoft Paint by default (other editors will be
launched if they are installed and as the default Windows OLE server for bitmaps ; if this function does
not operate correctly, please re-install Microsoft Paint. The user can modify the existing bitmap image or
replace it with another bitmap. In Simulation Studio, any bitmap can be used for a component icon and it
can vary in size. The user may wish to use larger bitmaps for more significant pieces of equipment
(chiller, building, etc.) and smaller bitmaps for less important pieces (valves, pumps, etc.). It is also
possible to modify directly the .BMP files on the hard disk in the Studio\Proformas\ sub folder: the .BMP
files have the same name as the associated .TMF files. If such a bitmap file is not present in the same
directory as the .TMF file, a default icon is used.
Keywords
The lower right corner of the General tab has a box for adding keywords concerning this model such as
solar collector, building load, etc.
Two edit boxes in the lower part of the Proforma determine the type number for the component as well as
the number of possible instances of the component. Some components, such as the pump, have an
unlimited number of possible instances. Other components, such as the multi-zone building model only
allow for one instance.
2–19
TRNSYS 18 – Simulation Studio
Comment: The text entered here will appear as a comment in the TRNSYS input file. This allows
to attach important information about the component to all its users, including users who prefer to
edit the input file with a text editor. This text should be short, to avoid overloading the input file.
Plug-in path: The plug-in path contains the path to the an external application which will be
executed to modify component properties instead of the classical properties window. Such plug-
ins can be developed by the user, as described in the annex.
2–20
TRNSYS 18 – Simulation Studio
2–21
TRNSYS 18 – Simulation Studio
For each of the variables in the TRNSYS specification of a component (parameters, inputs, outputs, and
derivatives) the user must specify the following information:
The name of the variable: This name will be seen by the user in the connections window and all
other variable information windows.
The role of the variables such as input, output, etc. Changing the role of a standard component
requires reprogramming and recompiling the component.
The dimension of the variable (power, temperature, etc.): This dimension must be already
defined in the unit dictionary (refer to section 2.9) to be used. The pre-defined dimension ‘any’
allows to make a variable compatible with any other variable: no checks are performed on such
variables if the user attempts to connect them to other variables.
The unit of the variable that the TRNSYS program requires for the specified dimension (C, F, K
etc.). The user may use any set of units in the assembly window for the specified dimension, the
program will convert the units back to the unit specified here.
The minimum, maximum, and default values for the variable: These values will be used when
the component model is placed into an assembly. The default value must be between the
minimum value and the maximum value. The default value is replaced by the initial value for the
inputs and derivatives and suppressed for the outputs. These values must be given in the units
specified. Between the minimum and maximum values resides a small box containing two
brackets and a semi-colon. This setting determines if the minimum and maximum are included or
not in the range. The minimum and maximum can be "-INF" or "+INF" to indicate no limit (infinity).
+/-INF is the default value.
To enter the above information in the input boxes provided, simply click on the input box. In some input
boxes, the user will then have to type the information into the input box (name, minimum, maximum, and
default value). In other input boxes (dimension, unit, and type) a pop-up menu will appear when the input
box is selected. The user should then choose one of the values from the list provided and close the box,
to make the choice active. Make sure to check the units as they will be reset to the default units upon
changing the dimension.
2.3.3.1.1. NAME
This input box contains the name of the variable. The name will appear in the list of parameters, inputs,
outputs, or derivatives throughout the Simulation Studio program. The name can be changed by the user
only when accessed through the Proforma. To change the name, simply click in the input box with the
mouse and type the new variable name.
2.3.3.1.2. DIMENSION
This drop down box is used to choose the correct dimension for the TRNSYS variable. The dimension
can be changed by the user only when accessed through the Proforma. To change the dimension, click
on the 'dimension' box. A list of dimensions that are currently available in the Unit Dictionary program will
appear. Choose the new dimension by clicking on it. The dimension name will be then highlighted. Make
sure to check the units as they will be reset to the default units upon changing the dimension.
2–22
TRNSYS 18 – Simulation Studio
2.3.3.1.3. UNIT
This box is used to choose the correct units for the TRNSYS variable. The units can be changed by the
user whenever the Variable Information window is open. However, depending on where the Variable
Information window was opened, changing the units has different effects. When the units are changed
from the Proforma, the new units selected will become the default units for this variable. (Such a change
must be taken into account - re-programmed - in the component’s source code!). When the units are
changed anywhere else in the Simulation Studio program, it is solely for display purposes. The value of
the variable will be converted to the default units for the variable when the simulation is run. This feature
allows the user to enter the values for the variables in a known unit system and have the program convert
the values to the required unit system at run time. To change the default units for a variable, click on the
'unit' button. A list of units that are currently available in the Unit Dictionary program will appear for the
given dimension. Choose the new unit by clicking on it. The unit name will be then highlighted.
2.3.3.1.4. ROLE
The role drop down box shows the user if the variable is a parameter, input, output or derivative. By
changing this value, the user moves the variable from one group to another. It will be placed at the end of
the list of variables in the other window. For example, if “efficiency” was originally a parameter, the Role
box allows it to be changed to an input while retaining the other information (Such a change must be
taken into account - re-programmed - in the component’s source code!).
2.3.3.1.5. TYPE
The Type drop down box is used to set the variable type for Simulation Studio purposes:
Real - The user is only able to supply a real number for the value of the variable, 2.315 or
3.14159 for example.
Integer - The user is only able to supply an integer for the value of the variable, 2 or 5 for
example.
Boolean - The user is only able to supply a BOOLEAN value for the variable, TRUE (‘1’) or
FALSE (‘0’).
String - The user is able to supply any character string for the variable, START or VALUE1 for
example. The string feature is used in TRNSYS to supply labels for printers and plotters, and to
use EQUATION or CONSTANT names for parameters or initial values of inputs.
To change the variable type, click on the 'Type' button. A list of the four available types will appear.
Choose the new type by clicking on it with the mouse; the type name will be then highlighted. Users may
change the type for a variable whenever the Variable Information window is accessed.
2.3.3.1.6. MINIMUM
This input box contains the minimum value of the variable that a user can specify when using the model
in an assembly. The minimum value is given in the default units for that variable. The minimum value can
be changed by the user only when accessed through the Proforma. To change the minimum value,
simply click in the input box with the mouse and type the new value.
2–23
TRNSYS 18 – Simulation Studio
2.3.3.1.8. MAXIMUM
This input box contains the maximum value of the variable that a user can specify when using the model
in an assembly. The maximum value is given in the default units for that variable. The maximum value
can be changed by the user only when accessed through the Proforma. To change the maximum value,
simply click in the input box with the mouse and type the new value.
2.3.3.1.9. DEFAULT
This input box contains the default value for the variable expressed in the default units of that variable.
The default value must lie between the minimum and maximum values for the variable. All variables in a
component model are initially set to the default value. For this reason, users should enter a reasonable
default value for all variables in the model. The default value can be changed by the user only when
accessed through the Proforma. To change the default value, simply click in the input box and type the
new value.
The Variable Information window contains the complete description of a TRNSYS variable (parameter,
input, output, or derivative). The Variable Information window can also be accessed through the 'more'
button in the Connections window, and the 'more' button in one of the Inputs, Outputs, Parameters, or
Derivatives windows for a component in the Assembly Panel window. However, the variable may only be
modified when accessed through the Proforma window. The Variable Information window allows the user
to easily specify the required information for a parameter, input, output, or derivative. This window is
unique in that it is the only window which allows the user to give a text definition to a variable. This
definition is available when the user requests information on a variable in the connections window. The
name, minimum value, maximum value, and default value should be entered in the input boxes provided.
The dimension, unit, and variable type should be chosen from the pop-up menus which appear when their
respective buttons are pressed. The input boxes and buttons have already been described previously, but
the Definition button allows for a more detailed description of the variable.
2–24
TRNSYS 18 – Simulation Studio
2–25
TRNSYS 18 – Simulation Studio
2.3.3.2.1. DEFINITION
This input field contains a short description of the variable. The variable definition should be complete
enough so that a user, unfamiliar with the component model, is able to understand the significance of the
variable. This definition will be seen by any user that requests information about a variable in the
Assembly Panel.
2–26
TRNSYS 18 – Simulation Studio
A Cycle Description window, an example of which can be seen in Figure 2.3.3-6, will appear allowing the
user to define how the length of the cycle will be determined; either through the answer to a question, or
by the value of a parameter (such a parameter must not be of type ‘string’). This choice is accomplished
by the radio buttons provided in the Cycle Description window. All questions previously defined will be
accessible by the button “Select an existing question” thereby allowing several variable cycles to depend
on the answer to the same question. If the cycle depends on the answer to a question, the author must
establish the minimum and maximum values allowed for the answer to the question. Embedded cycles
are allowed and are created in the same way. When the user specifies how many cycles are to be used in
the model, the program will tag each of the variables in the cycle with a integer identifier. For example,
the name of the parameter 'VALUE' becomes 'VALUE-1', 'VALUE-2' etc. when viewed within the
Assembly Panel window.
2–27
TRNSYS 18 – Simulation Studio
To edit an existing cycle, select the variables contained in the cycle. Then, the cycle symbol will be
selected. At this point, the user can select the “Change” button and the same Cycle Specification window
will open up.
Like the external file specification, the author can attach a list of possible answers to the question which
can be accessed by the user. Note - neither the 'Card', 'Question to ask', or 'Default' answer input boxes
are required to be filled by the author. The Simulation Studio program will only write those lines to the
input file which have been specified by the author.
2–28
TRNSYS 18 – Simulation Studio
2–29
TRNSYS 18 – Simulation Studio
To edit the source code use the EDIT button. Finally, by entering the necessary Compile command and
switches, the COMPILE MODULE button will compile the module. This can be useful, although many
users prefer to use the integrated development environment provided with their compiler. Please refer to
‘Volume 8- Programmer’s Guide’ in the TRNSYS documentation for information about creating new
components. Note that the File/Export as... command will create a compile project along with the source
code. This compile project (*.dsp) can be directly opened by the compatible FORTRAN and C/C++
compilers. The component can then be conveniently edited, debugged and compiled within the compiler’s
integrated development environment (IDE).
Finally, there is a box at the bottom of this window called Associated Files. This box contains a list of
related files and Internet links for this component. These files can then be opened in the appropriate
program by selecting their name and pushing the Edit button on the right (the appropriate program, such
as MS Word, must be installed on your computer or otherwise accessible).
2–30
TRNSYS 18 – Simulation Studio
To use synchronization inheritance, first open the Proforma of the component from which inheritance will
occur (the ‘father’ model). Then, click on the “Tools/Add Sons” main menu. This opens the Inheritance
screen shown below in Figure 2.3.5-1. In this window, you can select one or more models which will
inherit from this model.
Once the desired components have been selected, close this window with the OK button. Now, select
"Tools/Update Inheritance" menu that will open the Inheritance settings window (see Figure 2.3.5-2).
There are also some options that can be selected for this inheritance as well. These options include a
listing of what can be inherited including General information, Variables, and attached Files. Also, the
user can select if existing variables (such as parameters already defined in the ‘son’ model) will be saved
and added to the end of the inherited variables or discarded. Once the Settings are correct, click OK to
actually perform the Inheritance Update.
2–31
TRNSYS 18 – Simulation Studio
The File/Export as... and Fortran/C++ commands create a skeleton of a TRNSYS component (TYPE)
for the current Proforma window. The user should enter all the parameter, input, and output information
into a blank Proforma (created with File/New/Component) and save it to the hard disk (in a .TMF file).
When the Export as... or Fortran/C++ command is selected, Simulation Studio uses this .TMF file to
generate a source file which contains all the basic syntax for a new TRNSYS type, including the function
(subroutine) definition, the reading of parameters and inputs, calling of TRNSYS checking functions, etc.,
as well as a compile project (*.dsp).
Once the source code has been generated, Simulation Studio attempts to start the user’s programming
environment. If one of the recommended development environments (such as Compaq Visual FORTRAN
6.6B, Intel Visual FORTRAN, Microsoft Visual C++ 6.0 or .NET) is installed on the user’s machine, a
complete, pre-configured compilation project will automatically open in that environment. (It is possible to
modify the environment used under File/Settings…/Directories/FORTRAN environment and C++
environment).
2–32
TRNSYS 18 – Simulation Studio
At this point, the only missing Fortran/C++ code are the actual equations which relate the inputs to the
outputs; the corresponding lines can be found at the end of the source code. The output variables are set
to ‘0’ by default, for example:
The user can simply edit these lines to add his own equations. Of course, any existing
FORTRAN or C++ source code can be added to the compilation project as usual.
.\Trnsys17\Studio\Templates\Components
Once the source is completed, the new type can be compiled (typically by using the ‘Build’ function of the
compiler). The result of this compilation will be a new DLL, which is automatically created in the UserLib
subdirectory. Now simulations using the new component can be run in the Simulation Studio.
2–33
TRNSYS 18 – Simulation Studio
The Assembly main menu provides many useful commands for working with the Assembly panel. In
addition, the Project toolbar contains many icons with actions appropriate for the Assembly panel. The
assembly panel actions are discussed in detail below.
To move one of the component models or macros within the assembly window, the user should first make
sure that the "select" tool is active. Then, the user must click on the model icon and, while holding the left
mouse button down, drag the model to the new position. Any links attached to this model will move
accordingly. Note that if "Snap to Grid" is selected in the View menu, the icon can only be moved at grid-
spaced intervals. To place a component in between, turn off "Snap to Grid".
A link is a "pipeline" of output-input connections between two components. The details of links and
connections are explained later in the manual. A user may wish change the position of a link in order to
make the Assembly panel easier to understand. To move a link between two components, the user must
first click on the link between the two models so that the link becomes active (small squares will appear at
all corners of the link). The user must then click on one of the small squares attached to the highlighted
link and, while holding the left mouse button down, drag that square to the desired location. The mouse
pointer will change to a two-ended arrow when the user is on the proper place. The link will act like there
is a rubber band attached to the square. A link can only be moved to a new location if the link has been
defined to be a user-defined link. Refer to the "Connections" section of this manual for more information
on creating and modifying links between components (section 2.6).
Holding down the Control (Ctrl-) key while clicking on a link allows to add passage points to a link, or to
remove them (when clicking on an existing passage point). .
2–34
TRNSYS 18 – Simulation Studio
To view the lists of parameters, inputs, outputs, derivatives, special cards, external files and comments
associated with a component model, the user must right-click on the component icon and select the
Variables item. Alternatively, the user can use the menu item Assembly/Variables which will open the
Variables window for the currently selected component.
To rename a component model, double-click on the name of the desired model so that a cursor appears
in the name of the model. Retype the name using the keyboard. The name must be unique. Press the
Return key to validate the new name of the component.
To select multiple items in the program, users may utilize one of two methods. Items may be selected or
deselected sequentially by clicking on the selected components with the mouse while holding the SHIFT
key. Users may also click on an empty area of the assembly panel and, while holding the mouse button
down, slide the cursor to a new location. Every item that is contained within the box formed by the drag
will be selected. Once multiple items have been selected, these items can be moved by clicking on one of
the selected components with the left mouse button and dragging it to a new location.
By pressing the F2 key, the names of the components will be replaced with the component’s
Type and Unit numbers.
2–35
TRNSYS 18 – Simulation Studio
When clicking this menu, a dialog appears containing all available components (like in the Direct Access
Tool).
Referring to Figure 2.4.5-2, the multi-zone building component has been selected; TYPE56. Through this
process, the user will make several choices about the model he will select and also the “operation mode”
of that component. The main TRNSYS manual has very detailed information about the different modes of
the different components.
2–36
TRNSYS 18 – Simulation Studio
Once a component has been selected, close the dialog and the cursor will change to a plus sign (+).
Move the cursor to the point on the Assembly Panel window where the component model should be
placed and click. The component model will appear in the Assembly Panel.
2–37
TRNSYS 18 – Simulation Studio
2–38
TRNSYS 18 – Simulation Studio
The Assembly/ Link Mode menu command allows the user to specify information flow between two
component models. The direction of information flow is from the first model to the second model (outputs
of first model ==> inputs of second model). Inputs to a model are always represented as a line flowing
into a component icon. Outputs from a component model are always represented as a line leaving the
component icon. To connect the outputs of one component to the inputs of another component, the user
has several methods to choose from.
To make many links: The best way to operate when you want to make many links is to turn on the Link
Mode using the Assembly/Link Mode menu item. Then, the cursor will change to reflect ongoing link
operations which is normally a crosshair (+). When the cursor is above a component that can start or
begin a link, the cursor appears as a crosshair in a circle. When the user crosshair approaches a
component, 8 ports appear around the icon. Each port can be used to hook the new link to the icon. The
active (selected) one is shown as a filed, red circle.
2–39
TRNSYS 18 – Simulation Studio
A segmented line will be drawn between the two components to indicate information flow between the two
components. This segmented line will initially be colored blue to signify that the there is information flow
between the two components, but that the flow on a variable level has not yet been defined. When the
information flow is specified on a variable level, the link will turn black. When the user is done making
links, the Link Mode can be turned off by re-selecting the Assembly/Link Mode menu command, right-
clicking on a free spot in the assembly panel or selecting another tool.
To make just one link: The user can select the starting component, then use the right mouse button to
select “Start Link” from the right-click dropdown menu. Then, the cursor will change to reflect an ongoing
link operation. Users must complete the link process by (left) clicking on the component model to which
the outputs of the first model will be connected. After that, clicking on a component will not start another
link. Thus, a single link is created in this way.
If a user wishes to specify the path of the link joining the two components, the user should first click on
the component from which the outputs will come. Subsequent clicks on open spots in the Assembly Panel
window will cause joints to be placed in these positions. The link will then act like a rubber band which
has been attached to this joint. Users should end the user-defined link by clicking on the component
which will receive these outputs.
To specify which outputs of the first model are connected to which inputs of the second model, the user
should double-click on the link between two components with the Select tool active. A connection window
will appear in which the user can specify the detailed input/output connections. Refer to the "Connections"
chapter for more information.
2–40
TRNSYS 18 – Simulation Studio
The macro-model behaves like any other model. It can be moved, used to create other macros, deleted,
saved as a model, etc. To create a macro-model, first select the models to be replaced with a macro-
model by holding down the SHIFT key to select several components or draw a box around several
components to select them. Alternatively, a rectangle containing a set of models can be drawn with the
mouse to select all models contained in the rectangle. Then, click on the Assembly/Create Macro menu
item, or click on the button ( ) on the Project Toolbar. The program will replace the selected models
with a macro-model.
Macro variable names can be changed by double-clicking on the name and typing a new text.
Inside a macro, little arrows on the top-left and top-right corners of a component indicate that this
component has incoming and/or outgoing links outside the macro. These links can be accessed with the
right-mouse click context menu “Edit Connections with…”.
2–41
TRNSYS 18 – Simulation Studio
The Assembly/Add Text menu item or Add Text icon on the Project Toolbar ( ) allows the creator of
a project to insert text strings onto the Assembly panel itself. These text strings allow the user to remind
themselves of certain characteristics of the project. This is also useful when the Assembly panel is
printed. To use this feature, click on the Add Text menu item and then click a space on the Assembly
Panel at which point the user can start typing in the desired text. The text will be added on the text layer.
The Assembly/Lock-Unlock menu item or Lock toolbar item ( ) allows the creator of a project to
lock certain components in the assembly panel. These locked components cannot be erased nor
modified. Selecting one of the components and clicking this command will tag this model with a padlock
as shown in Figure 2.4.18-1. Clicking again on this command will unlock the model. The locked/unlocked
status of the model will be preserved when the assembly is saved as a project. If TRNEDIT commands
are being automatically written to the TRNSYS input file, no TRNEDIT statements will be written if the
entire Component is locked.
2–42
TRNSYS 18 – Simulation Studio
Clicking on the tool will also open the Control Cards window as shown in Figure 2.4.19-1.
In this window, users must specify the control cards to be used in the simulation. Users should refer to
Volume 8 ‘Programmer’s Guide’ for a complete description of the TRNSYS control cards.
In the control tab of this window, it is possible to choose if TRNEDIT commands should be generated in
the TRNSYS input file or not. An input file containing TRNEDIT commands can be used to create stand-
2–43
TRNSYS 18 – Simulation Studio
alone applications from a simulation project with the help of the TRNEDIT program (see “Volume 7
TRNEDit: Editing the Input File and Creating TRNEDIT Applications” for more information). While
selecting 'Write TRNEDIT commands' allows the user of the input file with TRNEDIT, this option will
generate more CONSTANTS (one for each unlocked variable in the simulation project). These extra
constants may cause huge simulations to run very slowly. The other option, 'Don’t write TRNEDIT
commands', produces more legible input files. The default value is “Don’t write TRNEDIT commands”.
Another variable controls the writing of Simulation Studio Meta-commands in the TRNSYS input file. If this
value is "True" (On), Simulation Studio Meta-Commands will be added to the TRNSYS input file. These
commands are treated by TRNSYS like comments, i.e. they will not have any influence on the simulation.
However, they allow Simulation Studio to better reconstruct a simulation project from a TRNSYS input file,
using the File/Import function. This is useful for re-importing a modified TRNSYS Input file.
If Meta-commands are not present in the import file, Simulation Studio uses the ModelConfFile.conf file in
the EXE directory to map UNIT declarations to PROFORMAs.
Users have the ability to lock (or unlock) any or all of the control cards for a simulation by clicking on the
locks scattered throughout the control card window. Locked control cards can not be changed. All the
locks in the window can be locked by clicking the Lock All Button at the left side of the window. The
control cards will be written to the TRNSYS input file specified in the 'Deck file name' input box.
The value for the 'Simulation start time', the 'Simulation stop time', and the 'Time step' will be written as
TRNSYS equations with the equation names 'START', 'STOP', and 'STEP' respectively. These equation
names can be used in the equations component or as parameters to any component model (the printer
component for example). Refer to the "Equations" section of this manual for more information on using
these equations.
Note that next to the location of the Simulation Input File Name box is a BROWSE button which allows
the user to search the hard drive for the location and name of the filename they wish to use for the
TRNSYS input file. The name and path for the list file is identical to the input file except for the extension
which is automatically *.lst. The name ***.dck can be used to insert the current project name.
The "Component Order" tab will open another window in which the user can reorder the components in
the simulation as shown in Figure 2.4.19-2. By default, the components and equation blocks appear in the
order in which they were placed in the Assembly Panel window. By selecting a component, holding the
left mouse button down and sliding the component up or down, the component can be moved earlier or
later in the input file. The unit number generated in the deck file can be modified by clicking with the
mouse or pressing F2 key on the corresponding line.
The Optimize components order button will optimize the order for the simulation to be more efficient.
2–44
TRNSYS 18 – Simulation Studio
The Calculate/Create Input File menu item or the Write Input File toolbar icon ( ) allows users to
generate the input file only without running the simulation. This capability can be very valuable when the
user wants to check that all the components are currently connected properly without starting a simulation
(that the user knows will not run properly because the simulation is not completely constructed).
The Calculate/Open / Input File menu item or the Deck File toolbar icon ( ) allows users to access
the generated input file through Simulation Studio. The file, which Simulation Studio has generated, will
be opened in the editor window which is Notepad by default. If the user edits this file and saves it, the
changes will NOT be simulated. When the Run Simulation command is selected, the input file is
overwritten with a new version and changes are lost.
2–45
TRNSYS 18 – Simulation Studio
The Calculate/Run Simulation menu item or Run toolbar icon ( ) allows the user to run the TRNSYS
simulation program on the currently opened project. Clicking on this command starts the following
process:
The project is checked for any errors or omissions which Simulation Studio can find (verified).
The TRNSYS simulation program is run with the newly created input file.
Once the TRNSYS program has finished the simulation, control is returned to the Simulation Studio
program where the results can be analyzed, graphs can be created, or additional simulations can be run.
Care should be taken when analyzing the results from a simulation as neither TRNSYS nor Simulation
Studio automatically delete the output, list, and plot files when a new simulation is run. If a new simulation
fails, the output and plot files may be from the previous successful simulation of this input file. Users
should always check the TRNSYS list file for sources of warnings or errors before analyzing the results.
The Calculate/Open/List File menu item or the List File toolbar icon ( ) allows users to access the
Error Manager, which analyzes and parses the list file which is generated by TRNSYS during a
simulation. The file will be opened in the Error Manager (see Figure 2.4.23-1). This dialog contains all
generated TRNSYS error messages and is the first place to check when the simulation fails to run.
2–46
TRNSYS 18 – Simulation Studio
Time is the time when the message appeared during the simulation.
Unit is the unit number of the component that is responsible of the message (if available).
Type is the type number of the component that is responsible of the message (if available).
2–47
TRNSYS 18 – Simulation Studio
If the type / unit number information is available, double clicking on a row will open the corresponding
component properties to check the validity of the parameters. This information may not be available if an
error cannot be assigned to a particular component (e.g. error in global information, etc.).
In order to create Unit / Type statistics, debug mode (control card #6) must be set to ‘true’. Otherwise,
these tabs are not available.
Note that at the bottom, check boxes are available for filtering displayed messages.
This tab contains a table at the top which summarizes time of calculation spent for each unit.
The check box at the bottom can be used for filtering displayed rows, depending on the selected unit
number.
This tab is only available if debug mode (control card #6) must is set to ‘true’.
2–48
TRNSYS 18 – Simulation Studio
The check box at the bottom can be used for filtering displayed rows, depending on the selected type
number.
This tab is only available if debug mode (control card #6) must is set to ‘true’.
2–49
TRNSYS 18 – Simulation Studio
2–50
TRNSYS 18 – Simulation Studio
2.5. Variables
An important step in the creation of an assembly in Simulation Studio is the specification of the required
variables for each component model. The specific variable (input, output, parameter, and derivative)
window can be accessed in the assembly panel by double-clicking the desired model icon. The
parameters, inputs, outputs and derivatives are all available in a single window using a tabbed view. The
user is required to specify all the parameters, the initial values for all the inputs, and any derivatives that
may be present in the model. The output window is just for informational purposes. Failure to provide any
of this information to the component model will result in default information being used for the component.
The different variable tabs contain some unique features, but are all very similar in look and operation.
The inputs window for a TRNSYS radiation processor is shown in Figure 2.4.24-1. Each variable set
contains important variable information organized into rows of data. Each row contains:
The name of the variable. Connected input variables names are written in black, while non
connected variables are blue.
An input box containing the current value for this variable. This value may be changed only if the
variable is unlocked. The new value for the variable must lie within the bounds specified by the
author of the component model.
If a specialized, external program (a so-called plug-in) is available to edit the variables of a component,
an icon representing a magic stick ( ) appears in the bottom-left corner of the variable window. Pushing
this button will activate open the external application. An example is the function editor for type 14 (under
Utilities/Forcing functions).
2–51
TRNSYS 18 – Simulation Studio
If the user wishes to lock all the variables, a single click on the Lock/Unlock All button ( ) will perform
the task. Clicking again on the Lock/Unlock All button will unlock all the variables in the window.
The locking of a parameter, input, or derivative has important effects if TRNEDIT mode is used
(Assembly/Control Cards/Write TRNEDIT commands; see the TRNEdit manual for details). An
unlocked parameter or unlocked initial value of an unconnected input will be written to the generated
2–52
TRNSYS 18 – Simulation Studio
TRNSYS input file in TRNEDIT format. Only these variables that are written in TRNEDIT format can be 1)
changed by a user in the TRNEDIT program and 2) put into a parametric table in TRNBuild. Therefore,
the decision to leave a parameter locked or unlocked should be made with some thought.
To change the current value for a variable, the user must click in the input box containing the current
value and enter a new value. Pressing the arrow keys or TAB key will place the cursor in the next value to
edit. This value may be changed only if the variable is unlocked. The new value for the variable must lie
within the bounds specified by the author of the component model. The output window does not contain
this input box for obvious reasons.
To change the units for a variable, the user must select the current unit. By clicking on the current unit
with the mouse or by selecting "Alt" + Down-Arrow will make the drop down menu appear. A pop-up
menu will appear with available choices of units for this variable (based on the dimension of the variable).
Choose the new unit and the box will disappear. The value of the variable will change to reflect your new
choice of units. Users do not have to worry about specifying a variable in the correct unit system. The
Simulation Studio program will automatically convert the variable to the correct set of units as required by
the TRNSYS simulation program. The units required by the TRNSYS program can be seen if the More
button is pressed. The required unit is that unit shown in the 'Unit' input box.
Clicking on the more button will bring up a window of detailed information on the variable. A sample
Variable Detail window is shown in Figure 2.5.2-1.
If a user wishes to use a TRNSYS equation name, or constant, as the value for a parameter or the initial
value of an input, the Type button should be pressed and the variable type changed from its current
status to "string". This will allow the user to type the name of the equation or constant into the value input
2–53
TRNSYS 18 – Simulation Studio
box. Care should be taken when using equation names as parameters or initial values of inputs as time-
varying equations will cause problems with the TRNSYS equation solver. Please refer to “Volume 7
TRNEDit: Editing the Input File and Creating TRNEDIT Applications” for more information on equations
and constants. Users wishing to use equations as inputs to a component are required to use the
equations component (Assembly / Insert Equation command). Users may also change the units for this
variable in this window. Refer to the description of the Variable Detail window contained in the Proforma
chapter of this manual for more information (section 2.3).
In many components, there are special cards to be filled in, cycles to be specified, or external files to be
specified and comments. These topics are discussed below. Detailed information about special cards,
cycles, and external files can be found in the "Proforma" section of this manual.
2.5.4. Cycles
In many components, the number of parameters, inputs, outputs, or derivatives depend on the answer to
a question posed to the user. Users must enter a number in the input box provided that lies within the
specified validity range. An example of a cycle is shown in Figure 2.5.4-1.
2–54
TRNSYS 18 – Simulation Studio
In some cases, the ‘size’ of a cycle (the number of variables contained in it) may also be determined by
the value of another parameter.
For some special models, such as the multi zone building model (type 56), the number as well as the
names of the variables depend on some external file (e.g., the building description file). The inputs and
outputs of these components adapt to the contents of such an external file. For example, if the user adds
an additional thermal zone to a building in TRNBuild, additional default outputs (such as the zone
temperature) will be added to the list of outputs. The right-mouse-click menu ‘Update building variable list’
can be used to update these lists.
In the case of the coupling with the air flow simulation tool COMIS (type 157), the output variable names
will automatically adapt as a function of certain parameters. For example, setting parameter 8 of type 157
(‘Output-1’) to ‘2.3’ will cause the first output of this component to be named
‘Fma 2->3 (Coupling flow from COMIS zone 2 to COMIS zone 3 [kg/h]) -1’
The user may wish to browse for the proper file on the hard drive. The browsing window can be opened
2.5.6. Comment
Comment can be specified in the comment tab (see Figure 2.5.6-2). This comment will be written to the
TRNSYS input file.
A plug-in path can also be specified. A plug-in is an executable file (.exe) that can be used to edit
component properties. It can be graphical and as complex as needed (see Appendix 2 How to create new
Plug-ins).
2–55
TRNSYS 18 – Simulation Studio
2–56
TRNSYS 18 – Simulation Studio
2.6. Connections
With the specification of the values for the variables in the component models complete, it is important
that users specify how information flows from one component to another. In Simulation Studio, this
information flow is indicated by a link between two components in the Assembly Panel window. However,
the link shown on the assembly panel is purely informational. Users must specify the details of the link
between two components to actually flow information from one component to another. To specify the
details of a link between two components, the Connections window is used. The Connections window is
opened when the user double-clicks on the link between two components (while the Select tool is
active) or use mouse right click and Edit connections with....
The Connections window contains two tabs (see Figure 2.6.1-1 and Figure 2.6.1-2), “Classic” and
“Table”. The first tab is the classic one used in previous version of Simulation Studio, the second one is a
table which summarizes all connections involved between the two connected components. Both tab are
dependant and updated depending on user interactions on each tab.
Each tab has two columns of variables. The first column contains the outputs of the first component
model while the second column contains the inputs to the second component model. For reference, the
names of the component models being linked appear above in the title bar of the Connections window.
Any input that is left unconnected in a component after all connections have been made to this
component will be assumed to be constant at its initial value for all time.
In the classic tab, to specify the information flow for these two components, users must connect the
outputs of the first component (left-side) to the required inputs of the second component (right-side).
Inputs and outputs that have been connected, either in this window or in another Connections window,
will be listed in black. Inputs and outputs which have not yet been connected will be colored blue.
Remember, in TRNSYS, inputs can have only one connection while outputs may have several
connections. Highlighted links will appear in red. To the right of the inputs column are input boxes for the
specification of the initial values of the inputs. The initial values of the inputs could be entered here or in
the inputs tab of the Variables window. To change the initial values, press the button for the Select tool to
change from the connection tool (which is the default tool). Then, click on the initial value that you wish to
change. To change the initial values in the Variables window, refer to the "Variables" section of this
manual for more information.
In the table tab, only connections are displayed. In other words, if no connections are available between
the two involved components, no line will appear in the table. To specify the information flow for these two
components, users must add a line and specify the output (left combo box) and input (right combo box).
Then, the classic tab is also updated and a new connection appears.
Clicking on the name of an unconnected output (left column) and then clicking on the name of an input
(right column) will draw a line between the input and the output. These two variables are now connected.
Inputs may only be connected to one output, but outputs may be connected to many different inputs.
Simulation Studio will only allow users to connect variables of the same dimension, i.e. 'temperature' to
'temperature'. Inputs that have already been connected in a previous connection window cannot be used
2–57
TRNSYS 18 – Simulation Studio
in this connection window and will be colored black. This is done to avoid linking an input to two or more
different outputs.
Clicking on the Link button ( ) will add a new line (i.e. a new connection) between the two
components. By default, the connection is created between the two first compatible variables found (i.e.
the two variables have the same dimension and unit). Once the connection is added, it can be modified
by selecting other variables in the corresponding combo box (for input or output variable).
2–58
TRNSYS 18 – Simulation Studio
Sometimes, it is difficult to determine (because of many crossing lines) the connection location.
Therefore, if the user clicks on either an input or output that is already connected, this will “highlight” the
link. Both the connected input and output names as well as the link line will change color to red. The use
of the align button ( ) will align the elements in the selected connection for easier visualization.
Variables can be filtered by unit using the popup menu on top of the window.
Variables can be sorted using ‘natural’ order (as defined by the component’s author and used in the input
file and documentation, use radiobutton ‘1-2-3’) or in alphabetic order (radiobutton ‘A-Z’).
Clicking on the row header will select the corresponding connection. Then, the row is highlighted in black.
2–59
TRNSYS 18 – Simulation Studio
The Delete Connection button in the Connection window ( ) allows the user to delete an input-output
connection.
Clicking on either the name of the input or the name of the output will highlight the connection (change
the connection line and the other variable name to the color red). The user can then delete the line joining
the two variables by pressing the Delete connection button. This action deletes the information flow
between these two variables.
Clicking on the row header will select the corresponding connection, which can be deleted by clicking on
the Delete Connection button.
Double-clicking on a variable name is used to view detailed information about a particular input or output.
Double-clicking on the name of an input or output will open the Variables window as shown in Figure
2.4.24-1. Then, the user can press the "More" button for the input or output about which they are
interested in getting detailed information.
The user can delete all the links by clicking on the Delete All Links button ( ) on the left of the
window.
The button on the bottom of the connections window ( ) is used to define how a link between two
components will move when one of the components, or the link itself, is moved. Depending on if the
button is "pressed" or not, it determines if the link will follow default positions or user-defined positions.
This can also be changed from the right-click menu of the link in the Assembly Panel.
2–60
TRNSYS 18 – Simulation Studio
Figure 2.6.6-1: Default position for links Figure 2.6.6-2: User defined positions for links
The link property tool ( ) will close the connections window and open the link’s property window. The
‘line’ tab of this window can be used to adjust graphical attributes of the line representing the link.
2–61
TRNSYS 18 – Simulation Studio
2.7. Equations
A very useful feature in TRNSYS is the ability to define equations within the input file which are not in a
component. These equations can be functions of outputs of other components, numerical values, or
previously defined equations. These equations can then be used as inputs to other components, or as
parameters, initial values of inputs, or derivatives if the equations are time independent. Refer to “Volume
7 TRNEDit: Editing the Input File and Creating TRNEDIT Applications” for more information on the use of
equations. In Simulation Studio, the use of equations is most easily accomplished by using a special
equations component. This equations component can be placed in an assembly or saved like any other
component.
The equation component will not be represented in the generated input file by a UNIT, TYPE statement.
Rather, the information contained in this component will be placed in an EQUATIONS statement within
the TRNSYS input file. The user can specify the location of the equations in the Control Cards window.
Different blocks of equations can be placed anywhere within the input file and are arranged just like
different components.
To add equations to an opened assembly panel, select Assembly/Insert New Equation. When put in
place in the assembly panel, the equations component can be linked to the outputs and inputs of all other
components as if it were a normal component. Double-clicking on the "Equation" icon will open the dialog
box used to create the equations. This window can be seen in Figure 2.6.6-1.
A list of variables that are used in equations (intermediates) or outputs that are defined in the
equations component (list box located in upper right corner)
A list of variables that are inputs to the equations (upper left corner)
A box that will display the current variable being defined by an equation (middle left)
TIME (the current simulation time), START (the simulation start time defined in the control cards),
STOP (the simulation stop time defined in the control cards), and STEP (the simulation timestep
defined in the control cards) are included with the special operators.
A button ”Edit all equations” which allows to edit all equations defined by this component at the
same time in a text editor
The variables that are defined in the equations component can be thought of as outputs from the
equations model. These outputs can then be linked to inputs of other components. Likewise, the variables
defined as inputs to the equations will be displayed as inputs to this "equa" component and can be linked
to the outputs of other components.
2–62
TRNSYS 18 – Simulation Studio
1) Decide what variable names will be inputs to these equations and what variables will be outputs from
these equations.
2) Click on the "Add a new input variable" button next to the inputs box ( ). It is usually best to
rename the new input variable with a meaningful value. The equations in the "equa" component can be
saved and used in future projects so the more memorable the name is, the better it is.
3) Once all the necessary inputs are defined in the input box, do the same for output variables in the
upper right hand box. Again, click on the “Add a new output variable" button and enter an appropriate
name for this output variable.
2–63
TRNSYS 18 – Simulation Studio
4) The next step is to define the relationship between an output variable and one or more input variables.
Therefore, select an output variable by clicking on it. Then, click on the "Select the output for edition"
button ( ).
5) Now, the desired output should appear in the middle left box. The user has several options to enter the
equation:
Click on the TRNSYS special operator buttons to place them in the equation box.
Select an input or previously defined output and then click on the "Place in equation" button ( ) to
place it in the equation.
Simply type in the equation box. Simulation Studio is monitoring what is typed. If it does not recognize a
variable name as either an input, an output, or a special operator, then the variable name is displayed in
red. As a variable name is typed into the box, the text will be red until completely entered.
6) Close the Equation window and make links to other components to connect the inputs and outputs.
The equation component is just as any other component at this point.
Figure 2.6.6-2 demonstrates the completion of an equation entered into the window.
Note that user can specify a plug-in path to manage its equation with a plug-in (see Appendix 2 How to
use a plug-in).
2–64
TRNSYS 18 – Simulation Studio
2–65
TRNSYS 18 – Simulation Studio
2.8.1.1. File/New
The New command creates a new empty project, component, or a pre-configured project from a template
in Simulation Studio. A wizard dialog box with a list of options (see Figure 2.8.1-2) allows choosing the
type of object to create: Empty TRNSYS Project, New Component, Solar Hot Water System,
Simplified Building Project, Multizone Building Project and Coupled MATHIS project. Depending on
what kind of new item is created, different events occur.
If File/New/New Component is selected and Create button clicked, a blank component Proforma is
created. This Proforma is entitled "Component1". Into this Proforma, the user should type all information
about the component. See the discussion later in this manual for details about the Proforma (section 2.3).
When the user has finished with the Proforma, it can be saved using the Save menu item within the
Proforma window. Note that it is important where the component is saved as the Direct Access menu will
locate the model based on its location on the hard disk. All Proformas should be saved under
.\Trnsys17\Studio\Proformas. This is further described in the discussion on the Direct Access Menu
(section 2.2.3). Note also that the standard ending for Components is *.tmf (short for TRNSYS Model
File). It is important that the user follow this convention.
2–66
TRNSYS 18 – Simulation Studio
If File/New/Solar Hot Water System OR File/New/Building Project (simplified) is selected and Open
button clicked, example project is opened showing how to describe this kind of project. Components and
connections can be modified later to adapt to user project.
If File/New/Building Project (Multizone) is selected and Next button clicked, a step by step wizard is
launched and allow to set all parameters for a multizone building project. All these parameters could be
modified later. (see Appendix 3 How to use the Wizard).
If File/New/3D Building Project (Multizone) is selected and Next button clicked, the user is prompted
for a .idf file to import. IDF files can be created using a modified version of the Open Studio pluging for
Google SktechUp™ available free of charge. (See the type56 manual for details).
If File/New/New Coupled MATHIS is selected and Next button clicked, a step by step wizard is launched
and a coupled Multizone building and MATHIS air flow simulation project will be created. The assistant
will help you set up a multizone building project, including the building description AND an the air flow
network.
2.8.1.2. File/Open
The Open command opens either an existing Project or Component file in Simulation Studio. Depending
on what kind of item is opened, different events occur.
If File/Open is selected, Simulation Studio displays the Open dialog box shown in Figure 2.8.1-3. The
Files of Type box will default to listing the *.tpf files, Proforma files (*.tmf), COMIS Project Files (*.cpf)
and all files (*.*) can also be displayed.
2–67
TRNSYS 18 – Simulation Studio
2.8.1.3. File/Close
The Close command closes the active TRNSYS project. Several TRNSYS projects, represented by their
Assembly Panels, can be open simultaneously. The Close command closes the project with the active
window. If your project has not been saved, Simulation Studio will ask you if you want to save the file
before it is closed.
2.8.1.4. File/Save
The Save command saves the active project to disk. If, for example, the Save command is issued with a
Assembly panel project named TEST.TPF as the active window, the file TEST.TPF will be overwritten.
Note that the keyboard shortcut CTRL-S will also save the project.
2.8.1.5. File/Save As
The Save As command displays the Save As dialog box (see Figure 2.8.1-4). The Save File As input
box is used to enter the desired file name to save the project under or the file-mask for the Files list box.
A file-name mask is a portion of the file name that may identify one or more files in the current directory.
For example, the project-name mask *.tpf would display all files in the current directory with a .tpf
extension. The mask is a useful tool for determining the names of the files that have been previously
saved.
2–68
TRNSYS 18 – Simulation Studio
The file "ModelConfFile.conf" contains the mapping rules that determine which Simulation Studio
Proforma is used for each instance of a UNIT - TYPE combination in the input file that is being imported.
To add additional components for the input-file-reading capability, the Proforma for each component
needs to already exist in the Simulation Studio data directory. Then, the user needs to add additional
entries in the "ModelConfFile.conf" file so that Simulation Studio will know to use the new Proformas
when it encounters that Type number in the TRNSYS input file that it is processing.
2–69
TRNSYS 18 – Simulation Studio
2.8.1.12. File/Report
The Report command allows the user to generate a report that summarizes all projects properties
(parameters, connections, components used...). A dialog is displayed to choose the target file name, and
the file is edited in the default editor. This command is only visible if a project is the current Active
Window.
2.8.1.13. File/Print
The Print command prints the contents of the current active Assembly window using the information
provided in File/Print Setup. The Print menu item is removed when no Assembly panel is present. The
printer output may be directed to the printer or to a file as decided in the Print Setup (see Figure 2.8.1-5).
2–70
TRNSYS 18 – Simulation Studio
The Print command preview allows to display a page as it would appear on paper before actually printing
it.
2.8.1.18. File/Settings
This command allows the user to change the Simulation Studio and TRNSYS configuration. The following
setup menu tabs are available:
2–71
TRNSYS 18 – Simulation Studio
2–72
TRNSYS 18 – Simulation Studio
2.8.1.18.2. FILE/SETTINGS/PROJECT
The settings on this tab set the line colors for links (both with and without internal connections) and the
color for when an item (link or component icon) is selected. This screen also allows the user to include
additional standard layers. These layers are then available in the current Assembly panel as well as
future projects. See the chapter on the Assembly Panel to learn more about using Layers within
Simulation Studio to organize the viewing of component icons. To add a new Layer, type the desired
name in the text box in the Layers: box, then select "Add" to include it in the main list of layers. The
dimension of the project desktop can be specified in the Project size box in the lower left corner. It should
be increased to add room for additional components.
The size of the icons in the Direct Access Toolbox can be set in the Icon size of Direct Access bar in the
lower right corner. You may have to restart Simulation Studio for the new icons sizes to be active in the
Direct Access Toolbox.
Autoscroll can be enabled/disabled for project or connection dialog using the check box at the bottom
right
2.8.1.18.3. FILE/SETTINGS/DIRECTORIES
The Directories tab allows the user to select directories and file names for launching and configuring
various tools within Simulation Studio (see Figure 2.8.1-8). For example, you can select a different editor
than Notepad by changing the path and filename by the “editor” entry. Except for the editor where
“Notepad.exe” can be specified, all path are relative to the Trnsys installation directory if the path does
not start with a drive name or a “\”.
2–73
TRNSYS 18 – Simulation Studio
Text Editor: The text editor used throughout the system; if this line is left
blank, the MS Windows Notepad will be used. Users are free
to specify any text editor here or even a word processor.
TRNEDIT Application: The program file of the TRNEDIT front end program.
FORTRAN Environment: The program file for the Fortran Development tool used and
provided separately by the user.
C++ Environment: The program file for the C++ Development tool used and
provided separately by the user.
Base Icon Folder: The directory in which the component icons are located; this
allows users to switch between different sets of component
icons such as the DIN standard icons
Base Library Folder: The directory in which the component models are stored; the
direct access tree will use this directory to construct its
structure.
Default project Folder: The directory in which new projects are stored by default;
projects can be saved anywhere on the hard disc.
2.8.1.18.4. FILE/SETTINGS/COMPILER+OTHERS
This option allows users to specify the proper command line statements that will be run when the
Simulation Studio menu commands Tools/Rebuild TRNSYS, and Tools/Execute User Command are
chosen.
The full command line statements, including path names and file extensions, should be entered in these
fields as shown in Figure 2.8.1-9. The Rebuild TRNSYS command executes the command line in the box
titled "Linker Command". It is intended to be the command which will rebuild the TRNSYS DLL
(TRNDll.dll). For more information on compiling Fortran routines and rebuilding the TRNSYS DLL, refer to
“Volume 8 – Programmers Guide”. The User Command field is intended as a convenient way to execute
any desired program or batch file from Simulation Studio. If desired, the Rebuild TRNSYS command can
be used for this purpose as well.
Modern Integrated development environments (IDEs) such as Intel Visual Fortran or Microsoft Visual
Studio offer advanced functionalities to create program code, compile and debug it. Most users prefere to
work within their respective development environment directly, making sure that the compile products
(DLLs) are created in the appropriate Trnsys directories (.\Trnsys17\Exe for TrnDll.dll, subdirectories of
.\Trnsys17\Userlib for user-defined components). Please refer to “Volume 8 – Programmers Guide” for
more information.
This tab also allows to define the behavior of certain aspects of the user interface:
- Open connections when creating link: if this checkbox is checked, the connection window will
automatically be opened when a new link is created in the project window
2–74
TRNSYS 18 – Simulation Studio
- Maximize connection window: if this checkbox is checked, the connection windows will open in
full screen mode
- Show startup screen : if this checkbox is checked, the startup animation is shown each time the
software is started
2.8.1.19. File/Exit
The Exit command exits the Simulation Studio program and returns the user to MS Windows. If a project
has been modified without being saved, a prompt to save the file before exiting will be displayed by
Simulation Studio.
2–75
TRNSYS 18 – Simulation Studio
2–76
TRNSYS 18 – Simulation Studio
2.8.2.7. Edit/Replace
The Replace command allows the user to replace a current component on the Assembly panel with
another component. The user should select a component already existing on the Assembly Panel. Then,
select Edit/Replace which will bring up a dialog. From this dialog, the user should select another
component. This new component will replace the existing component. The advantage of this method is
that existing links will not be broken and the user does not need to re-connect as many links between
components.
2.8.2.9. Edit/Properties...
The Properties... command opens up the "Component Properties" window for the currently selected
component. This property window is shown below and allows you to modify every aspect of the
component icon from the text properties to the position and size of the icon.
2–77
TRNSYS 18 – Simulation Studio
2–78
TRNSYS 18 – Simulation Studio
2.8.3.2. View/Grid
Simulation Studio has a built-in grid for arranging component icons and links within the Assembly panel.
This command turns on and off the visible display of the grid. The grid is on if there is a checkmark next
to the menu item.
2–79
TRNSYS 18 – Simulation Studio
2.8.3.10. View/Toolbars
The Toolbars command will display or hide toolbars which are associated with different windows and can
access quickly the same commands as are available on the pull down menu. The values chosen will be
saved for the next use of Simulation Studio.
2–80
TRNSYS 18 – Simulation Studio
The Direct Access Menu\Refresh Tree refreshes the Direct Access Tree on the right of the main
window. User should use this menu each time a new component is added to the library directory. Once
this menu is clicked, the tree will display the new component.
2–81
TRNSYS 18 – Simulation Studio
2–82
TRNSYS 18 – Simulation Studio
2.8.5.4. Assembly/Lock-Unlock
The Assembly/Lock-Unlock menu command allows the creator of a project to lock certain components
in the assembly panel. These locked components cannot be erased nor modified. When the entire
component is locked, then all parameters and inputs internally are locked. This means that, if TRNEDIT
commands are being written to the TRNSYS input file, they will not be included for this component.
2–83
TRNSYS 18 – Simulation Studio
Clicking on a component node will display its output variables and on a printer or plotter its input
variables.
Displayed properties and available buttons are updated depending on which type of output component is
selected.
Just after selecting a valid output and input, clicking on this button ( ) in the middle of the dialog will
add a new connection between the two components (the assembly panel will be updated in
consequence).
Removing an existing connection is available by clicking on this button ( ) after selecting a valid output
and input connected variables.
Printers and plotters can be added by clicking the Add Printer ( ) or Add Plotter button ( ).
plotter properties: unit name, graph title, left axis properties, right axis properties and number of
plots.
printer properties: unit name, file name, print interval and number of input variables.
2–84
TRNSYS 18 – Simulation Studio
Left or right axis variables can be added using the Add Left Variable ( ) and Add Right Variable
button ( ). Adding a variable to the printer is allowed by clicking on the Add Printer Variable button
( ).
2–85
TRNSYS 18 – Simulation Studio
2–86
TRNSYS 18 – Simulation Studio
2.8.5.18. Assembly/Connections...
This command opens the currently selected link as if it had been double-clicked.
2–87
TRNSYS 18 – Simulation Studio
2–88
TRNSYS 18 – Simulation Studio
2.8.6.4. Calculate/Open
This command allows the user to easily access text files associated with the current project.
Calculate/Open/Input File
The Input File command opens the TRNSYS input file in the editor 1. The file name of the Input file is
shown in the menu as well. The input file shown will be the one which is generated from the active
Assembly panel project.
Calculate/Open/List File
The List File command opens the TRNSYS list file in the editor1. The file name of the List file is shown in
the menu as well. The list file shown will be the one which is generated by running the simulation in the
active Assembly panel project.
Calculate/Open/External Files
The External files command is used to open any of the other files associated with the current TRNSYS
project. Simulation Studio searches the components in the project to see if they have any associated files
(such as data files or output files). A list of these files is shown in the submenu to External Files. The user
can select these files which will be opened in the editor.
1The text editor is, by default, Microsoft Notepad. The user can change this to the editor of their choice,
such as WinCommander. To do this, click on File/Settings/Directories menu item and change the path
and file name for “editor”.
2–89
TRNSYS 18 – Simulation Studio
2.8.7.3. Tools/TRNBuild
This command initiates the TRNBuild program for use with Type 56, the multi-zone building model. Refer
to the TRNBuild manual for details about the program. For ease of use, the TRNBuild directory in the
File/Setup/Directories menu should be changed to Building\TRNBuild.exe before calling this program.
2–90
TRNSYS 18 – Simulation Studio
2.8.7.4. Tools/TRNEdit
This command calls the TRNEdit program, a utility program for displaying TRNSYS input files with a
modified look. TRNEdit is used for sharing TRNSYS simulations with non-TRNSYS users to allow them
to do limited simulations. Please see the TRNEdit manual for more details.
2–91
TRNSYS 18 – Simulation Studio
2.8.8.1. Windows/Cascade
The Cascade option will stack all open files so that a user can see the title bar of each file.
2.8.8.2. Windows/Tile
The Tile command will display all open files in a format where every file takes up a portion of the window
environment.
2–92
TRNSYS 18 – Simulation Studio
2.8.9.1. ?/Help
This command shows the index of the PDF documentation of TRNSYS Simulation Studio. The PDF
document will open separately in your Acrobat Reader application. You can navigate in the document by
clicking in the Table of content. To move forward or backward through the help topics, click on the
available buttons at the bottom. This file contains all other help files from the package. Each file is
accessible from this index file.
When starting simulation Studio for the second time after installation, the update system ask you if you
would like to check for updates automatically. If you choose this option, it is not necessary to use this
menu, as the check will be done automatically once a day.
2–93
TRNSYS 18 – Simulation Studio
2.8.9.3. About...
This command shows the About screen for Simulation Studio (Figure 2.8.9-2). This contains information
about Simulation Studio, the version number and who the registered user is for this copy of Simulation
Studio. Only the person or group indicated on this screen is allowed to use Simulation Studio. Any other
users are using a pirated copy of Simulation Studio.
This ends the section about the main menus. Following are individual sections giving more detail on
various aspects of the Simulation Studio program.
2–94
TRNSYS 18 – Simulation Studio
The menus of the User Dictionary will launch various applications contained in the unit dictionary
program. A detailed description of the unit dictionary functions follows.
2–95
TRNSYS 18 – Simulation Studio
2–96
TRNSYS 18 – Simulation Studio
Temperature K
Mass kg
2–97
TRNSYS 18 – Simulation Studio
Length m
Time s
Illumination cd
Electric Current A
If a user could delete any of the base units and/or dimensions, it would no longer be possible to use some
of the existing units and dimensions, or add units and dimensions to the unit dictionary program.
Therefore, this is not allowed.
1) Launch the Unit Dictionary application by clicking on the Tools/Unit Dictionary menu item in
the main Simulation Studio window.
2) Click with the mouse on the Add button in the Unit Dictionary window. A blank Dimension window
will open up.
3) Fill in the name, "Pressure", and a description of the new dimension; "Pressure is a measure of
the force per unit area", for example.
4) Fill in the standard SI symbol for the unit of pressure. In this case, the standard unit for pressure
is the Pascal which is commonly shown as "Pa". Note: kiloPascals (kPa) would not be an
acceptable choice for the standard SI pressure unit since kPa is a direct multiple of Pa.
= kilogram/square second/meter.
7) In this case the following text would be added to the "In base units" input box:
"kg/m/s/s"
8) The program will automatically format the text into the desired form. Make sure to use the correct
symbols for the base units or the program will not accept the new dimension.
9) Note: At this stage, the new dimension has been added to the unit dictionary. The next steps will
detail how to add a new unit, in this case kPa, to the unit dictionary.
10) Add a new unit by selecting the Add tool button in the Dimension window.
2–98
TRNSYS 18 – Simulation Studio
11) The Unit Definition window will appear similar to Figure 2.8.9-3.
12) Fill in the symbol for this unit, "kPa", and a description of the new unit; "kPa = kiloPascal = 1000
Pascals; a unit of pressure in the SI unit system", for example.
13) Fill in the conversion coefficients required to convert the base units of pressure (Pascals) to
kiloPascals:
15) In this case, "0.001" would be input to the multiplication field and "0.0" would be input to the
addition field.
16) Click OK to exit the Unit window and then OK to exit the Dimension window. The new dimension
and unit are now saved to the Simulation Studio program and may be used in the component
models.
If the option “Search the Internet” is selected, additional results are displayed in a web browser.
The output tab also displays a short report each time a simulation is stared.
2–99
TRNSYS 18 – Simulation Studio
/r run simulation
/q quit
For example, to open the ‘Begin.tpf’ project, create the deck file, run the simulation and then quit Studio,
the following command line can be used:
\Trnsys17\Studio\Exe\Studio.exe /d /r /q \trnsys17\Examples\Begin\begin.tpf
2–100
TRNSYS 18 – Simulation Studio
2–101
TRNSYS 18 – Simulation Studio
2–102
TRNSYS 18 – Simulation Studio
2–103
TRNSYS 18 – Simulation Studio
We have chosen an EXE file format instead of a DLL, because using an EXE file is more flexible for the
user. He doesn't have to match with a specific API and to call a method with thousands of parameters.
Moreover, an EXE file can be easily written any programming language (C++, java or VB for example),
but it will be much more difficult to write a DLL in some of these languages (such as JAVA).
This executable will read values from an exchange file in order to be initialized, and write modified values
to the same exchange file.
The exchange file name will be automatically generated and unique for each instance of type. It will be
passed as an argument to the executable. So, the user will just have to check in the main method of his
EXE for the argv[1] argument which will contain the name of the exchange file including the whole path.
Thus, there is no problem for editing two units at the same time, because exchange files names will be
different.
2–104
TRNSYS 18 – Simulation Studio
This option can also be set for each project. Then, when a project is opened, click on “Assembly/Control
Cards…”. You can change the same option as before, except that the value (true or false) can be
different for each project and saved with the project.
2–105
TRNSYS 18 – Simulation Studio
Either you specify the name in the Proforma itself or in the component properties. If you specify the name
in the Proforma, each component based on this Proforma will know the name.
Just type the name of your plug-in including the whole path in the edit box “Plug-in path”. If the path starts
with “.”, Simulation Studio will look for the plug-in in the installation directory of Trnsys17 and complete
automatically the name.
Then, when you will add a component based on this Proforma to your project, it will know the name of the
plug-in application to launch.
2–106
TRNSYS 18 – Simulation Studio
Just type the name of your plug-in including the whole path in the edit box «Plug-in path».
2–107
TRNSYS 18 – Simulation Studio
2–108
TRNSYS 18 – Simulation Studio
So if you modify the plug-in name, each time you go to another tab, the file name is checked and the
button appears or disappears depending on the file name validity.
2–109
TRNSYS 18 – Simulation Studio
Now, either you work as usual and then you close the dialog, or you click on the new button which
launches the plug-in, taking the name of the file containing all the component values as a parameter (the
exchange file). When the plug-in is launched, the old dialog is closed.
In this example, “FunctionEditor.exe” is launched opening the file with the values of the “type14h”
component (see Figure 2.12.8-3).
The plug-in window is always visible on top of Simulation Studio, just like the ‘old‘ dialogs.
Now, when you close the plug-in, the values are read back by Simulation Studio from the exchange file,
taking into account the new values modified by the plug-in (note: the exchange file is erased when the
plug-in is closed).
2–110
TRNSYS 18 – Simulation Studio
2–111
TRNSYS 18 – Simulation Studio
Then, click on the button to launch the plug-in. If notepad is used as a plug-in, it looks like the Figure
2.12.9-2: the exchange file has been opened as a simple text file in notepad. Equations can be modified
in the notepad.
2–112
TRNSYS 18 – Simulation Studio
INPUTS
Number_Of_Cycles ! [Number of cycles]
Number_of_cycle_1_repetition First_Var_Cycle_1 Last_Var_Cycle_1 !
[CycleRepetition FirstVar LastVar]
Number_of_cycle_2_repetition First_Var_Cycle_2 Last_Var_Cycle_2 !
[CycleRepetition FirstVar LastVar]
…
Number_of_cycle_n_repetition First_Var_Cycle_n Last_Var_Cycle_n !
[CycleRepetition FirstVar LastVar]
Number_Of_Inputs ! [Number of variables]
Input_1 ! Name_1 | Unit_1 | Min_1 | Max_1 | ConnectionState
Input_2 ! Name_2 | Unit_2 | Min_2 | Max_2 | ConnectionState
…
Input_n ! Name_n | Unit_n | Min_n | Max_n | ConnectionState
EXTERNAL_FILES
Number_Of_FileName
File_Name_1 ! Question_1
File_Name_2 ! Question_2
…
File_Name_n ! Question_n
SPECIAL_CARDS
Number_Of_Cards
Card_1 ! Question_1
Card_2 ! Question_2
…
Card_n ! Question_n
COMMENT
Number_Of_Comment_Line
Comment_Line_1
Comment_Line_2
...
Comment_Line_n
2–113
TRNSYS 18 – Simulation Studio
In line “Input_1 ! Name_1 | Unit_1 | Min_1 | Max_1 | ConnectionState”, the value of Input_1 and Unit_1
are the values converted to the Proforma default value.
For example, if an input is a temperature given in °C in the Proforma and given in K in the type, it will be
converted to °C in the exchange file.
This conversion is the same for Inputs, Outputs, Parameters and Derivatives.
The “!” means that the values read after until the end of the line won’t be taken into account by Simulation
Studio when the exchange file will be read back after closing the plug-in dialog.
INPUTS
0 ! [Number of cycles]
9 ! [Number of variables]
20 ! Inlet temperature|C|-Inf|+Inf|Connected
100 ! Inlet flowrate|kg/hr|0.0|+Inf|Connected
10 ! Ambient temperature|C|-Inf|+Inf|Connected
0 ! Incident radiation|kJ/hr.m^2|0.0|+Inf|Connected
0 ! Total horizontal radiation|kJ/hr.m^2|0.0|+Inf|Connected
0 ! Horizontal diffuse radiation|kJ/hr.m^2|0.0|+Inf|Connected
0.200000 ! Ground reflectance|-|0.0|1.0|NotConnected
45 ! Incidence angle|degrees|-360|+360|Connected
0 ! Collector slope|degrees|-360|+360|Connected
PARAMETERS
0 ! [Number of cycles]
11 ! [Number of variables]
1 ! Number in series|-|1|+Inf
5 ! Collector area|m^2|0.0|+Inf
4.190000 ! Fluid specific heat|kJ/kg.K|0.0|+Inf
1 ! Efficiency mode|-|1|3
40 ! Tested flow rate|kg/hr.m^2|0.0|+Inf
0.800000 ! Intercept efficiency|-|0.0|1.0
13 ! Efficiency slope|kJ/hr.m^2.K|-Inf|+Inf
0.050000 ! Efficiency curvature|kJ/hr.m^2.K^2|-Inf|+Inf
2 ! Optical mode 2|-|2|2
0.200000 ! 1st-order IAM|-|0.0|1.0
0 ! 2nd-order IAM|-|-1.0|+1.0
DERIVATIVES
0 ! [Number of cycles]
0 ! [Number of variables]
EXTERNAL_FILES
0
2–114
TRNSYS 18 – Simulation Studio
SPECIAL_CARDS
0
COMMENTS
0
2–115
TRNSYS 18 – Simulation Studio
INPUTS
Number_Of_Inputs
| Name_1 ! ConnectionState
| Name_2 ! ConnectionState
…
| Name_n ! ConnectionState
OUTPUTS
Number_Of_Outputs
Output_1 | Name_1 ! ConnectionState
Output_2 | Name_2 ! ConnectionState
…
Output_n | Name_n ! ConnectionState
Everything after ‘!’ can be skipped, Simulation Studio will add it back next time the file is passed to the
EXE.
INPUTS
8
|IColl_d!Connected
|QuColl_d!Connected
|QDHW_d!Connected
|QAux_d!Connected
|IColl!Connected
|QuColl!Connected
|QDHW!Connected
|QAux!Connected
OUTPUTS
4
QuColl_d / (5*IColl_d+1e-6)|EtaColl_d!Connected
1 - ( QAux_d / (QDHW_d + 1e-6) )|FSol_d!Connected
QuColl / (5*IColl+1e-6)|EtaColl!Connected
1 - ( QAux / (QDHW+ 1e-6) )|FSol!Connected
2–116
TRNSYS 18 – Simulation Studio
2.13.1. Description
The wizard is launched after clicking in the main window on File\New or on the New ( ) button.
2–117
TRNSYS 18 – Simulation Studio
Once the right item is selected in the list (i.e. Building Project (multizone)), clicking on the Next button
( ) will go to next step.
The rest of this explanation shows the Building project (multizone) wizard, because it is the most complex
one.
Once the floor plan is drawn, clicking on the next button will go to next step.
2–118
TRNSYS 18 – Simulation Studio
Note that height is the same for all cells. If the width is modified, it is modified for all cells in the same
column. If the depth is modified, it is modified for all cells in the same row. More complex geometries must
be adapted in TRNBuild later.
Once all zone properties are defined, clicking on the next button will go to next step.
2–119
TRNSYS 18 – Simulation Studio
On the top right, the building rotation is asked in degrees. The angle is positive for North to east rotation
and negative for North to West.
On the bottom edit box, the weather data file path must be set. The Browse button can be used to select
a file.
Once all values are defined, clicking on the next button will go to next step.
2–120
TRNSYS 18 – Simulation Studio
Mechanical and natural ventilation can be added by checking the corresponding check boxes. Depending
on the selection, more or less boxes are displayed and must be set. Activating these options will create
more complex simulation projects, adding components as required.
For the mechanical ventilation, the rate must be set in 1/h. Two values are asked, one for periods where
the building is occupied and another for periods where the building is unoccupied. A default schedule
defining these periods is applied and can be adapted in TRNBuild later.
Also the humidity of supply air in percentage and the supply temperature in degree C are asked.
Finally, at the bottom, natural ventilation properties are defined. On the left, the natural ventilation rate is
given, in 1/h. On the right, additional dependant temperature dependant ventilation can be defined. If this
option is checked, additional ventilation will be simulated as soon as the temperature defined in
‘ventilation start’ is reached. On the other hand, this additional ventilation will stop if the temperature
drops below the value defined under ‘Ventilation stop’.
Once all values are defined, clicking on the next button will go to next step.
2–121
TRNSYS 18 – Simulation Studio
In this step, the characteristics of the heating and cooling equipment built into TRNBuild can be defined.
Although the settings defined here apply to all zones, separate heating and cooling types are defined.
This allows the user to easily adapt the heating and cooling characteristics of each zone separately in
TRNBuild later.
The cooling set point temperature can be defined by the user (in °C) or defined as depending on the
ambient temperature. In this second case, temperature at which cooling is to start will ‘follow’ the ambient
temperature using the formula T_Cool = (T_Ambient + 49) /3, but not exceed 27 degrees nor fall below
25 degrees. An example is shown below. This formula can be adapted in the Simulation Studio’s
Assembly Panel later.
2–122
TRNSYS 18 – Simulation Studio
In this step, internal gains due to occupants and lighting can be defined.
A simple lighting control strategy based on the total horizontal solar radiation is automatically defined.
This control strategy can be later on refined in the Simulation Studio’s Assembly panel.
2–123
TRNSYS 18 – Simulation Studio
This step allows to define fixed shading elements (overhangs and wing walls) for each of the four main
orientations of the building.
The user must click on the orientation (North, East, South or West) for which he wished to modify the
fixed shading. Then, fixed shading can be activated for the selected orientation by checking the ‘Active’
checkbox. A given orientation can have no fixed shading, an overhang, a wing wall or both, depending on
the status of the checkboxes in the lower part of the window. The receiver dimensions (window height
and width) apply to all shading elements in this orientation.
Once all orientations are defined, the user can ‘walk through’ the settings by successively selecting all
orientations again, to check that the settings are correct.
2–124
TRNSYS 18 – Simulation Studio
This step allows to define fixed shading elements (such as stores or blinds) for each of the four main
orientations of the building.
The user must click on the orientation (North, East, South or West) for which he wished to modify the
movable shading. Then, movable shading can be activated for the selected orientation by checking the
‘Active’ checkbox. Moveable shading for a given orientation is characterized by the total radiation
thresholds for which the element will be opened or closed, as well as the ‘Maximum shading’ settings,
which define the element’s characteristics in case it is closed.
Once all orientations are defined, the user can ‘walk through’ the settings by successively selecting all
orientations again, to check that the settings are correct.
2–125
TRNSYS 18 – Simulation Studio
Once this dialog appears, all necessary parameters for the creation of the project have been entered.
When the user pushes the ‘Create project!’ button, the Simulation Studio will
2. open the TRNBuild program to translate this BUI file to the internal files
necessary for simulation (.BLD and .TRN files), and close TRNBuild
3. create a simulation project (stored in a .TMF file) and open it in the Simulation
Studio.
The user should now check that the project runs correctly (by hitting F8). From this point, both the
simulation project (in the Simulation Studio) and the building description (in TRNBuild, using the ‘Edit
building’ right-mouse-menu in the Simulation Studio) can be modified, adapted and extended to fit the
user’s needs.
2–126
TRNSYS 18 – Simulation Studio
The wizard uses template deck and .b17 files to create simulation projects. The user may adapt these
templates to his needs. They are located in
.\Trnsys17\Studio\Templates\MultizoneBuilding
The file MultizoneWizard.dck pilots the creation of the multizone building project, while
MultizoneWizard.b17 is used to create the building description file.
Care should be taken when these templates are modified, as such changes can provoke the generation
of incorrect projects.
The template files contain variables which will be replaced by the appropriate commands by the wizard,
based on user input. For example, $$VERSION will be replaced by the TRNSYS version used. Before
modifying the templates, we advice users to study the existing templates and the variables they contain
first, by generating some example projects and comparing them to the templates.
It is also a good idea to keep a copy of the original version of the templates.
2–127