TRNSYS 15 for Windows


About TRNSYS

TRNSYS (‘tran-sis’), commercially available since 1975, is designed to simulate the transient performance of thermal energy systems. TRNSYS relies on a modular approach to solve large systems of equations described by Fortran subroutines. Each Fortran subroutine contains a model for a system component. For example, Subroutine Type 32 contains a model of a cooling coil. Subroutine Type 56 contains a model of a multizone building. Each component has inputs and outputs. The inlet flow rates and temperatures for the air and water are inputs to the Type 32 model, while the total and latent cooling rates are among the outputs of the model. By creating an input file, the user directs TRNSYS to connect the various subroutines to form a system. The TRNSYS engine calls the system components based on the input file and iterates at each timestep until the system of equations is solved. The alternative to this method is for the researcher to write a single, monolithic program that models only the system at hand. Subsequent changes to the system configuration are more difficult with monolithic programs than they are with modular programs such as TRNSYS.

Unlike many other programs, TRNSYS allows users to completely describe and monitor all interactions between system components. For example, the user determines the connections between the output of the pump and other system components. The modularity of the program allows the user to have as many pumps, chillers, cooling coils and solar panels as necessary, in any desired configuration. Because the components are written in Fortran, a user can easily generate a TRNSYS component to model any new technology that is created. Historically, TRNSYS has been used for simulating solar thermal systems, modern renewable energy systems including PV and wind power, more general HVAC systems, and buildings.

 First released in the spring of 2000, TRNSYS 15 for Windows features many improvements to the existing graphical user-interface programs as well as a host of new standard components. A major effort has also been made to allow the user to connect TRNSYS to other, existing simulation tools and to develop non-Fortran components for use with the standard library.

 

TRNSYS in the Windows Environment

 The TRNSYS executable program has changed significantly from earlier versions of TRNSYS. The executable is an independent Windows program that controls the Windows display during the simulation. The executable calls a Dynamic Link Library (DLL) containing the actual TRNSYS Fortran source code. This combination of Windows program and DLL allows TRNSYS to take advantage of the Windows display with few modifications to the original TRNSYS source code.

 During a TRNSYS simulation, up to 100 system variables can be plotted on-line (20 on each of 5 separate plots) as shown in Figure 1. The on-line plot is a powerful diagnostic tool for the simulation formulation and allows verification that the simulation is progressing as desired. The user initializes the format of the On-line Display and chooses variables to be plotted in the TRNSYS input file; the On-line Display is the component called Type 65. But even when the simulation is running, the user may pause the TRNSYS simulation, change the scale of the plot, hide one or more variables on the plot, check the precise numerical value of any of the variables, or zoom in on a portion of the display window. If an On-line Display is not desired for a simulation, TRNSYS displays a simple window indicating the progress of the simulation.



Figure 1: The TRNSYS On-line Plot Display

 As it has been since its conception more than 20 years ago, the TRNSYS source code is written in Fortran. In order to modify component models in the standard TRNSYS library, a modern Fortran compiler capable of producing 32-bit Dynamic Link Libraries is required. New components can be created using any programming language as long as the compiler used can create a 32-bit DLL. No compiler is required, however, in order to use the components in the standard library. TRNSYS may still be used outside the Windows operating system (under DOS or UNIX). However, the utility programs in the TRNSYS package (PRESIM, IISiBat, TRNSHELL, etc.) and the TRNSYS executable, which handles the On-line Display, are designed for use only with Windows 95/98, Windows NT or Windows 2000. A Fortran compiler is required for using TRNSYS outside Windows.

 

TRNSHELL

 One of the cornerstones of the today’s use of TRNSYS is the TRNSHELL program. With TRNSYS version 13.2 and earlier, the only items distributed to TRNSYS users were the Fortran source code and the manual containing a description of each Fortran component. This left the user to provide the Fortran compiler, an editor to work with input files and view output files, a method for keeping track of all the necessary files, a plotting package for analyzing output, etc. The user also had to type in all the information contained in the input file. With TRNSYS 14.1 for DOS, several of these problems and inconveniences were addressed by including several utility programs with the TRNSYS package.

