0% found this document useful (0 votes)
53 views

09 Tutorials

Uploaded by

Oum Solayman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

09 Tutorials

Uploaded by

Oum Solayman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 220

TRNSYS 18

a TRaNsient SYstem Simulation program

Volume 9

Tutorials

Solar Energy Laboratory, Univ. of Wisconsin-


Madison
http://sel.me.wisc.edu/trnsys

TRANSSOLAR Energietechnik GmbH


http://www.trnsys.de

CSTB – Centre Scientifique et Technique du


Bâtiment
http://software.cstb.fr

TESS – Thermal Energy Systems Specialists


http://www.tess-inc.com
TRNSYS 18 – Tutorials

About This Manual


The information presented in this manual is intended to provide tutorials on using TRNSYS 18. This
manual is not intended to provide detailed reference information about the TRNSYS simulation software
and its utility programs. More details can be found in other parts of the TRNSYS documentation set. The
latest version of this manual is always available for registered users on the TRNSYS website (see here
below).

Revision history
2004-09 For TRNSYS 16.00.0000 2005-02 For TRNSYS 16.00.0037
2006-01 For TRNSYS 16.01.0000 2006-06 For TRNSYS 16.01.0002
2007-03 For TRNSYS 16.01.0003 2009-11 For TRNSYS 17.00.0006
2010-04 For TRNSYS 17.00.0013 2012-03 For TRNSYS 17.01.0000
2014-05 For TRNSYS 17.02.0000 2018-02 For TRNSYS 18.00.0008

Where to find more information


Further information about the program and its availability can be obtained from the TRNSYS website or
from the TRNSYS coordinator:

TRNSYS Coordinator Email: [email protected]


Thermal Energy System Specialists, LLC
22 North Carroll Street – suite 370
Madison, WI 53703 – U.S.A.

TRNSYS website: http://sel.me.wisc.edu/trnsys

Notice
This report was prepared as an account of work partially sponsored by the United States Government.
Neither the United States or the United States Department of Energy, nor any of their employees, nor any
of their contractors, subcontractors, or employees, including but not limited to the University of Wisconsin
Solar Energy Laboratory, makes any warranty, expressed or implied, or assumes any liability or
responsibility for the accuracy, completeness or usefulness of any information, apparatus, product or
process disclosed, or represents that its use would not infringe privately owned rights.

© 2017 by the Solar Energy Laboratory, University of Wisconsin-Madison

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 the Solar Energy Laboratory, University of Wisconsin-Madison.

9–2
TRNSYS 18 – Tutorials

TRNSYS Contributors

S.A. Klein W.A. Beckman J.W. Mitchell

J.A. Duffie N.A. Duffie T.L. Freeman

J.C. Mitchell J.E. Braun B.L. Evans

J.P. Kummer R.E. Urban A. Fiksel

J.W. Thornton N.J. Blair P.M. Williams

D.E. Bradley T.P. McDowell M. Kummert

D.A. Arias M.J. Duffy

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.

Contributors to the TRNSYS Simulation Studio are listed in Volume 2.

9–3
TRNSYS 18 – Tutorials

TABLE OF CONTENTS
9. TUTORIALS 9–5
9.1. Using TRNSYS examples 9–5
9.1.1. Opening and running a simple example 9–5
9.1.2. Opening and running an example with the Multizone building model (Type 56) 9–13
9.1.3. More TRNSYS Examples 9–16
9.2. Creating a Simple TRNSYS project 9–17
9.3. Creating a building project with 3D Data Model 9–45
9.3.1. Introduction 9–45
9.3.2. Using T3D (SketchUp Plug-in) with 3D Building Wizard 9–47
9.3.3. Using T3D (SketchUp Plug-in) without 3D Building Wizard 9–85
9.3.4. Using TRNLizard (Rhino/Grasshopper) 9–176
9.4. Creating a Building Project without 3D Data Model 9–176
9.4.1. Using Building Wizard 9–176
9.5. Temperature Level Control Tutorial 9–185
9.6. TRNSYS Multizone Slab Model Tutorial and Example 9–196
9.7. Using TRNEdit and creating a distributable (TRNSED) application 9–207
9.7.1. Starting point: TRNSYS Studio project 9–208
9.7.2. Editing the TRNSED file in TRNEdit 9–210
9.7.3. Some refinements 9–213
9.7.4. Adding pictures, links and multiple tabs 9–216
9.7.5. Creating the redistributable application 9–218
9.8. Running TRNSYS in batch files or in hidden mode 9–220
9.8.1. Running TRNSYS in batch mode 9–220
9.8.2. Running TRNSYS in Hidden mode 9–220

9–4
TRNSYS 18 – Tutorials

9. TUTORIALS
This manual includes tutorials that will show you how to use and the make the most of TRNSYS.

9.1. Using TRNSYS examples


This section explains how you can quickly get started using TRNSYS by opening and running the
examples provided with the distribution. You can then start creating your own projects by making changes
to those examples.

9.1.1. Opening and running a simple example


Launch the simulation Studio by using the created shortcut or by browsing to %TRNSYS18%\Studio\Exe
and launching the Program called Studio.exe

Go to File/Open and select %TRNSYS18%\Examples\Begin\Begin.tpf. A TRNSYS project consists of


components (e.g. a solar collector, a data reader, a printer) linked together.

Figure 9-1: The "Begin" example

9–5
TRNSYS 18 – Tutorials

Note: Each component is assigned two numbers: a Type and Unit numbers. If you press
the key F2 you will see these two values for all of the components present in the
simulation.

9.1.1.1. Component configuration


You can check a component's configuration by double-clicking its icon. This will open a window with
multiple tabs. When you open the window, the foremost tab shows a list of parameters and their value
(the solar collector parameters are shown in Figure 9-2). You can see additional information about the
parameters by clicking the "More" button.

Figure 9-2: The Solar Collector Parameters

You can explore the different tabs to view the component's inputs, outputs and derivatives (if any –
derivatives are capacitive variables of the component, e.g. nodes representing a given amount of water in
a storage tank).

Note: The values and units displayed in the input tab give the initial values for the
corresponding inputs. They are overridden during the simulation if those inputs are
connected to other components or equations.

9.1.1.2. Connections
If you double-click on a link between two components, you will open a new window that lists all input-
output connections inside that link. Figure 9-3 shows the link between Type 15 (weather data reading and
processing) and Type 1b (solar collector)

9–6
TRNSYS 18 – Tutorials

Figure 9-3: Example of connection window


If there are many available inputs and outputs, the lists will be longer than what can be displayed. You
can resize the window and/or use the scrollbars.

Note: The Simulation Studio can be set to auto-scroll in the connection window (as well
as in the project window). If you want to enable/disable that mode, go to
File/Settings/Project and check/uncheck the "auto-scroll" boxes.
It may be easier to make new connections after aligning a given output with the input to which it is
connected. To do this, click on the align icon on the left (see Figure 9-4 for an example).

9–7
TRNSYS 18 – Tutorials

Figure 9-4: Aligned connection window

You can also decide to show only the inputs and outputs that have given dimensions. Figure 9-5 shows
the results when "angle" is selected. Note that inputs/outputs with "any" or "unknown" dimensions will
always be displayed.

9–8
TRNSYS 18 – Tutorials

Figure 9-5: Filtered connection window

Alternatively, you can use the table view to display and manage connections: Just switch from the
"Classic" tab to the "Table" tab. The result is shown in Figure 9-6.

Figure 9-6: Connections window – Table tab

9.1.1.3. Running the simulation and viewing the results


You can run a simulation by pressing the "F8" key, which is the shortcut for "Calculate/Run Simulation".

9–9
TRNSYS 18 – Tutorials

THE ONLINE PLOTTER

If at least one "online plotter" component is present in the simulation, an online plot will be displayed
during the simulation. The online plotter offers several features that will help you analyze the simulation
results while it is running and after it is done.

You can interrupt / resume the simulation while it is running by right-clicking anywhere in the plot, by
using the "F7" and "F8" keys, or using the "Calculation/Stop" and "Calculation/Resume" menu entries.
The "Pause at…" command is also very useful when you want to diagnose some problems occurring at a
given time in a simulation.

When the simulation is stopped, you can use the "Plot options" menu to change the plot background from
black to white, or increase the line thickness. You can also change the left and right Y-axis limits by
clicking on the axes themselves, which will display a dialog box (see Figure 9-7). Please note that
changes to those limits will be lost if you re-run the simulation. You should change the online plotter
parameters in the simulation itself (double-click on the online plotter icon) if you want changes to be
permanent.

Figure 9-7: Online plotter in a paused simulation with Y-axis control box

You can hide or show any variable in the plot by clicking on its name in the legend fields. For example
clicking the Qaux variable name at the top left of Figure 9-7 would hide/show the QAux plot.

ANALYZING THE SIMULATION: ZOOMING AND DISPLAYING NUMERICAL VALUES

You can zoom in on part of the plot to have a more detailed view of a shorter time interval. Just click on
the upper-left corner of the area you want to zoom in on and drag the mouse pointer to the lower-right
corner, then release the mouse button. In the zoom window, you can adjust the Y-axis limits but also the

9–10
TRNSYS 18 – Tutorials

X-axis (time) limits by clicking on the axes. This is very useful when you want to study such a short
period of time that it is hard to zoom on that period right away. The zoom window is shown in Figure 9-8.

Note: By pressing SHIFT and moving the mouse over the plot, you will display the values
plotted by the online plotter, which are interpolated between TRNSYS timesteps. If you
want to see only the actual simulation timesteps, press CTRL-SHIFT when moving the
mouse. This can be useful to study control signals switching from 0 to 1, for example,
since the online plotter will draw a continuous line between those 2 states and it will show
interpolated values that do not correspond to any simulated values.

Figure 9-8: Online Plotter: Zoom window

TRNSYS gives you the ability to plot the contents of two online plots on the same screen. If you have
defined more than one Type65 Online Plotter in your simulation, select “Create Double Online” from the
“Plot Options” menu. Select the names of the two plots that you want to display from the two pull-down
menus and give your Double Online a name in the “Tab Caption” field. Click OK and you’ll notice that you
now have one more Online Plot tab at the bottom of your plot screen; this one displays the contents of
both individual online plots. You may notice that one of the two plots is outlined in bold. By holding down
the SHIFT key, and you are able to move the mouse over the plot and display variable values. However,
only the values of the plot that is outlined in bold will be displayed (due to space restrictions).

CLOSING THE ONLINE PLOTTER AND ANALYZING PRINTED RESULTS

At the end of the simulation, you will be asked if you wish to exit the online plotter. If you click "No", you
will be able to use the online plotter commands described above. If you click "Yes", you will come back to
the Simulation Studio, from where you can view the printed results.

You can open external files (input or output files) by using the "Calculate/Open/External Files" menu or by
double-clicking on the component that uses a file, switching to the "External Files" tab and using the "Edit"
button (Figure 9-9). Both actions will open the file using the editor set in "File/Settings/Directories/Text
Editor" (Notepad by default).

Note: In a file name, "***" means that TRNSYS will use the input file (.dck) filename to
assign a name to the file at runtime. Example: if your project's input file is called

9–11
TRNSYS 18 – Tutorials

"MyProject.dck" and you set "***.dat" as the output file name, TRNSYS will create a file
called "MyProject.dat".

Warning: the input (deck) file name is not always the same as the TRNSYS Studio
project's name. The deck filename is set in the project's Control Cards, which can be
accessed by "Assembly/Control Cards" or by the appropriate toolbar button

Figure 9-9: Opening external files

The standard TRNSYS output components always create text files, but you can use any file extension in
a project. In particular, some users find it convenient to use the file extension registered with their
preferred spreadsheet program, e.g. ".xls" for Microsoft Excel. This allows opening those files in the
spreadsheet program by double-clicking their name in Windows Explorer. Please note, however, that the
created files only have plain text information. Special features, like colors, cannot be created with the
standard output components.

TROUBLESHOOTING A SIMULATION (THE ERROR MANAGER)

During a simulation, TRNSYS writes messages to a special file called the Log file. That file has the same
name as the input file (deck) with a ".log" extension. Another file, the listing file, is also created (the listing
file also has all messages but in addition it repeats the input file and has some additional printed outputs
like the results of a "Trace" command, which prints the inputs and outputs of a component at each
iteration).

The Simulation Studio provides access to the log and listing file through the Error Manager, which can be
accessed by clicking on the LST button. Figure 9-10 shows an example of error message when an
external file for a Type cannot be found. The TRNSYS simulation ends with a "TRNSYS Errors" dialog

9–12
TRNSYS 18 – Tutorials

box. You can then return to the Simulation Studio by clicking OK, and you the Error Manager will launch
automatically to analyze notices, warnings and error messages that were generated during the
simulation. The Error Manager will only launch automatically if there were errors. You will need to launch
the Error Manager manually to see the warnings and notices.

Figure 9-10: The Error Manager

The "Units stats" and "Types stats" of the Error Manager present additional information on the calculation
time spent in each component and on the number of times each component was called. Finally, clicking
on the "List file…" button will open the listing file in a text editor.

9.1.2. Opening and running an example with the Multizone


building model (Type 56)
The "Sunspace" example is a simple example inspired by BESTEST Case 960. BESTEST (Building
Energy Simulation programs TEST) is the methodology developed in the framework of the IEA to test and
diagnose the simulation capabilities of the exterior envelope portions of building energy simulation
programs.

9.1.2.1. Opening and running the example


In the simulation Studio, open %TRNSYS18\Examples\SunSpace\SunSpace.tpf. You can explore the
connections and the components configuration as explained here above.

9–13
TRNSYS 18 – Tutorials

Figure 9-11: The SunSpace example

When you run the example (F8), TRNSYS launches TRNBuild in order to process the building input data.
This ensures that the data used in TRNSYS matches the latest version of the .bui file and that Type 56
will find all intermediate files it uses for the simulation (.bld, .trn and .inf). After the automatic call to
TRNBuild, the online plotter is displayed and the simulation runs.

9–14
TRNSYS 18 – Tutorials

Figure 9-12: SunSpace example: online plotter with zoom on air and operative temperatures

Figure 9-12 shows the online plotter with a zoom window displaying the air and operative temperatures.

9.1.2.2. Editing the building description


A building model involves too many parameters to use a standard proforma in the Simulation Studio. The
building model is described in a special file, the .bui file. You can edit the building description by right-
clicking on the building icon and selecting "Edit Building". This will launch TRNBuild and open the
corresponding .bui file.

You can explore the building parameters from the top level (thermal zones) to the bottom level (thermal
properties of one layer in a massive wall). You can, for example, change the window area in the zone
"SunZone" from 12 to 1, as illustrated in Figure 9-13. To do this, click on the name of the zone
(SUNZONE) in the TRNBuild Manager, then in the zone window select the 3rd wall (BST_H_EXT wall
Type with orientation SOUTH). The properties of windows pertaining to that wall will be displayed in the
right column.

9–15
TRNSYS 18 – Tutorials

Figure 9-13: SunSpace example: changing the window area

After changing the area, you will notice a significant decrease in summer temperatures compared to
Figure 9-12.

9.1.3. More TRNSYS Examples


You can learn more about TRNSYS 18 by using the examples included in the distribution. To open an
example, launch the Simulation Studio, select "Open" and browse to %TRNSYS18%\Examples.

Examples are described in more detail in Volume 10 – Examples.

9–16
TRNSYS 18 – Tutorials

9.2. Creating a Simple TRNSYS project


In this tutorial we will construct a model of a simple solar collector system. The project will include a solar
collector, a pump and an auxiliary heater along with weather data, forcing function controller and output
components.

Start Simulation Studio - The Simulation Studio program is where you will construct your simulation.
The program has menus at the top, toolbars with icon shortcuts at the top and left, a large assembly
panel window in the middle and a component tree on the right as shown in Figure 9-14. The menus
contain the commands, functions and tools that are needed to create and run a project. Most of these are
recreated in icon form in the toolbars. The assembly panel is where the components will be added to the
project and connected together to build the simulation. The component tree displays the components that
have been made available in your TRNSYS installation and allows you to select the component to be
added in the assembly panel.

Figure 9-14: Simulation Studio

From the File menu select New and then Empty TRNSYS Project as shown in Figure 9-15 and Figure
9-16.

9–17
TRNSYS 18 – Tutorials

Figure 9-15: File Menu

Figure 9-16: New Project Window

This will create a blank assembly panel in Simulation Studio. Simulation Studio has automatically
assigned a name to the project but we should save the project with a name and location that means
something. Under the file menu select Save As. Under the MyProjects folder create a new folder called
Tutorials and in that folder save the new project as BeginTutorial. (See Figure 9-17)

9–18
TRNSYS 18 – Tutorials

Figure 9-17: Saving the Project

The main component for this project is the solar collector – without it there would be no reason for the
simulation. There a number of solar collector models included in the standard TRNSYS package. On the
component tree, expand the Solar Thermal Collectors folder. Now you can see the various categories of
collector component models that are available. We want to model a collector based on the tested
efficiency values, so expand the Quadratic Efficiency Collector folder and the 2nd-Order Incidence Angle
Modifiers folder. There you will see the component model Type1b. Select this component and place it on
the Assembly Panel. Do this by simply clicking on the component in the tree and then clicking in the
assembly panel window at the location you want to place the component as shown in Figure 9-18.

9–19
TRNSYS 18 – Tutorials

Figure 9-18: Adding the Solar Collector Component

Just adding a component to the project does not define a model. We need to specify the parameters of
the component and understand the inputs to and outputs from the component to be able to put the entire
simulation together. If you double click the component on the assembly panel you will open the variables
window for the collector component as shown in Figure 9-19.

Figure 9-19: Solar Collector Component Parameters

In this window you will see tabs for the parameters, inputs, outputs and comments for the component.
The parameters tab shows the various parameters that need to be set to define the component.
Parameters are constant during the simulation and while default values of the parameters have been

9–20
TRNSYS 18 – Tutorials

provided, these may not match the values to model your specific component. For this project, the default
values are mostly correct, but our collector is twice as big and the default value. So we need to change
the 2nd parameter, Collector Area, from 1 m^2 to 2 m^2 as shown in Figure 9-20.

Figure 9-20: Changing Collector Area Parameter

By looking at the inputs tab we see the time-dependent variables for the component. These variables can
either be connected to outputs from other components or equation blocks, or set to constant values here
in the inputs tab (See Figure 9-21). (Any input that is not connected to another component or equation
block will simply stay at the value entered here for the entire simulation.)

Figure 9-21: Solar Collector Component Inputs

On the outputs tab (Figure 9-22) you will see the output variables for the component which are available
to be connected to other components, equation blocks, or output devices.

9–21
TRNSYS 18 – Tutorials

Figure 9-22: Solar Collector Component Outputs

On the comments tab there may be some information that the developers felt was important for the users
to know about the component. You will not always understand the variables from their titles in the
variables window. There are two sources of help on what the variables mean. In the variables window, if
you click the More button after any variable, you will activate a window with more information on the
variable. As sown for the collector array parameter in Figure 9-23.

Figure 9-23: Collector Array More Information

Also, the Component Reference volume of the TRNSYS documentation contains more detailed
information on all of the components. After you have specified the variables save the project.

A single component is not much of a simulation, but it is a simulation. If you click the run tool or select the
Run Simulation option under the Calculate menu, you will see a progress bar that indicates that the
simulation has run and is complete as shown in Figure 9-24.

9–22
TRNSYS 18 – Tutorials

Figure 9-24: Calculation Progress Bar

You cannot learn much from watching the progress bar, but you can add an online plotter to your project
that will show variables as they are simulated. From the Assembly menu, select the Output Manager. In
the Output Manager you will see your components on the left and your output devices in the middle.
Select an online plotter by clicking the monitor button and a System Plotter will be added to the list of
output devices. By clicking on the System Plotter in the list you can define the parameters of the output
screen. Change the Graph title to “Test” as we are using this online plotter to test our components. By
clicking the little + next to the Collector Component, you can get list of the outputs from the component.
Similarly, the + next to the plotter will list the available inputs to be plotted. You can control the number of
variables to be plotted on the two axes using the parameters at the right of the screen. For this test
simply connect the collector outlet temperature to the first left-axis variable by clicking on the outlet
temperature and the first left variable and then clicking the -> button. Do the same for the outlet flowrate
and the second left variable. The Output Manager should now look like Figure 9-25.

Figure 9-25: Adding an Online Plotter in the Output Manager

Now close the Output manager and run the simulation again. Now you will see a graph on the screen with
two constant lines for the outlet temperature and flowrate as shown in Figure 9-26. Since we have not

9–23
TRNSYS 18 – Tutorials

connected the flow inputs to any other components or equations, the collector model is simulated with a
constant inlet temperature and flowrate.

Figure 9-26: Online Plotter with Collector Component

We need to add some driving forces to our collector model. The point of a solar collector is to take solar
radiation and heat up a fluid, so we need to add solar radiation to our model. Weather data is typically
added to simulations using standard weather data files. There are numerous sources of this type of data
in multiple file formats. Rather than convert these different file formats to a different standard TRNSYS
format, TRNSYS simply reads these various file formats through the weather data reader component.
For this analysis we will use the standard weather file for Ouagadougou, Burkina Faso which is available
in Meteonorm format. From the Component Tree, expand the Weather Data Reading and Processing
folder and then the Standard Format folder. From the Meteonorm Files (TM2) folder select the Type15-6
component and add it to the project as shown in Figure 9-27.

9–24
TRNSYS 18 – Tutorials

Figure 9-27: Adding the Weather Data Reader Component

Open the variables screen for the weather component. We need to tell the component what weather file
we like to use in the External Flies tab as shown in Figure 9-28

Figure 9-28: External Files Tab for the Weather File Component

Click the browse button and navigate to the TRNSYS Weather\Meteonorm\Africa folder and select the
BF-Ouagadougou-655030.tm2 file as shown in Figure 9-29.

9–25
TRNSYS 18 – Tutorials

Figure 9-29: Selecting the Weather File

We need to define the slope and azimuth of the collector surface so that the weather data component can
calculate the solar radiation incident on the surface. The collector is sloped at 45 degrees and will be
facing the equator (north). This information is entered on the Type 15 Parameters tab. Since we only
have a single collector, we will only need the solar radiation on a single surface. Enter the slope of the
collector as 45 degrees and the azimuth stays at 0 since it is facing the equator as shown in Figure 9-30.

Figure 9-30: Setting the Surface Slope and Azimuth