TRNSHELL brings together in one program all of the activities associated with building, running, and analyzing a TRNSYS simulation. TRNSHELL features a full-featured editor for writing and viewing TRNSYS input files, Fortran subroutines, and output files. Compiling and linking of Fortran subroutines can be executed from TRNSHELL with a single click of the mouse that executes the proper commands for your compiler. TRNSHELL can perform parametric TRNSYS simulations, varying the values of one or more system variables between runs, and store all of the results. Finally, TRNSHELL can plot data from the TRNSYS simulation output.



Figure 2: Editing the TRNSYS Input File in the TRNSHELL Environment

 

Parametric Simulations in TRNSHELL

 Often TRNSYS users wish to explore the effects of changes in several system parameters on system performance. From the Parametrics menu of TRNSHELL, the user may select any of the TRNSYS variables assigned as constants in the TRNSYS input file and add them to a parametric table as shown in Figure 3.



Figure 3: Selecting Variables for the TRNSHELL Parametric Table

 After specifying the number of parametric table runs and the values of the selected TRNSYS variables, the parametric table is run and a complete TRNSYS simulation is completed for each row (see Figure 4). Upon completion of the TRNSYS calculations, the results of the parametric table runs may be plotted and the results assessed easily.



Figure 4: The TRNSHELL Parametric Table

 

Plotting Simulation Results in TRNSHELL

 TRNSHELL offers extensive plotting capabilities for TRNSYS simulation results. Following a simulation, plots may be generated of any variable over time or two variables as functions of one another. Complete plotting options include overlaying of plots from one or more output files, plot proportion adjustment, colors, fonts, and more. As always, any variable or parameter in the TRNSYS simulation may be written to a file with any desired frequency. These text files may then be imported into any external analysis software.



Figure 5: TRNSYS Simulation Output Results Plotted in TRNSHELL

 

 TRNSED

 TRNSYS users often share simulations with non-TRNSYS users. TRNSED makes this exchange simple. For the TRNSYS programmer, the standard TRNSYS input file is relatively easy to read and edit. However, manipulation of the file might be confusing for those not familiar with its syntax. With the addition of a few commands to the TRNSYS input file by the programmer, TRNSED eliminates unwanted details and generates a professional, customized display of selected parameters and inputs. TRNSED provides a refined interface in which selected inputs may be viewed and/or changed and simulations run. Like TRNSHELL, TRNSED offers a parametric simulation capability as well as post-simulation plotting. Detailed help, unit conversion and input checking are also included at the discretion of the TRNSED programmer. The TRNSYS license agreement allows the TRNSYS owner to freely distribute TRNSED, the small TRNSYS executable, and a TRNSED input file to others.



Figure 6: A TRNSED Input Window Allows Easy Changes to the TRNSYS Input File

 

IISiBat: The TRNSYS visual interface

The Center for Scientific Research in Buildings (CSTB) in Sophia Antipolis, France has developed a general front-end program, IISiBat, designed for use with any simulation program. CSTB has now adapted IISiBat specifically for use with TRNSYS. The IISiBat environment replaces most functionalities of TRNSHELL (TRNSHELL is still included with TRNSYS for backwards compatibility. It also offers a greater flexibility to develop TRNSED-based applications).

 IISiBat had its origin in the perceived difficulty of creating a complete TRNSYS input file to describe the interconnection of components and other simulation parameters. Each TRNSYS component has inputs and outputs that represent the actual pipes, ducts, and control signals of their physical counterparts. The TRNSYS input file tells TRNSYS which parameters and initial values to use for each system component and how the various system components are linked together. For each component, a number of parameters (time-independent quantities), inputs (time-dependent quantities that may be outputs of other components), and initial values must be entered into the input file. For example, below is a section of an input file that indicates to TRNSYS that one of the system components is a solar collector of 6.5 m2 area that receives its solar radiation information from a weather file.