Before we proceed with connecting the weather outputs to the solar collector we should first check
whether the weather parameters make sense. Open the Output Manager and add another on-line plotter
titled “Weather”. On the right axis plot the dry-bulb and dewpoint temperatures from the weather file. On
the left axis plot the total horizontal, beam horizontal, total diffuse horizontal, total tilted surface, beam
tilted surface and diffuse tilted surface radiation. Adjust the max value for the left axis to 100 since we are

9–26
TRNSYS 18 – Tutorials

plotting temperatures and the maximum for the right axis to 5000 since we are plotting solar radiation
values. The Output Manager should now look like Figure 9-31.

Figure 9-31: Adding Weather to the Output Manager

Now run the simulation and look at the results from reading the weather file. You should see the
temperatures taking a normal daily swing and the solar radiation having a typical humped shaped as
shown in Figure 9-32. Also the solar radiation on the tilted surface is slightly higher than the solar
radiation on the horizontal as the slope of the surface is facing the equator.

9–27
TRNSYS 18 – Tutorials

Figure 9-32: Weather Output

To connect the components, select the connection tool from the toolbar on the left, click on the weather
data component and then click on the solar collector component (See Figure 9-33).

Figure 9-33: Connecting Weather to Solar Collector

9–28
TRNSYS 18 – Tutorials

This will establish the connection and open the connection window as shown in Figure 9-34. (If the
connection window does not automatically open simply double-click on the line connecting the weather
data reader with the solar collector.)

Figure 9-34: Connect Window for Weather Output to Collector Input

In the connection window you will see the outputs from the weather data reader on the left side and the
input variables for the solar collector on the right. To define the connection select the output from the
weather file and the select the appropriate input for the solar collector. For example, to connect the dry
bulb temperature from the weather data to the ambient temperature input for the solar collector, click the
dry bulb temperature on the left and then click the ambient temperature on the right. A line should now
be shown that indicates that a connection between the output and the input has been defined as shown in
Figure 9-35.

9–29
TRNSYS 18 – Tutorials

Figure 9-35: Connecting Dry Bulb Temperature Output to Ambient Temperature Input

Now connect the remaining weather data outputs to weather inputs for the solar collector:
 Total tilted surface radiation for surface -> Incident radiation
 Total horizontal radiation -> Total horizontal radiation
 Total diffuse radiation on the horizontal -> Horizontal diffuse radiation
 Ground reflectance -> Ground reflectance
 Angle of Incidence for surface -> Incidence angle
 Slope of surface -> Collector slope
When you are done with the connections, the window should look like Figure 9-36.

Figure 9-36: Completed Weather-Collector Connections

Run the simulation now and see the changes in the collector outlet temperature. Now during the day
when there is solar radiation incident on the collector the temperature leaving the collector increases just
as would be expected as shown in Figure 9-37.

9–30
TRNSYS 18 – Tutorials

Figure 9-37: Online Plotter with Weather Connected

After you run a simulation it is a good idea to check the error file to see if there were any issues with the
simulation. Click the ‘Warnings and errors’ button in the toolbar on the left and open the simulation log
file as shown in Figure 9-38.

Figure 9-38: Simulation Log Window

The log file shows a warning that there was an issue with the calculated horizontal radiation at one
timestep. This is a fairly common issue with weather file processing and would be a concern if it occurred
at a higher percentage of the timesteps. The notices all describe where TRNSYS is being run and from

9–31
TRNSYS 18 – Tutorials

which DLLs components are loaded. While these can be important debugging tools they are not
particularly important for normal simulations. Checking the log file after running simulation is a good
practice and allows you to fix problems with your simulation as you go.

A solar system would not run all of the time, but only during the periods of the day when there is useful
energy to be gained in the collector. For this example we will create a simple control system that provides
flow through the collector between the hours of 8 am and 6 pm every day. Flow rates in TRNSYS are
generally controlled by the use of pump and/or fan components. So first we need to add a pump
component to control the flow of water through the collector. From the Hydronics/Pumps/Single Speed
folder select the Type114 pump and add it to the project as shown in Figure 9-39.

Figure 9-39: Adding Pump Component to the Project

In the parameters for the pump change the rated flow rate to 50 kg/hr and the rated power in 60 kJ/hr as
shown in Figure 9-40.

Figure 9-40: Pump Component Parameters

We want to model an ideal pump without any losses so on the input tab change the overall pump
efficiency and the motor efficiency both to 1 as shown in Figure 9-41.

9–32
TRNSYS 18 – Tutorials

Figure 9-41: Pump Component Inputs

Create a connection between the pump and the collector and define the connection as the temperature
and flow rate leaving the pump as the temperature and flow rate entering the collector as shown in Figure
9-42.

Figure 9-42: Pump – Solar Collector Connections

If you run the project you will see as shown in Figure 9-43 that the flow through the collector has been
reduced and thus the temperature leaving the collector when there is incident solar radiation has
increased.

9–33
TRNSYS 18 – Tutorials

Figure 9-43: Results after Pump Component added to Project

Open the error log file and see that we now have a new warning that the pump mass balance has failed
at 1344 timesteps as shown in Figure 9-44.

Figure 9-44: Simulation Log after Pump Component added to Project

Pumps (and fans) typically set the flow in TRNSYS models. So if the pump is setting the flow how can
the mass balance fail? Our simulation has an open water loop where there is no flow returning to the
pump. If you had a closed water loop, you would connect the flow output from the last component in the
loop back to the flow input for the pump. The pump would still set the flowrate based on its parameters
and control inputs, but having the input flow from the loop connected to the pump, the component can

9–34
TRNSYS 18 – Tutorials

check that there is mass balance in the loop. If you have a closed loop system and you are getting mass
balance warnings, then you should check your components to understand where the flow change is
occurring. Since we have an open loop we do not expect the mass to balance and we can safely ignore
the warning.

However, there is still constant flow through the collector at all times, so we need to add some control on
the pump. Our control will be a simple time-based control using a forcing function. From the
Utility/Forcing Functions/General folder select the Type14h component and add it to the project as shown
in Figure 9-45.

Figure 9-45: Forcing Function Component Added to Project

Since the control will be a control signal for the pump, we will want to set-up a forcing function that is 1
from 8 am to 6 pm and 0 at all other hours. To define the schedule we can make use of the plug-in for
setting-up a schedule. Double click on the component to see the variable screen. On the bottom left of
the parameter tab there is a small button to activate the plug-in. Simply click this button to activate the
plug-in as shown in Figure 9-46. (If the setting in Simulation Studio for automatically launch plugin is set
to true, then the plugin will be activated automatically without having the go to the parameter tab and
clicking the button.)

9–35
TRNSYS 18 – Tutorials

Figure 9-46: Forcing Function Plugin

The schedule starts correctly with a value of 0 at the 0 hour, but we need the schedule to change to 1 at 8
am. If we change the second point to be time = 8 and value = 1 the graph shows a signal that ramps up
from 0 at 0 to 1 at 8 (see Figure 9-47) rather than the step-change signal we are looking for.

Figure 9-47: Forcing Function Ramping Schedule

So we should set the second point as time = 8 and value = 0 and then add a third point by using the Add
button and define it as time = 8 and value = 1. Now we have the step change that we were looking for.
Go ahead and add points that return the signal from 1 to 0 at 6 pm (time = 18). The schedule only takes
up 18 hours at this point rather than a full day and if we were to use it in the simulation, on the second
day the pump would turn on at 2 am rather than 8 am. So we need to add a final point at hour 24 and
value = 0 to complete a daily schedule as shown in Figure 9-48.

Figure 9-48: Completed Forcing Function Schedule

Connect the forcing function schedule output (average value over the timestep) to the pump control signal
input as shown in Figure 9-49.

9–36
TRNSYS 18 – Tutorials

Figure 9-49: Connection between the Forcing Function and the Pump

Run the simulation and see that the flow through the collector is only on during the period from 8 am to 6
pm as shown in Figure 9-50.

Figure 9-50: Results with Controlled Flow

While our solar collector system is now working, it is not producing water at a high enough temperature
during all operation hours. We would like to have at least 60C water at all times during the hours of 8 am
to 6 pm. To provide the energy that is lacking from the solar radiation we need to add an auxiliary heater
to bring the water up to 60C when necessary. From the HVAC/Fluid Heater folder add a Type138 to the
project as shown in Figure 9-51.

9–37
TRNSYS 18 – Tutorials

Figure 9-51: Auxiliary Heater Component added to Project

Since we want to know the amount of energy that is needed to supplement the solar resources set the
maximum heating rate parameter to 999999 kJ/h so that we will always have adequate power to make
the water stream 60C and the fluid heater component will simply tell us how much energy is needed to
create the 60C water. We are also not worried about the difference between the input energy to the
auxiliary heater and the energy added to the fluid stream so we should set the efficiency of auxiliary
heater to 1 as shown in Figure 9-52.

Figure 9-52: Auxiliary Heater Component Parameters

Connect the solar collect temperature and flow outputs to the temperature and flow inputs for the auxiliary
heater as shown in Figure 9-53 and make sure that the setpoint input for the auxiliary heater has been set
to 60C.

9–38
TRNSYS 18 – Tutorials

Figure 9-53: Solar Collector - Auxiliary Heater Connections

Add an output to the online plot of the temperature leaving the auxiliary heater and see that the setpoint is
maintained at all times the pump is activated as shown in Figure 9-54. There are times just prior to 8 am
where the outlet temperature of the collector and the heater are higher than 60C. Since there is no flow
through the collector at these times, these are stagnation temperature of the fluid in the collector loop.
While important if these temperature get too high, they do not have a meaning for the rest of the
simulation.

Figure 9-54: Results with Auxiliary Heater

We now have a running simulation of a simple solar collector system where we can watch the simulation
variables on the screen. But to do any real analysis of the results we will need to produce an output file of
the results that we can look at in detail. What we really want to know is the amount of useful energy we
have collected with our solar collector and the amount of auxiliary energy that is needed to maintain the
required delivery temperature. To calculate these values we can use the component which is a
combination of an integrator and a printer – the printegrator. From the
Output/Printegrator/Unformatted/User-Defined Period folder add the Type46a component to the project
as shown in Figure 9-55.

9–39
TRNSYS 18 – Tutorials

Figure 9-55: Printegrator Component added to the Project

Since we only want to know the totals at the end of the simulation we need to set the printing &
integrating interval to STOP in the printegrator parameters as shown in Figure 9-56. But first we have to
change the Unit for the variable to variable name and then we can enter STOP for the value. (STOP is an
automatically defined variable name in TRNSYS.)

Figure 9-56: Printegrator Component Parameters

In the input tab we can tell the printegrator how many values will be integrated and printed. At the bottom
of the window there is a question about how many variables will be printed. Change the answer to 2. We
are also able to enter names for the values that will be printed. In the Value field in the input tab enter
Qcollector and Qauxiliary in the Value fields for the two variables as shown in Figure 9-57.

9–40
TRNSYS 18 – Tutorials

Figure 9-57: Printegrator Component Inputs

Finally we need to tell the component the name of the file that will be written. On the external files tab
there is a space to enter the name of the output file as shown in Figure 9-58. The default name is ***.out.
The *** characters are wildcards which tell TRNSYS to use the name of the project file as the name of the
file and append the extension of .out to the file. Since this works well for our case we can leave the
default value.

Figure 9-58: Printegrator Component External Files

The component outputs need to be connect to the printegrator. Connect the useful energy gain from the
collector component to Qcollector and rate of energy delivered to the fluid stream from the auxiliary
heater to the Qauxiliary input. Run the simulation and open the output file by selecting the menu item
Calculate->Open->External Files->***.out. The file should look like Figure 9-59.

9–41
TRNSYS 18 – Tutorials

Figure 9-59: Output File Contents

From the file we can see that there was 277,504 kJ of energy collected from the solar energy and an
additional 309, 096 kJ of energy was needed from the auxiliary heater to maintain the set-point.

The example is running for the first week of January. If we want to know the annual energy collected and
auxiliary needed, we need to change the simulation stop time. Open the simulation control cards by using
the toolbar and change the stop time to hour 8760 as shown in Figure 9-60.

9–42
TRNSYS 18 – Tutorials

Figure 9-60: Simulation Control Cards

Now when we run the simulation we get results for the entire year as shown in Figure 9-61.

Figure 9-61: Results for Annual Simulation

The output values are hard to discern in a single plot. Open the System Plotter component and change
the number of plots per simulation to 52 as shown in Figure 9-62 so we get one week’s worth of output on
a single plot.

Figure 9-62: System Plotter Parameters

If we run the simulation now the output values are easier to see on the chart as shown in Figure 9-63.

9–43
TRNSYS 18 – Tutorials

Figure 9-63: Results for One-Week of Annual Simulation

Looking at the output file that is created we see that annually the collector collects 11,454,326 kJ and the
auxiliary heater adds 19,132,674 kJ of energy as shown in Figure 9-64.

Figure 9-64: Results File for Annual Simulation

This completes the tutorial for creating a basic TRNSYS simulation. The techniques shown here can be
applied to creating more complex projects.

9–44
TRNSYS 18 – Tutorials

9.3. Creating a building project with 3D Data


Model
This section presents two different tutorials for creating simple building projects in TRNSYS using the
TRNSYS 3D plugin for SketchUp. The first uses the Building Wizard inside Simulation Studio to import
the building in a TRNSYS project and the second builds the model inside Simulation Studio as individual
components.

9.3.1. Introduction
To simulate the thermal behavior, Type 56 requires a great deal of building data (geometrical data, wall
construction data, etc.) and other data (radiation, ambient temperature, humidity, building schedules, etc.)
which influence the building. The data for a calculation are first assembled and then defined for the
TRNSYS simulation. Figure 9-65 shows a schematic flow diagram for a thermal building simulation with
TRNSYS.

Building Simulation Active Systems

Trnsys3d

*.idf

TRNSYS
Studio
w4-lib.dat

TRNBUILD
(Building Definition)
INPUT

*.Vfm *.Ism *.Shm *.Inf *.Bui example.dck Weather.dat load.dat

TRNEXE
(TRNSYS-Simulation) SIMULATION
*.Bld *.Trn

TRNBuild

Results
Online
Type 65
example.out example.prn

OUTPUT

Figure 9-65: Flow diagram for a dynamic building simulation using TRNSYS

9–45
TRNSYS 18 – Tutorials

Only when detailed radiation modes and/or 3D shading calculations are required, the building model has
to be set up including 3D geometric data. The basic steps shown in the flow diagram are the following:

1. Divide the building into airnodes / thermal zones and determine the geometry from plans. (Note:
The architectural model is not equal the thermal model for simulation!!)
2. Enter the 3D geometry data for walls and windows by using TRNSYS3d.
3. Import the resulting drawing file using the 3D-Building Wizard from the TRNSYS Studio.
The wizard automatically creates a building description (*.B18) file and a TRNSYS input (*.DCK)
file which is opened in the Studio. (see 02-SimulationStudio.pdf: 2.12. – Appendix 3: How to use
the Wizard)
4. Run a first simulation in the studio
5. Modify, adapt and extend both the simulation project (in the TRNSYS Studio) and the building
description (in TRNBuild)
6. Rerun simulations
The definition of 3D input data in TRNSYS3d can be quite time consuming and isn’t required with respect
to accuracy for many building projects. For simulations without 3D data, TRNSYS3d isn’t used at all
and a different studio wizard is available. The steps shown in the flow diagram can described as follows:

1. Divide the architectural building model into airnodes / thermal zones for the simulation model and
determine the geometry from plans. (Note: The architectural model is not equal the thermal model
for simulation !!)
2. Create a new building project using the Wizard “Building Project (multizone)” in TRNSYS Studio.
The wizard automatically creates a building description and a TRNSYS input file which is opened
in the Studio. (see 02-SimulationStudio.pdf: 2.12. – Appendix 3: How to use the Wizard)
3. Run a first simulation in the studio
4. Modify, adapt and extend both the simulation project (in the TRNSYS Studio) and the building
description (in TRNBuild)
6. Rerun simulations

9–46
TRNSYS 18 – Tutorials

9.3.1.1. From the architectural model to thermal model


Thermal models are quite different to architectural 3D-models which include lots of information not
important for energy modeling. Thus, the energy model (also the 3D energy model) becomes a derived
version with a focus on heat transfer aspects. The first important step is to divide the architectural model
into thermal zones. The following should be considered:

 Keep it as simple as possible. The user effort, complexity and computation time increases
significantly with the number of zones and not necessarily accuracy.
 A thermal model doesn’t have to look like an architectural model, but has to model the thermal
behavior. For most cases the geometry can be simplified. E.g. for an ordinary zone with ten
windows 1m x 2m in the south façade it is not necessary to draw ten windows instead draw one
with the same total size.
 The zoning depends on the expected results of the simulations. Similar areas with respect to
solar gains, construction, utilization and conditioning show the same thermal behavior and can
often be combined into one zone for energy simulations. For detailed analysis of comfort and
detailed temperatures it is recommended to simulate “special areas” as separate zones.

9.3.2. Using T3D (SketchUp Plug-in) with 3D Building


Wizard

9.3.2.1. 3D Building Example: 2-Zone Building


In this example by TRANSSOLAR (Stuttgart, Germany), a dynamic 3D-building simulation is carried out
within Trnsys using the 3D drawing capabilities of Trnsys3d for Google SketchUp and import the
geometrical information into the Type 56 component in which the thermal behavior of buildings can be
calculated very precisely.

The building modeled by this example (Figure 9.3.2-1 and Figure 9.3.2-2) is divided into two thermal
zones: first floor and second floor.

In front of the south-oriented façade there is a garage that will later be treated as a constructional
shader.From the building plans, the geometry and the orientation are derived.

SOUTH ISO EAST NORTH WEST

Figure 9.3.2-1: Various views of the building

9–47
TRNSYS 18 – Tutorials

Figure 9.3.2-2: 3D-view of the building and dimensions

9.3.2.2. Step 1 - 3D Building definition by Trnsys3d


The 3D geometry can be created by using Trnsys3d, a free-AddOn to Trnsys. Trnsys3D is a plugin for
Goggle SketchUpTM. The use of Trnsys3d and the definition of this example is described in this chapter.

9–48
TRNSYS 18 – Tutorials

Figure 9.3.2-3: building in Trnsys3D

The entered data in Trnsys3d is saved as a so-called *.idf file. The IDF file consists- of two parts: a “BUI-
Template for Trnsys18” and the Trnsys3d data starting from “ALL OBJECTS IN CLASS: VERSION”. The
template part is required for importing / exporting into Trnsys Studio / TRNBuild. Due to the strict syntax it
is not recommended to edit this file!

The resulting “Building.IDF” file for this example can be found in the following directory
<Trnsys18>\Examples\3D_Building\1_Step_Create_Trnsys3d

9–49
TRNSYS 18 – Tutorials

INSTALLATION OF SKETCHUP AND TRNSYS3D PLUG-IN


 Download and install Google SketchUp from http://sketchup.google.com/.
 Download and install Trnsys3d from www.trnsys.de/
 Start Google Sketchup. If you are starting Google SketchUp for the first time, you will be
prompted to choose a Google SketchUp template. Choose the ‘Engineering – Meters’ template
and click ‘Start using SketchUp’.
 If you already use SketchUp in IP units, it is recommended that you switch to ‘Engineering –
Meters’ Template. To do this, go to Window>Preferences>Template> ‘Engineering – Meters’

 Delete the drawing of the person standing at the axis origin by clicking on it and pressing ‘Delete’

UNDERSTANDING “ZONES” – SKETCHUP ZONES VS.TRNSYS3D ZONES


SketchUp Zones

In SketchUp, the interior walls make up the zones. For example, in the building pictured above, there are
no interior walls so it is modeled as one large rectangular zone. Note that the smaller cube represents an
exterior shade and is not a zone.

9–50
TRNSYS 18 – Tutorials

Trnsys3d Zones (=AIRNODES)

Trnsys3d zones are different from SketchUp zones, particularly because Trnsys3d zones are used to
simulate the dynamic flow of energy. An energy model of a building should typically be separated into
perimeter and core zones. This is important to separate the effects of infiltration from the perimeter and
core, and to correctly account for solar gains into the building. In this tutorial, the example building is
divided into two zones: the first floor with a shade (see the purple box), and the second floor, without
shading. It is also important to note that, unlike SketchUp zones which can be any shape imaginable,
Trnsys3d thermal zones must be convex, meaning that every surface in the zone should be in the line of
sight with all other surfaces of the zone.


AUTOMATIC PROMPT TO SELECT PRE-MADE ZONE TEMPLATE [NEW FEATURE]

Upon launching Google SketchUp after the Trnsys3d plugin has been installed, you will be prompted to
choose a template for your 3D model. This template contains pre-defined information for your *.b18 file
for schedules, heating, cooling, ventilation, infiltration, internal gains and daylight. If you don’t want to use
a predefined template, choose NewFileTemplate.idf.

Choose German > 3_office_basedon_SIA2024.idf and click Open.

For the German library, these zone templates according to SIA 2024 are available:
1. apartment
 Living/bedroom
 kitchen
2. hotel
 hotel room
 reception
3. office
 office 1

9–51
TRNSYS 18 – Tutorials

 office 2
 meeting
 reception
4. school
 classroom
 staffroom
 library
 lecturehall
 specialroom
5. supermarket
 commercial
6. restaurant
 restaurant
 kitchen

9–52
TRNSYS 18 – Tutorials

CREATE A TRNSYS3D ZONE

Create a new Trnsys3d zone by choosing Plugins > Trnsys3d > New Zone Tool from the main menu.
A small, blue cross-hair will appear at the tip of the cursor arrow. Hover over the axis origin until a small
yellow dot appears and click. This will place a blue box on the screen, which represents the Trnsys3d
zone. If the blue box is not visible, try changing the view to fit the object by going to Camera > Zoom
Extents from the main SketchUp menu. Now you can zoom in and out with the mouse wheel to fit the
object in the window as desired.

SKY

NORTH

EAST

Note that by clicking on the screen outside of the blue box, the object will disappear from view. This is
normal. Turn on hidden geometry (Go to View > Hidden Geometry from the main menu) and a small gray
cross‐hair will be visible at the opposite corner of the box.

This cross hair allows the user to find the Trnsys3d zone more easily. Note that if you click on the gray
cross‐hair, the Trnsys3d zone is outlined in blue again.

Double click on the small cross‐hair, which is now visible with hidden geometry turned on. The blue
outline of the Trnsys3d zone should be replaced with a slightly larger box with a broken, black outline.

9–53
TRNSYS 18 – Tutorials

This ‘activates’ the Trnsys3d zone. Note that in order to modify the Trnsys3d geometry the Trnsys3d zone
MUST be ‘activated’ (outlined with the broken black line). Alternative to clicking on the crosshair, double
click inside the blue box.

This is what separates the Trnsys3d


geometry from SketchUp geometry.
Any object drawn in a ‘unactivated’

! Trnsys3d zone is only SketchUp


geometry and will not be written out
to the Trnsys3d IDF file. It is VERY
important to make sure the zone is
activated before you start creating
geometry.

MODIFYING GEOMETRY WITHIN THE TRNSYS3D ZONE

Make sure that the Trnsys3d zone is still ‘active’ (outlined with the broken black line). Then create the
floor for the model by going to Draw ‐> Rectangle from the main menu. Start the rectangle at the axis
origin by clicking on the origin. Next designate the size of the rectangle by typing ’12, 4’ and pressing
enter (you can see the numbers being input in the lower right hand corner of the screen, the comma
between the numbers is operating system language dependent and can also be ;,.). This will create a
12m by 4m floor.

Note the gray color of the floor. This color is automatically generated by
Trnsys3d and designates this surface as a floor in Trnsys3d. Similarly,
! the walls and roof will be colored accordingly, in the next few steps.

Next ‘pull’ the rectangle up to create a rectangular prism. Make sure that the Trnsys3d zone is still ‘active’
(outlined with the broken black line). Choose Tools > Push/Pull from the main menu. Hover over the
rectangle until small blue dots appear on the floor surface and click ONCE with the mouse. The tool will

9–54
TRNSYS 18 – Tutorials

‘grab’ the rectangle surface. Move the mouse up and down to see how the tool works. Move the mouse
slightly up (so that the rectangle is projecting towards the top of the screen), type ‘4’, and press enter.
This will ‘pull’ the rectangle up to create a 4m tall prism.

Saving the IDF File


It is crucial to save the IDF file early and often. The IDF file is separate

! from the SketchUp file and saving the SketchUp file will not preserve the
IDF information. To save the IDF file, choose Plugins > Trnsys3d > Save
from the main menu . If it is the first time you are saving the file a dialog
box will prompt you for a location and name.

CREATING FENESTRATION OBJECTS

Trnsys3d can also be used to generate fenestration objects. Make sure that your Trnsys3d zone is still
‘active’ (outlined with the broken black line). Use the tape measure tool to create a 1m offset guides from
the corner of the wall. Select Tools > Tape Measure and click once on the lower right hand corner.
Hover to a point above the corner, type in ‘1’ and press enter. A small black crosshair will appear. Using
the tape measure tool again, click once on the new crosshair and hover to a point left of it, type in ‘1’ and
press enter. A dotted vertical guide and another crosshair will now appear on the wall surface.

9–55
TRNSYS 18 – Tutorials

Now, select Draw > Rectangle and click once on the crosshair located on the wall surface. Type in ‘6,2’
and press enter. Note that as long as the rectangle is completely contained within the wall surface,
Trnsys3d will recognize it as a window and automatically color it a transparent blue. A skylight is created
the same way as a window, but the rectangle is drawn on a roof instead of a wall. The guide lines can be
removed by going to Edit > Delete Guides. This will also remove the hidden geometry.

CREATE EXTERNAL SHADING OBJECTS

Trnsys3d can be used to create shading objects, including overhangs and detached shading objects to
represent other buildings. Select Plugins > Trnsys3d > New Shading Group Tool , which is very similar
to the new zone tool. For this example, place the new shading group at the axis origin. Just like the new
zone tool, in order to edit the shading group geometry you must make the group ‘active’. To do this, press
enter while the shading group geometry is highlighted blue, or double click on the small gray cross‐hair
that was created when you placed the new shading group. When the shading group is ‘active’ you should
see the rest of the model become lighter.

9–56
TRNSYS 18 – Tutorials

Use the rectangle tool to create the footprint of a detached shading object. Click the origin once and
move the mouse so that the footprint is previewed in the correct quadrant. Type in ‘4,4’, which will create
a floor surface of 4m by 4m. Notice that the gray dotted box extends itself to include the floor surface.

Similar to creating a new zone, use the Push/Pull tool to ‘pull’ the shading surface up to 4m.

USING THE OUTLINER WINDOW

We will now use the outliner window to review the zones that we have created. To access the outliner
window from the main menu choose Window > Outliner :

9–57
TRNSYS 18 – Tutorials

You can use the outliner window to select the Trnsys3d objects by clicking on them. Double clicking on an
object in the outliner window will ‘activate’ the object. You should have one Trnsys3d shading group and
one Trnsys3d zone with a random six‐digit alphanumeric name. If you have any additional objects placed
on accident select them in the outliner window and delete them.

USING THE OBJECT INFO TOOL

Trnsys3d also has the ability to modify the Trnsys3d object information. Choose Plugins > Trnsys3d >
Object Info . The class type will change as objects are selected on the screen. If nothing is selected,
the class type is ‘Building’. Change the name of the building to ‘TRNSYS18’

Click on the zone in the main SketchUp drawing area and you will see the class type change to ‘Zone’ in
the object info window. Change the Zone name from the default six digit alphanumeric zone name to
‘first_floor’ (!!!NOTE: No Spaces!!!) and press TAB on your keyboard to confirm. Select the Zone Type
template ‘31office’ from the drop-down for ‘Type’.

9–58
TRNSYS 18 – Tutorials

Open the outliner window again; notice that the Trnsys3d zone name has changed.

With the object info window still open double click on ‘First Floor’ in the
SketchUp model to ‘activate’ the zone. Notice how the object info
changes as you select a wall, roof, or window (note characteristics like
surface name, type, construction, zone, outside boundary conditions,
! and the ground view factor). You can change the surface type, the
construction, and outside boundary condition for each surface. Toggle
between surfaces by clicking on them on the main SketchUp window.
You cannot change the surface name, as it will be automatically
changed later on.

9–59
TRNSYS 18 – Tutorials

MOVABLE SHADING FOR WINDOWS

Windows in TRNSYS 18 can have an automatic internal shading calculation depending to user-defined
set points. For this reason in the Object Info of Trnsys3d for windows there is a new drop down called
shading device. Here one can define if the window will have an internal or external shading device. The
set points can later on be adapted in the TRNBUILD window type manager.

9–60
TRNSYS 18 – Tutorials

USER-DEFINED WALL CONSTRUCTIONS

The option to define a new construction can be accessed through the SketchUp menu > Plugins >
Trnsys3d > New Construction. This allows defining user-specific names for constructions that can be
afterwards selected by the Object Info Window. The detailed wall construction including the layers and
their thicknesses will have to be done after the import in TRNBUILD.

9–61
TRNSYS 18 – Tutorials

USER-DEFINED BOUNDARY TEMPERATURES

The option to define a new boundary temperature control can be accessed through the SketchUp menu >
Plugins > Trnsys3d > New Boundary Temperature Control. This allows defining user-specific INPUT
variables for a boundary temperature that can be afterwards selected by the Object Info Window. Make
sure to change the Construction to ‘BND_WALL’, Outside Boundary Condition to ‘Other Side
Coefficients’, and Outside Boundary Object to ‘BOUNDARY=INPUT 1* CORRIDOR’.

ADD A SECOND ZONE IN TRNSYS3D

Create the second floor of the example model by creating a new Trnsys3d zone and repeating the
previous steps, but ‘pull’ this floor to 5m instead of 4m. To create a sloped roof, portions of the
rectangular prism will be ‘sliced’ off. Using the tape measure tool, place a crosshair guide 1m below the
upper corner, as shown below. Then select Draw > Line and draw a line from the crosshair to the
midpoint of the top edge. (The midpoint shows up in blue when you hover over it.) Draw another line
connecting the midpoint to the edge opposite of the one with the crosshair, outlining the shape of the
sloped roof.

Select Tools > Push/Pull, hover over a triangle until the blue dots appear and click once inside the
triangle. Move the mouse towards the other end of the prism until the cut follows through the entire

9–62
TRNSYS 18 – Tutorials

length of the prism and click to complete the ‘slicing’ (the cursor will snap to a triangle at the other end.)
Repeat for the other triangle.

Note that the sloped roof you just created is now the same color as the walls. To re-assign the surface
type in Trnsys3d, right-click on the surface make the selections as shown below to finally choose ‘Roof’
for each sloped surface. Repeat previous steps to rename this zone as “Second Floor”

9–63
TRNSYS 18 – Tutorials

Finally, the interzonal adjacencies must be considered. The mating surfaces between the First Floor and
Second Floor must be linked together. Open Window > Outliner, and right click on the Second Floor to
‘Hide’ it. If View > Hidden Geometry is checked, then the second floor will appear hatched. You must
uncheck it to hide it.

Next, double click the First Floor zone to ‘activate’ it. Right Click on the roof of the first zone and select
Trnsys3d > Object Info. Change the Type to “Ceiling” and construction to “ADJ_CEILING”. The outside
boundary condition should be “Zone” and the outside boundary object is “Second Floor.”

Right click on the Second Floor in the Outliner to unhide it. Repeat the same steps above to hide the
First Floor and reassign the floor of the Second Floor correctly. See the Object Info entries below. Note
that although the type of the Second floor is ‘Floor’, the construction must match the First Floor
(ADJ_CEILING). This is critical for adjacency recognition, when importing into TRNBUILD.

9–64
TRNSYS 18 – Tutorials

9–65
TRNSYS 18 – Tutorials

MATCHING SURFACES

A method for automatic surfaces matching can be accessed through the SketchUp Trnsys3d menu
toolbar. Click on the surface matching icon to start matching walls, roofs and floors. A window will pop
up that gives you different options like matching/unmatching surfaces or also to show the last reported
matching information.

Depending on the size of the models and the select geometry for matching surfaces this can be a slow
process. Note that this method requires several key assumptions.

First, in order to match two surfaces the methods requires that they both have same number of vertices
and that the vertices exactly line up. This can most easily be accomplished using the snap functionality of
the SketchUp drawing tool.

If you check the box “Replace with Default Constructions”, construction names of the matched surfaces
will be changed to: "ADJ_CEILING" and "ADJ_WALL", if construction objects of those names appear in
the current idf file.
If you uncheck the box “Replace with Default Constructions”, construction names of the matched surfaces
will not be renamed. Please make sure, that front and back side of all matched surfaces do have the
same construction. Otherwise there will be an error message during the import into TRNBuild.

VirtualSurface Definition

! Note that thermal stratification is normally modelled with a stack of several


zones. To model this example as an atrium, assign the construction as
‘VirtualSurface’. When it gets imported into the TRNSYS TRNBUILD, the
VirtualSurface will automatically be deleted and reflect an accurate radiative
model.

9–66
TRNSYS 18 – Tutorials

9.3.2.3. Step 2 - Creating a building project by 3D-Building Wizard

IMPORT IDF FILE INTO SIMULATION STUDIO WITH THE WIZARD

The TRNSYS18 Simulation Studio offers the opportunity to automatically set up a simulation by importing
the *.idf file with the 3D-Building Wizard. After opening the Simulation Studio, select ‘New Project’ in the
menu and the 3D-Building Project Wizard can be chosen. The Wizard prompts you for the location of your
*.idf file, the location of the weather data file (Note: The wizard requires a *.tm2 data format, If you need a
different format select a *.tm2 file first and replace the data reader later by the one you need.), the
building rotation, the static distribution factor of solar direct radiation (typical range from 0.6-0.8), shading
controls for exterior shades and boundary temperatures of the ground and any adjacent spaces.

A great advantage of the 3D-Building Wizard is that all orientations of the Building are linked
automatically. This reduces errors and time used to link this information manually.

Figure
9.3.2-4: 3D Building project wizard of Trnsys Studio

The main reason for importing the 3D geometry into Simulation Studio is to use the Studio Wizard to
generate the *.b18 and *.tpf files, which happens after you create the project with the Wizard. The*.dck is
generated when you click Calculate>Create Input File. It is also possible to import 3D geometry into
TRNBuild, however this approach only generates the *.b18 file and is only appropriate when you have an
existing *.dck file. This alternative workflow where the *.dck file is created from scratch, is not covered in
this tutorial.

The inputs for the model in Simulation studio are populated with Information from the IDF template that
was selected during the launch of SketchUp.

9–67
TRNSYS 18 – Tutorials

Figure 9.3.2-5: Created building project in Trnsys Studio

Select File > Save to save the Studio project.

The Wizard creates a 3D model with default settings which can be found under “Wizard Settings”.
Double click the Wizard Settings icon to see input variables. Double click each input variable to see
default assignments. It is possible, for example, to adjust the control for SHADE_CLOSE, directly in the
circled cell below.

For ground-adjacent models, it is important to define ‘t_T_min’, as highlighted in the image to the right,
below. This variable equals the ‘coldest day’, in this example (.\Weather\Meteonorm\Europe\DE-
Stuttgart-107370.tm2), 11 days from the start of the new year. If you change the weather data file, identify
the coldest day for your climate and adjust t_T_min as necessary. In addition, you need to adkust
T_AMPLITUDE (see Type 77 for further Information).

Figure 9.3.2-6: Wizard settings in equations block

9–68
TRNSYS 18 – Tutorials

It is always recommended to double check the imported building data in TRNBuild (using the „Edit
building‟ right-mouse-menu in the Simulation Studio). Especially, the following items shall be double
checked at least:

 Number of zones/airnodes

 Airnode volumes
(Note: For the calculation each airnode is assumed to be a closed volume. Otherwise the volume
calculation is incorrect)

 Reference floor area

 Number and category of surfaces for each airnode

RUN A FIRST TRNSYS SIMULATION

For a first run, click Calculate > Run Simulation, which will launch Trnsys18 and by default it will run for a
single week. Trnsys18 will prompt you to “Exit the Online Plotter” upon completion of the simulation. Click
“No” for the purposes of this tutorial.

Figure 9.3.2-7: First simulation results

After starting a simulation run the Studio generates the Trnsys Input file (*.dck) first. Then, the executable
is called with the input file. During the simulation of the example the following screen output is generated
by four Type 65 (Online) in tab view.

The first online “Solar Plotter” shows the total and beam incident solar radiation for the defined
orientations calculated by the weather data component (Type15).

9–69
TRNSYS 18 – Tutorials

The second online plotter shows zone temperatures (air and operative) as well as the ambient and
ground temperature. It can be see that heating is kept at 21°C.

The 3rd online shows specific heating and cooling demands for all zones.

The 4th online shows specific electric power demand for devices and artificial lighting for all zones.

Hold down shift and hover mouse in plotter area to see instantaneous values. The menu ‘Plot options’
allows you to change the background color, line style an so on. User-defined outputs can be added to the
online plotter as shown in the next sections.

After the simulation, it is highly recommended to check the printed *.log and *.lst file which contain output
messages (building_modified.log and building modified.lst). Therefore, close the online plotter and in the

Studio click the button ‘results warnings and errors’ on the left handed tool bar.

Figure 9.3.2-8: The log file view in the Trnsys Studio

The *.log file provides a comprehensive overview of the reported messages during the simulation
whereas in addition the *.lst file contains the processed Trnsys input file, the included Types and their
connections.

Besides error messages there are warnings and notices included providing valuable information for the
user. Note: Warnings don’t necessarily mean that there is a problem but require carefully checking by the
user!!

All related files are located at \Trnsys18\Examples\3D_building\2_Step_Import_Studio.

9–70
TRNSYS 18 – Tutorials

9.3.2.4. Step 3 - Modification of the building description (TRNBuild)


Modifications, adaptions and extensions of the building description are performed with TRNBuild (using
the „Edit building” right-mouse-menu in the Trnsys Studio).

The inputs for the model in TRNBuild were populated when the 3D model was imported into Simulation
Studio, as described in the previous step.