UNIT 1 TYPE 1 SOLAR COLLECTOR
PARAMETERS 10
*NS  AREA  CP    EFF_MODE  G_TST  A0  A1  A2  OPT_MODE  B0  B1
1    6.5   4.19  1         50     .7  15  0   1         0.1  0
INPUTS 10
*T_IN  M_DOT  T_AMB  I_T  I_H  ID_H  RHO  INCANG  SLOPE 
3,1    3,2    5,5    6,6  6,4  6,5   0,0  6,9     6,10
20     200    10     0    0    0     0.2  20      45

 TRNSYS input files can be difficult to interpret visually for the novice user. While comment lines can help clarify, They do not help enough. Consequently, the graphical user interface, IISiBat, was devised to simplify the authoring of input files and to provide other features that speed the TRNSYS simulation process as described below.


Using TRNSYS with IISiBat

 IISiBat, which can be roughly translated from French as "Intelligent Interface for the Simulation of Buildings," is a general simulation environment program that has been adapted to house the TRNSYS simulation software. By its flexible nature, many powerful tools and utility programs can be controlled from the IISiBat shell. In this way, a complete simulation package can be incorporated into one environment program, from simulation engine and graphical connection programs to plotting and spreadsheet software. The IISiBat package is designed to handle all the necessary activities associated with TRNSYS. This is the combined role of TRNSHELL and PRESIM in the other Windows version of TRNSYS. These functions include editing Fortran and input files, displaying listing and output files, plotting results, offering online help, running parametric simulations, and providing shortcuts for several repetitive tasks such as Fortran compiling and linking. Similar, in theory, to PRESIM, IISiBat has an integrated pre-processing utility that allows the TRNSYS user to graphically create TRNSYS input files by connecting inputs and outputs of icons that represent TRNSYS components.



Figure 9: The IISiBat Assembly Window

 Figure 9 shows the IISiBat Assembly Window used to create and work with TRNSYS simulations within the IISiBat environment. This main window contains many descriptive icons with lines connecting them. Each icon represents a different system component (eg. pump, solar collector, etc.). The user drags the necessary icons into the Assembly Window. The user creates links between the components that share information. The lines connecting the icons represent the pipes and wires that connect the physical components. While several connections are possible between two components, just one link is displayed. To view or change the input and output connections, the user clicks on the link itself to view a detailed window. A series of Tools around the border of the Assembly Panel window allow the user to place icons onto the working area, connect the icons as necessary, run the simulation, access the editor, access the spreadsheet and plotting packages, and perform many other functions.

 In IISiBat, all essential TRNSYS activities are controlled directly from the Assembly Window. For example, to plot the results of a simulation run, the user clicks the Spreadsheet Tool and then clicks on the Printer Icon. The output file generated by this TRNSYS component is automatically loaded into the spreadsheet to be manipulated and plotted. Figure 10 demonstrates the spreadsheet and plotting tool.



Figure 10: IISiBat Spreadsheet and Plotting Tool

 Another IISiBat feature helps the user avoid frequent reference to the TRNSYS component description manual. Figure 11 shows an example of the IISiBat Proforma containing a complete component description. The Proforma is a standard method of documenting component models into a syntactical format. The Proforma file is the model documentation standard used in IISiBat. Each TRNSYS component model has been broken down into the Proforma format which is stored in the IISiBat program. The first page of the Proforma window contains information about the history and function of the component model. The second page contains a complete description of the variables required in the model.



Figure 11: First Page of a TRNSYS Component Proforma in IISiBat

 Several computer requirements exist for the effective use of IISiBat: an IBM-compatible computer running Windows 95/98, NT, 2000 or Windows XP, at least 64 MB of RAM, at least 65 MB of free disk space, and a Pentium processor.