By choosing the SIA 2024 template ‘31office’ in TRNSYS3d, the following regime data is predefined and
applied for both zones, first and second floor:

 Infiltration (0.05 1/h)

 Ventilation (2.6 m³/((hm²) * ref. floor area * weekly occupancy schedule)

 Heating (Tair,min = 21 °C during operation hours (schedule used); else Tair,min = 15 °C)

 Gains (persons, computers, artificial light)

In addition, several items are modified below.

 Deactivate Cooling for both zones (click fields shown in Figure 9.3.2-9)

Figure 9.3.2-9: Deactivate cooling in TRNBuild

 Volume (adjusted to 0.9 of the calculated volume for taking into account the wall thickness; note:
the surfaces of the 3D model were drawn at the outer boundary)

 Capacitance (adjusted by a factor of 3.6 for taking into account additional mass like furniture), see
Figure 9.3.2-10

9–71
TRNSYS 18 – Tutorials

Figure 9.3.2-10: Change volume and capacity in TRNBuild

 Additional ventilation type for stack ventilation in case of overheating (depending on input
Y_stackvent) is defined (see Figure 9.3.2-11) and added to second floor

Figure 9.3.2-11: Define stack ventilation regime

 Integrated shading control for all external windows

 Boundary temperature of the wall adjacent to the garage set to constant 15°C (see Figure
9.3.2-12)

9–72
TRNSYS 18 – Tutorials

3
Figure 9.3.2-12: Change boundary temperature for wall to garage

 Detailed radiation modes for zone first_floor (Note: The detailed radiation modes are used for
demonstration of the feature only. It is not required with respect to accuracy for such geometry!)

Figure 9.3.2-13: Change radiation modes to detailed

 Comfort Point in zone first_floor

9–73
TRNSYS 18 – Tutorials

Double click on Geo-Info in the TRNBuild Navigator. Select ‘gain, comfort points’ under ‘GeoPosition
Geometry’ and click the green ‘+’ to add a comfort point. Adjust the coordinates if desired; typically 1m
height is recommended for comfort analysis. Click the Checkmark to close out of the Geo-Info dialogue
and select File > Save.

Figure 9.3.2-14: Add Comfort Point

 Outputs

Click ‘Outputs’ in the TRNBuild Navigator to access the outputs as seen from the Online Plotter. Click ‘+’
to add an output

9–74
TRNSYS 18 – Tutorials

Figure 9.3.2-15: Add Output

Select ‘First Floor’ from the list of “Available Thermal Airnodes” and click the LEFT arrow to add it to the
list of “Selected Thermal Airnodes”. Below, select NType number 9 ‘RELHUM’ from the list of “Available
Outputs” and click the LEFT arrow to add it to the list of “Selected Outputs”. Click the green checkmark
box to exit the dialogue and select File > Save.

In addition to saving the building.b18 file, the additional matrix files for detailed radiation modes have to
be generated. The *.shm file contains information about solar radiation shading on external windows, the
*_xxx.ism file information about the direct solar radiation distribution and the *.vfm contains information
about the view factors of surfaces in each zone. TRNBuild asks the user before closing if these files
should generated. In addition, these files can be generated with the tools menu ‘Generate
shading/insolation matrices’ and ‘Generate view factor matrix’. A free AddOn called TRNviewSHMISM
can be used for visualizing of the shading/insolation matrices.

Finally, the building project in the Trnsys Studio has to be updated by „Update building variable list … ”
(right-mouse-menu in the Trnsys Studio). The 14th input of Type 56 ‘Y_STACKVent’ for stack ventilation is
added.

All files for this step are located at \Trnsys18\Examples\3D_building\3_Step_AddData_TRNBuild.

9–75
TRNSYS 18 – Tutorials

9.3.2.5. Step 4 - Modification of the building project (Studio)


For the example the Trnsys project is extended by an external control of the additional ventilation
airchange rate ‘Y_STACKVent’. The control is set from 0 to 1 by a combination of two ON/OFF controler
(Type 2):
 the air temperature of airnode second_floor raises above 25 °C and
 the ambient temperature is 1.5 K lower than the air temperature of second_floor

For a better overview the macro function of the studio is used.

It is highly recommended to double check at least the following entities by an online plotter:
 incident solar radiation (especially for windows)
 control signals
 gains
 heating

In the example, a new online printer is inserted and connected to the control signal of the stack
ventilation.

Figure 9.3.2-16: Building project in Simulation Studio including stack ventilation

In the example, no additional variables are printed. For printing additional variables, it is recommended to
use the Type46 – printegrator. Another option is to replace the online Type 65 by a different Type 65
which write variables into a file. However, the variables are printed every time step and can’t be
integrated by this component.

All files for this step are located at \Trnsys18\Examples\3D_building\4_Step_AddData_Studio.

9–76
TRNSYS 18 – Tutorials

9.3.2.6. Step 5 - Modifying the geometric part of the building model


The data related to the 3D geometric data can’t be edited within TRNBuild, but in Trnsys3d. Therefore,
export the .b18 file to an idf file, edit it in TRNSYS3d and reimported back to .b18.

EXPORT IDF FILE FROM TRNBUILD

Right-click on the Building icon in Simulation Studio and select ‘Edit Building’, which will open the *.b18
file in TrnBuild18. Select File > Export TRNSYS3d file.

Figure 9.3.2-17: Export .idf file from TRNBuild

You will be prompted to save your exported IDF file. Use a clear name to distinguish the exported IDF
from the original IDF, for example ‘Building_step5.idf’.

MAKE CHANGES IN IDF FILE WITH TRNSYS3D

Launch Google SketchUp. Navigate to ‘Building_step5.IDF’ when prompted.

Activate (double-click) the zone, make a change to the geometry (add a window as shown below), and
save the IDF file, using the same name ‘Building_step5.idf’’

Figure 9.3.2-18: Geometry modification with TRNSYS3d

9–77
TRNSYS 18 – Tutorials

RE-IMPORT IDF FILE IN TRNBUILD

Launch TRNBuild18. Select File > Import TRNSYS3d file. Browse to the location of the IDF file with
modified geometry, as described in the previous step: ‘Building_step5’’, select ‘Northern Hemisphere’ and
click Import.

In Simulation Studio, double click the Building icon. On the External Files tab, Browse to the location of
the *.b18 file with modified geometry that was generated from TRNBuild18: ‘Building_step5’

Figure 9.3.2-19: Assigning building description file (*.b18) to Type56

Select File > Save. Modified geometry is now incorporated in the model. You can double check by right
clicking the Building icon in Simulation Studio and selecting Edit Building, which will open the *.b18 file in
TRNBuild where you can search for the newly added window on the second floor.

Figure 9.3.2-20: Reimported zone with new window in TRNBuild

Note:
If Shading / Insolation matrices or View factor matrix are required due to detailed radiation modes they
have to be regenerated for matching the model!
If the airnode volume/capacity was modified manual in the original B18 file this has to be redone!

All related files are also located at \Trnsys18\Examples\3D_building\5_Step_Modify3D_Trnsys3D.

9–78
TRNSYS 18 – Tutorials

9.3.2.7. Step 6 - Add daylight controls (TRNBuild)


To view/modify the settings for daylight controls that were pre-defined as part of the Trnsys3d template
when starting the model in SketchUp expand the ‘Daylight Control Types’ from the TRNBuild Navigator.
The pre-defined daylight depending control of the artificial light is a simple on/off controller based on a
daylight factor of 2%. (For further information see section 5.2.6.7 of 05-MultizoneBuilding.pdf)

This daylight control type is used to control the gain ‘Ltg_31office’ of the zones ‘first_floor’ and
‘second_floor’.

9–79
TRNSYS 18 – Tutorials

An advanced daylight depending control is based on the actual illuminance available at a certain location
in the room. This advanced control requires a dynamic daylight simulation coupled with the thermal
simulation. In the following the steps for adding required daylight data to the building model and run the
coupled simulation are described.

ADD DAYLIGHT GEOMETRY POINT

This is a similar process to adding a comfort point. Double click on Geo-Info in the TRNBuild Navigator.
Select ‘Daylight sensor points’ under ‘GeoPosition Geometry’ and click the green ‘+’ to add a daylight
sensor point. Adjust the coordinates if desired; typically 1m height is recommended for daylight sensing.
Click the Checkmark to close out of the Geo-Info dialogue and select File > Save.

To create a new daylight control, right click on ‘Daylight Control Types’ and select ‘Add Control Type‘. In
the new dialog you define a name (firstfloor) first. Next the control type is defined as On/Off controller with
the illuminance setpoints 500 lx and 300 lx, respectively. Then, select ‘daylight sensor position’ and
choose the GeoPosition that was created in the previous step. Close out of this dialog by click the green
check box.

9–80
TRNSYS 18 – Tutorials

Click “Zone: First_Floor” in the TRNBuild Navigator, which will open the zone properties window. Click
the Gains icon and select ‘Ltg_31office’ to access the ‘lights’ gaintype category properties. Select the new
defined daylight control type ‘firstfloor’.

DEFINE VISUAL TRANSMISSION FOR WINDOWS

For the daylight simulation the visible light transmittance of windows have to be added. Expand
“Windows” on the TRNBuild Navigator. Double click ‘EXT_WINDOW1’ to access the Window Type
Manager. Under Daylight Properties, a radiance material name has to be assigned for two states of the
window: shaded and unshaded. Type in ‘glass_78’ for ‘Material name unshaded’ and ‘glass_20’ for
‘Material name shaded’, to define the material of the window system when it is unshaded and shaded,
respectively.

9–81
TRNSYS 18 – Tutorials

ADD OUTOUTS FOR ILLUMINANCE AND DAYLIGHT CONTROL SIGNAL

Click ‘Outputs’ on the TRNBuild Navigator and click the green ‘+’ icon to add new outputs. Add outputs
NTypes 400,403 and 406, (the ‘horizontal external illuminance’, ‘Daylight shading control signal’ and
‘Daylight illuminance of first daylight controlled gain’) Note that multiple daylight control gains can be
defined, each with its own GeoPositions. > Save.

GENERATE RADIANCE FILES

When using the integrated daylight simulation feature, daylight coefficients for every sensor point have to
be generated according to the DAYSIM approach [daysim.ning.com]. These coefficients are obtained by
raytracing methods with RADIANCE [www.radiance-online.org ]. The generation process and its
parameters are explained in detail in section 5.2.9.5 of 05-MultizoneBuilding.pdf

Select Tools > Generate radiance files. Choose “classic” format of daylight coefficients for DAYSIM.
Adapt the geographical information according to your weather file.

The ground may have a significant influence to the daylight results. The ground is modeled as a ‘ground
glow’ generated with the ground reflectance. For being more accurate the user may draw the ground
surface as shaders in Trnsys3d and assign the IDs here. The ground reflectance is applied to these
shading surfaces. The ground surface must be defined large enough to shield the ground glow and reflect
enough radiation (a common rule is an extension of 5x building height). For this example, a ground
surface with the shader ID 10004 was added.

9–82
TRNSYS 18 – Tutorials

Click the Green triangle button to generate the radiance files. This may take some minutes for a simple
model, to a few hours depending on the parameters and the model complexity.

CONNECT OUTPUTS TO PLOTTER IN SIMULATION STUDIO

In Simulation Studio, right click the Building icon and click “Update Building Variable List”. This will make
the new defined daylight outputs (NType 400,403 and 406) in the previous step, available to connect to a
printer. Create a new Online Plotter called ‘Daylight’ and connect it to the Building type. (see

9–83
TRNSYS 18 – Tutorials

All related files of this step are located at \Trnsys18\Examples\3D_building\ 6_Step_Add_Daylight\.

9–84
TRNSYS 18 – Tutorials

9.3.3. Using T3D (SketchUp Plug-in) without 3D Building


Wizard
In this tutorial, we will first create a simple building model in TRNSY3D. Then we will build a project from
scratch inside Simulation Studio where we enter all the components one-by-one including the multi0zone
building component.

9.3.3.1. Creating the 3D Building Model


The building modeled in this tutorial is intended to be a small 2-story office building. The model will
include 5 thermal zones – 4 on the lower floor and 1 on the upper floor. Diagrams for the building are
shown in Figure 9-21, Figure 9-22, and Figure 9-23.

Figure 9-21: Lower Story Floor Plan

9–85
TRNSYS 18 – Tutorials

Figure 9-22: Upper Story Floor Plan

Figure 9-23: Building Perspective

Start up SketchUp and make sure that the TRNSYS3d plugin in installed. If it is installed correctly the
TRNSYS3d toolbar will be visible in SketchUp as shown in Figure 9-24.

9–86
TRNSYS 18 – Tutorials

Figure 9-24: TRNSYS3d Toolbar

This toolbar contains all of the controls for the TRNSYS3d program. If SketchUp has started correctly
including the TRNSYS3d toolbar, we can move on creating a building model. Start with a blank project as
shown in Figure 9-25.

Figure 9-25: Blank SketchUp and TRNSYS3d Project

Add the first zone using the Add Zone icon as shown in Figure 9-26.

9–87
TRNSYS 18 – Tutorials

Figure 9-26: First Zone Added

Open the Object Info window for the zone and rename the zone Lower1 as shown in Figure 9-27.

Figure 9-27: Object Info Window

If you look at the Outliner window you can now see the zone with the name Lower1 as shown in Figure
9-28.

9–88
TRNSYS 18 – Tutorials

Figure 9-28: Outliner Window

In order to enter the geometry for a specific zone it is necessary for the zone to be active in TRNSYS3d.
You can make a zone active by double-clicking on its name in the Outliner window. (Note – not having the
zone active will cause you to draw the geometry in SketchUp, but not in TRNSYS3d so that it will not be
in your building model; this is the most common source of errors in using TRNSYS3d.) When a zone is
made active in TRNSYS3d the lines denoting the extent of the zone geometry will change from blue to
grey as shown in Figure 9-29.

Figure 9-29: Zone Active in TRNSYS3d

9–89
TRNSYS 18 – Tutorials

With the first zone active, we need to draw in the surfaces of our zone. For the first line, select the line
tool, click on the origin point and draw a line along the red axis line for 15 m as shown in Figure 9-30.

Figure 9-30: First Line of the Zone

From the end-point of the first line, draw a line parallel to the green axis for 10 m as shown in Figure 9-31.

Figure 9-31: Second Line of the Zone

9–90
TRNSYS 18 – Tutorials

Finish the floor surface of the zone with a line parallel to the red axis to the green axis and then another
line back to the initial point at the origin as shown in Figure 9-32.

Figure 9-32: Finished Floor Surface of the Zone

Now to create a wall, draw a line from the origin along the blue axis 3 m long as shown in Figure 9-33.

Figure 9-33: First Line of Wall

9–91
TRNSYS 18 – Tutorials

Finish the wall by drawing from the endpoint parallel to the green axis 10 m long and then a line down to
the endpoint of the line along the green axis as shown in Figure 9-34.

Figure 9-34: Completed First Wall

Draw the remaining three walls following the same procedure (the will also automatically complete the
ceiling for the zone) as shown in Figure 9-35.

Figure 9-35: Completed First Zone

9–92
TRNSYS 18 – Tutorials

This is a good point to save the TRNSYS3d project. Select the Save button in the toolbar and save the
project file as ExampleBuilding.idf as shown in Figure 9-36. It is good idea to save your project at points
during the process of completing your TRNSYS3d project creation. It is even better practice to use
incremental file names so that you can go back to an earlier version of the project if a problem has
occurred.

Figure 9-36: Saving the Project

Now we return to our project and add a second zone. Click the add zone button and then click at the
endpoint of the first zone along the red axis. This will add the new zone frame adjacent to the first zone
as shown in Figure 9-37.

Figure 9-37: Adding the Second Zone

Change the name of the zone to Lower2 in the object window, and draw the second zone – remember to
make the zone active before drawing the surfaces – as shown in Figure 9-38.

9–93
TRNSYS 18 – Tutorials

Figure 9-38: Completed Second Zone

A very important step in defining the building to be used by TRNBuild is to determine which surfaces are
adjacent to other zones. This process can be tricky, especially if you wait until the entire model is
complete in TRNSYS3d before trying to match surfaces as adjacent surfaces. It can be easier to check
the model by matching surfaces as you draw zones with adjacent surfaces. The zones Lower1 and
Lower2 share one adjacent wall and we will now go through the process of matching the wall to make it
an adjacent wall.

First let’s look at the current properties for the wall between zones Lower1 and Lower2: activate the zone
Lower1 and ‘hide’ the ceiling surface (note to just hide the surface and not delete the surface). Now make
the wall between the two zones active and select the Object Window as shown in Figure 9-39. Notice
that the wall contract for the wall is Ext_Wall even though the wall is an interior wall between two zones.

9–94
TRNSYS 18 – Tutorials

Figure 9-39: Adjacent Wall in First Zone

Now select the Match button and select Match in Entire Model as shown in Figure 9-40.

Figure 9-40: Surface Matching

Once the matching process is complete look at the properties for the same wall in Lower1 and not the
construction show as Adj_Wall as shown in Figure 9-41l.

9–95
TRNSYS 18 – Tutorials

Figure 9-41: Adjacent Wall Construction

It is best to also check that the wall in Lower2 has also changed to an adjacent wall after the match
procedure.

Now add the remaining two lower floor zones using the same procedures as shown in Figure 9-42 –
remember to match your adjacent surfaces.

Figure 9-42: Completed First Floor

9–96
TRNSYS 18 – Tutorials

Once the first floor is drawn, matched and saved; add the upper floor on top of the lower floor based on
the dimension from the plans as shown in Figure 9-43.

Figure 9-43: Completed Building Geometry

While the upper floor zone does not have any adjacent walls with other zones, it does have adjacent
floor/ceiling surfaces with other zones. However, in order to match the surfaces, they must have identical
vertices with the zones being matched. Right now the floor of the Upper zone is a single surface that is
adjacent to all four zones. We need to subdivide the floor of the upper zone to match the surface of the
lower zones.

Figure 9-44 shows the Upper zone floor as a single surface:

9–97
TRNSYS 18 – Tutorials

Figure 9-44: Second Floor Single Surface Floor

Figure 9-45 shows the floor divided into four surfaces that match the zones below:

Figure 9-45: Second Floor Divided Surface Floor

The Upper zone floor completely cover the ceiling of the Lower2 and Lower3 zones, but only partially
covers the ceilings of the Lower1 and Lower4 zones. Similar to dividing the Upper zone floor, we need to
divide the ceilings for Lower1 and Lower4 into the portion that is covered by the Upper zone and the
portion that is an external roof.

9–98
TRNSYS 18 – Tutorials

Once the surfaces have been divided, run the match tool for the entire model and then check that the
surfaces of the Upper zone floor are all ADJ_CEILING and that the Lower1 and Lower4 ceiling surfaces
are ADJ_CEILING where covered by the Upper zone and EXT_ROOF where exposed to the ambient
conditions.

Windows are added to walls simply be drawing a closed rectangle on the surface of the wall.

Make the Lower1 zone active and draw a 1.5m by 2m rectangle on the wall surface to create a window as
shown in Figure 9-46.

Figure 9-46: Window added to the Lower1 Zone

Finish the Lower1 zone windows by adding two more 1.5m X 2m windows on the same wall and a 1.5m x
6m window on the other exterior wall surface a shown in Figure 9-47.

9–99
TRNSYS 18 – Tutorials

Figure 9-47: All Windows added to the Lower1 Zone

Add the 1.5m x 2m; 1.5m x 4m; and 1.5m x 6m windows to the remaining zones so that the facades look
like the elevations as shown in Figure 9-48, Figure 9-49, Figure 9-50, and Figure 9-51.

Figure 9-48: All Windows added to Front Facade

9–100
TRNSYS 18 – Tutorials

Figure 9-49: All Windows added to Left Facade

Figure 9-50: All Windows added to Right Facade

9–101
TRNSYS 18 – Tutorials

Figure 9-51: All Windows added to Back Facade

Now save your model and you are done!

9.3.3.2. Creating a TRNSYS building model project


The first step is to create the empty TRNSYS project: start-up Simulation Studio and then under the File
menu select New. Select the “Empty TRNSYS Project” and press the “Create” button a shown in Figure
9-52.

Figure 9-52: New Project Window

With the blank project created, select “Save As” from the File menu and save the project as “Building
Example Project”.

9–102
TRNSYS 18 – Tutorials

As the intent of this project is to simulate the behavior of a building, the first component that we will add to
the project is the multi-zone building component.

Select the Type 56 Component from the Loads and Structures -> Multi-Zone Building folder from the
Component Tree and add the component to the project as shown in Figure 9-53.

Figure 9-53: Multi-Zone Building Component added to Project

Right click the Type56 component, and select “Edit Building” as shown in Figure 9-54.

9–103
TRNSYS 18 – Tutorials

Figure 9-54: Edit Building Option

This will open the TRNBuild program. Inside TRNBuild select File->Import TRNSYS3d file as shown in
Figure 9-55.

9–104
TRNSYS 18 – Tutorials

Figure 9-55: TRNBuild Import Option

In the Import TRNSYS3d File screen push the small green arrow and browse to find the TRNSYS3d file
you created earlier. Then select the Northern Hemisphere for the project and press the Import arrow as
shown in Figure 9-56.

Figure 9-56: TRNBuild Import Window

9–105
TRNSYS 18 – Tutorials

The geometry has now been imported into the TRNBuild program and you can see the Project window on
the left side of the screen and the Navigator window with the list of the zones on the Right as shown in
Figure 9-57.

Figure 9-57: TRNSYS3d Data Imported into TRNBuild

Now we need to define the other characteristics of our building for the model.

First let us define the physical make-up of our walls.

From the Construction Types in the TRNBuild Navigator, double click the EXT_WALL. In Figure 9-58,
you will see that TRNSYS has put in some default constructions for the wall.

9–106
TRNSYS 18 – Tutorials

Figure 9-58: Wall Type Manager

Since this construction does not match the construction of the wall in our building we need to delete the
layers and then add the correct layers. You delete a layer by selecting the name of the layer and then
pushing the arrow that send the layer from the wall construction and toward list of available layers. Do
this until there are no layers left in the wall constructions as shown in Figure 9-59.

9–107
TRNSYS 18 – Tutorials

Figure 9-59: Ext_Wall in the Wall Type Manager with the Layers Deleted

To add the appropriate layers to our wall select the new option from the list of available layers and we can
define the properties of our first layer. Our first inside layer is gypsum board so add the properties as
shown in Figure 9-60:

9–108
TRNSYS 18 – Tutorials

Figure 9-60: New Layer Type

Name GypBoard: k = 0.576 kJ/h m K; Cp = 1.09 kJ/kg K; density = 800 kg/m3 and click the checkmark
button.

It now asks you for the thickness of the layer in the wall, so enter 0.019 m as shown in Figure 9-61.

Figure 9-61: Layer Thickness Window

Add the remaining layers as shown in Figure 9-62:

Name StlStuds: k = 0.389 kJ/h m K; Cp = 1.22 kJ/kg K; density = 61.77 kg/m3; t = 0.09 m
Name AirGap: massless resistance = 0.0417 h m2 K/kJ
Name Insul: k = 0.108 kJ/h m K; Cp = 1.21 kJ/kg K; density = 43 kg/m3; t = 0.05 m
Name Brick: k = 3.204 kJ/h m K; Cp = 0.79 kJ/kg K; density = 1920 kg/m3; t = 0.1 m

9–109
TRNSYS 18 – Tutorials

Figure 9-62: Ext_Wall with New Layers

For the convective heat transfer, since this is an exterior wall, set the front (interior) surface to internal
calculation: vertical wall. For the back (exterior) surface make the convective heat transfer coefficient to
user-defined and set the value to an input called HOUTSIDE as shown in Figure 9-63. We will calculate
this value in our TRNSYS project later.

9–110
TRNSYS 18 – Tutorials

Figure 9-63: Back Convective Coefficient set to Input HOUTSIDE

So the defined wall would look like Figure 9-64:

9–111
TRNSYS 18 – Tutorials

Figure 9-64: Completed Ext_Wall Description

Define the remain walls as

ADJ_WALL as shown in Figure 9-65

Name GYPBOARD: t = 0.019 m


Name STLSTUDS: t = 0.09 m
Name GYPBOARD: t = 0.019 m

Convection coefficients Internal Calculation: Wall for both surfaces

Figure 9-65: Completed Adj_Wall Description

EXT_ROOF as shown in Figure 9-66:

Name Concrete: k = 1.908 kJ/h m K; Cp = 0.84 kJ/kg K; density = 1280 kg/m3, t = 0.1 m
Name Insul; t = 0.05 m
Name Roofing: k = 0.504 kJ/h m K; Cp = 0.9 kJ/kg K; density = 530 Kg/m3, t = 0.019 m

9–112
TRNSYS 18 – Tutorials

Convection coefficients: Front (interior) Internal Calculated: Ceiling; Back (exterior) User-Defined:
HOUTSIDE

Figure 9-66: Completed Ext_Roof Description

ADJ_CEILING as shown in Figure 9-67:

Name Concrete: t = 0.1 m

Convection coefficients: Front Internal Calculated: Ceiling; Back Internal Calculated: floor

9–113
TRNSYS 18 – Tutorials

Figure 9-67: Completed Adj_Ceiling Description

GROUND_FLOOR:

The slab-on-grade for our building presents some unique challenges. Just entering the floor properties as
constructed and connect these to the ambient temperature will dramatically over-predict the heat transfer
through the slab. Using the same properties and connecting the wall surface to the deep earth
temperature will not capture the variations in the heat transfer. The most correct method for simulating
the heat transfer through a slab (or basement) would be to use a detailed 3-D heat transfer model for the
ground temperature, but that is more work than is appropriate for an initial building simulation like we are
doing here. If the initial studies show that the heat transfer through the slab is a significant concern, the
more detailed model can be added later. There are a number of simplified methods to estimate the heat
transfer through a slab and the one we will use here is the ASHRAE F-factor method. In this method the
heat transfer through the slab is estimated by Equation 9-1.

Equation 9-1

Where q is the heat transfer, F is the perimeter heat lost factor, P is the exposed perimeter of the slab, Ti
is the indoor temperature and Ta is the ambient temperature. F factors are available from a table in
Appendix A of ASHRAE Standard 90.1. For an unheated slab with 12 in of vertical R-10 insulation, the F
factor is 0.58 Btu/h ft F (1.004 W/m K).

9–114
TRNSYS 18 – Tutorials

However, we cannot enter these values directly into TRNSYS. In TRNSYS the heat transfer is calculated
from Equation 9-2.

Equation 9-2
Where U is the overall heat loss coefficient for the wall and A is the area of the wall. These two equations
can be combined into Equation 9-3.

Equation 9-3
For our slab, the perimeter is 100m and the area is 600 m2 and substituting these value into the equation
gives us a u-value for the slab of 0.167 W/m2 K.

To enter the wall properties into TRNSYS for the GROUND_FLOOR we start with the actual construction
of the slab (0.1m of concrete) and then add enough thickness of the insulation (INSUL) wall material we
entered earlier to make the total assembly u-value for the slab equal to 0.167 W/m2 K. For this case,
0.169m of INSUL gives us the correct U-VALUE. For the convection coefficients the front surface is
internally calculated as a floor and since this is boundary wall connected to the ambient temperature the
back surface coefficient should be 0.001 for direct connection to the temperature as shown in Figure 9-68

Figure 9-68: Completed GROUND_FLOOR Description

9–115
TRNSYS 18 – Tutorials

A boundary wall must have a temperature assigned to the boundary. This temperature is set in the zone
window for a boundary wall specific to that zone. Open the zone window for the Lower_1 zone and select
the GROUND_FLOOR wall from the Walls list on the left of the window. At the bottom of the screen you
will see the “boundary conditions” selection. During the process of importing the TRNSYS3d file into
TRNBuild, the boundary condition was automatically set to TGROUND for all of the GROUND_FLOOR
walls as shown in Figure 9-69. We do not need to change this and can simply connect the appropriate
weather property to this input in Simulation Studio.

Figure 9-69: GROUND_FLOOR Boundary Temperature

Window:

From the TrnBuild Navigator select EXT_WINDOW1: The properties for this default window (Double
Pane u = 1.06 SHGC = 0.586) are pretty close to those of our building so we can leave the selection.
Just change the convection coefficients to be front (interior) Internal Calculated: Wall and the back
(exterior) to User-Defined: HOUTSIDE. Since we are not going to model any internal shading of the
windows, we can remove the inputs SHADE_CLOSE and SHADE_OPEN for the radiation depending
shading control and simply set the radiation levels to a constant number as shown in Figure 9-70.

9–116
TRNSYS 18 – Tutorials

Figure 9-70: Window Type Window

You may have notice that there are other wall constructions, layers, windows and other inputs that have
been automatically created by the TRNSYS3d import function. While not necessary it can help the clarity
of your model and connecting inputs to delete these extra things that are not being used.

First we can delete the default wall types that are not used in our model. From the TrnBuild Navigator
right click on the BND_CEILING construction and select “Delete Surface construction”. A window
prompting you to confirm the delete process with appear as shown in Figure 9-71.

9–117
TRNSYS 18 – Tutorials

Figure 9-71: Delete Type Window

Pushing the check mark button with complete the delete process. If you attempt to delete a wall type that
is used in your model the confirmation window will show where the wall is used and will not let you delete
the wall type as shown in Figure 9-72.

Figure 9-72: Delete Type Window with Used Layer

Repeat this process to delete the wall types: BND_FLOOR, BND_WALL, and EXT_FLOOR.

The wall layers that are not used in any of the wall types can be deleted by using the same procedure.
Delete the wall layers CONC_SLAB, FBRGLS_ASHRAE, INS_FLR_ASH, INS_FLR_ASH_900,
PLASTERBOA, RFDCK_ASHRAE, TMBR_FLR_ASHR, and WD_SIDN_ASHRA.

9–118
TRNSYS 18 – Tutorials

For the windows, we are only using the EXT_WINDOW1, so ADJ_WINDOW, ADJ_WINDOW2, and
EXT_WINDOW2 can be deleted.

In order to make the connections to the building model in our project, it is good practice to delete any of
the user inputs that you are not planning to use. You find the inputs by pressing the Inputs button at the
top of the TrnBuild Navigator. This displays the Inputs screen as shown in Figure 9-73.

Figure 9-73: Inputs Window

At the top of the screen are the Standard Inputs for the building model. At the bottom of the screen are
the User-defined Inputs and many of these are not being used on our model. TGROUND is used as the
boundary temperature for our slab and HOUTSIDE is used as the external convection coefficient. The
other inputs are not used and can be deleted. You delete an input by selecting the name of the input and
the pressing the – button. Again if an input is still used somewhere in the building model, TRNBuild will
not allow you to delete the input. When you are done the Inputs screen should look like Figure 9-74.

9–119
TRNSYS 18 – Tutorials

Figure 9-74: Inputs Window with Extra Inputs Removed

Save the file and exit back to Simulation Studio. Since we have changed the inputs to the building model,
right-click on the Type 56 component and select “Update building variable list” as shown in Figure 9-75 to
make the new inputs accessible to Simulation Studio.

Figure 9-75: Update Building Variable List Option

With the physical description of the building complete, we now start working on the driving forces for the
gains for the building. The largest driving force is the weather, so add a weather component a shown in
Figure 9-76.

9–120
TRNSYS 18 – Tutorials

Figure 9-76: Weather Data Reading Component

Double click on the weather component, go to the “external files” tab. The default weather file is for
Madison, WI but we would like to simulate the behavior of the building in Chattanooga, TN. Press the
Browse button and navigate to the Weather\US-TMY3\ directory and select the
US_TN_CHATTANOOGA_LOVELL_FIELD_AP_723240.tmy3 weather file as shown in Figure 9-77.

9–121
TRNSYS 18 – Tutorials

Figure 9-77: Weather Data External File

The Type56 Multi-zone Building component will automatically calculate the incident solar radiation on the
various surface orientations, but we need to set the azimuth of the building. To do this, first insert a new
equation block to the project as shown in Figure 9-78.

Figure 9-78: Insert New Equation Option

Title the equation block Orientation, add input variable ‘SolarAzm’, add an intermediate variable ‘Turn’ to
represent the turn away from true north and set to 0, and add output variable ‘BuildAzm’ and set to
‘SolarAzm-Turn’ as shown in Figure 9-79.

9–122
TRNSYS 18 – Tutorials

Figure 9-79: Entering Equations

With the two components and the equation block added to the project, let’s connect these together into a
simulation as shown in Figure 9-80.

9–123
TRNSYS 18 – Tutorials

Figure 9-80: Creating Connections

With the Weather to Orientation Equation Block link connect the Solar Azimuth Angle to the variable
SolarAzm as shown in Figure 9-81.

Figure 9-81: Connecting Weather to Equations

For the Weather to Building link, connect Dry Bulb Temperature to TAMB, TSGRD and TGROUND;
connect Percent Relative Humidity to RELHUMAMB; connect Effective Sky Temperature to TSKY;
connect Solar Zenith Angle to AZEN; connect Ground Reflectance to GRDREF as shown in Figure 9-82.

9–124
TRNSYS 18 – Tutorials

Figure 9-82: Connecting Weather to Building

For the Orientation equation block to the Building link; connect BuildAzm to AAZM as shown in Figure
9-83.

Figure 9-83: Connecting Equations to Building

This is a good time to add an on-line plotter so we can check whether the simulation is working correctly
before adding more components. But first we should assign a default value for the outside convection
coefficient since 0 is not a reasonable value. Double click on the building component to open the
proforma and go to the inputs tab. Set the value of HOUTSIDE to 64 as shown in Figure 9-84. Later we
will connect this input to a calculated value.

9–125
TRNSYS 18 – Tutorials

Figure 9-84: Entering Constant Input

From the Assembly menu select the Output Manager as shown in Figure 9-85.

Figure 9-85: Output Manager Option

In the Output Manager, add an on-line plotter and set the left axis for one input and set it to the ambient
temperature. Make the right axis have 5 inputs and set these to the 5 zone temperatures as shown in
Figure 9-86.

9–126
TRNSYS 18 – Tutorials

Figure 9-86: Output Manager

Now save the project and run the simulation.

Figure 9-87: On-line Plotter

As shown in Figure 9-87, the simulation runs without any errors and the zone temperatures decrease with
the drop in ambient temperature, so things look correct and we can move on to other driving forces.

Infiltration

Infiltration is the introduction of ambient air into the building through cracks in the construction due to the
pressure difference between the inside of the building and the ambient. There are programs that can be
used to calculate the infiltration flow into the building, but usually the infiltration is set to a constant value
for the entire simulation. Based on ASHRAE HOF chapter 16, a building with typical construction will

9–127
TRNSYS 18 – Tutorials

have an infiltration rate of 1500 cm 3/s m2 (5.4 m3/h m2) per external wall area. For the lower zones this
works out to 1.11 air changes per hour and for the upper zone it is 0.93 air changes per hour. Since the
lower zones have 70 m 2 of external wall area and a volume of 450 m 3 this works out to 0.9 ach for the
lower zones. The upper zone has 240 m 2 of external wall area and a volume of 1200 m 3 for an infiltration
rate of 1.08 ach.

Right click the building component and select Edit building to open the building model in TRNBuild. First
we need to add our infiltration types to the regime types. From the Navigator right click on the Infiltration
Types and select Add Infiltration. This will open the New Infiltration Type window. Define the infiltration
type INF_LOW and set the value to 0.9 ach as shown in Figure 9-88. Follow the same procedure to
define a second infiltration type called INF_UP set it to 1.08 ach.

Figure 9-88: Infiltration Window

From the Navigator select the Lower1 zone and the Zone window will open. Select the infiltration button,
switch the infiltration to on and select the INF_LOW infiltration type as shown in Figure 9-89.

Figure 9-89: Infiltration Option

Set the infiltration rate for each of the other lower zones to INF_LOW and the upper zone infiltration rate
to INF_UP following the same procedure.

Save and close the building file to return to Simulation Studio.

9–128
TRNSYS 18 – Tutorials

Convection Coefficients

The convections coefficients for heat transfer from the exterior of the building depend on the conditions
on the exterior of the building. Earlier we define an input to the building model for the convection
coefficient on the exterior of the building. We need to define the value for that input. There are many
different calculation methods for the external convection coefficients of varied complexity. McAdams
offers a simple correlation for the convection coefficient [W/m 2 K] based on the wind speed for rough
surfaces shown in Equation 9-4:

Equation 9-4

To add this calculation to the project add a new equation block named Convection, enter an input variable
for the windspeed, add an output variable for the exterior convection coefficient, and enter the equation
as shown in Figure 9-90 (remembering that TRNSYS will be looking for the convection coefficient in kJ/h
m2 K rather than W/m2 K). With the equation block defined, connect the windspeed from the weather
data type to the equation block and the convection coefficient from the equation block to the building
component as shown in Figure 9-91.

Figure 9-90: Convection Coefficient Equation

9–129
TRNSYS 18 – Tutorials

Figure 9-91: Project with Convection Coefficient

Internal Gains

Internal gains, such as occupancy, lighting and equipment, are a main driving force for building loads.
Also they are rarely constant throughout the simulation, so it is necessary to provide schedules for the
gains to better simulate the actual building.

The first step is to enter the inputs to the building model for the occupancy, lighting and equipment gains.
Right click on the building component and select “Edit building” to open the building model in TRNBuild.

Next we need to define our gains. For the occupancy gain, right click Gain/loss Types in the Navigator
and select Add Gain from Library. Select the ASHRAE_130W-Person gain type by double clicking on the
gain as shown in Figure 9-92.

9–130
TRNSYS 18 – Tutorials

Figure 9-92: Defining Occupancy Gains

To define the Lighting gain, right click on the Gain/loss Types in the Navigator and select Add Gain.
Name the gain LIGHT and set the radiative portion 0.8 kJ/h and the convective portion 0.2 kJ/h as shown
in Figure 9-93. We will set the amount of the gains as inputs to the zones, so we only need to set the
radiative/convective split at this point. Use the same procedure to define a gain called Equip with a
radiative power of 0.5 and a convection power of 0.5.

9–131
TRNSYS 18 – Tutorials

Figure 9-93: Defining Lighting Gain

Next we need to add the gains to the zones. Select the Lower1 zone from the Navigator. Click the
Gains/losses button. Click the plus sign to add a gain. Select the ASHRAE_130W-Person_AV_24C gain
and set the scale to a new input called PEO_L1 as shown in Figure 9-94.

9–132
TRNSYS 18 – Tutorials

Figure 9-94: Occupancy Gains

Use the same procedure to add a lighting gain of the scale LIGHT_L1 and an equipment gain of the scale
EQP_L1 as shown in Figure 9-95.

Figure 9-95: Lower1 Zone Internal Gains

Do the same for the remaining zones, changing the input scaling variables to L2, L3, L4, and Up as
appropriate. Save the building model and update the building variable list in Simulation Studio.

Often, the peak gain is defined or a per floor area basis. For example, for an office type building the
occupancy will be assumed to be 1 person per each 21 square meter of floor area. Similarly, lighting will
be around 10.8 W/m2 and equipment around 21.5 W/m 2. If you have design data for your building you
should use those values, but for this tutorial we will use these defaults.

Since multiple gains are calculated based on the area, it is convenient to have variables for the areas
defined in the simulation. Add an equation block in the simulation that defines the lower zone area
(LowerArea) equal to 150 m 2 (all four lower zones have the same area) and the upper zone area
(UpperArea) equal to 200 m 2 as shown in Figure 9-96.

9–133
TRNSYS 18 – Tutorials

Figure 9-96: Equation Block with Floor Areas

The peak load densities are also needed as variables. By entering them as variables, it makes it easier
to modify these values in future simulations. Add another equation block called gains and enter LightDen
= 10.8*3.6; EqpDen = 21.5*3.6, and OccDen = 1/21 as shown in Figure 9-97. Remember that the
TRNSYS power units are kJ/h and not W.

9–134
TRNSYS 18 – Tutorials

Figure 9-97: Equation Block with Gain Densities

We know that these values are not constant during building operation, so we need to added schedules for
the various gains. Usually, there will be schedules available from the building design or from actual
operation. However sometimes this information is not available and you will need to use some form of
default schedule. In this tutorial we will implement schedules that are found in the User’s Guide for
ASHRAE 90.1-2007 as shown in Figure 9-99 and Figure 9-99.

Figure 9-163: Lighting and Equipment Gain Schedules

9–135
TRNSYS 18 – Tutorials

Figure 9-99: Occupancy Schedules

Building schedule typically differ between weekdays, Saturdays and Sundays, so it is necessary to enter
base schedules for each of these categories and then conglomerate them into a single input for the
building model. The base schedules can be set using Type 14. From the Utility Component folder add a
Forcing Function – General component to the project. Change the name to “M-F Occ” to denote that it is
the weekday occupancy schedule as shown in Figure 9-165.

Figure 9-165: Project with Forcing Function Component

Type 14 assumes a line between any two points entered in the parameters, so to enter a schedule with
step-changes as our schedules have, you need to enter each combination of times and values. For the
Weekday occupancy schedule you will need to 17 points beyond the initial point.

9–136
TRNSYS 18 – Tutorials

Answer the questions at the bottom of the Parameters with 17 and then enter the following Parameters as
shown in Figure 9-166:
Initial Value of Time: 0
Initial Value of Function: 0
Time at point – 1: 6
Value at point – 1: 0
Time at point – 2: 6
Value at point – 2: 0.1
Time at point – 3: 7
Value at point – 3: 0.1
Time at point – 4: 7
Value at point – 4: 0.2
Time at point – 5: 8
Value at point – 5: 0.2
Time at point – 6: 8
Value at point – 6: 0.95
Time at point – 7: 12
Value at point – 7: 0.95
Time at point – 8: 12
Value at point – 8: 0.5
Time at point – 9: 13
Value at point – 9: 0.5
Time at point – 10: 13
Value at point – 10: 0.95
Time at point – 11: 17
Value at point – 11: 0.95
Time at point – 12: 17
Value at point – 12: 0.3
Time at point – 13: 18
Value at point – 13: 0.3
Time at point – 14: 18
Value at point – 14: 0.1
Time at point – 15: 22
Value at point – 15: 0.1
Time at point – 16: 22
Value at point – 16: 0
Time at point – 17: 24
Value at point – 17: 0

9–137
TRNSYS 18 – Tutorials

Figure 9-166: Forcing Function Parameters

Add Type 14 schedules for Sat Occ, Sun Occ, M-F L&E, Sat L&E and Sun L&E that match the load
profile graphs.

To conglomerate the different occupancy and lights and equipment schedule into single occupancy and
lights and equipment schedules we will use two Type 41 forcing function sequencers.

Add a Utility->Forcing Function Sequencers->Unique Days of the Week->Type41c to the project and
change the name to Occupancy Schedule. Connect the output from the Weekday Occupancy Schedule
to the first 5 inputs of the sequencer for the 5 weekdays and then connect the output of the Saturday
Occupancy Schedule to the 6th input and Sunday to the 7th. Now repeat the process with the lights and
equipment schedules as shown in Figure 9-167.

9–138
TRNSYS 18 – Tutorials

Figure 9-167: Aggregated Forcing Functions

With the base gains and the schedules complete, we need to calculate the zone gains and connect these
to the inputs of the building model. Add an equation block called occupancy, add an input variable for the
fraction of peak occupancy (FracOcc) and output variables for the occupancy gains for each zone. The
equation for the occupancy gains for a zone will be the peak occupancy times the fraction of peak
occupancy. The peak occupancy is define as the occupancy density times the floor area. Previously we
defined both of these in different equation blocks. Since we have already defined these variables it is not
necessary to redefine them in the new equation block. We also do not have to set them as new input
variables. We can use them directly by using the same variable name inside our equation (note – make
sure that the name exactly matches the one used in the other equation block; if not, you will get an error
in your simulation). Earlier, we defined the occupancy density as OccDen and the area of the lower zone
as LowerArea. This means that the occupancy gains for a lower zone would be
FracOcc*OccDen*LowerArea. When you enter this equation into the equation you will see the variables
OccDen and LowerArea are written in red ink. This indicates that they have not been defined inside this
equation block. Normally this would denote a syntax error in your equation, but since we are using
equation names defined in a different equation block this is okay. Now enter the equations for the
remaining zones remembering to use the appropriate area for each zone as shown in Figure 9-168.

9–139
TRNSYS 18 – Tutorials

Figure 9-168: Occupancy Gain Equations

Follow a similar procedure for adding an equation block for the light and equipment gains as shown in
Figure 9-169.

9–140
TRNSYS 18 – Tutorials

Figure 9-169: Lighting and Equipment Gain Equations

Finally, connect the schedule outputs to the fraction on peak inputs and the final gains to the building
zone gain inputs as shown in Figure 9-170.

9–141
TRNSYS 18 – Tutorials

Figure 9-170: Internal Gains Connected to the Building Model

Internal Capacitance

While not a gain to the building, the internal capacitance of the materials and furnishings inside the
building are an important consideration. When a building model is created in TRNBuild, the default for
the capacitance of a zone is simply the capacitance of the air included in the zone (volume times specific
heat of air). In reality, there are many things inside the zone (furniture, furnishings, internal walls, etc)
that add to the capacitance and slow the zone’s response to temperature changes. Leaving the zone at
the default capacitance will over-predict how quickly the zone temperature will change. There is no
definitive rule for adjusting the capacity of the zone, but typically we will multiple the air only capacity by 5
to 15 times.

Since this building is intended to be an office it would mostly likely have an open floor plan with limited
furnishing. So for this example we will multiple the capacitance of the air by 5 to determine the internal
capacitance of the zone. For the lower zones with a volume of 450 m 3 the capacitance of just the air is
540 kJ/k. Multiplying this by five leads to a capacitance of 2700 kJ/K. Change the capacitance of the
zone to this value as shown in Figure 9-171.

9–142
TRNSYS 18 – Tutorials

Figure 9-171: Zone Capacitance

The same situation is true for the moisture changes inside the zone. The moisture capacitance can be
changed by clicking the humidity button in the zone window. Leave the humidity model as the simple
humidity model and change the humidity capacitance ratio to 10 as shown in Figure 9-172.

Figure 9-172: Zone Humidity Capacitance

9–143
TRNSYS 18 – Tutorials

Make the capacitance changes for all of the zones, save the building model and exit TRNBuild.

Save your project and run the simulation to check for errors as shown in Figure 9-173.

Figure 9-173: On-Line Plotter with Internal Gains

At this point we have a building model that reacts to the ambient weather conditions and internal gains.
While this does have some analysis benefit, it usually only really gets interesting when we introduce
heating and cooling (HVAC) systems to our building model. The first step in analyzing HVAC systems is
to determine the design loads for the building.

Determining System Loads

Ventilation Air

Most building codes require fresh air to be provided to the occupants of the building. Since this air will
rarely be at the zone setpoints, the HVAC system must treat this air along with mitigating the envelope,
solar and internal gains in the building. It is important that these fresh air requirements are included when
determining the overall system loads. In the US, the standard for determining the fresh air requirements
for buildings is ASHRAE Standard 62.1. According to ASHRAE Standard 62.1-2004, 0.304 lps/m 2 (0.06
cfm/ft2) and 2.36 lps/occupant (5 cfm/occupant) of fresh air should be provided whenever the building is
occupied.

To include this ventilation air into our building model we need to add the inputs for the air stream to the
building model. In Simulation Studio, right click on the building component and select “Edit Building” to
open TRNBuild. Right click on Ventilation Types in the Regime Types and select Add Ventilation. This
will open the New Ventilation Type window.

Title the new ventilation Type as VENT_L1 and set the airflow to be mass flow rate and set it to an input
called VFLOW_L1. Since we will be determining the conditions of the ventilation air inside our Studio
project, select “external by other component” for the Supply air conditioning option. For the temperature
of the ventilation stream, select userdefined and set it to an input TVENT_L1. For the humidity we will

9–144
TRNSYS 18 – Tutorials

input the properties as relative humidities. Again we will be setting the input humidity and not having it
controlled by Type56, so select userdefined and set to an input RHVENT_L1 as shown in Figure 9-174.

Figure 9-174: Ventilation Type Defined for the Lower1 Zone

You may wonder why we choose to use inputs for the temperature and humidity rather than the options
for automatically use the outside conditions. Since we will want to add a real HVAC system to our model
later which will provide the fresh air for the occupants as well as the heating and cooling, we can use
these inputs later to connect the supply air from that system. So we are adding these now so we don’t
have to go back and add them later.

Now we need to assign this new ventilation stream to the zone. Open the Zone Lower_1 and click the
Ventilation button. In the Ventilation window press the + sign to add a ventilation type to the zone and
then select the VENT_L1 we just defined as shown in Figure 9-175.

9–145
TRNSYS 18 – Tutorials

Figure 9-175: Assigning Ventilation Type to the Lower1 Zone

Create ventilation streams for the remaining zones and assign them to the zones following the same
procedure we just used for zone Lower_1.

Save the model and return to Simulation Studio. When you return to Simulation Studio, right-click on the
building model and select “Update building variable list” to make the new inputs available for connections
in Simulation Studio.

Now we need to define the fresh air flow rates into the zones. Earlier we defined variables for the floor
area of the zones and the occupancy density for the building. We can reuse those variable now to define
the total fresh air requirement. For the lower zones, the total fresh air flow rate in l/s would be

Equation 9-5

The fresh air is only required when the zone is occupied and we can determine this by using a TRNSYS
math function and the occupancy schedule we defined earlier. The function GT(x,y) returns 1 when x > y
and 0 when x <= y. So if we say GT(fraction on occupancy,0) the function will return 1 when the zone
has occupancy and 0 when is does not. The equation for flow rate based on occupancy is then

Equation 9-6

The input to the building model for the fresh air flow rate is in kg/h rather than l/s so the volumetric
flowrate must be converted by the density of air (1.2 kg/m3), the time period (3600 s/h), and the volume
(1000 l/m3).

Equation 9-7

To add this to the project, add another equation block with an input for the occupancy signal for the
building and then an equation for the fresh air flow for each zone. Remember, since the area and
occupancy density variables were defined in other equation blocks, you can use these equation names
without setting them as inputs to the new equation block as shown as Figure 9-176.

9–146
TRNSYS 18 – Tutorials

Figure 9-176: Ventilation Equation Block

When you are entering many or repetitive equations it can be easier to push the “Edit all equations”
button and enter the equations all at once as shown in Figure 9-177.

Figure 9-177: Ventilation Equations

9–147
TRNSYS 18 – Tutorials

Now connect the occupancy signal input to the occupancy schedule output and the ventilation rates to the
building model inputs for the ventilation air inputs as shown in Figure 9-178.

Figure 9-178: Building Ventilation Connections

At this point we are going to still use the ambient air conditions for the temperature and humidity of the
ventilation air, so connect all of the ventilation temperature and relative humidity inputs to the building
model to the dry-bulb temperature and relative humidity outputs from the weather model as shown in
Figure 9-179.

9–148
TRNSYS 18 – Tutorials

Figure 9-179: Building Ventilation Air Conditions Connections

This is a good time to save the project and run the project to make sure that the zone temperatures are
reacting to the fresh air ventilation being added to the building as shown in Figure 9-180.

9–149
TRNSYS 18 – Tutorials

Figure 9-180: Zone Temperatures with Ventilation

Heating and Cooling

With the gains specified, we now need to add in heating and cooling to our building. The building model
has the ability to add ideal heating and cooling systems to the zones. These systems will calculate the
amount of energy needed to maintain a setpoint temperature.

First we must define the heating and cooling types for the building. Open the building model and right
click on the heating type and select Add Heating. Name the heating type HEATING and define the
setpoint to be an input called THEAT. Make sure to check the multiplier is set at 1 and additive value to
zero when you define the input. Leave the Heating Power to unlimited so that we can always meet the
setpoint and the Humidification to off because we will not be humidifying the zone as shown in Figure
9-181.

9–150
TRNSYS 18 – Tutorials

Figure 9-181: Zone Heating Type

Similarly add a cooling type to the zone with the set point temperature as an input call TCOOL as shown
in Figure 9-182.

9–151
TRNSYS 18 – Tutorials

Figure 9-182: Zone Cooling Type

Since we want to use the same setpoints for all of the zones, we do not need to define new heating and
cooling types for each zone. But we do need to activate the heating and cooling for each zone. Activate
the Lower_1 zone and press the heating button. Turn the heating to on and select the HEATING type we
just defined. Do the same for the cooling in the Lower_1 zone. For the remaining zones follow the same
procedure to turn the heating and cooling on.

Save the building model, return to Simulation Studio and update the building model inputs.

Finally we need to add the setpoints for the heating and the cooling. Typically the setpoints in a building
are different during occupied and unoccupied periods. We could define setpoint schedules using Type 14
forcing functions as we did for the internal gains, or we can figure out a way to reuse the schedules that
we have already created. If we want to change the setpoint based on occupancy, we can use the fraction
of peak occupancy schedule and the GT function as we did for the ventilation air. If we wanted a heating
setpoint of 20C during occupied periods and 18.33C during unoccupied periods, we can define an
equation of

Equation 9-8

Similarly, for a cooling setpoint of 22.22C during occupied and 23.89C during occupied periods we can
define an equation of

Equation 9-9

These setpoint equations could be added in a new equation block, or we can take advantage of an
existing equation block that already has the necessary occupancy schedule inputs. The equation block
we previously defined for the ventilation air has the fraction of occupancy schedule as an input, so we can
just add the setpoint equations to that equation block. Rename the equation block from “Ventilation Air” to
“HVAC Settings” so it is easier to remember which information is set in the equation block. Open the
equation block and add the equations for the heating and cooling setpoints. Open the link between the
equation block and the building and connect the setpoint equations to the setpoint inputs as shown in
Figure 9-183.

9–152
TRNSYS 18 – Tutorials

Figure 9-183: Setpoint Connections

Save and run the project.

Figure 9-184: One-Week Simulation

Running a simulation for one week, as shown in Figure 9-184, to determine the design loads on a building
does not make sense. We should set-up a one-year simulation. Open the control cards and set the
simulation stop time to 8760. Now run the simulation and look at the on-line plot as shown in Figure
9-185.

9–153
TRNSYS 18 – Tutorials

Figure 9-185: Full Year Simulation

Now we have on-year of temperature data, but it is hard to see anything in detail on the plot. The number
of plot screens per simulation is a parameter of the online plotter. Open the on-line plotter component
and change the number of plots per simulation to 52 so each plot will be one week. If we run the
simulation now we get a year-long simulation with a weekly plot on the screen as shown in Figure 9-186.

Figure 9-186: Weekly Plot of a Full Year Simulation

9–154
TRNSYS 18 – Tutorials

The temperature outputs, while interesting, do not tell much about the heating and cooling needed in our
building. To determine the loads on the space we need to look at some other outputs to our building
model. The default outputs from the building model are the air temperature, the operative temperature,
the heating demand, the cooling demand, the electricity demand of lighting gains and the electricity
demands of the equipment gains for each zone. By looking at the heating and cooling demands for each
zone we can see the loads on the space.

We can add a second on-line plotter to display the loads using the Output Manager as shown in Figure
9-187.

Figure 9-187: Output Manager – Adding an Additional On-Line Plotter

Now we can run the model and look at the heating and cooling loads for the building.

Figure 9-188: Building Loads Outputs

9–155
TRNSYS 18 – Tutorials

By looking at the plot in Figure 9-188, we can immediately see an issue with our simulation. At the time
the heating setpoint returns from the night set-back temperature, the model is telling us we have a very
high load which then immediately returns to a more expected value. When you are running a model with
ideal heating and/or cooling and unlimited power, if there is a step-change in the setpoint, you will see a
very large spike in the loads. Since the ideal heating/cooling model is calculating the energy needed to
maintain the setpoint, when the setpoint makes an immediate change there is a large amount of energy
needed instantaneously to move the zone temperature to the new temperature. To solve this issue we
could limit the power of the ideal heating and cooling, but what value would we use as the maximum
power. Since we are creating this simulation in order to determine the size of the equipment we cannot
set a maximum power because this will become the size of our equipment. We could make the setpoint
temperature change more slowly over time, but this is not how the thermostat would actually work. The
setpoint would change and the equipment would operate at full load until the new setpoint was satisfied.
We could remove the set-back/set-up portion of the setpoint schedule so that we have a constant
setpoint. Since we are worried about the load during the occupied period this solution makes the most
sense. Once we have determined the size of the equipment we can return the set-back/set-up into the
schedule and limit the power (or add a real HVAC system to the model).

Open the HVAC Settings equation block and set the heating setpoint to 18.33 C and the cooling setpoint
to 23.89 C. We can accomplish this and save the set-back/set-up part of the equation for use later, by
placing an “!” just before the set-back/set-up portion of the equation a shown in Figure 9-189. The “!”
denotes that everything else written to the right in the equation is a comment and will not be evaluated by
TRNSYS.

Figure 9-189: Changing the Setpoints

Now when we run the project the spike have disappeared as shown in Figure 9-190.

9–156
TRNSYS 18 – Tutorials

Figure 9-190: Output with Constant Setpoints

We have the energy needed for each zone to maintain a setpoint, but scrolling through the on-line plots
and trying to determine the necessary equipment size to meet the loads is not practical. So let’s create a
data file of the ideal heating and cooling loads for the various zones. The Printegrator is a component
that both integrates the input values and prints them to an external file. Add a Printegrator component
from Output – Printegrator – Unformatted - User-Defined Period to the project as shown in Figure 9-191.

9–157
TRNSYS 18 – Tutorials

Figure 9-191: Printegrator Component

Double click on the printegrator component to set the parameters as shown in Figure 9-192 Simulation
Studio automatically assigns the logical unit number for the output file (and the monthly summary file to -1
denoting that we did not select the monthly summary). Since we want the output file to show the output
for the entire simulation we can leave the relative or absolute start time to relative (=0) so that it prints at
each time interval from the beginning of the simulation. The printing & integrating interval parameter
takes some more thought. What time period makes sense for determining the required size of the HVAC
equipment? Too short of an interval and we are likely to oversize the equipment and see lots of on-off
chatter and too long of an interval and we will likely undersize the equipment and not maintain setpoint. A
typical time period for determining sizing loads is 15 minute averages, so we can set the internal to 0.25
hours.

9–158
TRNSYS 18 – Tutorials

Figure 9-192: Printegrator Parameters

On the Inputs tab, set the number of variables to be printed to 10 and set a meaningful name for the
outputs in the Value column as shown in Figure 9-193.

Figure 9-193: Printegrator Inputs

If we want units for our outputs in the file we need to enter them as Special Cards. In the Special Cards
tab set the number of labels to 10 and since the load values are power (kJ/h) integrated over time the
output values will be energy (kJ) as shown in Figure 9-194.

9–159
TRNSYS 18 – Tutorials

Figure 9-194: Printegrator Special Cards

Finally we need to set the name of the output file in the External Files tab. The *** characters are a
wildcard in TRNSYS and mean replace the *** characters with the name of the project file. Since this
means that the printegrator will create a file with the name of the project file and the .out extension we
can leave this set-up as default as shown in Figure 9-195.

Figure 9-195: Printegrator External Files

Now close the Printegrator component and create the link between the building model and the
printegrator as shown in Figure 9-196.

9–160
TRNSYS 18 – Tutorials

Figure 9-196: Building - Printegrator Connections

Now run the project and the file Example.out is created with the 15-minute average loads for the zones.
The file can be opened in a program like Microsoft Excel and the peak 15-minute heating and cooling
load for each zone can be determined. Or if HVAC equipment is going to serve more than one zone, the
zone values can be summed for individual 15-minute periods to determine the peak coincident loads.

Modeling an HVAC System

At this point we have a model that can be exercised to learn many things about the building’s reaction to
different stimuli. By looking at the changes in the building loads versus any change in the driving forces,
you can determine any changes needed in the building design and what features have a big influence on
the building loads. But building loads are not energy consumption. In order to determine the energy
consumption of the building it is necessary to add an HVAC system model to the simulation.

We need to make some changes in the building model and our project to get ready for adding the HVAC
system. In the building model we need to turn off the ideal heating and cooling for each zone. This is
very important because if we leave it on, even though we have added a HVAC system to the model, the
building model will still maintain the zone temperature at the setpoint (and calculate the energy needed to
maintain the setpoint). Right click on the building component and edit the building model. Inside
TRNBuild activate each zone and set both the heating and cooling to Off.

9–161
TRNSYS 18 – Tutorials

In the Studio Project, we will still need all of the internal gain components, but we do not need the
ventilation air and setpoint that we added to calculate the design loads. Go ahead and delete the links
between the HVAC Settings equation block and the building component. We can leave the equation
block in the project for now because it has information that we will use later for the HVAC system. We
can delete the Printegrator component as well since we will not be calculating the heating and cooling
loads.

The system that we are going to add to the project is an air-source heat pump system where each zone
will have its own heat pump providing the heating and cooling. If we look at the ExampleBuilding.out file
produced earlier we can find the maximum 15 minute integrated heating and cooling load for each zone.
We can use these loads to estimate the size of the equipment needed for each zone. The integrated
loads are in kJ per 15 minutes so we need to multiply the values by 4 to get kJ per hour. Since we are
planning to use night setback/set-up, we need to oversize the units to have the capacity to return the
zones to the setpoint so we will multiple the loads by 1.25. The zone loads are shown in Table 9-1 and
Table 9-2.

Table 9-1: Cooling Loads (kJ/h)

Zone 15m load hour load design load

Lower1 8,601 34,402 43,003

Lower2 7,459 29,835 37,294

Lower3 7,394 29,575 36,969

Lower4 8,563 34,252 42,815

Upper 17,414 69,655 87,069

Table 9-2: Heating Loads (kJ/h)

Zone 15m load hour load design load

Lower1 6,648 26,591 33,239

Lower2 5,967 23,867 29,834

Lower3 6,008 24,032 30,040

Lower4 6,732 26,927 33,659

Upper 18,041 72,164 90,205

Typically heat pumps are selected based on the cooling load needed and any short-falls of the heating
load are made up with auxiliary heat. If you remember, the ideal cooling system we used in the building
model did not include the humidity effects inside of the zones. Thus, the cooling loads that were
calculated are the sensible cooling loads and not the total cooling loads. So when we select the
appropriate size heat pumps for our zones we must use the sensible cooling capacity and not the total
cooling capacity. Some heat pump design data can be seen in Table 9-3.

Table 9-3: Some Typical Heat Pump Design Capacities (for demonstration purposes – do not use for actual
sizing)

9–162
TRNSYS 18 – Tutorials

Size Total Sensible Cooling Heating Heating Airflow Outdoor Indoor


(kW) Cooling Cooling Power Capacity Power (l/s) Fan Fan
(kJ/h) (kJ/h) (kJ/h) (kJ/h) (kJ/h) Power Power
(kJ/h) (kJ/h)

10.55 40092 28803 12420 39037 11556 566 671 2685

14.07 52859 39670 15840 46423 13896 755 1074 2685

17.58 66891 49799 18468 61721 17784 944 1074 2685

21.10 82295 59822 23688 74909 21420 1133 1879 2685

26.38 99176 73116 28872 90735 26676 1416 2013 2685

35.17 132938 99914 37944 117112 32544 1888 2013 10067

Looking at the required loads and the heat pump design loads, the Lower1 and Lower4 zones need a
17.58 kW heat pump, the other Lower zones need a 14.07 kW heat pump each and the Upper zone
needs a 35.17 kW heat pump. In all of these cases the heating capacity of the selected heat pumps is
large enough to meet the required zone load.

Let’s add the first heat pump component to our project. Select the Air Source Heat Pump component
from the HVAC->Air-Source Heat Pump->Electric Auxiliary folder and add it to the project. Change the
name to ASHP-L1 as shown in Figure 9-197.

Figure 9-197: Addition of the First Heat Pump Component

The ASHP component model (and many of the other HVAC components) requires a data file that
includes the performance map for the piece of equipment. This performance map is unique to the exact

9–163
TRNSYS 18 – Tutorials

piece of equipment that is being modeled and you will need to produce this file from the manufacturer’s
performance data for the specific equipment being modeled. The format of this file is discussed in the
documentation for the ASHP component and here we will use files that have already been created for our
components. (Please note that these files do not represent a specific make and model of ASHP and
should not be used in place of an actual performance map in a simulation.)

Many of the parameters for the ASHP model define how the data is presented in the performance map
data file. Logical unit numbers are used by TRNSYS to reference the various files that are read and/or
written. Since these numbers must be unique for each file, Simulation Studio automatically assigns the
logical unit numbers so that there are not any duplicates. The names of the files that are associated with
the logical units must be assigned. Double-click on the ASHP-L1 component and go to the External Files
tab. Here we can select the two files that define the cooling and heating performance map for the heat
pump that will serve the Lower1 zone. Earlier, we determined that we will need a 17.58 kW heat pump so
select the ‘ASHP Cooling 17_58.dat’ and ‘ASHP Heating 17_58.dat’ files for the performance map for the
heat pump as shown in Figure 9-198.

Figure 9-198: External Files Tab for ASHP-L1

Now we need to set the other data parameters to match the file. If you open the cooling data file you can
see how the independent variables for the data file are set as shown in Figure 9-199.

Figure 9-199: Data File ASHP Cooling 17_58.dat

At the top of the file you can see that there is data for 3 air flow rates, 4 return (indoor) air wet bulb
temperatures, 5 return (indoor) air dry bulb temperatures, and 6 outdoor dry bulb temperatures. In the

9–164
TRNSYS 18 – Tutorials

heating file there are 3 air flow rates, 4 return (indoor) are dry bulb temperatures and 16 outdoor air dry-
bulb temperatures. All of these need to be entered as parameters for the ASHP component. Be careful
entering these parameters, because any difference between these parameters and the data in the file will
cause the data to be misread and used incorrectly.

We need to set the remaining parameters to match our selected heat pump. The air flow rate is 944 l/s,
the indoor fan power is 2685 kJ/h and the outdoor fan power is 1879 kJ/h. The remaining parameters can
be left to their default values as shown in Figure 9-200.

Figure 9-200: Parameters Tab for ASHP-L1

Now we can turn our attention to the inputs to the ASHP component for the Lower1 zone. The first inputs
are the conditions of the return air. These will be the zone air conditions and we can create a link
between the Building model and the ASHP-L1 components to define these inputs. First we need to
define outputs from the building model. Edit the building model and open the outputs window. We no
longer need the heating and cooling load outputs and we need to add the zone relative humidity as
outputs. Delete the existing outputs and then add the TAIR and RELHUM outputs for all of the zones as
shown in Figure 9-201. This output is the relative humidity of the zone and is needed to calculate
moisture effects in the rest of the model. Once you have added the outputs save and close the building
model and Update the building variable list in Simulation Studio.

9–165
TRNSYS 18 – Tutorials

Figure 9-201: Adding Relative Humidity Outputs to the Building Model

Now we can go ahead and connect the building model and ASHP component as shown in Figure 9-202.

Figure 9-202: Connections between the Building and the ASHP

Because we selected the mode for the ASHP component for calculations based on the relative humidity,
we only need to connect the relative humidity and the component will automatically calculate the absolute
humidity. Likewise the return air flowrate is calculated by the component and does not need to be
calculated. We are not going to worry about pressure effects in our analysis so those can be left to the
default values. The outside air conditions and the ambient (sink) temperature will be the conditions from
the weather data and we can make a link between the weather data reader and the ASHP component
and make the appropriate connections as shown in Figure 9-203.

9–166
TRNSYS 18 – Tutorials

Figure 9-203: Connections between the Weather Data and the ASHP

The remaining inputs are for the control of the heat pump and we are going to need to add components or
logic to the model for these inputs. HVAC systems are typically controlled by thermostats that determine if
the zone is being maintained at a desired setpoint. Similarly, we will a thermostat to the model to control
when the heat pump is providing heating and cooling. Add a thermostat component from the Controllers-
>Simple Thermostat folder and call it “Thermostat-L1”.

The parameters for the thermostat are the number oscillations permitted and the deadband for the
thermostat. The limit on the number of oscillations is to prevent the thermostat model from iterating
between on and off states during a timestep and causing non-convergence by limiting the number of
times that the thermostat model can change states during a timestep at which point it will ‘stick’ to a
decision allowing the simulation to continue with convergence. By setting this parameter to an odd
number, the controller will stick in an opposite state from the one in the previous timestep. Leaving this
value at its default value of 5 is appropriate for our simulation. A thermostat in real life does not turn on
and off at the same temperature. If it did the HVAC system would continually be cycling on and off
immediately as well. There is some temperature above and below the setpoint where the device
considers that it is on – in other words a cooling thermostat would turn on at 25 and turn off at 23. This
temperature difference is called the deadband and is the second parameter. Two degrees Celsius is a
reasonable deadband so we can leave the default for this parameter as well.

The inputs to the thermostat model are the temperature being monitored and the heating and cooling
setpoints. The monitored temperature is the temperature of the zone Lower1 and we can link the
thermostat component to the building component and connect the zone temperature output to the
monitored temperature input. The heating and cooling setpoints are something that we determined
earlier when we were setting up the ideal heating and cooling system. Since we left the HVAC Settings
equation block in our project, we can simply link the equations we created earlier for the setpoints to our
thermostat model. First we need to go back to the setpoint equations and make the set-up/set-back
active by removing the ‘!’. Then we can connect the equation block to the thermostat model. Now
connect the thermostat control signal outputs to the heat pump heating and cooling inputs as shown in
Figure 9-204.

Figure 9-204: Connections between the Thermostat and the ASHP

9–167
TRNSYS 18 – Tutorials

The next control signal is the Fan Control Signal. Since the heat pump will be providing the fresh air for
the occupants, the fan needs to run at all times the building is occupied and not just when there is a
demand for heating or cooling. We can add an equation to the HVAC Settings equation block that is 1
when the building is occupied and the fan needs to be on. There is already the input to the equation
block ‘Occ’ that is the fraction of peak occupancy at that time, so we can use that to create a new output
FanOn that is gt(Occ,0) as shown in Figure 9-205.

Figure 9-205: Equations for the Fan Control Signal

Create a new link between the HVAC Setting equation block and ASHP-L1 and connect the FanOn
output to the Fan Control Signal input as shown in Figure 9-206.

9–168
TRNSYS 18 – Tutorials

Figure 9-206: ASHP Fan Control Connection

The Outside Air Damper Position determines how much fresh air mixes with the return air before entering
the heat pump. Any time that fresh air is needed for the occupants, the damper position needs to be the
correct ratio of required outdoor air flow to the total flow through the heat pump. Earlier we defined
equations for the mass flow rate of fresh air for each zone. We can easily modify these equations to
calculate the volumetric flow (in l/s) of fresh air for each zone. Since we are going to need to modify
multiple equations, it is easier to utilize the “Edit all Equations” function in the equation block window. If
you press the button a new window will open that includes all of the equations in that equation block. In
the HVAC Settings equation block. Press the Edit all Equations button and then remove the unit
conversion (1.2*3600/1000) from the first 5 equations as shown in Figure 9-207.

Figure 9-207: Fresh Air Flow Rate Equations

For ASHP-L1, we know that the total flow rate through the heat pump is 944 l/s. We can define a new
equation in the HVAC Settings equation block call OADamper_L1 and set it equal to Vent_L1/944 as

9–169
TRNSYS 18 – Tutorials

shown in Figure 9-208. This output value then is connected to the Outside Air Damper Position input for
ASHP_L1.

Figure 9-208: OA Damper Position Calculation

Finally we have the auxiliary heating signals. Since heat pumps are typically selected based on their
cooling capacity, there are times that the heat capacity is not adequate to maintain the desired setpoint.
To address this situation, heat pumps usually come with auxiliary heating that is activate if the space
temperature is not being maintained. The heat pump model we have chosen includes two stages of
electric auxiliary heating. Because you want to only use the auxiliary heat when the setpoint is not being
met, you do not want to use the same control signal that you used for the heat pump heating signal, so
we will need to add thermostats for each stage of auxiliary heating. Setting the auxiliary setpoints can be
a little tricky. We need to think about both the setpoints and the deadbands for the thermostats. If we
want the first stage of auxiliary heat to come on if the zone temperature has dropped one degree below
when the heat pump is in heating mode and turn off at the same point that the heat pump heating would
turn off, it is tempting to think you should just subtract 1 from the heating setpoint and change the
deadband to 3. But since the setpoint is centered in the deadband, this would cause the auxiliary heat to
become active 1.5 degress below the heating setpoint and turn off 0.5 degrees before the heating turns
off. The easiest way to determine your setpoint and deadband is to write out the temperature control you
want. So if you want the heat to turn on at 9 degrees and off at 11 degrees, the setpoint is the average
(9+11)/2 = 10 and the deadband is the difference (11-9) = 2. Since we want the first stage auxiliary to
turn on if the zone temperature drops 1 degree below when heating turns on (8 degress in this example)
and turn off at the same time (11 degrees in the example), then we should set the setpoint to (8+11)/2 =
9.5 and the deadband to 11-8 = 3. Thus, rather than subtracting 1 degree we need to subtract 0.5 degree
and increase the deadband to 3. For the second stage of auxiliary, if we want the stage to come on 2
degrees below the temperature at which heat comes on and turn off at the same time, we use the same
setpoint temperature and increase the deadband to 4. Since our heating setpoints change during the
simulation, we need to set new equations for the two auxiliary setpoints. To the HVAC Settings equation
block add an output Taux_1 = Theat - 0.5 and an output Taux_2 = Theat as shown in Figure 9-209. We
could simply reuse the Theat output for the 2 nd stage auxiliary setpoint, but we may want to adjust this in
future simulations so it is clearer to make a second equation.

9–170
TRNSYS 18 – Tutorials

Figure 9-209: Auxiliary Heat Setpoint Equations

Now we need to add the thermostat components for the auxiliary heat for ASHP-L1. Add two simple
thermostat components called Aux1-L1 and Aux2-L1. For Aux1-L1, set the deadband parameter to 3 and
the cooling setpoint to something high like 99 so that cooling will not turn on. Then connect the Lower1
zone temperature to the monitored temperature and the Taux_1 setpoint equation to heating setpoint.
Then connect the heating control signal output to the Stage 1 Supplemental Control Signal input to
ASHP-L1. Likewise for Aux2-L1, set the deadband parameter to 4 and the cooling setpoint to something
high like 99 so that cooling will not turn on. Then connect the Lower1 zone temperature to the monitored
temperature and the Taux_2 setpoint equation to heating setpoint. Then connect the heating control
signal output to the Stage 2 Supplemental Control Signal input to ASHP-L1.

Now we need to connect the ASHP output to the building model so we can condition the building.
Because we set-up our zone ventilation flows with temperature and humidity inputs rather than just using
the outdoor air conditions, we do not need to add any additional inputs to the building model. But we do
need to disconnect the ventilation temperature and humidity connections to the Weather Data
component. Open the link between the Weather Data and the Building, select the link between the
ambient temperature and Tvent_L1 (the link will turn red when selected) and select the red X to delete the
connection. Do the same for all of the ventilation temperature and relative humidity inputs as shown in
Figure 9-210.

9–171
TRNSYS 18 – Tutorials

Figure 9-210: Connections Deleted

Link the ASHP-L1 component to the Building component and connect the outlet flowrate, temperature
and relative humidity to the VFLOW_L1, TVENT_L1 and RHVENT_L1 inputs as shown in Figure 9-211.

9–172
TRNSYS 18 – Tutorials

Figure 9-211: Ventilation Connections

Before running our simulation we should contemplate our simulation timestep. A heat pump is typically a
device that operates in either the on or off state. If our timestep is too long, the simulation will tend to
over-predict the effect of the heat pump operation on the zone temperature since only one control
decision is made per timestep. So open the Control Cards for the simulation and change the timestep to
12 per hour (or 5 minutes) as shown in Figure 9-212.

9–173
TRNSYS 18 – Tutorials

Figure 9-212: Timestep in Control Cards

Now run the simulation and look at the zone temperature in the on-line plot. The plot (Figure 9-213)
shows that for the Lower1 zone, the temperature is now oscillating around the setpoints while the
remaining zones still show free floating temperatures. The oscillating temperature is caused by the heat
pump turning on and off to satisfy the call for heating from the thermostat. This mimics what would
happen in a real building with a heat pump so we can continue with the project and add the remaining
heat pumps following the same procedure as we did for the Lower1 heat pump. Remember to set the
appropriate heat pump parameters based on Table 9-3.

Figure 9-213: On-line Plot with Lower1 Heat Pump

9–174
TRNSYS 18 – Tutorials

When you are finished adding all of the heat pumps your project should look something like Figure 9-214.

Figure 9-214: Complete Project

Now run the project and check that the temperatures of all of the zones is been controlled appropriate as
in Figure 9-215.

Figure 9-215: On-line with All Zones Controlled

9–175
TRNSYS 18 – Tutorials

Congratulations, you have completed a building model with an HVAC system. Now you can add printers
to see you much power the equipment is consuming, play with different controls, try different sizing of the
heat pumps, etc. The same process can be used to include different HVAC systems for buildings.

9.3.4. Using TRNLizard (Rhino/Grasshopper)

9.4. Creating a Building Project without 3D Data


Model

9.4.1. Using Building Wizard


To launch the building wizard, choose File / New and then select "Building Project (Multizone)"

Figure 9-216: Building Wizard Step 1: Launching the building wizard

The first step in defining the building is to create thermal zones and tell the wizard which zones are
adjacent to which others. This is done using a grid layout. Clicking in a cell of the grid will create a zone at
that location. In this example, we create 3 zones in E5, E6 and F6.

9–176
TRNSYS 18 – Tutorials

Figure 9-217: Building Wizard Step 2: Zones layout

The representation uses squares independently of the real shape of the building. In our case, the real
shape of the building (which can be refined later in TRNBuild) is different from the simplified "square grid"
view.

The 3rd step is to enter the dimensions of each room:


 Zone E5: Width = 6, Depth = 9, Height = 3
 Zone E6: Width = 6, Depth = 6, Height = 3
 Zone F6: Width = 12, Depth = 6, Height = 3

Figure 9-218: Building Wizard Step 3: Room dimensions

We can then set the glazing fraction of each side of the building (to be distributed equally among all
zones) and a global rotation angle for the building (with respect to due North). The weather data file also
selected. All those parameters can be changed later, once the project is created. The building in this
example has 10% glazing fraction for the North side, 25% for East and West and 50% for South. "North"
is actually 25° East of North.

9–177
TRNSYS 18 – Tutorials

Figure 9-219: Building Wizard Step 4: Building orientation and glazing

We can now define the infiltration and ventilation. In this example, infiltration is 0.2 vol/h at all times and
ventilation is 1 vol/h when the building is occupied (0 else).

Note: the building uses a default schedule for occupancy. All schedules can be modified
later in TRNBuild)

Figure 9-220: Building Wizard Step 5: Infiltration and ventilation

This building has heating and cooling. Set points, maximum power and other characteristics are defined
in step 6. We will use the default values except for the cooling set point (constant value of 26°C).

9–178
TRNSYS 18 – Tutorials

Figure 9-221: Building Wizard Step 6: Heating and Cooling

Internal gains use the default values.

Figure 9-222: Building Wizard Step 7: Internal gains

The last two steps of the building wizard allow us to define shading devices. Step 8 is used to define fixed
shading devices (overhangs and wingwalls). We only define an overhang on the South side of the
building. The dimensions of the window (height = 2 m, width = 13.5 m) approximate the real windows as
one big window. We assume that equivalent window is shaded by a 0.5-m overhang that is attached 0.1
m above the window.

9–179
TRNSYS 18 – Tutorials

Figure 9-223: Building Wizard Step 8: Fixed shading

Movable shadow is only used on the South side of the building as well. We keep the default values for
thresholds and shaded coefficients.

Figure 9-224: Building Wizard Step 9: Movable shading

We can now generate the TRNSYS project. The building wizard will generate a TRNSYS Project and a
Building Description file (.bui). It calls TRNBuild to generate the associated building files, and then opens
the created project in the Studio.

9–180
TRNSYS 18 – Tutorials

Figure 9-225: Building Wizard Step 10: Generating the TRNSYS Project

The TRNSYS project created by the building wizard has all the necessary components and the
connections have been created for you. You can explore them by double-clicking on any component or
link.

Figure 9-226: TRNSYS Project generated by the Building wizard

9–181
TRNSYS 18 – Tutorials

9.4.1.1. Modifying the wizard-generated project


This section will briefly illustrate how you can modify the project generated by the building wizard. You
can modify the building itself but also change or add components in the simulation.

First, we will shorten the simulation period: you can run the simulation for the first week of July (hours
4344 to 4512) by changing the "Start" and "Stop" times in global control cards (accessed through
Assembly/Control Cards or using the document icon circled in Figure 9-227.

You can change the online plotter axis limits by double-clicking on its icon and changing the parameters
(see in Figure 9-227). Set the temperature axis limits of the online plotter to 20 and 40.

Figure 9-227: Changing the simulation start and stop and the online plotter configuration

Turn cooling off by opening the Equation Editor for "Cooling" and setting the "T_COOL_ON" variable to
50 °C (see Figure 9-228); in effect, this raises the cooling set point temperature high enough that cooling
will never be engaged.

9–182
TRNSYS 18 – Tutorials

Figure 9-228: Turning off cooling

Run the simulation and take a look at the plotted temperatures (see Figure 9-229).

Figure 9-229: Temperatures for the first week of July

9–183
TRNSYS 18 – Tutorials

Now we are going to make some changes to the building and study the influence on the results. To edit
the building, right-click on the Building icon and selecting "Edit Building". This will launch TRNBuild (see
Figure 9-230).
 Select Zone F6.
 The South wall is of Type OUTWALL and has an area of 36 m² (including 18 m² of glazing). Its
orientation is SHADS_0_90.
 Change the wall orientation to S_0_90. This will change the incident radiation for the wall and the
included windows, effectively removing the overhang and movable shading effects.
 Change the window area to 35 m².

Figure 9-230: Wizard-generated building in TRNBuild

Save the file. Go back to the TRNSYS Studio by closing TRNBuild and run the simulation again (press
F8). The temperature in zone F6 increases dramatically as far more solar gains enter the zone (larger
window area and no shading). Figure 9-231 shows results of the new simulation.

9–184
TRNSYS 18 – Tutorials

Figure 9-231: Temperatures after changing the South wall / window in zone F6

9.5. Temperature Level Control Tutorial


It is commonly desired to model a building using temperature level control instead of energy rate control.
This tutorial demonstrates changing the TRNSYS Restaurant Example from energy rate control to
temperature level control. There are four important steps to implement temperature level control: turning
off the internal heating and cooling in Type56, defining the inputs, defining the outputs, and connecting
the proper mechanical components in the Simulation Studio. This tutorial will guide through each of the
steps.
Before we start to change to temperature level control, the peak loads for each zone must be found. This
will determine the capacity of the heating and cooling components we add to the project later.
Open the Restaurant.tpf example project in the Simulation Studio from the TRNSYS Examples directory.
Right click on the Type56 component and click ‘Edit Building’. At this point it is recommended that the
project and building are saved as different names (File Save as). In the TRNBuild Navigator, select
the HEATER Heating Type and change the set temperature to a constant value at its maximum, 20C in
this case (Figure 9-232). The cooling type should already be a constant but checking is never a bad idea.
Make sure heating and cooling are turned on for both zones (you will have to turn on cooling for the
DINING zone).

9–185
TRNSYS 18 – Tutorials

Figure 9-232: Setting the Heating type to a constant value

Check the capacity of each zone, it should be about 6 times the volume of the zone. This accounts for the
thermal capacity of the stuff in each zone, see the building tutorial for more details.

Create outputs for the sensible heating and cooling demand for both zones by going to the output
manager in the TRNBuild project window and adding QHEAT and QCOOL outputs for both the KITCHEN
and DINING zones (Figure 9-233). Save the building, go back to the studio, double click the Type56
building, go to the external files tab, click browse and find the updated building file you just edited and
saved. Now insert a Periodic Integrator, Type55, from the Proforma window on the right side. This will find
the maximum value (among many things) for input variables. Attach QHEAT and QCOOL for both the
Kitchen and Dining room from the Type56 to Type55 and run the simulation for a year (can be changed in
the control cards). Send the max value for each variable to a printer (Type25c) which will create a file to
the location of your choosing (can be changed by double clicking the component and going to the external
files tab). For each input in the Type55 parameters tab, set the cycle repeat time to 1 hour, keep the
stopping hour at 8760 and have the printer print results every hour. Run the simulation and open the
output file in excel, find the maximum for each column. These are your maximum loads.

9–186
TRNSYS 18 – Tutorials

Figure 9-233: Creating QHEAT and QCOOL outputs

Now we may begin the change to Temperature Level Control. Open DINING zone, click the Heating
button and turn it off as shown in Figure 9-234. This action removes the TRNBUILD internal heating
setting for the zone. The internal heating and cooling settings in both zones must to be turned off.

Figure 9-234: Heating for Dining Room Zone

9–187
TRNSYS 18 – Tutorials

The next step to achieve temperature level control is to create the necessary inputs for Type56 in
TRNBuild; specifically input air flows that can heat or cool each zone. Open the Ventilation Type
Manager from the TRNBuild Navigator. Only the ventilation for the kitchen zone has been previously
defined as shown in the drop down menu in the Ventilation Type Manager (Figure 9-235). In AirFlow,
select mass flow rate instead of air change rate. Instead of defining the ventilation by a schedule as in
Figure 9-235, click on the green arrow in AirFlow.

Figure 9-235: Kitchen Zone Ventilation Prior to Defining Input

Click on the Input button rather than the Schedule button (Figure 9-236).

9–188
TRNSYS 18 – Tutorials

Figure 9-236: Defining Ventilation as an Input into Type56

A new input may be created by using the drop‐down menu and clicking on ‘ new…’ (Figure 9-237).

Figure 9-237: Creating a New Input for Ventilation

Define the new input as M_DOT_KITCH in the pop‐up window and press the OK button (Figure 9-238).

Figure 9-238: Naming the New Input for Ventilation

Press the OK button to go back to the Ventilation Type Manager for the kitchen zone. The Temperature
of Air Flow and the Relative Humidity of Air Flow also need to be defined as inputs. Using the previous
process to define inputs, create a new input for the inlet temperature and relative humidity to the kitchen
zone called T_IN_KITCH and RH_IN_KITCH, respectively. The Ventilation Type

9–189
TRNSYS 18 – Tutorials

Manager for the kitchen zone should look like that in Figure 9-239.

Figure 9-239: Inputs for the Kitchen Zone Ventilation

The same set of inputs needs to be defined for the dining room zone. To create a new ventilation type
right click on Ventilation Types in the TRNBuild Navigator and selecting Add Ventilation. Name the new
type DINING and using the same process for creating the kitchen inputs, define the flow rate, inlet
temperature, and the inlet relative humidity for the dining room zone, M_DOT_DINING, T_IN_DINING,
and RH_IN_DINING, respectively. The ventilation type for the dining room zone should look like that in
Figure 9-240. The ventilation type needs to be assigned to the Dining zone. Open the Dining zone and
select the ventilation type, click the “+” symbol to add a ventilation type to the zone and assign the
DINING ventilation type you just created.

9–190
TRNSYS 18 – Tutorials

Figure 9-240: Inputs for Dining Room Zone Ventilation

The necessary inputs for temperature level control have been defined and will be listed as inputs into
Type56 in the Simulation Studio.

Now, the necessary outputs for in TRNBuild have to be implemented. In the Project window, click on the
Outputs button (Figure 9-241).

9–191
TRNSYS 18 – Tutorials

Figure 9-241: The Project Window with the Outputs Button

Double click on the existing set of outputs for the DINING, KITCHEN, and STORAGE zones (Figure
9-242).

Figure 9-242: The Output Window

Many of the possible outputs are included, but it is desired to add the relative humidity output,

Select the RELHUM Output, press the left arrow button (Figure 9-243), click the check mark, and click the
check mark again in the Outputs window.

9–192
TRNSYS 18 – Tutorials

Figure 9-243: Adding the Relative Humidity Outputs

Save the *.b18 file, close TRNBuild, and go back to the Simulation Studio. Double click on Type 56 and
check to see that the external file connected to the type is the building you just edited (due to saving as at
the beginning of the project this may not be synced correctly). Right click on Type56 and “Update building
variable list” (Figure 9-244). This will update the inputs and outputs that were just created in Type56.

Figure 9-244: Updating the Type56 Variable List

The project is now ready to obtain the mechanical components for temperature level control. The user
may choose to have both the dining room and kitchen zones on the same mechanical equipment or on
separate mechanical equipment as shown in Figure 9-245. In the case of this example, there is a
Type146 fan, a Type123 cooling coil, Type114 pump to control the fluid into the cooling coil, a Type117
heater, and a Type82 thermostat for each of the two conditioned zones. Grab the components from the
proforma window tree on the right side of the Simulation Studio and drag them into the Simulation Studio
Project.

The Type166 thermostats will monitor the zone temperatures and control the heating and cooling
temperatures based on the input setpoints. Connect the Type56 outputs, TAIR_KITCHEN and
TAIR_DINING, to the each respective Type166 input monitoring temperature. Pick a desired heating and
cooling setpoint. The outputs of Type166, Control signal for heating and Control signal for cooling, should
be connected as the Control function input of the Type117 heater and Type114 pump to control the
cooling coil respectively. The Type166 output Conditioning Signal should be connected to the control

9–193
TRNSYS 18 – Tutorials

signal input of the Type146 Fan. The black dotted lines in Figure 9-246 represent the control signal
connections for the Type166 thermostat.

Figure 9-245: Adding Mechanical Components in the Simulation Studio

Now we must scale the components to the maximum heating and cooling values that we found in the first
step of this tutorial. I found that QCOOL_dining_max was 21530 kJ/hr. Using a standard safety factor of
1.1 for cooling, the Sensible Cooling Capacity for the dining room cooling coil must be 23683.

The Maximum Heating Rate of the kitchen and dining heaters must be updated using the previously
found QHEAT_max, this time with a standard safety factor of 1.25. Once you have updated all of the
heating rates and cooling capacities for both the Kitchen and Dining components, you can finish linking
components. A mass flow rate of 1650 kg/h and 2000 kg/h was used for the Kitchen and Dining loops
respectively (set in the inputs of Type146 fan). This was found using the max loads and a desired delta T
of 11 C.

The solid blue line represents the air stream temperature flow in Figure 9-245. The zone outputs of
temperature and relative humidity should be connected to the inputs of the Type146 fan. Remember, the
fan’s nominal flow rate must be the same as the air flow rate in the cooling coil and furnace so that the
mass balances work out. Continue connecting the air flow rate, temperature, and relative humidity (not
humidity ratios) to and from the mechanical equipment in the Simulation Studio. Note that the Type123
cooling coil needs an inlet fluid temperature and flow rate which can be set as a constant or controlled
with the Type114 pump as shown in Figure 9-245.

When making the connection from the Type117 heater to the Type56 multi‐zone building, the new inputs
that were created in TRNBuild will be displayed in the connection window (Figure 9-246).

9–194
TRNSYS 18 – Tutorials

Figure 9-246: Connection to New Inputs in Type56

Once all of the components are linked, you may want to go to the output manager under the Assembly
tab and plot the zone temperatures or the heating and cooling rates. An example of a plot of the zone
temperatures is shown in Figure 9-247.

9–195
TRNSYS 18 – Tutorials

Figure 9-247: Controlled zone air temperatures

It is important to note a few things about using temperature level control in the TRNSYS. There is no
output mass flow rate for the air in Type56 so the flow rate must be controlled using another component
(in this case a Type146 fan). The simulation time step must be small to account for the temperature
monitoring of the thermostat. Also, the mechanical conditioning should be adjusted accordingly for the
zone loads.

9.6. TRNSYS Multizone Slab Model Tutorial and


Example

INTRODUCTION

The TRNSYS Multizone Slab Model interacts with one or multiple zones in Type56 to simulate building to
ground energy exchange. There are three important steps to implement the TRNSYS Multizone Slab
Model. The first step is to create the SketchUp model and use the provided plugin to create the input file.
The second step is to create the necessary inputs and outputs in Type56/TRNBUILD and connect them

9–196
TRNSYS 18 – Tutorials

to the Multizone Slab model in the TRNSYS Simulation Studio. The third step is post-processing and
viewing the output file.

Figure 1: TRNSYS House in Sketchup

TRNSYS MULTIZONE SLAB MODEL INPUT FILE

The input file is a text, tab-delimited file that contains the number of nodes in the x-direction, y-direction,
z-direction, node locations in the three directions, and the zone locations. It is necessary to create more
nodes close to the building/ground boundaries as shown in the following figure.

Figure 2: Nodes Near Boundary Walls

USING SKETCHUP TO CREATE THE INPUT FILE

The Sketchup software must be installed in order to use to plugin that writes the input file for the
TRNSYS Multizone Slab input file. You may use one of the provided SketchUp files, House for
TRNSYS.skp or House for TRNSYS – Floor only.skp, to use for example purposes. If you intend to
make your own building in SketchUp, the slab layer has to be on the default plane (0 on the blue,
vertical axis and normal to the blue, vertical axis). Your own SketchUp model shall include simple
surfaces on the default plane. The plugin will recognize every surface on this plane and define it as
a separate zone.

9–197
TRNSYS 18 – Tutorials

Figure 3: SketchUp Model for Slab

IMPLEMENTING THE GOOGLE SKETCHUP PLUGIN

The provided TRNSYS Multizone Slab Plugin for Sketchup, SoilNoding_2D.rb, needs to be
placed in the appropriate SketchUp Plugin directory.

A new menu will be created in SketchUp. Please note that you will have to close and reopen
SketchUp to have the menu created. Click on the plugin (Plugins  SoilNoding_2D) to start.

Figure 4: Plugin Menu in SketchUp

TRNSYS MULTIZONE SLAB SKETCHUP PLUGIN

The TRNSYS Multizone Slab SketchUp Plugin prompts a series of windows to define the input
file. The first window is simply prompts the question (Figure 5) in some detail while the following
question (Figure 6) is a numerical value field where the user submits the appropriate answer. If
an error is prompted or any other window that is different from Figure 5 , please follow the
instructions in that window (i.e. saving the project or changing the units).

9–198
TRNSYS 18 – Tutorials

Figure 5: Question Window in the TRNSYS Multizone Slab SketchUp Plugin

Figure 6: Numerical Value Field Window in the TRNSYS Multizone Slab SketchUp Plugin

HORIZONTAL FAR FIELD

The distance away from the slab in the horizontal direction at which the soil is undisturbed by
the heat transfer from the slab. A nominal value for this parameter is usually around 10 to 20
meters.

DEPTH OF FOOTER

The depth of the footer for the slab is usually dependent on the geographic location and the
design of the building. A nominal value for this parameter is 1.5 meters if applicable.

VERTICAL FAR FIELD

The distance beneath the slab in the vertical direction at which the soil is undisturbed by the
heat transfer from the slab. A nominal value for this parameter is usually around 10 to 20
meters.

SMALLEST NODE SIZE

The smallest node size is the shortest distance between the slab edge and the surrounding
earth that will be implemented in the input file. Please recall Figure 2 where the smaller nodes are
located around the significant boundaries between the slab and soil. Thus, a nominal value for the
smallest node size would be 0.1 m, and a finer value would be 0.05 m or less.

NODE MULTIPLIER

The node multiplier is used to increase the node size. A nominal value for node multiplier is 2.
Please note that the value should be greater than 1.

THE REPORTTEXT FILE

9–199
TRNSYS 18 – Tutorials

The report text file that is produced from the plugin i, ***_report.txt, will be used and referenced in
TRNSYS as the input file for the TRNSYS Multizone Slab Model.

REFERENCING THE INPUT FILE FOR THE MULTIZONE SLAB MODEL

In the TRNSYS Simulation Studio (see Figure 7), the text file that was created from Sketchup
needs to be referenced in the External Files tab of the Type49 Multizone Slab Component (see
Figure 8).

Figure 7: Multizone Slab Example in TRNSYS Simulation Studio

Figure 8: External Input File for Multizone Slab Model

9–200
TRNSYS 18 – Tutorials

INPUTS AND OUTPUTS IN TYPE56/TRNBUILD

In order to couple the TRNSYS Multizone Slab Model with Type56/TRNBuild, the slabs created in
TRNBUILD have to be defined as a “Boundary Walls”. When defining the wall type in the Wall
Typemanager in TRNBUILD make sure to specify a back heat transfer coefficient of less than 0.001 as
shown in Figure 9.

Figure 9: Wall Type Manager in TRNBUILD for Back Convective Heat Transfer Coefficient

TEMPERATURE INPUTS FOR SLABS

Again, make sure to specify input temperatures for all of the boundary walls that are coupled to the
Multizone Slab model. Creating the input temperature name is shown in Figure 11.

9–201
TRNSYS 18 – Tutorials

Figure 10: The Input Boundary Temperature in the Zone Window in TRNBUILD

Figure 11: Creating an Input in TRNBUILD for the Boundary Temperature

OUTPUTS FOR BOUNDARY WALLS

9–202
TRNSYS 18 – Tutorials

TRNBUILD has numerous outputs for many different things. The output that is necessary for the
TRNSYS Multizone Slab Model is the surface output, NTYPE 20, QCOMO. Make sure you select
the surface outputs radio button (Figure 13)

Figure 12: The Outputs Button on the Project Window in TRNBUILD

Figure 13: Assigning the Output, QCOMO, to the Appropriate Zone

9–203
TRNSYS 18 – Tutorials

Figure 14: Selecting the Appropriate Surface zone

SURFACE ID NUMBER

Take note of the surface identification number in TRNBUILD. This is necessary to connect the
appropriate Type56 outputs to the TRNSYS Multizone Slab Model component.

Figure 15: Surface ID Number in the Zone Window in TRNBUILD

9–204
TRNSYS 18 – Tutorials

CONNECTING THE INPUTS OF THE MULTIZONE SLAB COMPONENT

The zone air temperatures (TAIR_ZONE#) and the boundary wall heat transfer rates
(QCOMO_S#) need to be connected to the respective inputs of the Multizone Slab component.

Figure 16: Connecting Type56 Building Outputs to Type49 Multizone Slab Inputs

CONNECTING THE OUTPUTS OF THE MULTIZONE SLAB COMPONENT

The boundary temperatures of the Multizone Slab model component are connected to the
userdefined boundary wall temperatures of Type56.

9–205
TRNSYS 18 – Tutorials

Figure 17: Connecting Type49 Multizone Slab Outputs to Type56 Building Inputs

POST-PROCESSING

The TRNSYS Multizone Slab Model creates an output text file (***.Soil_Temperatures). This output text
file may be post-processed in a spread sheet program, or your it may be implemented in the provided
GroundDisplay_Slideshow.exe executable.

3.1 VIEWING THE RESULTS IN THE SLIDESHOW EXECUTABLE.

Open the output file (***.Soil_out or ***.Soil_temperatures) in the provided

GroundDisplay_Slideshow.exe which is located in the same directory as this example.

9–206
TRNSYS 18 – Tutorials

Figure 18: Ground Display Slideshow

The GroundDisplay_Slideshow.exe application is fairly straightforward. The temperature range may be


altered and updated, you may change the view: top view on the X‐Y plane, front view on the X‐Z plane,
and side view on the YZ plane. The View Slider on the right side of the application allows for viewing the
different levels or “slices” through the ground. The Slideshow may also be selected from the View menu
to view through all of the levels.

9.7. Using TRNEdit and creating a distributable


(TRNSED) application
This section explains how to create a simple TRNSYS-based redistributable application using the
Simulation Studio and TRNEdit / TRNSED.

Note: Redistributable stand-alone applications based on TRNSYS, known as TRNSED


Applications, are subject to a special license agreement. The basic terms of the
agreement is that you have the right to distribute those applications free of charge and
that you have to negotiate a contract with the TRNSYS developers if you want to sell
those applications. Please contact your TRNSYS Distributor if you have questions about
licensing.

9–207
TRNSYS 18 – Tutorials

Some distributors may not activate the "Create TRNSED" function by default. If it is the
case, the "TRNSED/Create distributable" menu item will be disabled in TRNEDit. You
should contact your distributor to activate it.

9.7.1. Starting point: TRNSYS Studio project


Open Examples\TRNSED\SDHW-TRNSED (Studio).tpf. This is a slightly modified version of the SDHW
example. The modifications are listed here below. They are already made in the project distributed with
TRNSYS. If you want to repeat the whole process, please replace Examples\TRNSED\SDHW-TRNSED
(Studio).tpf with a fresh copy of Examples\SDHW\SDHW.tpf

Set "Write TRNSED Commands" to "true" and change the deck file name in Control Cards. The deck
filename should say: SDHW-TRNSED (Studio).trd. TRNSED applications must have a .trd extension.

Figure 9-248: Modified Control Cards for TRNSED projects

TRNSED will present a simplified view of the projects, with only some of the parameters available to
users. You need to select those parameters by keeping them "unlocked", while you "lock" all other
parameters to hide them.

This is done by opening the proformas of all components in the simulation and clicking on the lock icon
for the corresponding parameters. It is also possible to lock all parameters of one component by clicking
on the lock icon in the upper left corner of each tab. You must lock all fields in the Studio that you don't
want users to be able to change. This includes parameters but also initial values for inputs and
derivatives, and filenames (see Figure 9-249 for an example).

9–208
TRNSYS 18 – Tutorials

Figure 9-249: Locking parameters, initial input values, file names, derivatives initial values

In this case, we will let users change the weather data file used, the solar collector slope and azimuth
(Set in Type 15, the weather data processor), the solar collector area, the tank volume and the set points
for auxiliary heating and for domestic hot water after the mixing valve. All other input fields should be
locked (not all windows are shown in Figure 9-249, you need to double-click on every single component
in the simulation).

Once all the "lock-unlock" settings are correct, you can generate the TRNSYS input file (the TRNSED
deck in this case) by using "Calculate / Create input file" or using the "pen" button.

Note: This will re-create SDHW-TRNSED (Studio).trd, which you can use as a working
copy for the following. The final TRNSED file after editing is saved in SDHW-
TRNSED.trd. You can use this second file to examine the changes without actually
performing them

9–209
TRNSYS 18 – Tutorials

9.7.2. Editing the TRNSED file in TRNEdit


After creating the file, launch TRNEdit and open it. TRNEdit recognizes that the input file is a TRNSED file
by its extension and by the "*TRNSED" command that is included by the Studio. TRNEdit creates two
tabs, one displaying the source code of the input file, the other displaying the TRNSED view of the file.
Both tabs are shown in Figure 9-250.

Figure 9-250: Opening the input file in TRNEdit: the Source tab and the TRNSED view

By flipping back and forth between the two tabs, you can immediately see the impact of your changes to
the source code in the TRNSED view.

9.7.2.1. Rules for editing TRNSED files


All TRNSED statements start with " *| ". The first character (*) makes sure that TRNSYS will ignore those
instructions (lines starting with a * and all characters after an exclamation mark are ignored by TRNSYS).

The first few lines of the TRNSED file set the title and first comment block. You can edit it to match the
following lines (modified text is in bold):
*|<BACKGROUND> WHITE
*|<COLOR1> RED
*|<SIZE1> 20
*|<ALIGN1> CENTER
*|<STYLE1> ITALIC BOLD

*|[HEADER|
*|*Solar Domestic Hot Water System
*|<STYLE1> BOLD
*|<COLOR1> NAVY
*|<SIZE1> 12
*|* TRNSYS input file: SDHW-TRNSED (Studio).trd
*|* A simple TRNSED demo
*|]
A few TRNSED instructions illustrated here are:

9–210
TRNSYS 18 – Tutorials

 Groups: They are surrounded by a black border to identify a group of settings that go together but
they also serve other purposes (e.g. a group can be turned on or off by TRNSED controls). A group
has a name for TRNSED controls (no blanks) and a title that is displayed in the TRNSED view (if that
name is blank, no title is displayed, as it is the case here). A group starts with:
*|[GroupName|Group title
and ends with
*|]
 Text Style properties such as *|<COLOR1> RED. This command sets the color of comments. You
can use usual color names or any color by specifying values for Red, Green and Blue levels (1 to
255) with the following syntax (the numbers here below will result in the darker red used in the SEL
logo):
*|<color1> rgb(204,0,0)
Other instructions are *|<STYLE1> (e.g. bold, italic), *|<ALIGN1> (left, center, right).
 Comments: They start with *|*. The text after that is just displayed by TRNSED

We can create additional groups in the file (e.g. one for each component). The section about Type 15
(Data reader and weather data processor) is

*|*
*|* *** Model Weather (Type 15, Unit 2)
*|*
CONSTANTS 2
*|*PARAMETERS
SLOPEOFS=45
*|Slope of surface |degrees|degrees|0|1|-
360|360.000|1000
AZIMUTHO=0
*|Azimuth of surface |degrees|degrees|0|1|-
360|360.000|1000

UNIT 2 TYPE 15 Weather


*$UNIT_NAME Weather
*$MODEL \ TRNSYS18\Studio\Proformas\Weather Data Reading and
Processing\Standard Format\TMY2\Type15-2.tmf
*$POSITION 103 129
*$LAYER Weather / Data Files # Weather - Data Files #
PARAMETERS 9
2 ! 1 File Type
39 ! 2 Logical unit
3 ! 3 Tilted Surface Radiation Mode
0.2 ! 4 Ground reflectance - no snow
0.7 ! 5 Ground reflectance - snow cover
1 ! 6 Number of surfaces
1 ! 7 Tracking mode
SLOPEOFS ! 8 Slope of surface
AZIMUTHO ! 9 Azimuth of surface
*** External files
ASSIGN "..\..\Weather\Meteonorm\Europe\CH-Zuerich-Kloten-66700.tm2" 39
*|? Which file contains the TMY-2 weather data? |1000

You can edit it to remove unnecessary comments inserted by the Studio (Those comments are useful if
the deck file was to be re-imported in the Studio) and to enclose all input fields related to this component
in a group called "LOCATION".

9–211
TRNSYS 18 – Tutorials

*|[LOCATION|Location
CONSTANTS 2
SLOPEOFS=45
*|Slope of surface |degrees|degrees|0|1|-
360|360.000|1000
AZIMUTHO=0
*|Azimuth of surface |degrees|degrees|0|1|-
360|360.000|1000

UNIT 2 TYPE 15 Weather


PARAMETERS 9
2 ! 1 File Type
39 ! 2 Logical unit
3 ! 3 Tilted Surface Radiation Mode
0.2 ! 4 Ground reflectance - no snow
0.7 ! 5 Ground reflectance - snow cover
1 ! 6 Number of surfaces
1 ! 7 Tracking mode
SLOPEOFS ! 8 Slope of surface
AZIMUTHO ! 9 Azimuth of surface
*** External files
ASSIGN "..\..\Weather\Meteonorm\Europe\CH-Zuerich-Kloten-66700.tm2" 39
*|? Which file contains the TMY-2 weather data? |1000

After making similar changes to include all individual components in groups, you will get the TRNSED
view shown in (The result after all the editing work is saved in Examples\TRNSED\SDHW-TRNSED
(Studio).trd)

Figure 9-251: TRNSED view after creating groups

9–212
TRNSYS 18 – Tutorials

Note: If you forgot to "lock" some parameters in the Simulation Studio or if you want to hide additional
parameters, it is easy to remove the TRNSED Statements without modifying the TRNSYS statements by
deleting the lines starting with "*|" or commenting them out. This is easily done by adding a second "*" in
front of the "|". The statements here below will display an input field for the Collector slope and another
one to select the weather data file:
SLOPEOFS= 4.5000000000000E+01
*|Slope of surface |degrees|degrees|0|1|0|90.000|1000

ASSIGN "..\..\Weather\Meteonorm\Europe\CH-Zuerich-Kloten-66700.tm2" 39
*|? Which file contains the TMY-2 weather data? |1000
The modified version here below is the same as far as TRNSYS is concerned but will not create the
TRNSED input fields:
SLOPEOFS= 4.5000000000000E+01
**|Slope of surface |degrees|degrees|0|1|0|90.000|1000

ASSIGN "..\..\Weather\Meteonorm\Europe\CH-Zuerich-Kloten-66700.tm2" 39
**|? Which file contains the TMY-2 weather data? |1000

9.7.3. Some refinements

9.7.3.1. Adding an input field


There are a few things we can do to improve the usability of our TRNSED demo:

We can add a parameter that is the daily load. That parameter is set by an equation block in the
simulation and the Studio did not create an input field for it.

Search for the following lines in the file (Edit/Search "Daily load" for example):
* EQUATIONS "Daily load"
EQUATIONS 2
mdDHW = [9,1] * 200 ! Multiply by daily consumption
TCold = 15
We will replace the constant 200 with a new variable, DayDraw:
mdDHW = [9,1] * DailyDraw ! Multiply by daily consumption
Then we have to define that variable and include it in a TRNSED command in the "DHW Load" group:
*|[DHW|DHW Load
Constants 1
DailyDraw = 200
*|Daily hot water draw |l/d|m^3/d|0|0.001|0|1000.00|9999
… Rest of the DHW group
*|]
Do not forget the last line that closes the group.

The syntax to add an input field is as follows:

TRNSYS CONSTANT or EQUATION (Variable = 12345.6789)


*|Description |Units1|Units2|Add|Mult|Min|Max|Help

9–213
TRNSYS 18 – Tutorials

With:
 Description: Descriptive text displayed by TRNSED
 Unit1: Variable units in the primary unit system
 Unit2: Variable units in the secondary unit system
 Add and Mult: Unit conversion between 1 and 2: Unit 2 = Add + Mult*Unit1
 Min: Minimum acceptable value for the parameter
 Max: Maximum value of the parameter. This number also fixes the format used to display the
variable. If you enter 100 for the maximum and want to display 3 digits after the decimal point, you
need to specify 100.000
 Help: Help number in a text file that must have the same name as the .trd file with an .hlp extension
(not used here)

After adding that line, the DHW load group now looks like Figure 9-252.

Figure 9-252: Adding an input field

9.7.3.2. Reorganizing TRNSED fields


We could consider removing the "Location" Group. The weather data file choice would move to the
"Simulation Parameters" group and the collector slope and azimuth would move to the "Solar collector"
group.

Note: When moving TRNSED commands around, it is important to remember that the file
has to be run by TRNSYS. It is important to comply with the TRNSYS syntax when
modifying a TRNSED input file

The initial view is shown in Figure 9-253

Figure 9-253: Reorganizing the input file (1)

9–214
TRNSYS 18 – Tutorials

To modify the file:

Move the opening command for the "solar collector" group up and replace the existing opening of the
"Location" group with it. Delete the closing statement (*|]) for group "Location". The result is shown in
Figure 9-254.

Figure 9-254: Reorganizing the input file (2)

Move the commands that allow users to select the input file up, into the "Simulation Parameters" group.
The two lines making the statement are:
ASSIGN "..\..\Weather\Meteonorm\Europe\CH-Zuerich-Kloten-66700.tm2" 39
*|? Which file contains the TMY-2 weather data?|1000
You must move both lines together. Note that TRNSYS will associate the file correctly with the data
reader thanks to the logical number unit (39) which is among the parameters of Type 15. Move both lines
just above the closing statement for the "SIMPAR" group. It may also be a good idea to prevent users
from changing the simulation time step by adding a "*" in front of the line that defines the input field:
"*|Timestep …" becomes "**|Timestep …". The result is shown in .

Figure 9-255: Reorganizing the input file (2)

9–215
TRNSYS 18 – Tutorials

9.7.4. Adding pictures, links and multiple tabs

9.7.4.1. Pictures
We will first add system schematics to the file to make it more user-friendly. TRNSED can use bitmaps
(.bmp files). The Examples\TRNSED folder contains SDHW-Schematics.bmp, which we will use as the
main picture. That picture was created from a screen shot of the TRNSYS Studio after hiding the output
layer to simplify the schema.

We will include that picture in the first group. Just add the following line of code before the closing
command for the group, after the "*|*A Simple TRNSED Demo" line:
*|<img src="SDHW-Schematics.bmp">
The syntax used to add pictures is very close to the HTML syntax (with the additional "*|" code at the
beginning of the line.

9.7.4.2. Links
You will notice that the picture includes a "question mark icon" that invites user to click for help. TRNSED
allows you to associate actions with pictures. In this simple example, we will launch a help file (HTML
document) when the user clicks anywhere in the picture.

TRNSED allows to define "hot spots" or clickable areas within a picture, each of them
being associated with a different action. In our example, we could have the question mark
open an HTML document with global info on the simulation, and the solar collector open
a PDF with solar collector catalogue data. Links between tabs, which will be described in
this section, can also be associated with hot spots in pictures.

To associate a link to a file or program with a picture, just add a "href=…" instruction to the "img" tag:
*|<img src="SDHW-Schematics.bmp" href="SDHW-Help.html">
You can also display a hint for users when they move the mouse over the picture by adding a "hint"
instruction:
*|<img src="SDHW-Schematics.bmp" href="SDHW-Help.html" hint="Click for help">

9.7.4.3. Multiple tabs


Now that we have a picture on the main page, it might be a good idea to distribute the components in
different tabs so that the user does not have to scroll down too much to make changes to the
configuration.

Tabs are similar to groups in that they require an opening and a closing tag, and they have a name:
*|<TabWindow name="Solar Collector">

All TRNSED commands that should appear in the "solar collector" tab

*|</TabWindow>

9–216
TRNSYS 18 – Tutorials

In this simple example, we can include each component (each group we created before) in a separate
tab. For the "Simulation parameters group, we have:
*|<TabWindow name="Simulation parameters">
*|[SIMPAR|Simulation Parameters
EQUATIONS 5
I_MONTH=3624

ASSIGN "..\..\Weather\Meteonorm\Europe\CH-Zuerich-Kloten-66700.tm2" 39
*|? Weather data file |1000
*|]
*|</TabWindow>

Note: In this case, each tab window has only one group. In general, you can include
several groups in a tab. However, each group can only be part of one tab: the same
group cannot span across several tab windows.

The user will be able to navigate between tabs by clicking on their name. Tabs can also be linked by
pictures. We will add a "Back" link to the main tab from all other ones. In order to do this, we add a group
to the "Simulation Parameters" Tab window:
*|<TabWindow name="Simulation parameters">

*|[SIMPAR|Simulation Parameters

*|]
*|[SIMPAR-Back|
*|<img src="Back.bmp" align="center" href="#Main" hint="back to main">
*|]

*|</TabWindow>
And we can do the same for all tabs. The "Solar collector" tab now looks like Figure 9-256.

Figure 9-256: Adding a "Back" button

Please refer to Volume 6 of the documentation for more information about other TRNSED commands.

9–217
TRNSYS 18 – Tutorials

9.7.5. Creating the redistributable application

9.7.5.1. Preparing the file


You cannot be sure where users will install your application and you cannot rely on TRNSYS files to be
present on their machine. In order to make sure that users will be able to use your application, you need
to go through the input file and search for all absolute path references that are likely to fail on a different
machine. Search for "C:\Program Files\TRNSYS18" for example.

In our case, we need to change two lines to remove the path to the .exe directory and copy those two files
to the Examples\SDHW-TRNSED directory: month1.dat and length.dat. Replace :
*|<Month of the simulation |C:\TRNSYS18\Exe\Month1.dat…

*|<Length of Simulation |C:\TRNSYS18\Exe\Length.dat …
with:
*|<Month of the simulation |Month1.dat…

*|<Length of Simulation |Length.dat …
and copy Month1.dat and Length.dat from Exe\ to Examples\SDHW-TRNSED\

The weather file uses a relative path but it is probably better to save a copy of the different files you want
to send to the users in the current folder: in our case we will just copy "CH-Zuerich-Kloten-66700.tm2"
from Weather\Meteonorm\Europe\ to Examples\SDHW-TRNSED\
ASSIGN "..\..\Weather\Meteonorm\Europe\CH-Zuerich-Kloten-66700.tm2" 39
With
ASSIGN "CH-Zuerich-Kloten-66700.tm2" 39

9.7.5.2. Creating the distributable


Go to "TRNSED", then "Create Distributable" and enter the following information (see Figure 9-257):
 .Exe name: Name of the program that users will have to run (SDHE-TRNSED here)
 Title: Any title you wish to use. It will be displayed on the welcome dialog box.
 Author: will be displayed at startup too.
 Destination directory: Location where you want to place all files required to run the .exe
 Include the following files: Select the .trd file(s) that should be included. Make sure you delete lines
that list files which you do not want to include.

9–218
TRNSYS 18 – Tutorials

Figure 9-257: Creating the TRNSED distributable

Click OK. TRNEdit copies all the required TRNSYS files to the destination directory (MyProjects\SDHW-
Exe here).

Note: TRNEdit will copy the EXE programs, TRNDll and User libraries found in the
UserLib folder. It also copies other required TRNSYS files but not additional input files
that your simulation may use. For that reason, it is recommended to keep all those files in
one directory or in subdirectories under the .trd file, so that you can easily copy all
required files to the destination folder. You should also make sure that you use relative
paths to access those files as you cannot be sure where users will install the application

In our case, the simulation uses 2 pictures: SDHW-Schematics.bmp and Back.bmp. We need to copy
them from "C:\Program Files\TRNSYS18\Examples\TRNSED" to "C:\Program
Files\TRNSYS18\MyProjects\SDHW-Exe". We must do the same with month1.dat, length.dat, the help file
SDHW-Help.html, and the weather file, CH-Zuerich-Kloten-66700.tm2.

After doing this, you can launch SDHW-TRNSED.exe (or the name you gave to the exe).It is
recommended that you test the distributable after moving the destination directory outside "C:\Program
Files" and temporarily renaming your "C:\Program Files\TRNSYS18" folder, in order to make sure that it is
not using any file from your TRNSYS installation. Testing the application on another machine is also
recommended.

9–219
TRNSYS 18 – Tutorials

9.8. Running TRNSYS in batch files or in hidden


mode

9.8.1. Running TRNSYS in batch mode


You can run TRNSYS in batch mode by adding a "/n" switch to the command line, e.g. (on one line):
"C:\Program Files\TRNSYS18\Exe\TRNExe.exe"
"C:\Program Files\TRNSYS18\Examples\SDHW\SDHW.dck" /n

In TRNSYS 18, the behavior of the /n switch was changed so that it also skips the dialog box that informs
you about errors in the simulation. Note that this is only true for actual TRNSYS errors, not for exceptions
generated by the code such as floating point overflows, etc.

9.8.2. Running TRNSYS in Hidden mode


You can run TRNSYS in hidden batch mode by adding a "/h" switch to the command line, e.g. (on one
line):
"C:\Program Files\TRNSYS18\Exe\TRNExe.exe"
"C:\Program Files\TRNSYS18\Examples\SDHW\SDHW.dck" /h

The "/h" switch implies the "/n" switch and makes TRNSYS completely invisible (you can check that it is
running by launching Windows' task manager and look for a process called TRNExe).

Please note that this switch is only applicable to simulations that do not use the online
plotter or for which all online plotters are disabled (which can be done by setting
parameter 9 to -1).

9–220

You might also like