UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Multi-energy systems simulator for hourly management and optimization of GHG emissions and fuel costs Lopez, Cesar 2011

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata

Download

Media
24-ubc_2012_spring_lopez_cesar.pdf [ 3.03MB ]
Metadata
JSON: 24-1.0072464.json
JSON-LD: 24-1.0072464-ld.json
RDF/XML (Pretty): 24-1.0072464-rdf.xml
RDF/JSON: 24-1.0072464-rdf.json
Turtle: 24-1.0072464-turtle.txt
N-Triples: 24-1.0072464-rdf-ntriples.txt
Original Record: 24-1.0072464-source.json
Full Text
24-1.0072464-fulltext.txt
Citation
24-1.0072464.ris

Full Text

MULTI-ENERGY SYSTEMS SIMULATOR FOR HOURLY MANAGEMENT AND OPTIMIZATION OF GHG EMISSIONS AND FUEL COSTS  by Cesar Lopez B.Sc., Cooperative University of Colombia, 2001 Ed.S., Cooperative University of Colombia, 2004  A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCE in The Faculty of Graduate Studies (Electrical and Computer Engineering) THE UNIVERSITY OF BRITISH COLUMBIA (Vancouver)  December 2011 © Cesar Lopez, 2011  Abstract Many legacy infrastructures are reaching the end of their service life. The necessary replacement of these infrastructures creates an opportunity to replace them with environmentally friendly and innovative systems. The steam plant at the University of British Columbia is one of those cases requiring replacement due to aging. The steam generation boilers are, on average, 53 years old and have short expected remaining service. The boilers process is fed by natural gas as main fuel. It was identified that almost 80% of the CO2e emissions on campus are produced from the use of gas for heating purposes. UBC is worldwide recognized for being one of the most sustainable university campuses, and the first university in Canada awarded a gold rating in sustainability. UBC‟s GHG emissions targets for Kyoto protocol were reached in 2007; at that point, new aggressive reduction targets were established, aiming for 33% by 2015, 67% by 2020 and 100% by 2050. These reductions are expressed in tonnes of CO2e. The situation described offers an opportunity to explore alternatives for the Steam Plant potential replacements. The Infrastructures Interdependencies Simulator (I2Sim) was selected as simulation platform for this study. The simulator allows real-time resource management using hourly historical operational data. To meet the campus thermal requirements, the system considers biomass cogeneration, heat pump, and excess electricity to offset traditional natural gas fuel sources. All technologies take advantage of real-time management of fuels allocation to reduce GHG emissions. A parallel distribution system based on hot-water is modeled, because of the potential in increasing the overall heating system performance. Four modeling scenarios are constructed, showing that fuel costs can be reduced by 51%, GHG emissions reduced by 76% and overall energy consumption reduced by 29%. The simulator is a first step in integrating all critical infrastructures into a Smart Energy MicroGrid paradigm.  ii  Preface The study and results from this thesis have been published in the IEEE Canadian Conference on Electrical and Computer Engineering: [1] López, César; Lusina, Paul and Martí, José. “Real-Time Monitoring of Energy Infrastructure” in IEEE Canadian Conference on Electrical and Computer Engineering, Connecting Engineering Applications and Disaster Management Workshop 2011: Niagara Falls, Ontario. I wrote and edited the most of this paper. Dr. Paul Lusina and Dr. José R. Martí provided guidance and revisions for the manuscript.  iii  Table of Contents Abstract .................................................................................................................................... ii Preface ..................................................................................................................................... iii Table of Contents ................................................................................................................... iv List of Tables ......................................................................................................................... vii List of Figures ......................................................................................................................... ix Acknowledgements ................................................................................................................ xi 1  Introduction ......................................................................................................................1 1.1  Campus as a Living Lab ....................................................................................... 1  1.2  Campus Electricity and Heating Infrastructure..................................................... 4  1.2.1  Heating System ................................................................................................. 5  1.2.2  Electrical Infrastructure .................................................................................... 7  1.3  Distributed Electrical and Thermal at UBC Campus ............................................ 8  1.3.1  Nexterra Plant ................................................................................................... 8  1.3.1.1 1.3.2 1.4  TRIUMF Particle Accelerator......................................................................... 12 Smart Grids and MicroGrids ............................................................................... 14  1.4.1  MicroGrid ....................................................................................................... 14  1.4.2  Smart Grids ..................................................................................................... 15  1.5 2  Gasification Process ................................................................................ 11  Research Objective ............................................................................................. 16  Smart Energy Micro-Grid Simulation .........................................................................18 2.1 I2Sim Infrastructure Interdependencies Simulator, Description and Modification for Smart-Energy Simulation .................................................................... 18 iv  2.1.1  I2Sim Ontology............................................................................................... 19  2.1.2  I2Sim Toolbox Components ........................................................................... 20  2.1.2.1  The I2Sim Control Panel ........................................................................ 22  2.1.2.2  The Source .............................................................................................. 23  2.1.2.3  The Production Cell ................................................................................ 24  2.1.2.4  The Delay Channel ................................................................................. 28  2.1.2.5  The Distributor ........................................................................................ 29  2.1.2.6  The Storage ............................................................................................. 30  2.1.2.7  The Aggregator ....................................................................................... 31  2.1.2.8  The I2Sim Probe ..................................................................................... 31  2.1.2.9  The I2Sim Visualization Panel ............................................................... 32  2.1.2.10 The Modifier Cell ................................................................................... 33 2.2 2.2.1  Energy Demand Data ...................................................................................... 34  2.2.2  Physical Constraints Data ............................................................................... 36  2.2.3  Fuels Cost Data ............................................................................................... 38  2.2.4  GHG Emissions Data ...................................................................................... 41  2.3  3  Input Data for the Smart Energy Simulation ...................................................... 33  Smart-Energy Simulation Cases ......................................................................... 43  2.3.1  Case 1: Platform Validation Case ................................................................... 44  2.3.2  Cases 2 to 6 Technical Simulation Considerations and Design ...................... 47  2.3.3  Optimization Algorithm .................................................................................. 57  Simulation Results and Discussions .............................................................................59 3.1  Case 2: Biomass, Electric Boilers, Natural Gas with Steam Distribution .......... 59  v  4  3.2  Case 3: Biomass, Electric Boilers, Natural Gas with Hot-Water Distribution ... 60  3.3  Case 4: Case 3 Extension with Heat Pump System ............................................ 61  3.4  Case 5: Projection 2011-2015 ............................................................................. 62  3.5  Case 6: Impact of Excluding the Electric Boilers (2011-2015) .......................... 64  3.6  Conclusions ......................................................................................................... 65  Conclusion and Future Work .......................................................................................70  Bibliography ...........................................................................................................................73 Appendices ..............................................................................................................................77 Appendix A Electrical Controller Level-2 M file ........................................................................ 77 Appendix B GHG Minimization Block Level-2 M file ............................................................... 81 Appendix C Financial Block Level-2 M file ................................................................................ 84  vi  List of Tables Table 1: Highlights from Sustainable History at UBC [10] ..................................................... 3 Table 2: Boiler Description [17] [18] [19] ................................................................................ 6 Table 3: Human Readable Table (HRT) ................................................................................. 25 Table 4: Information Sources.................................................................................................. 33 Table 5: Steam Growing Factors Used for Extrapolation ....................................................... 35 Table 6: Electrical Growing Factors Used for Extrapolation ................................................. 35 Table 7: Generation Technologies Efficiencies (%) ............................................................... 37 Table 8: Nexterra Plant Energy Production (MW) ................................................................. 38 Table 9: Distribution Systems Efficiencies (%)...................................................................... 38 Table 10: Natural Gas Price 2007-2008 ($CA/kWh) ............................................................. 39 Table 11: Natural Gas Prices (Partial) 2010 ($CA/kWh) ....................................................... 39 Table 12: Natural Gas Price Summary 2010-2015 ($CA/kWh) ............................................. 40 Table 13: BC Hydro Billing Rates ($CA)............................................................................... 40 Table 14: GHG Emissions per Fuel Source ............................................................................ 42 Table 15: Carbon Tax & Offset ($CA/Tonne of CO2e) [48] [49] .......................................... 42 Table 16: Cases Simulated ...................................................................................................... 43 Table 17: Case 1 Heat Generation Results ............................................................................. 45 Table 18: Summary Results Case 2 ........................................................................................ 59 Table 19: Summary Results Case 3 ........................................................................................ 61 Table 20: Summary Results Case 4 ........................................................................................ 61 Table 21: Electrical Growth Factors 2011-2015 [17] ............................................................. 63 Table 22: Electrical Accumulated Growth Factor 2011-2015 ................................................ 63 vii  Table 23: Thermal Growth Factors 2011-2015 [17] ............................................................... 63 Table 24: Thermal Accumulated Factors 2011-2015 ............................................................. 63 Table 25: Summary Results Case 5 ........................................................................................ 64 Table 26: Summary Results Case 6 (with Electric Boilers) ................................................... 64 Table 27: Summary Results Case 6 (without Electric Boilers) .............................................. 65 Table 28: Case 6 - GHG, Costs, and Energy Increase ............................................................ 65 Table 29: Energy Summary Cases 1 to 5 (GWh) ................................................................... 65 Table 30: Thermal Efficiencies Cases 1 to 5 .......................................................................... 66 Table 31: GHG Emissions Cases 1 to 5 (tonnes of CO2e)...................................................... 66 Table 32: Natural Gas and GHG emissions reduction ............................................................ 67 Table 33: Fuel Cost Cases 1 to 5 ($M-CA) ............................................................................ 67 Table 34: Fuel Cost Reduction ............................................................................................... 68 Table 35: Excess Electricity Cases 2 to 5 (GWh) ................................................................... 68 Table 36: Case 6 - Cost and Emissions Comparison .............................................................. 69  viii  List of Figures Figure 1: UBC as a Living Lab [7] ........................................................................................... 2 Figure 2: UBC Power Transmission 2009 [17] ........................................................................ 7 Figure 3: Nexterra Plant [21] .................................................................................................... 8 Figure 4: Nexterra Advance Biomass Heat and Power System [24] ...................................... 10 Figure 5: Nexterra‟s Gasification Technology [26] ................................................................ 11 Figure 6: TRIUMF‟s ISAC Facility [28] ................................................................................ 13 Figure 7: Smart Grid Technology Platforms [31] ................................................................... 15 Figure 8: I2Sim Toolbox ......................................................................................................... 21 Figure 9: I2Sim Control Panel ................................................................................................ 22 Figure 10: I2Sim Source ......................................................................................................... 23 Figure 11: I2Sim Production Cell ........................................................................................... 24 Figure 12: Production Cell Operation Example...................................................................... 26 Figure 13: Floor Function (HRT) ........................................................................................... 27 Figure 14: Piece-Wise Linear Function (Interpolated HRT) .................................................. 27 Figure 15: I2Sim Delay Channel ............................................................................................ 28 Figure 16: I2Sim Distributor ................................................................................................... 29 Figure 17: I2Sim Storage ........................................................................................................ 30 Figure 18: I2Sim Aggregator .................................................................................................. 31 Figure 19: I2Sim Probe ........................................................................................................... 31 Figure 20: I2Sim Visualization Panel ..................................................................................... 32 Figure 21: I2Sim Modifier Cell .............................................................................................. 33 Figure 22: Energy Data Availability Chart ............................................................................. 34 ix  Figure 23: Excess Electricity .................................................................................................. 36 Figure 24: Heat Energy Available at TRIUMF ...................................................................... 37 Figure 25: Case 1: Validation & Base Case............................................................................ 44 Figure 26: Electricity Peaks Case 1 ........................................................................................ 46 Figure 27: Case 1 Validated Results ....................................................................................... 47 Figure 28: UBC Thermal Energy Infrastructure ..................................................................... 47 Figure 29: Simulation of the Electrical System ...................................................................... 48 Figure 30: Heat Pump System Schematic [5] ......................................................................... 49 Figure 31: Nexterra Facility Schematic .................................................................................. 49 Figure 32: Simulation of the Biomass System ........................................................................ 50 Figure 33: Simulation Generation System .............................................................................. 51 Figure 34: Simulation Distribution System ............................................................................ 51 Figure 35: Financial Block...................................................................................................... 52 Figure 36: Simulation Results GUI......................................................................................... 53 Figure 37: Case 2, Complete I2Sim Simulation Model .......................................................... 54 Figure 38: Cases 3 & 5, Complete I2Sim Simulation Model ................................................. 55 Figure 39: Cases 4 & 6, Complete I2Sim Simulation Model ................................................. 56 Figure 40: GHG Minimization Algorithm .............................................................................. 57 Figure 41: GHG Minimization Block ..................................................................................... 58  x  Acknowledgements In first place I want to thank my supervisor Dr. José Ramón Martí for giving me the opportunity of joining his team and allowing me to participate in research projects led by him. Throughout these two years, the learning experience has been fruitful and worthwhile. I also thank Dr. K.D. Srivastava for making his experience and background available to me and other members of our team, during the weekly and project oriented meetings. My most sincere gratitude to all people involved in the research initiative and specially, to those who contributed with technical support or information to the subject of this study: Dr. Steve Cockcroft, Jeff Giffin and Kristina Welch, among others. I recognize the valuable help from the people directly connected to this project: Dr. Paul Lusina, for his hard work in management and documentation (specially the graphics design); Alex Shi, for his early versions of the models during his Co-op and Rui Ren for data assistance. Finally, I express my immense appreciation to all my family for their support in all of what this complete process has involved. I highlight the overall contributions from my sister Caroll, without whom this achievement would not have been accomplished.  xi  DEDICATED TO MY SON, DANIEL CAMILO  xii  1 Introduction  The subject of this thesis is the development of a mathematical-based Smart Energy Micro-Grid (SEMG) model of the UBC North Campus. The main goal is to minimize the Green House Gasses (GHG) emissions resulting from the central heat generation that covers the campus thermal demand. The fuel source economic and environmental impact is modeled with the Infrastructure Interdependencies Simulator (I2Sim) [1] [2] [3], taking into account the associated emissions established by the British Columbia provincial law and all efficiency factors and technical details provided by UBC Building Operations. Everything in this project is encompassed within the University as a Living Lab initiative.  1.1 Campus as a Living Lab  “Campus as a Living Lab combines campus operations and administration (e.g. energy and water management, landscaping, buildings and infrastructure, planning) with the education, research and outreach mandates of the university. Campus as a Living Lab involves students and faculty developing and applying their sustainability research in collaboration with university staff and can also involve industrial or community partners working with academic and operational staff.” [4] The concept of University as a “Living Lab” (Figure 1) aims at collaboration in interdisciplinary research, among academic departments, research centres and building operations at UBC. The strategy also promotes the involvement of the residents‟ community and industry partners [5]. Industrial partners are expected to be committed for a period of 5 years in demonstration projects and innovation strategies, the list of current partners includes: BCHydro, Honeywell, Nexterra, among others [6]. The basic idea is to use the campus as an experimental laboratory to conduct research projects to deliver solid results that can be easily applied to larger communities and municipalities, considering the characteristics and facilities comprised by the campus. At the same time, the campus as a living lab will provide a test bed for UBC‟s institutional sustainability goals, such as, Green House Gases (GHG) emissions reduction. 1  Figure 1: UBC as a Living Lab [7]  UBC is considered one of the most sustainable post-secondary campuses in the world, as represented by top grades in the Sustainable Endowments Institute‟s College Sustainability Report Card [8]. By signing “Talloires Declaration” in 1990, UBC started an important sustainability movement. During these years of uninterrupted “green” transformation, significant achievements and awards have been earned; confirming UBC as a leader in sustainability among educational institutions all around the world. Table 1, summarizes a set of UBC sustainability actions and projects adopted by UBC, as well as, awards received. “Established in 1990 at an international conference in Talloires, France, this is the first official statement made by university administrators of a commitment to environmental sustainability in higher education. The Talloires Declaration (TD) is a ten-point action plan for incorporating sustainability and environmental literacy in teaching, research, operations and outreach at colleges and universities. It has been signed by over 350 university presidents and chancellors in over 40 countries” [9]. UBC is the first Canadian university to announce it has achieved international targets established by the Kyoto Protocol for its core academic buildings in 2007, which required a six per cent reduction in greenhouse gas emissions from 1990 levels by 2012. 2  Table 1: Highlights from Sustainable History at UBC [10]  Year  Action /Award  1997  UBC became Canada's first university to adopt a sustainable development policy.  1998  A year later, we became the country's first university to open a campus Sustainability Office. Launched the largest energy retrofit of its kind in Canada (ECOTrek), aiming for energy and water reduction for 288 academic buildings [11]. With more than a dozen unique initiatives, UBC consolidates as Canada's leader in campus sustainability.  2001 2002 2003 2005 2006 2005 2006  2007  2008 2011  UBC was Canada's first and only university to receive Green Campus Recognition from the U.S.-based National Wildlife Federation. UBC's vision statement adopted sustainability as a core value by including a commitment to "promote the values of a civil and sustainable society". UBC published Canada's first campus-wide sustainability strategy after a consultation process with 20 departments, all faculties, all major student organizations, and over 100 individuals. UBC added 21 targets to the initial 68 in the sustainability strategy, representing UBC Okanagan‟s commitments. The first progress report against the initial strategy was also published. GHG emissions target achieved as established by Kyoto Protocol. Faculty members co-authored the “ecological footprint” measurement tool in 1996 and shared the 2007 Nobel Peace Prize with former U.S. Vice President Al Gore as members of the Intergovernmental Panel on Climate Change [12]. UBC President Stephen Toope and five other BC university and college presidents were the first to sign the Climate Change Statement of Action for Canada. UBC Bioenergy Research and Demonstration Project (BRDP). A biomass plant partnering with Nexterra Corporation, GE Energy and Jenbacher. UBC receives Canada‟s first „gold‟ in new university sustainability ratings [12]  During one of the largest conferences, the GLOBE 2010 conference, in Vancouver, University of British Columbia‟s President Stephen Toope announced aggressive new greenhouse gas (GHG) emissions targets for UBC‟s Vancouver campus. The university will now aim to [8]: Reduce GHGs by an additional 33 per cent from 2007 levels by 2015. Reduce GHGs to 67 per cent below 2007 levels by 2020. Eliminate 100 per cent of GHGs by 2050. (Net positive energy producer). To promote the involvement of the research and teaching on the achievement of GHG emissions target initiative aforementioned, the University has created four awarded Signature Sustainability Projects: Continuous Optimization, Smart Energy System, Centre for 3  Interactive Research on Sustainability (CIRS) and Bioenergy Project. The two signature projects directly connected to this thesis are described below: Smart Energy System (SES): The objective of the Smart Energy System is to maximize energy efficiencies while achieving UBC‟s GHG targets. The SES is intended to be an interactive and responsive system that intelligently responds to the changing energy needs and constraints of the campus and is capable of coordinating both electrical and thermal energy (supply and demand) as an integrated system. Examples of opportunities for Spotlight awards include [13]: Identifying opportunities to reduce overall campus thermal and electric energy load. Identifying opportunities for off-peak thermal energy generation, delivery, and storage. Policy development for sophisticated demand-side technologies and management.  Bioenergy Project: A partnership with Vancouver-based Nexterra Systems Corp. and GE Water & Power, the UBC Bioenergy Research and Demonstration Project is the first commercial-scale demonstration of its kind in North America. Scheduled for completion in the spring 2012, the $27-million Bioenergy Project will combine Nexterra‟s biomass gasification technology with GE/Jenbacher‟s high-efficiency gas engines to convert renewable woody biomass (wood waste) into heat and power for use on campus. Locally sourced biomass feedstock will be gasified into a combustible gas, generating electricity, steam and hot water that will feed into UBC‟s distribution systems. The project is not only a technical challenge but also highlights the need for innovative and positive methods of garnering the necessary social license required to incorporate these and other clean energy solutions within a community [13].  1.2 Campus Electricity and Heating Infrastructure  The Department in charge of maintaining the university owned infrastructure is UBC Utilities. This department belongs to Land and Building Services and is responsible for 4  providing electricity, steam, gas, water, sanitary sewer and storm water to tenant, ancillary and core academic buildings [14]. The energy used to operate UBC‟s buildings (heating, cooling, lighting and plug loads) generates the majority of the University‟s GHG emissions annually. In 2010, the use of natural gas, electricity and oil at UBC Vancouver produced approximately 57,663 tonnes of CO2e emissions [15]. About 76% of the emissions come from natural gas based steam generation [16]. UBC Utilities produces steam on campus at the Powerhouse with four natural gas fed steam boilers, and maintains the entire campus utilities infrastructure grid that includes two high-voltage substations, power lines, steam distribution lines, condensate return lines, water, sewer and storm distribution lines, and natural gas distribution lines [14].  1.2.1  Heating System  A steam based district heating system operates at UBC to fulfill the heating demand for all covered buildings on-campus. This district energy system uses Natural Gas boilers for generation. The boilers are installed at the central Steam Plant (Powerhouse) and connected to a distribution network of approximately 8.5km of buried piping, operating at a temperature of around 180ºC [17]. The condensate piping extension is almost the same as the distribution network and the system is equipped with the corresponding steam traps. Close to 15% of the condensate does not return to the plant and the use of the on-site pre-heaters is required to balance the residual heat lost [17]. Each building in the district system has an Energy Transfer Station installed, the station comprises a steam meter, a pressure reducing valve (PRV), heat exchangers and steam to water converters [17]. After describing the current operation of the on-campus heating system, it is convenient to describe the state of the equipment and infrastructure in use. In order to provide a proper description, the most import facts about the steam plant installed boilers will be covered, as well as the projected changes and projects headed to optimize the overall system efficiency, in both, generation and distribution. 5  The Steam Plant building went into operation in 1924 with three coal fired boilers. A coal receiving room, a set of hoppers and conveyor lines were also part of the heating system. From the original set of boilers, two were decommissioned and replaced in 1950. Boilers #1 and #3 were installed and operated with coal as fuel [18]. In 1961 the Steam Plant stopped using coal as heating fuel and started powering the process with natural gas. The process included, converting Boilers #1 and #3 to natural gas, and installing the new Boiler #4. During the 1960's, additional heating capacity was needed due to Campus‟ growth, thus, Boilers #2 and #5 were incorporated to the steam generation. At this moment, UBC covers the heating of 900,000 m2 of floor space with the operation of Boilers #2, #4 and #5 [18]. UBC‟s boilers summary information is provided in Table 2. Table 2: Boiler Description [17] [18] [19]  Boiler#  Installation Year  1 2 3 4 5  1950 1962 1950 1961 1969  Age [Years] Remaining Service Life [Years] 61 0 to 3 49 8 to 12 61 0 50 6 to 10 42 15 to 19  Status Back-Up Operating Decommissioned Operating Operating  Ongoing preventive maintenance and optimization programs have allowed UBC to extend the lifespan of UBC‟s heating infrastructure beyond their expected life [18]. Cities and large institutions around the world have faced a similar decision of replacing their aging steam-based district energy infrastructure. They opted to convert their systems to Hot-Water with excellent results [18]. A project involving the replacement of existing steam heating system infrastructure with infrastructure for a hot water district energy system was proposed. This will include the installation of 14 km of pre-insulated hot water distribution piping, 131 energy transfer stations (ETS) in building mechanical rooms, a new 52 MW hot water peaking plant and onsite steam generation for buildings that require steam for research or operational purposes [18]. The scale of this project will make it the largest steam to hot water conversion in North America and will be implemented in phases over a period of 5 years. FVB Energy Consulting provided pre-feasibility and costing analysis for the proposed project. When approved the project will include the replacement of the existing central steam plant with a new Hot Water Plant in a strategic new location on-campus [18]. 6  1.2.2  Electrical Infrastructure  For the UBC campus, electricity is provided by BCHydro through the Sperling substation by two transmission circuits: 60L56-North (62MVA) and 60L57-South (42MVA), the two lines operate in parallel [17].  The university owns and operates its electrical  distribution system which supplies all campus loads, from educational and research buildings to hospitals and residences [20].  UBC campus‟ infrastructure includes two electrical  substations: North Substation (UNY) fed by the two lines coming from Sperling substation; and South Substation (UNS) fed only by 60L57. The Schematic of the Electrical lines providing energy to the Substations is shown in Figure 2.  Figure 2: UBC Power Transmission 2009 [17]  7  The system was designed such that the termination of the two circuits into UNY creates a transmission ring where during a fault or planned outage on either circuit, the other circuit could carry the entire load of both UNY and UNS. This configuration provides system redundancy. BC Hydro aims to provide N-1 reliability to UBC by determining how much firm or peak load can be served with the loss of one of the two circuits of the system. In the case of UBC this would be the loss of either 60L56 or 60L57 [17]. Hydro meters located at UBC substations record the total demand of the campus on an hour-by-hour basis [20]. The average electrical power factor of the system is 0.95; these two facts are useful at the moment of determining the available information for studies and analysis.  1.3 Distributed Electrical and Thermal at UBC Campus  1.3.1  Nexterra Plant  Previously described as the Bioenergy Research and Demonstration Project (BDRP) in 1.1 Campus as a Living Lab.  Figure 3: Nexterra Plant [21]  8  The corresponding facility (Figure 3) is under construction and it will have four storeys, 1,886-square-metre and will be the first North American commercial application of Cross-Laminated-Timber (CLT), a European building system adapted for BC lumber and manufacturing facilities. CLT is a renewable, low-carbon replacement for steel or concrete in multi-storey residential and commercial buildings up to, and potentially higher than 10 stories [21]. To guarantee the uninterrupted supply of biomass fuel, UBC has signed a memorandum of understanding with the City of Vancouver, which will provide approximately 5,000 tonnes per year of tree chips from its municipal operations [21]. The system will require two to three truckloads of wood fuel per day, sourced locally as much as possible, from British Columbia Aboriginal and First Nations communities. It will include clean surplus wood manufacturing material, whole-tree chips from beetle-killed and non-marketable timber, wood chips from sawmills and tree trimmings from the campus, according to UBC [22]. The complete CHP Nexterra Biomass System is illustrated in Figure 4. Five major components of the overall system are identified during the process: 1) Fuel Storage: flat bed storage for the wood waste. Is the feeding point for the fuel delivered to the plant to be gasified. 2) Gasification Technology: process of converting waste wood into synthetic gas “Syngas” is the most important part of the process and it will be subsequently described in detail. 3) Syngas conditioning technology: syngas is upgraded and conditioned to meet engine‟s fuel specification. This process is able to iterate in order to minimize waste of syngas. 4) Engine(s): “GE/Jenbacher” high-efficiency combustion engine(s) operates on syngas to produce electricity and heat. Usually this type of engines operates with natural gas. 5) Heat and Power: heat and electricity are economically generated at small scale (210MWe) with efficiencies up to 65%. The efficiency is relatively higher considering that most of the gasification CHP plants reach only up to 40% [23]. 9  Figure 4: Nexterra Advance Biomass Heat and Power System [24]  10  1.3.1.1  Gasification Process  The core of Nexterra‟s technology is a fixed-bed, updraft gasifier. Fuel, sized to 3 inches or less, is bottom-fed into the centre of the dome-shaped, refractory lined gasifier. Combustion air, steam and/or oxygen are introduced into the base of the fuel pile. Partial oxidation, pyrolysis and gasification occur at 1500 - 1800 °F, and the fuel is converted into “syngas” and non-combustible ash. The ash migrates to the base of the gasifier and is removed intermittently through an automated in-floor ash grate. The clean syngas can then be directed through energy recovery equipment or fired directly into boilers, dryers and kilns to produce useable heat, hot water, steam and/or electricity [25].  Figure 5: Nexterra’s Gasification Technology [26]  “Syngas” is a proprietary technology from Nexterra Corporation based on a thermochemical process, its composition includes primarily carbon monoxide, hydrogen and methane. Syngas is a clean burning fuel that can be used to produce heat steam, hot water and/or electricity using conventional energy recovery equipment [27]. Figure 5 shows the components of the gasification process and it is described, in detail, as follows: 11  1) Fuel In-Feed System: The metering bin is designed to provide short term fuel storage and to deliver a steady rate of fuel to the gasifier. The metering bin out-feed augers have a variable speed drive that deposits fuel into a horizontal auger conveyor where it is transferred to a vertical conveyor. The vertical auger pushes fuel into the base of the fuel pile inside the gasifier. A constant fuel pile height is maintained in the gasifier over the entire operating range [26]. 2) Gasifier: As fuel enters the gasifier, it moves through progressive stages of drying, pyrolysis, gasification and reduction to ash. Combustion air (20 - 30% of stoichiometric), steam and/or oxygen are introduced through the inner and outer cone into the base of the fuel pile. The process is maintained by simultaneous control of combustion air and fuel feed rate. Combustion temperatures in the fuel pile are tightly controlled and kept below the ash melting temperatures to ensure that there is no formation of “clinker” and that the ash flows freely [26]. 3) Automatic Ash Removal System: As partially processed fuel passes to the outer cone, it is reduced to non-combustible ash. The ash migrates to the grate at the base of the gasifier where it is removed intermittently through a set of openings. The openings are normally covered by a rotating plate fabricated with the same pattern of openings. When hydraulically activated, the rotating plate aligns its openings with the fixed plate and the ash drops into two ash hoppers. Each ash hopper has two parallel augers to convey the ash to a collection conveyor and an enclosed ash bin [26]. 4) Syngas: Syngas exits the gasifier at 500 - 700 °F. The syngas can be combusted in a close coupled oxidizer with the resulting flue gas directed to heat recovery equipment such as boilers, thermal oil heaters, air-to-air heat exchangers and turbines. Nexterra is also developing systems to directly fire syngas into industrial boilers, kilns, dryers and other equipment [26].  1.3.2  TRIUMF Particle Accelerator  TRIUMF, Canada's National Laboratory for Particle and Nuclear Physics, is located at the southern end of the UBC campus, and its new ISAC facility is the world's leading 12  source of light radioactive ions. The TRIUMF subatomic physics program is based around the world's largest cyclotron, which accelerates H‾ ions to 500 MeV, producing intense beams of protons, neutrons, pions, muons, and light radioactive ions (A<30) [28]. TRIUMF is Canada's main centre for accelerator and beam physics expertise. UBC graduate students (and co-op or summer undergraduate students) may participate in research projects with TRIUMF physicists, either in developing and adding to the lab's existing accelerators and particle beams, or in collaborations with other laboratories [28].  Figure 6: TRIUMF’s ISAC Facility [28]  The operation of the equipment produces significant heat and requires cooling that produces hot water. To avoid the waste of heat energy a recycling option would be fulfilled by a heat pump system. The energy requirement to enable the system to operate is based on electricity to upgrade the temperature of the water to 80-85 Celsius degrees and pump it to UBC facilities in charge of heat distribution. The technical requirement, based on the nature 13  of the waste heat, is to have a hot-water based distribution system. The coefficient of performance for the system is 3, meaning that for 1 electrical unit input, 3 heat units are output.  1.4 Smart Grids and MicroGrids  For clarity in the presentation of this thesis, key concepts, such as, Smart Grid, Microgrids and Energy Management Systems have to be clearly defined and harmonized to demonstrate the intention of the initiative and the reasons to use the term Smart Energy MicroGrid.  1.4.1  MicroGrid  “The Consortium for Electric Reliability Technology Solutions (CERTS) MicroGrid concept assumes an aggregation of loads and microsources operating as a single system providing both power and heat. The majority of the microsources must be power electronic based to provide the required flexibility to insure operation as a single aggregated system” [29]. The definition from CERTS is certainly appropriate in terms of the subject of the present project, although, some concepts from IEEE Std 1547.4-2011 are also relevant considering that they were released in September 2011. In IEEE 1547.4 a new term is introduced: “Distributed Resources Island System” to characterize what is referred as Microgrids. Before defining DR Island Systems it is relevant to define what distributed resources are according the new standard: Distributed Resources (DR): sources of electric power that are not directly connected to a bulk power transmission system. DR includes both generators and energy storage technologies [30]. Distributed Resources (DR) Island System: DR island systems are parts of electric power systems (EPSs) that have DR and load, have the ability to disconnect from and parallel with the EPS, include the local EPS and may include portions of the area EPS, and are intentional and planned [30]. 14  1.4.2  Smart Grids  The Smart Grid is a complex system made up of integrated systems. As the power system is upgraded with more flexibility, integrated communications and advanced controls will enable large-scale integration and interoperability of a greater diversity of technologies and end-use applications. The Smart Grid is evolving towards a highly automated EPS that uses advance technologies to monitor and manage the availability and quality of power, the immediate and predicted load demands, and the status of supporting infrastructure [31]. The new smart grid standards provide full compatibility with different technologies and smart grid applications by understanding the concept as a large complex system of systems. Previous frameworks developed by The U.S. Energy Independence and Security Act (EISA) and The National Institute of Standards and Technology (NIST) are fully compliant with this new standardization. Figure 7 illustrates this interoperability among the different technologies and standards mentioned before.  Figure 7: Smart Grid Technology Platforms [31]  Another concept that is important to be mentioned and part of the scope of the project is energy management systems, which in the simulation process will be covered. 15  Energy Management System (EMS): A system of tools used to monitor, control, and optimize the generation, delivery, and/or consumption of energy [31].  1.5 Research Objective  The objective of this thesis is to model the UBC campus as a Smart Energy Micro-Grid (SEMG). After reviewing the campus situation related to GHG emissions and the main contributors, special focus will be given to the Steam Plant for two important reasons: the aging technology implying and imminent infrastructure replacement; and the dependency on natural gas to generate the heat. Natural gas has the biggest associated carbon footprint, therefore, its use reduction is going to be translated into a GHG emissions diminishing. Alternative fuels for heating considered for this study are: the Biomass Plant that provides both, electricity and heat to the system, adding a highly clean option in the campus energy portfolio; and electricity to produce heat via electric boilers in a cleaner manner. BC Hydro generates more than 90% of its electricity based on hydroelectric means; this fact identifies electricity as a clean fuel for British Columbia. Also an alternative heat distribution system based on hot water is part of the study, due to its smaller losses in transportation requires less energy to be generated. The equipment generating heat for a hot water system has increased efficiency compared to steam based distribution. The main goal is to find and provide consistent results to the SES committee (the committee in charge of the institutional study) about different combinations of technologies that assure a minimization of GHG emissions matching the University established sustainability goals at a feasible operation cost. The simulation platform will be the i2Sim simulator with the possibility of using other extensions from Matlab/Simulink. This thesis is organized as follows: Chapter 1 gives the background information about the origins of the project as an institutional initiative and describes the complete sustainable motivation. A current status of energy management and infrastructure is provided. All this provides the correct scope for the research objectives to be established.  16  Chapter 2 provides a detailed description of the simulation framework and enhancements for this project, source data to be used in the simulation, GHG minimization algorithm and the technical considerations for the simulations cases. The components of the simulation cases are explained and the cases are presented with respective models. Chapter 3 presents the results obtained from the simulated cases and a comparative analysis to highlight the highest efficient solution that might be implemented. Chapter 4 includes conclusions and pertaining recommendations. Future work to be developed on this topic is also provided.  17  2 Smart Energy Micro-Grid Simulation Considering the big investment represented by the implementation of a new heating system (generation and distribution), a trial and error approach with different physical technologies is impossible. The study has to be developed through simulation, in order to find the best combination of viable technologies while aiming for the most efficient and clean way to fulfill the heat demand on campus. The SES committee has commissioned a report using Infrastructure Interdependencies Simulator (i2Sim) as the simulation framework to run the cases. The simulator is a tool developed by the Complex Interdependent Systems (CIS) group from the Electrical and Computer Engineering Department at UBC. I modified the corresponding blocks for making I2Sim capable of handling smart-energy simulations and designed and wrote the additional customized blocks and GUIs required for the specifics of this project. I also did the interpolation to complete the datasets used in all cases. Regarding the modelling, I revised and completed the experimental models started by Alex Shih during his work as Co-op in our group.  2.1 I2Sim Infrastructure Interdependencies Simulator, Description and Modification for Smart-Energy Simulation  The Infrastructure Interdependencies Simulator (I2Sim) is an ongoing initiative, sponsored with federal funding, to investigate critical infrastructure interdependencies and it is the continuation of The Joint Infrastructure Interdependencies Research Program (JIIRP), sponsored in 2005 by Public Safety and Emergency Preparedness Canada (now Public Safety Canada) and the Natural Sciences and Engineering Research Council (NSERC) [32] [33]. This initiative is aimed at producing new science-based knowledge to improve the assessment, management and risk mitigation of failure events related to critical infrastructure interdependencies [32]. The purpose of infrastructure interdependency simulation is to aid in decision making processes without the user being an expert in the area of all infrastructures. I2Sim is a tool that can help a non-expert to build a system of interdependent infrastructures and accurately predict the direct and indirect outcomes of the decisions made. In addition, it can help discover the hidden interdependencies between infrastructures [1] [34] [35]. 18  I2Sim has been developed, in its last version, as a toolbox from the Mathworks simulation environment, Simulink. Simulink provides the user with the possibility to model, simulate and analyze dynamic systems; linear and non-linear systems can be simulated, as well as, in continuous and discrete sample time. Thus Matlab and Simulink are integrated and the full Matlab functionality is available to be used during simulation to better analyze, enhance and revise the models at any time [36]. Simulink works with a comprehensive graphical user interface that allows building models by using block diagrams and, also, provides the user with the tools to model and simulate almost any real-world problem. Integration methods and differential equations do not need to be programmed in common languages and all powerful toolboxes from Matlab are available [36]. In order to understand the i2Sim functionality it is important to go through an overview of the ontology and its key components.  2.1.1  I2Sim Ontology  Infrastructures are different based on their nature; therefore, a common grouping of the components has to be defined in order to get a proper abstraction that can be applied to categorize the functionality of each element present in the simulation environment, this is what we call Ontology [37]. For the I2Sim ontology four categories have been established, based on the task performed by the components, and provides a framework that can be extensively applied to different infrastructures [32]: (1) Tokens: the tokens are the exchange units that flow through the system. A token is a quantity that is transferred between other units inside the scope of the system under simulation. In other words, tokens are the inputs and outputs for every component included in a model. (2) Cells: the cells are production units. The cells are able to create, transform and store tokens. The output tokens may be the same nature of the original token or it could also be the product of combining a set of resources. (3) Channels: channels are transportation units. They are meant to represent a mean to transport tokens between the other units in a system. Depending on the characteristics of the physical entity emulated, a delay factor might be used. 19  (4) Control elements: the control elements are those allowing the user to establish decision points regarding resources allocation and distribution, as well as tuning the simulation parameters and have control of the simulation engine. These elements provide a communication point with upper simulation layers. (5) Visualization elements: the visualization elements allow the user to probe specific outputs from the system and present the results on two dimension axes against time. Results may be presented as a matrix of individual or overlapped plots.  2.1.2  I2Sim Toolbox Components  The previously described ontology is the initial step to consolidate the individual necessary components comprised by the simulator implementation, in order to enable the platform for a wide variety of system to be modelled. As mentioned before, the development and running environment is Matlab/Simulink. Almost all the blocks in the i2Sim toolbox has been developed as custom blocks using the Matlab format “Level2-Sfunctions” and including intuitive GUIs for user interaction. A minority of the blocks have been created as subsystems, coupling native Simulink blocks to generate a desire functionality that can be mask under the proper GUI to ease the user interaction. By using this type of custom blocks we enable the toolbox to be fully interactive with the different native blocks included in Simulink and most of its extension toolboxes for specific purposes. The i2Sim simulator operates in discrete time and uses a fixed-step solver. Since the discrete-time equations are algebraic with time delays, the constant time steps approach increases the speed of calculations by at least one order of magnitude. Another advantage of having Level2 functions is the possibility of incorporating blocks with multiple input and output ports; likewise, those ports may be multidimensional signals. The i2Sim toolbox (Figure 8), at the level of component blocks, uses two categories to classify them: (1) Basis Elements: Aggregator. Delay Channel. Distributor. 20  Modifier Cell. Production Cell. Source. Storage. (2) Visualization and Control: I2Sim Control Panel. I2Sim Probe. I2Sim Visualization Panel.  Figure 8: I2Sim Toolbox  21  The availability of the complete set of components offers a wide range of applications to be modeled but it does not imply that they all have to be used in every simulation case. Knowing that this reference to the simulator capabilities is not intended to replace its manual, some details are skipped in order to focus only on the most relevant aspects concerning the actual project. I2Sim blocks are described in the following part of this section, showing their corresponding toolbox symbol and (in some cases) functional GUI.  2.1.2.1  The I2Sim Control Panel  Figure 9: I2Sim Control Panel  The Control Panel is a key element that has to be present in every I2Sim simulation (only one instance). It provides an intuitive interface to interact the Simulink engine for configuring critical parameters, such as, solver, time step, starting and stopping point for the model under evaluation. The initial step for every simulation is always 1 (instead of 0 as set by default in Simulink) and the ending point is the value input in the “Simulation Time” box. The value “Time Step” corresponds to the time step size calculated for the model to be accurate and stable. The “Time Unit” drop-down menu presents the available units to be established on the model scope as main clock, other components with different time rates use that 22  information to calculate the equivalent adjusted outputs. To control the simulation elapse the buttons “Start/Pause” and “Stop” are available.  2.1.2.2  The Source  Figure 10: I2Sim Source  The I2Sim Source allows a user to generate a signal that can be used as an input to another block [32]. The signal produced by the source could be in the form of tokens flowing as resources or signals to change parameters in different blocks. “Token name” provides an internal opportunity to identify the generated signals. The output signal units of the source are labelled in “Token units” to properly define the magnitudes and ease the maintenance of the component. “Time units” allows the user to establish the equivalent output rate while compared to the main clock units. The source can have a constant output if “Type of Source” is “Constant”, the value is written in “Nominal 23  output”; or the output value can change in time, at specific points, as define in “Events Table” in the format “time-step value; …”.  2.1.2.3  The Production Cell  Figure 11: I2Sim Production Cell  The I2Sim Production Cell is a key component of the simulator because it represents a physical entity capable of creating tokens from a combination of input resources. The tokens output by the production cell can have either, the same nature of one the inputs or totally different nature from all the inputs, e.g. a water pumping station has as inputs electricity and low pressure water and outputs high pressure water. The relationship between inputs and output could be expressed as a function, but according to the experience acquired from a variety of projects, some complex infrastructures are highly non-linear multivariable relations impossible to be defined as a mathematical function. Based on the experience of managers and people in charge of infrastructures under study, the concept of Human Readable Table (HRT) was created in i2Sim. The HRT is an 24  analogous idea to the electrical Thévenin Equivalent in electric circuits, as a simplified way to describe the operation for a given physical entity from its input/output relationships. The first column in any given HRT (Table 3) corresponds to the output and the rest of the columns represent the set of resources to be used for generating that output. The HRT defines thresholds of operability accounting for the amount of available resources; these intervals are named Resource Modes (RM). In every case, a column search along each resource is performed in order to determine the minimum value possibly met with the provided inputs. Each column has the values ordered upwards; therefore a minimum input value belongs to a row with a higher id number. The restricting column (resource) will be called Limiting factor. The output value is selected from the first column by using the same row id number containing the corresponding threshold in the limiting factor. Table 3: Human Readable Table (HRT)  1 2 3 4 5  Discharged [Person/Minute] 4 3 2 1 0  Electricity [kW/minute] 20,000 15,000 10,000 5,000 0  Water [kL/minute] 51 38 26 13 0  Natural Gas [ft^3/minute] 56 42 28 14 0  The Production Cell is driven by two variables: Physical Mode (PM) and Resource Mode (RM). The physical mode represents the physical state of the facilities and, therefore, the capabilities to operate. In the Production Cell symbol the PM is displayed as a rectangle in the left-upper corner. The resource mode has been already described and is displayed as a solid color filling the cell itself. The cell has as many HRTs as defined PMs and each row of each table denotes the number of RMs per table (PM). The PM/RM identifying colors are the same that were used by the Colorcoded Threat Level System of U.S. Department of Homeland Security (DHS) [34]. The pair colorsfunctionality goes as: green (100%), blue (75%), yellow (50%), orange (25%) and red (0%). In order to provide a correct understanding of the Production Cell operability, it is recommended to go through a brief example, illustrating the process of determining a calculated output corresponding to a particular set of resources present as inputs. The corresponding example is presented in Figure 12. 25  Figure 12: Production Cell Operation Example  The first Production Cell shown has 100% resources and operates in the first row, namely RM:1, as displayed by the corresponding block. After varying the resource amounts in the input ports the functionality of the Production Cell gets affected, changing output and display information. The procedure to determine the RM of the cell and the respective output value initiates with a sequential search. Every input value is located within the working threshold on the corresponding column. Thus, electricity value of 12,000 belongs to third row, water with 46 is in the second row and natural gas operates on the first row. Electricity, therefore, is the limiting factor and the determiner of the RM. Since RM is 3, as shown in the figure, the cell possible output takes a value of 2. The HRT concept incorporates a dimensional reduction analysis by the use of the limiting factor and turns the inputs-outputs relation into a step function, in this case a “floor function” [38]. For multiple resources, equivalent to multivariable functions, the dependant variable (output), resides on the “hyperplane” delimited by the limiting factor. After evaluating the type of infrastructures present in this study, it was determined that there are no discontinuities in their operation. The Production Cell was enhanced, then, with an (optional) interpolation routine on the dimension of the limiting factor. By doing that, 26  all previously described features are kept and the “step function” is replaced by a “piecewise linear” function. The step function and piece-wise linear functions are plotter in Figure 13 and Figure 14, respectively.  Figure 13: Floor Function (HRT)  Figure 14: Piece-Wise Linear Function (Interpolated HRT)  27  2.1.2.4  The Delay Channel  Figure 15: I2Sim Delay Channel  The Delay Channel is a block built to represent physical connections between physical entities. Depending on the case under study and the comprised infrastructures, a delay channel could act as a transmission line, water pipe, etc. Different interconnecting means have different layouts, length and width; the combination of these characteristics affects how tokens move along. A common variable used to properly model tokens behaviour moving through transportation lines, is a time delay. The Delay Channel block includes one tokens input “in”, accepting the tokens to be transported. One additional input might be present, depending on the operating mode established through the drop-down menu “Channel delay input”. Three options to establish the time delay value are available: Manual, External and HRT. Manual delayed is a constant value given by the user on the “Manual Settings” section of the block GUI. External mode enables one more input port that waits for a signal 28  every time-step or sets zero otherwise. HRT mode uses a set of predetermined HRT tables with delay values, an external signal may be used to select the desired table. The nature of the tokens in the output port is the same as the input one.  2.1.2.5  The Distributor  Figure 16: I2Sim Distributor  The I2Sim Distributor is a component that allows a main flow of output tokens to be split into different paths to continue traveling along the system. The way to determine the values of the token output ports is based on percentages applied to the tokens input port signal. The operational mode of the I2Sim Distributor is selected from the three options available in the drop-down menu “Distribution factor input”. The first distribution mode is “Manual”, allowing the user to specify the number of token outputs and distribution percentages in the “Manual & External Settings” GUI section. The second way of 29  establishing output values is through an HRT table, by a preset set of percentages associated with intervals in the input. Therefore, the value in the tokens input port decides itself how to be split. There may be multiples HRTs and an additional input port to select a particular one via signal. The last operation mode is “External” and requires n-1 additional input signals, where n is the number of desired outputs. Each new signal has a percentage for the corresponding output port and the last one is calculated internally for validation purposes. The Distributor is considered a Decision Point because a higher level layer might interact with it, through optimization routines or specialized software, to decide how to allocate resources. Another use is to simulate token losses.  2.1.2.6  The Storage  Figure 17: I2Sim Storage  The I2Sim Storage is a depot that is able to keep an initial/given amount of tokens and release them based on an external signal. As a block two input ports are present: “in” to receive the new tokens to be stored, “cmd” accepting a value signal that pushes the same amount of tokens to be delivered. From the outputs: the “out” port is the tokens output port; 30  “level” informs the total amount of tokens inside the Storage and “Surplus” tells the user the number of tokens exceeding the storage maximum capacity. The I2Sim Storage GUI enables the user to define operating settings as “Maximum Level”, “Minimum Level” and the “Initial Level” for the component to work.  2.1.2.7  The Aggregator  Figure 18: I2Sim Aggregator  The I2Sim Aggregator is a block that receives multiple inputs, of the same type of tokens, and adds them up into a single output port. The number of input ports is given by the user via GUI.  2.1.2.8  The I2Sim Probe  Figure 19: I2Sim Probe  The I2Sim Probe block is an information monitor that provides step by step signal tracking from the connection point to model simulation workspace (not the Matlab 31  Workspace). At least one Probe has to be part of the model to avoid simulation errors on the visualization panel. Many Probes may be used on a single model, depending on the token signals that critical for the analysis.  2.1.2.9  The I2Sim Visualization Panel  Figure 20: I2Sim Visualization Panel  The I2Sim Visualization Panel is a framework to configure the way the probed information is displayed to the user. The Visualization Panel does not present information by itself; instead, it launches the Matlab plotting tools with the configuration provided through its GUI. The Visualization Panel GUI creates a matrix of plots, as the user defines the dimensions for that matrix. The “Layout” is shown and updated as the number of rows and columns are decided by the user, it also allows the user to choose the position for the signals to be displayed. All probes present in the model are listed in “Available Probes” and more than one probe can be assigned to a single spot in the layout under discretion of the user. 32  2.1.2.10 The Modifier Cell  Figure 21: I2Sim Modifier Cell  The general purpose is to apply weighted factors (modifiers) to an input and relate the result to a known curve to produce an output. The block has been specifically created to perform complex functions for Egress and Traffic models and will typically not need to be used by most users [32].  2.2 Input Data for the Smart Energy Simulation  The data required to simulate the smart-energy models includes: energy demand data (electrical and thermal), physical constraints on the equipment to be used (efficiencies and down time), fuels cost and associated emissions cost. The sources providing the verified data are also diverse. Table 4, presents detailed information about the simulation data used in the models part of this thesis. Table 4: Information Sources  Data Item  Description  Heat energy required by all the entities on-campus that are covered by the central steam plant. Electrical load of the campus covered by UNY, UNS Electrical Demand Substations. Equipment efficiencies, distribution technologies Physical constraints efficiencies, down time or maintenance periods.  Thermal demand  Fuels Cost  Cost for every fuel used in the heat generation process.  GHG Emissions  CO2 fuel generating factors and associated taxes.  Source UBC Building Operations (Steam Plant) UBC Building Operations UBC Building Operations, Stantec Consulting, FVB Energy Inc. BC Hydro, Shell, Terasen Gas, Henry Hub commodity index BC Government  33  2.2.1  Energy Demand Data  The Energy Demand Data available for the simulation task was acquired from historic metering records. The thermal energy measurements were taken inside the Steam Plant (before going to the distribution piping), providing the consolidated amount of steam to be deployed to the covered facilities on-campus. The electrical energy corresponds to the total campus consumption and has the same format used by BC Hydro for billing purposes. The minimum granularity of the information collected is hours, restricting the simulation cases to use discrete steps of one hour. To yield meaningful results it was determined that every simulation case would be conducted for a period of one year. Therefore, an overlapping data interval of that length is required for electrical and thermal energy. Figure 22 shows the energy original and generated datasets on an hourly basis.  Figure 22: Energy Data Availability Chart  34  Comparing the available information for electricity and heat consumptions, no consecutive overlapping period was long enough to be used. Checking the parallel calendar sets (Figure 22), the maximum matching interval was half a year starting from February 28th 2008 to September 1st of the same year. The solution implied to extrapolate the shortest possible interval to complete the desired time span. The six months needed to complete the dataset could be taken from prior to the overlapping found or posterior to it. There was more heating information earlier in the calendar providing a better support for extrapolation. Thus, the period elapsed from September 1st 2007 to February 27th 2007 was selected for extrapolation of steam data. In order to simplify the steam data projection, an average growth factor was calculated with all parallel values for the existing metered records, year by year. Once the calculated factor was applied on the corresponding set, the obtained interval (Sept. 1st 2007 – Sept. 1st 2008) is what was established as “Simulation-Data Base Period”. The decision of getting yearly factors allowed me, as well, to use additional steam data, on a monthly basis, for years 2007 to 2009. Thus, future information time spans could be more precisely projected; indeed, the extrapolation was also applied to subsequent years until 2011. The factors used to obtain the final working datasets are presented in Table 5, as follows: Table 5: Steam Growing Factors Used for Extrapolation  Period  Factor  2006 to 2007 2007 to 2008 2008 to 2009 2009 to 2010 2010 to 2011  0.8964 1.0435 1.0212 1.0323 1.0323  Source Hourly metered data Monthly metered data Monthly metered data Average previous two Same as 2010  Similarly, growth factors were applied to electrical demand to extend the available periods and make them match the generated steam (thermal) intervals (Table 6). Table 6: Electrical Growing Factors Used for Extrapolation  Period  Factor  2007 to 2008 2008 to 2009 2009 to 2010 2010 to 2011  0.9800 1.0447 1.0003 1.0323  Source Hourly metered data Hourly metered data Hourly metered data Average previous two  35  In both cases, when averages were used for extrapolation, the intention was to affect the set with two previous years, as the factors are different and, yet, the generated interval is completely new. This project does not focus on optimizing the actual electrical consumption oncampus, because there are different on-going projects aiming to achieve this. Instead, the purpose of having the electrical demand as energy input data is to determine the “Excess Electricity”. This concept is understood as the difference between the maximum contract electrical energy available and the amount of electrical energy required for a point in time. Figure 23 illustrates the concept of excess electricity on an hourly basis. What makes this concept important is its ability to be used as a fuel supply available for heating purposes apart from the normal electrical powered activities. The deployment of excess electricity is based on an electricity management strategy.  Figure 23: Excess Electricity  2.2.2  Physical Constraints Data  The efficiency of the heat generation equipment in operation is driven by the type of distribution system it is connected to. Likewise, some heat generation options like heat pump are only available for a particular distribution technology, in this case Hot-Water. 36  Therefore, the physical capabilities of the technology used in the simulation cases are determined considering two major tasks: production and distribution, both with independent thermal efficiencies. The corresponding data for generation equipment is shown in Table 7.  Table 7: Generation Technologies Efficiencies (%) Distribution Steam Hot-Water Generation Gas Boilers 82 90 Electrical Boilers 91 97 Biomass Plant 63 71 Heat Pump System N/A 300 (COP 3)  For the Heat-Pump System, the Coefficient of Performance (COP) is a more convenient way of expressing the output/input energy relation. In this case, the COP is 3, as for every kWh of electricity input; 3kWh of thermal energy is present in the output of the system. Previously, it was explained that the heat energy source is the TRIUMF particle accelerator, because it uses water for cooling down the equipment. Thus, the amount of heat energy in the form of hot water is another constraint for the system. The ratio for heat/electricity in the input is 2:1. The availability of this input energy (hot water) is calendar dependant and it is illustrated in Figure 24, as follows:  Figure 24: Heat Energy Available at TRIUMF  The CHP Biomass Plant (Nexterra Plant) can be operated in two modes: Thermal (only) or Co-generation. The selected method for its future operation is Co-gen, as the electricity generated becomes available to be incorporated in the grid. The advantages of 37  using the clean energy produced from this distributed resource, are the revenue obtained from selling it back to Hydro, as well as, delaying the need of upgrading the transmission lines to increase the peak capacity on-campus. Energy generated at the Nexterra Plant in each mode, is presented in Table 8. Table 8: Nexterra Plant Energy Production (MW) Distribution Mode Thermal CO-GEN  Steam Heat 6 3  Electricity 2  Hot-Water Heat 6 4  Electricity 2  The values in Table 8 don‟t represent net production and are subject to the efficiencies (thermal) mentioned before and a self-consumed amount of electricity equivalent to 0.4MW. Thus, the net electricity output by the plant is 1.6MW. The CHP system needs to go into maintenance two weeks during the year (schedule not yet available). This downtime has to be considered for the simulation cases in order to increase the accuracy of the results. The efficiencies for the distribution systems are consolidated values because the campus is treated as a whole and are summarized in Table 9. Table 9: Distribution Systems Efficiencies (%)  Distribution Technology Steam transportation Hot-Water transportation  Efficiency 78 98  As the heat pump system and electrical boilers depend on the availability of excess electricity to function, the system has to be able to fully operate on natural gas as backup fuel. Thus, regarding natural gas, the thermal generation capacity and fuel has the capacity to satisfy the total demand of the campus in the absence of other alternatives.  2.2.3  Fuels Cost Data  Every fuel has a different source for the data to be used in simulation; this data is based on stock markets, provincial policies and contracts with providers. 38  Starting with natural gas, the sources for the prices are the Henry Hub commodities for the periods 2007 to 2010, and starting from 2011 to 2015 the price is based on a fixed priced contract with Shell Gas. Since the Henry Hub presents the monthly natural gas value in U.S. dollars per million BTU, the corresponding conversion factors were used to express the information in Canadian dollars per kWh, including the respective monthly exchange rate $US to $CA given by the Bank of Canada. Table 10 displays the natural gas prices calculated for 2007-2008 based on the sources aforementioned.  Table 10: Natural Gas Price 2007-2008 ($CA/kWh) Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec  2007  2008  0.02628 0.03188 0.02830 0.02937 0.02851 0.02675 0.02226 0.02250 0.02127 0.02263 0.02356 0.02444  0.02753 0.02915 0.03228 0.03504 0.03840 0.04402 0.03822 0.02968 0.02770 0.02721 0.02781 0.02447  For the year 2010, the same methodology was followed but the commodity prices were not complete at the moment when the simulation cases were ready to run. For that reason, only the available on-line values were listed, as presented in Table 11, and averaged.  Table 11: Natural Gas Prices (Partial) 2010 ($CA/kWh)  2010 Jan Feb Mar Apr May Jun Jul Aug  0.02068 0.01922 0.01497 0.01382 0.01473 0.01703 0.01644 0.01531  39  The final values to be used as source data, regarding natural gas price, are summarized in Table 12. Table 12: Natural Gas Price Summary 2010-2015 ($CA/kWh)  Period  Price($CA/kWh)  2010 2011-2015  Details  0.01653 Averaged from available prices in Henry Hub (Table 11) 0.02794 Fixed priced 5 year contract with Shell  Electricity rates are the same used by BC Hydro for billing UBC. The methodology is based on two separate measurements: hourly metered consumption and maximum peak during a billing period. A billing period elapses from the 22nd at 8:00am of a month until the next month‟s 22nd at 7:00am. Table 13, summarizes the historic and projected BC Hydro rates from 2007 to 2015. Table 13: BC Hydro Billing Rates ($CA) kW Peak (KVA)  2007  2008  2009  2010  2011  2012  2013  2014  2015  0.0295 5.0282  0.0320 5.4642  0.0326 5.5654  0.0341 5.8220  0.0366 6.2447  0.0406 6.9316  0.0418 7.1250  0.0434 7.4100  0.0460 7.8546  The rates presented above include the respective taxes, and the projection for futures years are provided directly by BC Hydro. A new set of rates (consumption and peak) take effect from April 1st of the respective year and is valid until the same date next year. The current maximum capacity contracted with Hydro is 44.1MW and the next level is 60MW. BC Hydro buys electricity from local clean producers in order to reduce carbon footprints and follow the provincial regulations on GHG minimization. The program allows UBC to receive 12 cents revenue per kWh of electricity generated at the Biomass Plant. However, as the energy is consumed it will be charged in the corresponding billing period. Nonetheless, the difference between buying/selling rates constitutes a valuable saving. The wood chips for the operation of the CHP plant are required to have no more than 25% of moisture. This degree moisture present is accepted because the gasification process includes a drying session for the fuel, additionally; not being completely dry reduces the price for the chips. It is estimated that a tonne of wood chips provides 15 GigaJoules of energy at a cost of $49.5CA/tonne. Therefore, the price per kWh is $0.01188CA. 40  2.2.4  GHG Emissions Data  “The Carbon Neutral Government Regulation lists six distinct greenhouse gases or groups of gases as contributing to the GHG emissions: carbon dioxide (CO2); methane (CH4); nitrous oxide (N2O); hydrofluorocarbons (HFCs); sulphur hexafluoride (SF6); and perfluorocarbons (PFCs). For most provincial public sector organizations, the only GHGs emitted in significant amounts are the three principal gases associated with fuel combustion for energy (CO2, CH4 and N2O) and, to a much lesser extent, HFCs released from refrigeration and air conditioning equipment” [39]. Whenever possible, provincial public sector organizations‟ emission factors are specified by individual gases. For more practical instances, an aggregate factor for multiple gases is provided in terms of CO2 equivalent (CO2e) emissions. CO2e is the standard unit for measuring and comparing emissions across GHGs of varying potency in the atmosphere [39]. Reductions and removals must be expressed in tonnes of each specific greenhouse gas measured in carbon dioxide equivalent [40]. The GHG intensity is the measurement of how many tonnes of GHGs are emitted for every GWh [41]. Natural Gas emits 50 kg/GJ of CO2e [39] [42]. When this value is converted to more standard units (GHG intensity) the resulting factor is 180 tonnes of CO2e/GWh. In 2010, BC Hydro's GHG emissions were approximately 1.11 million tonnes of CO2e [43]. This amount of emissions represents a significant achievement for BC Hydro, considering that the target value for the year was 1.5 million tonnes of CO2e. The GHG intensity of electricity generated by BC Hydro, in the same period, was 23 tonnes of CO2e/GWh [41]. During combustion of biomass, the CO2 released to the atmosphere is assumed to be the same quantity that had been absorbed by the trees when they were alive. Because CO2 absorption from plant growth and the emissions from combustion occur within a relatively short timeframe to one another (typically 100-200 years), there is no long-term change in atmospheric CO2 levels. For this reason, biomass is considered carbon-neutral [39]. Besides, the biomass processes based on gasification or pyrolysis have low environmental emissions and higher energy recovery potential due to the inherent efficiency in combustion [44]. The emissions factors for all the fuels part of this study are summarized in Table 14. 41  Table 14: GHG Emissions per Fuel Source Fuel Emissions (Tonne/GWh) Natural Gas 180 Electricity 23 Bio Fuel 0  BC‟s approach for regulating GHG emissions involves a Carbon Pricing divided into two components: Carbon Tax (fossil fuels only) and Emissions Trading and Offsets [45]. The carbon tax became effective in July 1st 2008. The proposed rates started with a base of $10CA and a projected increase of $5CA per year, effective from every July 1st. “Being carbon neutral involves calculating your total climate-damaging carbon emissions, reducing them where possible, and then balancing your remaining emissions, often by purchasing a carbon offset: paying to plant new trees or investing in “green” technologies such as solar and wind power” [46]. The Pacific Carbon Trust (PCT) is a BC Crown corporation created by the Government to be in charge of collecting offset funds from government operations and selecting projects that cut carbon emissions [47]. According to PCT the proper definition for carbon offset is: “A carbon offset represents a reduction or sequestration of greenhouse gas emissions generated by activities, such as improved energy efficiency, that can be used to balance the emissions from another source, such as a plane trip” [47]. All PCT offsets are in compliance with the BC Emission Offsets Regulation. PCT has initially set its offset selling price at $25CA/tonne [48]. The rates applicable to carbon tax and offset, from 2008 and on, are shown in Table 15. Table 15: Carbon Tax & Offset ($CA/Tonne of CO2e) [48] [49]  Period Tax Carbon tax Carbon Offset  2008  2009  2010  2011  2012  10 N/A  15 N/A  20 25  25 25  30 25  Natural gas is taxed with both carbon tax and carbon offset tax while for electricity consumption only the carbon offset is applied. 42  2.3 Smart-Energy Simulation Cases  Once the available input data has been determined, the next step is to establish the number of cases to be simulated. In total, six simulation cases were prepared. Every case includes substantial variations in technology or source data, enabling us to configure various possible scenarios for helping UBC make a decision about the investment on the current Steam Plant replacement. Case 1 is a validation case used to verify the ability of I2Sim as simulation framework, therefore, is a platform feasibility case intended to certify I2Sim in producing coherent and trustable results while running the proposed cases. Case 2 uses the heat distribution system presently operating at the plant but the generation is enhanced by adding two new technologies: the biomass plant and electrical boilers. The third Case includes the same generation portfolio as in Case 2 but the distribution system modelled is Hot-Water based. Case 4 extends Case 3 with the Heat Pump System incorporated to the production grid. Case 5 has the same generation and distribution configuration present in the third case, it defers from its predecessors in the data set, using averaged projected data five years ahead. Case 6 includes the same configuration of Case 4 and uses the same datasets established for Case 5. The main goal for Cases 2 to 5 is to minimize GHG emissions, in order to help in fulfilling the institutional sustainability reduction targets. The main objective for Case 6 is to verify the impact of using electric boilers in GHGs and costs, i.e. Case 6 runs with and without electric boilers for the same time span (projected). Table 16 presents the summary of the simulated cases including the most representative characteristics.  Table 16: Cases Simulated  Cases  Distribution  1  Steam  2  Steam  3, 5  Hot-Water  4, 6  Hot-Water  Fuel Grid Natural Gas Natural Gas Electricity(Excess) Biomass Natural Gas Electricity(Excess) Biomass  Technology  Goal (Objective function)  Natural Gas Boilers  Historical validation  Natural Gas Boilers Electric Boilers Nexterra CHP Natural Gas Boilers Electric Boilers Nexterra CHP Natural Gas Boilers Natural Gas Electric Boilers Electricity(Excess) Nexterra CHP Biomass Heat Pump System  1. Minimize GHG emissions 2. Minimize cost 3. Maximize system efficiency 1. Minimize GHG emissions 2. Minimize cost 3. Maximize system efficiency 1. Minimize GHG emissions 2. Minimize cost 3. Maximize system efficiency  43  As the emissions have an associated cost, the overall operating cost is intended to be diminished. The use of excess electricity in generation and hot-water in distribution increases the total efficiency of the system due to their own individual higher efficiencies.  2.3.1  Case 1: Platform Validation Case  Case 1 uses the current infrastructure at the Steam Plant and natural gas as the only fuel to generate heat. The case uses the simulation-base data period, therefore, it elapses from September 2nd 2007 to September 1st 2008. The respective prices and factors required for calculations are taken from the compiled data (see 2.2 Input Data) applicable to the simulation span. Figure 25 includes the I2Sim implemented model for Case 1.  Figure 25: Case 1: Validation & Base Case  In order to facilitate the identification of components along the model, a set of colors was established to label the blocks accordingly with fuels used. As seen in the figure, blocks in red color are related to natural gas and orange filled blocks to electricity. The boilers are represented as a single entity with the Production Cell called “Gas Steam Plant”, because the efficiency is measured as a generation process and not separately. Similarly, the distribution system is 44  modeled as one pipeline going from the steam plant to the UBC campus; the latter represented as an aggregate by one block. The subsystem implemented for the electrical substation is a concise combination of I2Sim sources, distributors and a custom block. Two more blocks were written for the purposes of this study, one regarding the fuel deployment to generation equipment (“Fuel deployment”) and another to calculate all financial related data (filled with teal color). Details about the implementation of the electrical substation, fuel deployment (later renamed to GHG minimization) and financial blocks are given in the next section. The heat-related results from this case are a comparison between UBC‟s historical metered data and what was informed in invoices by natural gas providers for the corresponding period. Electricity consumption and monthly peaks are also calculated in order to determine the amount of excess electricity that would become available for usage during this particular year. If this calculated amount of “off-peak” electricity is high enough, its usage for heating purposes is recommended. Results from this case are the reference to compare the other simulation scenarios. The results (metered/modeled) are shown in Table 17.  Table 17: Case 1 Heat Generation Results  Parameter NG Consumption (GWh) CO2e Emission (Tonnes) Natural Gas Cost ($M)  Metered Data  Simulation Results  Error  296 53,050 8,89  0.48% 0.62% 6.64%  297 53,379 8,30  The values obtained from the simulation confirm the reliability and accuracy that I2Sim can provide as a simulation platform and allows us to run the proposed cases defined previously. The high absolute error of 6.64% in natural gas cost is attributed to high fluctuations in the collected values from commodity price plus exchange rates required for the conversion to Canadian dollars. However, the most significant value under comparison is the fuel consumption, since the other two are dependant on it. Electricity peaks are assessed with the intention of knowing the highest value throughout the year of data simulated, and to verify that the contractual limit is not exceeded. Furthermore, knowing the maximum monthly consumption provides an idea on how much the peak charge would be increased if going to the limit every month. Peak measures are presented in Figure 26. 45  44,100 39,690  39,452  41,085 40,177  39,140 36,826 36,593 36,024  37,788  38,447  38,259  39,354  40,168 38,124  35,280 30,870  [kW]  26,460 22,050 17,640 13,230 8,820 4,410 0 02/09/2007 0:00  02/10/2007 0:00  02/11/2007 0:00  02/12/2007 0:00  02/01/2008 0:00  02/02/2008 0:00  02/03/2008 0:00  02/04/2008 0:00  02/05/2008 0:00  02/06/2008 0:00  02/07/2008 0:00  02/08/2008 0:00  02/09/2008 0:00  Figure 26: Electricity Peaks Case 1  According to the results from simulation of Case 1, the total electricity consumed for the period under study is 273GWh. If we were to assume that we have peak consumption at every time-step of the entire simulation span, then the calculated value of excess electricity would come up to 387GWh. The difference between the total contractual possible usage and metered usage (for the simulated length) is 114GWh, and determines the amount of excess electricity that might be used for heating purposes. Thus, having 30% of the maximum electrical capacity available, as well as low carbon footprint electricity (BC Hydro), makes feasible the use of electrical powered equipment in the heating grid. To check the consistency of the results given by the model, the input thermal demand set and calculated the output were plotted together (see Figure 27, on page 47). The graph on the left side corresponds to the historic metered data provided to the simulator as source thermal energy for campus demand. On the right-hand side, the graph is generated by the simulator plotting engine based on the step by step allocation of natural gas in the steam production represented entity. The identical figures obtained from both sources show that i2Sim, during its operation, is capable of matching the input data. Thus, the proposed cases were implemented following the same methodology from Case 1 but this time incorporating all fuel sources and technologies part of the study. 46  Figure 27: Case 1 Validated Results  2.3.2  Cases 2 to 6 Technical Simulation Considerations and Design  Cases 2 to 6 are extended and enhanced versions of Case 1; new generation technologies and an alternate distribution system (Hot-Water) are included, as well as, a management block for GHG minimization fuel deployment. The common high level diagram of the desired proposed cases topology is displayed in Figure 28.  Figure 28: UBC Thermal Energy Infrastructure  47  The schematic in Figure 28 represents a flow model, since the information travels from left to right. The flow starts with the fuel sources, followed by the GHG minimization module, next we find the heat generation machines feeding the distribution piping and getting to the final destination, UBC campus. The same set of colors used for Case 1 is present in this diagram, namely, red for natural gas blocks, orange for electricity; additionally, gold color (according to html color code) identifies Nexterra blocks and green does for Heat Pump. Likewise, the distribution layout takes the color gray for steam-based and blue for hot-water. The case models follow the color distinctions, aiming for easier component identification and understanding of the processes emulated. Following a top to bottom description of the input fuels shown in the infrastructure schematics, natural gas is represented by a single source representing the amount of natural gas available for heating, since no other variables are considered for this supply, no subsystem or complex model is required for this component. Conversely, electricity implies a more complex representation, since more variables are involved in the process and a step by step verification is required. The subsystem designed to represent the electrical process on the input side is introduced in Figure 29.  Figure 29: Simulation of the Electrical System  Going through the electrical model from left to right, we find two sources on top: “BC Hydro”, outputting the maximum physical combined capacity of the substations and below it we have “Limit”, providing the value of the maximum contractual capacity. Percentage of use of Off-peak block is a feature that is present for future studies including a limited use (percentage) of the excess electricity. 48  The main block in the model is the “controller”. This is based on four input signals, the three previously described and the electricity coming from the biomass plant, plus the historical demand (electrical) data. The controller is able to calculate the excess electricity, peak values from campus demand and the difference between campus historical and new peaks. The distributor labelled “Substation” receives the percent values for consumption and excess electricity, as well as the maximum electricity value that can deliver the BC Hydro source. The outputs are the values for excess electricity and campus consumption in kW, plus a signal called “unused electricity”. “Unused electricity” refers to the remainder of excess electricity when its consumption is limited by a value given through the third input of the controller. Similarly to natural gas, the heat pump system does not require the design of an I2Sim/Simulink subsystem, since it is an energy source (see Figure 24, on page 37) combined with excess electricity, already calculated in the electrical subsystem. The assumption may be easily verified by reviewing the schematic on Figure 30.  Figure 30: Heat Pump System Schematic [5]  It is important to highlight that heat pump are only part of Cases 4 and 6. The Biomass Plant (Nexterra) is the last component of the energy portfolio and the relevant operation information required for simulation is sketched in the schematic on Figure 31.  Figure 31: Nexterra Facility Schematic  49  The previous chart shows the high level operation of the Nexterra plant. The first block receives the input energy in the form of wood chips. After processing (see 1.3.1 Nexterra Plant, on page 8 for more details about the plant operation) both, thermal and electrical energy are produced and some energy losses occur. On the thermal side, some losses are caused by the transportation to the thermal grid. Regarding electricity, a portion out of the total generated is self consumed in the plant. From the 2MWe produced, only 1.6MWe are injected to the electrical grid. Converting this schematic to an I2Sim equivalent, for the Cases under simulation, leads to the subsystem shown in Figure 32.  Figure 32: Simulation of the Biomass System  The I2Sim implementation complies with the schematic analyzed before. It starts with the input energy source, that is, the total wood chips equivalent amount of energy loaded in the plant to be processed. Next, the distributor splits the input energy into three paths: heat produced, total electricity produced and energy losses. By doing this, the internal gasification and generation process is simulated. Subsequently, the electrical energy is divided into two flows: available electricity to be incorporated in the grid and self-consumed. Three major outputs are needed thenceforth: Heat produced, going to heat generation, Electricity produced, going to the electrical subsystem for being incorporated in the grid, and Input energy, magnitude needed for calculating the fuel cost for the Nexterra plant operation. Up to this point, all the information regarding energy available for heating purposes is known, therefore the next process in the Case(s) simulation flow is to deliver this energy to the corresponding generating blocks. From fuel to generation the optimization process takes place with the main objective of minimizing GHG emissions. The description of this process is provided in the next subsection of this document. Due to its importance, the minimization algorithm requires detailed explanation. Generation is simulated with the use of production cells, each one corresponding to a specific technology. The number of electric or natural gas operated 50  boilers (or any other equipment) is not relevant for the process; what really takes importance is the combined capacity and efficiency. Figure 33, shows the generation process employed in Cases 4 and 6. The others cases include the same structure except the “Heat Pump” production cell.  Figure 33: Simulation Generation System  After the energy information outputted by generation is flowing, it goes through the distribution system. The distribution system is presented in Figure 34.  Figure 34: Simulation Distribution System  51  The color identification for the two distribution technologies follows the same code used in the energy infrastructure schematic, shown earlier in this chapter. There is no apparent difference except for the color used, but internally an overall efficiency factor is applied based on the technology in use. The final destination for both, thermal and electrical energy (not used for heating) is UBC‟s campus in a single block. The UBC block receives and processes all information related to thermal energy generated by the model. Simultaneously, it is sending the historical hour by hour value to the optimization block (GHG minimization block) to find the right combination of fuels to match the known demand every time step. All this happens with one step delay because the UBC block is located at the end of the information flow. The results from the first system iteration are not taken into account. For the purpose of collecting information related to fuel consumption and costing, as well as, the consolidated results from each case; the “Financial block” was created. The block has multiple inputs for parameters and signals required for the mentioned calculations. The Financial block was also the purpose of the companion Master Thesis [50], and looks as in Figure 35 below.  Figure 35: Financial Block  For each one of the fuels, three values are required for calculations: amount consumed, price per energy unit and GHG emissions factor. Special cases like electricity and biomass might require additional data. In the case of electricity, the peak measure is a portion 52  of the total cost and has a corresponding independent price. Based on pre-calculated information, the excess electricity will hit the limit at least once per month. Since the peak value is the first maximum kW value during the billing period, more occurrences of the same value would not be charged. The assumption, then, is to have the limit contractual value as peak value for every month included in the simulation span. Highlighting that this study focus on the emissions, energy and costs associated with the heating process, no analysis will be performed on the non-thermal electrical usage. As a result, the only peak charge related to heating tasks comes from the difference between contractual limit (44.1 MW) and the historical peaks from campus consumption. The generated electricity by Nexterra plant is important because it is sold to BC Hydro at a rate of 12 cents per kW. The revenue is subtracted from the total costs, except for the first two weeks. The explanation for choosing this period is the unknown specific time for the maintenance to happen. Since the plant is running at full capacity at all times and delivers the electricity produced to the grid, specific dates are irrelevant for avoiding crediting the income. The prices associated with emissions (carbon tax, carbon offset) change value at the established point of the year (July 1st) and are provided every time step to the financial block. The financial block includes a results GUI. At the end of the simulation, the GUI displays the most relevant summarized results (Figure 36). More information is loaded to Matlab workspace for further processing.  Figure 36: Simulation Results GUI  All modules were integrated accordingly to the specifics of every case. The complete I2Sim models for all the cases are presented in the next three figures (Figure 37, Figure 38 and Figure 39). 53  Figure 37: Case 2, Complete I2Sim Simulation Model  54  Figure 38: Cases 3 & 5, Complete I2Sim Simulation Model  55  Figure 39: Cases 4 & 6, Complete I2Sim Simulation Model  56  2.3.3  Optimization Algorithm  Once the scope variables are determined, the next step defines the strategy to manage the technologies. A hierarchical deployment of each fuel source is suggested based on their corresponding GHG emissions. Figure 40 shows the optimization algorithm.  Figure 40: GHG Minimization Algorithm  The biomass plant is considered carbon neutral (zero emissions associated) and supplies not only heat, but also electricity to be integrated into the grid. This fact positions the Nexterra option on top of the hierarchical heat source stack. The total production of the plant is deployed into the system to fulfill the campus heat demand. If the total energy demand is not satisfied, the next technology is used in order of increasing GHG emissions. The heat pump system has a good coefficient of performance and the thermal energy used is recycled from a process already running, and would be wasted otherwise. These circumstances put the HP system in the second level in the heat sources hierarchy. For this technology to start operating, the needed portion of available excess electricity is used (heat pump system is only considered in Cases 4 and 6, and for that reason the resource is drawn in a dotted line on Figure 40). 57  Based on the difference in GHG emission tonnes associated with electricity and natural gas (established by provincial law), electrical boilers are less polluting. Besides, electrical boilers are more efficient than natural gas powered boilers, irrespective of the nature of the distribution system. Hence, available excess electricity (remaining after running heat pump, if in Case 4 or 6) powers electrical boilers to provide the highest possible thermal energy to campus. Natural gas boilers will be operated if the demand has not been covered completely by the other means. Considering the varying thermal requirements and excess electricity availability, some periods of the day may need a big contribution from this supply. In the absence of any fuel due to maintenance or break down, the system has full capacity and supply to operate in natural gas only. The described deployment strategy is used in all the cases under study. The optimization algorithm was programmed inside the “GHG minimization” block. This optimization block appears in Figure 41:  Figure 41: GHG Minimization Block  Necessary inputs for this block are available fuel sources, generation efficiencies (coefficient of performance in the case of heat pump), and the thermal demand from the campus. The management strategy, described previously, is applied every time-step in the simulation. The calculated outputs go directly to the generation production units in optimized quantities for minimizing the total CO2e value emitted, after all constraints are considered. 58  3 Simulation Results and Discussions In the previous chapter all the technical details regarding the implementation of the models were provided. In this chapter the focus is given to the specifics of running the cases and analyzing the results obtained. The scenarios include analysis of the impact (environmental and financial) of adding biomass, heat pump and electrical boilers to the grid (depending on the case), as well as the change to a hot-water heat distribution system (Cases 3 to 6). Cases 2 to 4 are based on the same time span and pricing values. The calendar period for these cases elapses from April 1st 2010 to April 1st 2011. On an hourly basis, the period is discretized into 8760 time steps. The reason for establishing the simulation span between these two dates is to follow BC Hydro‟s billing period. Electrical rates remain the same for the complete simulation run. Biomass price is constant and natural gas price is the average value calculated for 2010 (see Table 12, on page 40). Carbon tax starts with $15CA/tonne and changes from July 1st 2010 to $20CA/tonne, according to BC regulations explained before. Carbon offset stays on $25CA/tonne.  3.1 Case 2: Biomass, Electric Boilers, Natural Gas with Steam Distribution  For this case the heat distribution system is based on steam, as in the base case. The generation includes biomass, electric boilers operated with excess substation electricity and natural gas boilers. The first two are new technologies incorporated to the original production grid, with smaller associated carbon footprint to their fuels. After running the simulation for the corresponding model, the summary results informed by I2Sim look as shown in Table 18, right below:  Table 18: Summary Results Case 2  Gas Energy(GWh) GHG(Tonnes CO2e) Cost($M)  Electricity Biomass  Total  Steam  Steam  (Production) (Demand) 359 262 203  175  113  71  31,333  2,496  0  33,829  N/A  N/A  4.27  3.53  0.84  8.64  N/A  N/A  59  Table 18 includes absolute costs for each one on the fuels consumption. Natural gas cost already includes the charges caused by emissions (both, carbon tax and carbon offset apply). Electricity cost involves consumption, peak charge, emissions charge and revenue from Nexterra‟s sold electricity. The thermal load calculated for this case goes up to 203GWh, the base case calculated thermal demand was 188GWh, thus the new demand in Case 2 has increased 7.4%. Since the input thermal data applies for Cases 2 to 4 the same increased load is present in these three models. The historical electrical demand gets diminished inside the electrical controller by subtracting the electricity generated at the biomass plant for every time step. By doing this, also the peaks values are lowered. Since the assumption is using all excess electricity at every time step, increase in peak charges might happen instead of any reduction. The total excess electricity available was 117GWh. For heating, 113GWh were used, thus, 96.6% of the overall excess electricity was consumed. Emissions were reduced from 53,050 tonnes to 33,829, when compared Cases 1 and 2, respectively. The 36.2% in emissions reduction is a sign that the optimization routine is balancing the energy portfolio according to the objectives. Natural gas utilized was decreased to 175GWh from 296GWh in the base case. This is equivalent to 40.9% reduction; close to the same ratio achieved in emissions, the small difference can be explained by considering, fewer but existing, emissions associated to the electricity used in this case to offset natural gas. Overall efficiency of the system is 56.5%, this is the ratio between total energy input to the system and thermal load delivered to campus. For this and all cases the ratio between the last two columns of the summary table represents the transportation losses.  3.2 Case 3: Biomass, Electric Boilers, Natural Gas with Hot-Water Distribution  Case 3 is essentially the same as Case 2 regarding generation technology and fuel sources incorporated to the process. The main difference is created by the change in distribution infrastructure. By using Hot-Water as distribution piping, not only the losses in transportation are significantly lower, but also efficiencies in production are increase for every technology in use. Summary results from this case are presented in Table 19. 60  Table 19: Summary Results Case 3  Gas Energy(GWh) GHG(Tonnes CO2e) Cost($M)  Electricity Biomass  Total  Thermal  Thermal  (Production) (Demand) 260 208 203  89  100  71  15,876  2,209  0  18,085  N/A  N/A  1.90  3.04  0.84  5.78  N/A  N/A  Total excess electricity for this case is 117GWh, as in Case 2. This is understandable, since the electrical subsystem does not get affected by the thermal distribution system (The only change from Case 2). The Nexterra plant gains efficiency only in heating generation, therefore, contributions to the electrical grid remain the same as in the previous model. The total excess electricity used for thermal energy production, in this case, goes up to 100GWh; namely, 85.5% of the off-peak electricity is powering electric boilers. GHG emissions are significantly reduced from 53,050 to 18,085 tonnes; this implies 65.9% less tonnes of CO2e on campus. The use of natural gas went from 296GWh to 89GWh compared to Case 1, the percentage of decrease in its usage is 69.9%. After seeing results from Cases 2 and 3, it is easy to notice the directly proportional relation between natural gas and GHG emissions. Thus, the management strategy gets verified as applied to the cases towards the main goal of the project. Overall efficiency of the system is 78.1%, the improvement from Case 2 to 3 is high and is due to the better efficiency of both, generation and distribution when based on hot-water.  3.3 Case 4: Case 3 Extension with Heat Pump System  Case 4 is an extension of Case 3, including a Heat Pump system with a high coefficient of performance. In Table 20, consolidated results for this case are displayed:  Table 20: Summary Results Case 4  Gas Energy(GWh) GHG(Tonnes CO2e) Cost($M)  Electricity Biomass  Total  Thermal  Thermal  (Production) (Demand) 210 208 203  61  78  71  10,997  1,732  0  12,729  N/A  N/A  1.32  2.23  0.84  4.39  N/A  N/A  61  All electrical considerations for this case are the same already explained for the two previous scenarios. The only variant occurs in the amount of excess electricity used for heating. This time 33.3% remains off-peak. From the 78GWh of excess electricity used in heating, 56GWh (71.4%) was used in electric boilers and 22GWh (28.6%) went into heat pump. The total amount of heat produced by the heat pump systems is 67GWh, for the complete period. The ratio between this value and the excess electricity employed to produce it coincides with the coefficient of performance input in the modeling. The coefficient of performance calculated from the simulation results is 3.04; the theoretical value given was 3. Differences are attributed to round-off errors. The total heat energy contribution from the heat pump to the campus demand is 31.9%. This represents a significant increase compared to the total wasted energy at TRIUMF. TRIUMF is able to deliver 46.61GWh of waste heat during the period under analysis. With this complete thermal setup, 76% of the GHG emissions obtained in the base case are removed. Natural gas reduction usage is 79.4%. Once more this value is directly related to CO2e emissions and their difference is very small. The overall efficiency of the heating system is 96.7%, a remarkable value that highlights this configuration over the other alternatives. GHG emissions were reduced by 76%. This is also the best reduction ratio obtained from all of the cases running in the same time span, and implies a 10% additional reduction to Case 3 if the heat pump is added to the thermal grid.  3.4 Case 5: Projection 2011-2015  The idea of creating Case 5 is to consider projection for future growth. To avoid the need of multiple scenarios, one only case was modeled chosen for convenient considerations. The energy demands (electrical and thermal) were projected to 2015. Efficiencies in equipment remain equal to the ones used for previous cases, fuel prices and emissions factor and charges were also projected to 2015. It was decided to use an averaged data set based on periods 2011 to 2015, in order to accommodate one only suitable scenario. The period for which the case elapsed was one year. Following BC Hydro‟s billing calendar, once more, the time span starts April 1st and includes 8760 hours. In this case, this corresponds to 8760 sampling points. 62  Growth factors are taken from Stantec‟s Report. Factors are given in per year expected growth, base on indicators, such as, campus expansion, among others. To include the accumulated increase, new factors were calculated with a nested growth formula. All factors and nested factor for both, thermal and electrical demand growth are listed below, in Table 21 to Table 24. Table 21: Electrical Growth Factors 2011-2015 [17] Period Factor 2010 - 2011 1.0997 2011 - 2012 1.0907 2012 - 2013 1.0568 2013 - 2014 1.0537 2014 - 2015 1.0510 Table 22: Electrical Accumulated Growth Factor 2011-2015 Period Factor 1.0997 2010 - 2011 1.1995 2011 - 2012 1.2675 2012 - 2013 1.3356 2013 - 2014 1.4037 2014 - 2015 Average 1.2612 Table 23: Thermal Growth Factors 2011-2015 [17] Period Factor 1.0159 2010 - 2011 1.0156 2011 - 2012 1.0048 2012 - 2013 1.0048 2013 - 2014 1.0048 2014 - 2015 Table 24: Thermal Accumulated Factors 2011-2015 Period Factor 1.0159 2010 - 2011 1.0318 2011 - 2012 1.0368 2012 - 2013 1.0417 2013 - 2014 1.0467 2014 - 2015 Average 1.0346  For this scenario, the electrical contractual limit was increased to 60MW and the layout and technological equipment employed are the same presented in Case 3, the reason was to model electric boilers as a convenient way to use excess electricity for heating, and the hot-water distribution piping (already approved). All results are compiled in Table 25. 63  Table 25: Summary Results Case 5  Gas Energy(GWh) GHG(Tonnes CO2e) Cost($M)  Electricity Biomass  Total  Thermal  Thermal  (Production) (Demand) 272 215 210  155  46  71  27,749  1,011  0  28,760  N/A  N/A  5.85  0.91  0.84  7.6  N/A  N/A  The total amount of excess electricity available throughout the period was 48GWh. Of these, 46GWh were used for powering electrical boilers, representing 96% of the usage. The emissions in this case were 28,760 tonnes of CO2e, implying a 48% reduction from the levels obtained in Case 1. The reduction in natural gas usage was identical to the one achieved in GHG emissions, 48%. The overall energy efficiency of the system was 77% comparing the 272GWh in the input against the 210GWh delivered to campus. This case reinforces the previously obtained results, thus assuring that the best option for the Steam Plant replacement would need to start from switching to hot-water in distribution, and making the most possible usage other fuels rather than natural gas.  3.5 Case 6: Impact of Excluding the Electric Boilers (2011-2015)  Case 6 includes all the fuels sources considered for this study; therefore its layout is identical to Case 4. Similarly to Case 5, this case ran in a projected span for an average period between 2011 and 2015. All considerations used to generate the datasets for Case 5 are also applicable to Case 6. To summarize the characteristics of the model one can say that the layout is taken from Case 4 and the input data from Case 5. The methodology used to generate the results consists in running the case with all active functionality, subsequently; a second run is performed with the Electric Boilers disabled. The two sets of results are presented in Table 26 and Table 27.  Table 26: Summary Results Case 6 (with Electric Boilers)  Gas Energy(GWh) GHG(Tonnes CO2e) Cost($M)  Electricity Biomass  Total  Thermal  Thermal  (Production) (Demand) 238 215 210  130  37  71  23,196  819  0  24,015  N/A  N/A  4.89  0.55  0.84  6.28  N/A  N/A  64  Table 27: Summary Results Case 6 (without Electric Boilers)  Gas Energy(GWh) GHG(Tonnes CO2e) Cost($M)  153 27,355 5.85  Electricity Biomass 15 342 -0.37  Total  71 0 0.84  239 27,697 6.24  Thermal  Thermal  (Production)  (Demand)  215 N/A N/A  210 N/A N/A  Comparing the results displayed in the two previous tables, it is observed that by excluding the electric boilers from the grid an increase of 3,682 tonnes of CO2e is produced in the amount of emissions; this represents 15.33% more than the emissions produced when the complete set of alternatives sources operates. The total operating cost is reduced by only 0.64%, this reduction is not attributed to the use of natural gas but to the revenue produced by the biomass plant. In total energy required the decrease is 0.42%. With the first configuration the excess electricity usage goes up to 77.55%, without using the electric boilers this value reaches only 32.36%. The most relevant results are summarized in Table 28. Table 28: Case 6 - GHG, Costs, and Energy Increase GHG emissions Operational Cost Total Input Energy 15.33% -0.64% 0.42%  3.6 Conclusions For all cases, the particular results were discussed already. In the following tables, results are grouped to facilitate the relative analysis between cases. The main intention here is to consolidate categories of reported data resulting from the simulation. The intent is to aid in decision making for future investments on the thermal infrastructure of the campus. Starting with Table 29, all information about energy required in the input of each system for covering the campus thermal demand is presented as per fuel used in the generation. The last three columns correspond to: total energy input, total energy generated and total energy delivered (after distribution), respectively.  Case 1 Case 2 Case 3 Case 4 Case 5  Gas 296 175 89 61 155  Table 29: Energy Summary Cases 1 to 5 (GWh) Electricity Biomass Total(Input) Generated 0 0 296 243 113 71 359 262 100 71 260 208 78 71 210 208 46 71 272 215  Delivered 188 203 203 203 210  65  Based on the energy values presented in the previous table, generation and total efficiencies are calculated. The distribution efficiency is presented for information. Because the campus was treated as a whole, transportation losses are constant and only vary depending on the technology represented. The lower generation and total efficiencies in Case 2 compared to the base case are due to the lower efficiency in Biomass, but the main goal focuses on GHG minimization as priority. The efficiencies are determined by the amount of energy provided by each fuel plus particular generation efficiencies associated with each technology. The information is presented in Table 30.  Case 1 Case 2 Case 3 Case 4 Case 5  Table 30: Thermal Efficiencies Cases 1 to 5 Generation combined Thermal system overall Distribution efficiency efficiency efficiency 82% 77.5% 64% 73% 77.5% 57% 80% 97.5% 78% 99% 97.5% 97% 79% 97.5% 77%  The main goal of the energy management strategy was to minimize GHG emissions. In Table 31 all emissions are presented by fuel and totalized for the heating generation process. As observed, Cases 2 to 4 have a consecutive lower value of CO2e tonnes, due to the new alternatives added in both, generation and distribution. Case 5, despite being farther away in the future presents a high reduction in emissions when compared to the base case.  Table 31: GHG Emissions Cases 1 to 5 (tonnes of CO2e) Gas Electricity Biomass Total 53,050 53,050 Case 1 31,333 2,496 0 33,829 Case 2 15,876 2,209 0 18,085 Case 3 10,997 1,732 0 12,729 Case 4 27,749 1,011 0 28,760 Case 5  The results show that reductions in GHG emissions are significantly lower in cases with distribution based on hot water. As stated in the beginning of the project, the use of natural gas causes most of the emissions. Table 32, shows the strong connection between 66  natural gas usage and GHG emissions. The reduction in natural gas consumption results in an almost identical proportion on the diminished CO 2e tonnes produced. From case to case reduction in GHG emissions is associated with the progressive improvement in generation and distribution, as a well as cleaner energies deployment, lowering the dependency on natural gas. Case 5, even though being projected farther into the future (with additional demand) than its predecessors, achieves an excellent 48% reduction in emissions levels from 2008.  Table 32: Natural Gas and GHG emissions reduction NG consumption GHG emissions reduction reduction 41% 36% Case 2 70% 66% Case 3 79% 76% Case 4 48% 48% Case 5  The second goal in the project was to reduce the costs associated with fuels and emissions. In Cases 2 to 5 the total cost is less than in the base case. The factors discussed earlier with respect to efficiencies and emissions, explain the consecutive lower values in overall costs in Cases 2 to 4. Case 5 has a lower total cost compared to Case 1. Case 5 uses a composite demand growth and future prices, despite the fact that operational costs are less than in the base case, and the proposed configuration simulated in this case provides a serious and trustable feasibility. All costs per generation technology are shown in Table 33, as well as the total operational cost of every system configuration defined by Cases 2 to 4 (Case 5 uses the same configuration as Case 3).  Case 1 Case 2 Case 3 Case 4 Case 5  Table 33: Fuel Cost Cases 1 to 5 ($M-CA) Gas Electricity Biomass 8.89 4.27 3.53 0.84 1.90 3.04 0.84 1.32 2.23 0.84 5.85 0.91 0.84  Total 8.89 8.64 5.78 4.39 7.60  In Table 34, total fuel costs are displayed in percentages referred to Case 1. The purpose is to better illustrate all ideas expressed in the previous cost analysis. 67  Table 34: Fuel Cost Reduction Fuel cost reduction 3% Case 2 35% Case 3 51% Case 4 34% Case 5  To emphasize the importance of excess electricity in this study, Table 35 is used to summarize the related results to the use of this strategy.  Table 35: Excess Electricity Cases 2 to 5 (GWh) Available Excess Elect. % Excess Excess Elect. Used Elect. used 117 113 97% Case 2 117 100 85% Case 3 117 78 67% Case 4 48 46 96% Case 5  Case 3 uses less excess electricity compared to Case 2, possibly due to incremented efficiencies in the whole process. An additional fact for not using all excess electricity is the possibility of having a peak value of heat demand and a peak value in electrical demand at the same time. Thus the required amount of natural gas, at that moment in time simulation, is higher. The lower use of excess electricity in Case 4 is explained by the good coefficient factor of the heat pump system, as discussed in the results for Case 4 in this chapter. Case 5 & 6 rely on less than 50% excess electricity than the previous cases; this is attributed to the demand increase. Although, the contractual limit was also increased, excess electricity represents a smaller portion of the total electricity on campus for this period. Therefore, natural gas usage is higher. This situation opens the discussion on incorporating more alternative local generators into the electrical grid. Case 6 shows that when all alternative fuels are working in the heating grid, the impact of the electric boilers is not significant because the contribution of the heat pump is 21% of the total heat deployed to the campus. Therefore, for future investment electric boilers are not necessary if the grid includes the heat pump or other way of recycling heat. The difference in cost and emissions obtained from Case 6 (in its two variants) are displayed in Table 36. 68  Table 36: Case 6 - Cost and Emissions Comparison  Cost ($M-CA)  GHG (ktonnes of CO2e)  Only Gas boilers  6.24  27.7  Electric & Gas boilers  6.28  24.0  69  4 Conclusion and Future Work Results show that based on the main objective function of minimizing GHG emissions, natural gas consumption is reduced in Cases 2 to 4 through the introduction of cleaner heat sources such as a biomass CHP system, heat pump system and electrical boilers, as well as a more efficient hot-water based distribution technology. All scenarios clearly show the benefits of implementing an advanced SEMG on campus in helping to achieve the GHG emission targets as it facilitates the more strategic use of the campuses energy resources in real-time. The i2Sim modeling framework allows for a sensitivity analysis to be completed on any of the model input parameters. For example, the impact of a tiered cost structure for the electrical energy or a reduction in the peak demand for electricity due to the introduction of demand side management could be considered. Thus, a sophisticated model could be used to help guide capital investment in clean energy infrastructure and operational practice. The i2Sim approach for Smart Energy Micro Grid simulation demonstrates how an optimization strategy based on hourly data can be implemented, and shows a clear possibility of going into studies with smaller time constants. Results from the simulator provide quantitative data which can be shared with industry and government partners in describing the institutional requirements. The modularity and flexibility of the model allows expansion to include other infrastructures, as well as an increase in the level of detail in focalized areas, depending on the criticality, of any particular zone or individual facilities. From the results presented in the previous chapter, Case 4 is the clear winner in evaluating the different technologies based on GHG emissions, energy required and fuel cost. This consideration only comprises the cases evaluated for identical time periods. In this study the comparison goes among cases 2 to 4. Declaring Case 4 as a “winner” is a way to highlight the excellent results from that particular setup. The results provided by that case involved 76% GHG emissions reduction, 51% total fuel cost and an overall system efficiency of 96.7%. The hot-water distribution system is an important factor to be considered for the new district heating system, because all efficiencies (generation, distribution, total) are increased, heading for a less expensive and polluting process. Assuming that this level of analysis were sufficient, one could conclude by using this model that the thermal demand could be met by keeping some natural gas infrastructure for 70  peak and back-up, keeping the Nexterra Biomass facility at its current size and capacity, and looking for heat reservoirs that could be developed to provide the bulk of the thermal demand, such as, recycling heat from inefficient buildings to nearest locations. In order to become a more accurate and robust evaluation tool, future work will expand the existing model in the following areas: Investment Benefit: Each scenario would be evaluated based on lifecycle cost. This would include the current real-time cost analysis based on fuel and emissions charges; and would incorporate but would not be limited to operational and maintenance, investment and capital costs and actualizations. Demand Side Management: The current model offers a time granularity of hours for managing fuel supply and heating technologies for the campus as an aggregate. Future models must, first, develop a geographical granularity which will allow individual buildings or aggregated blocks to be modeled, depending on their energy consumption impact on the system. Next, the time constants should be decreased to a feasible minimum value to allow a finer control over the optimization criteria, up to the point where the differences in the investment needed for controlling at higher granularity (additional controlling points and faster system response) does not compromise the gains in the overall system costs. Power Generation with Alternative Technologies: A first step in incorporating alternative electrical generation was taken with the Nexterra plant under construction on campus. Day by day these technologies become more efficient and popular and in cases like wind generation, the fuel is free. The main problem is intermittency for some technologies; in these cases the energy management becomes more complex. The use of distributed generation will ease the concern about a large investment in increasing peak capacity for the feeding transmission lines coming from Sperling substation, due to a year by year demand increase. In addition, electricity generated with local distributed resources might be sold back to Hydro, creating a suitable opportunity for lowering fuels cost. Storage and Technological Innovations: The tool succeeds in modeling several new technologies including the biomass facility and heat-pumps. Work should continue in this direction resulting in a library of technology modules that could be easily interchanged to explore different strategies or policies. Furthermore, energy storage methods from traditional and non-traditional sources need to be incorporated as a part of the modeling repertoire. 71  Special use of storage technologies would complement alternative electrical generation coming from intermittent sources, e.g. solar panels, wind turbines.  72  Bibliography [1] José Martí, K.D. Srivastava, and Hugón Juárez, "UBC – Joint Interdependencies Infrastructures Research Program (UBC-JIIRP)," Institute for Computing, Information, and Cognitive Systems (ICICS), UBC, Final Report 2009. [2] José Martí and JIIRP-UBC Team, "The I2Sim Simulator for Disaster Response Coordination in Interdependent Infrastructure Systems," Institute for Computing, Information, and Cognitive Systems (ICICS), UBC, Report to British Columbia Transmission Corporation, Telus Corporation, Greater Vancouver Regional District, and Vancouver International Airport Authority 2006. [3] José Martí, Carlos Ventura, Jorge Hollman, K.D. Srivastava, and Hugón Juárez, "I2Sim Modelling and Simulation Framework for Scenario Development, Training, and Real-Time Decision Support of Multiple Interdependent Critical Infrastructures during Large Emergencies," in NATO (OTAN) MSG-060 Symposium on "How is Modelling and Simulation Meeting the Defence Challenges out to 2015?", Vancouver, 2008. [4] UBC Sustainability. (2011) Campus as a Living Laboratory. [Online]. http://www.sustain.ubc.ca/hubs/campus-living-laboratory [5] Paul Lusina, José Martí, and Smart Energy Systems (SES) Project Committee, "Energy Infrastructure Simulation," Critical Interdependent Systems (CIS) Laboratory, UBC, Final Report 2011. [6] John Hepburn, Pierre Ouillet, John Metras, and Brent Sauder, "UBC as a Living Laboratory Partnership Initiative," UBC Board of Governors, 2011. [7] John Hepburn, Pierre Ouillet, John Robinson, John Metras, and Brent Sauder, "UBC as a Living Laboratory Progress Update," UBC Board of Governors, 2011. [8] UBC Public Affairs. (2010) UBC sets aggressive new targets to reduce greenhouse gas emissions. [Online]. http://www.publicaffairs.ubc.ca/2010/03/24/ubc-sets-aggressivenew-targets-to-reduce-greenhouse-gas-emissions/ [9] Association of University Leaders for a Sustainable Future. (2001) Talloires Declaration. [Online]. http://www.ulsf.org/programs_talloires.html [10] UBC Sustainability. (2011) Campus-Overview. [Online]. http://sustain.ubc.ca/campussustainability/overview [11] UBC Sustainability. (2011) ECOTrek. [Online]. http://sustain.ubc.ca/campussustainability/greening-the-campus/ecotrek [12] UBC Public Affairs. (2011) UBC receives Canada‟s first „gold‟ in new university sustainability ratings. [Online]. http://www.publicaffairs.ubc.ca/2011/08/19/ubcreceives-canada%E2%80%99s-first-%E2%80%98gold%E2%80%99-in-newuniversity-sustainability-ratings/ [13] UBC Sustainability. (2011) Sustainability Teaching & Learning Spotlight Program. [Online]. http://sustain.ubc.ca/teaching-learning/spotlight-program  73  [14] UBC Climate Action Plan. (2011) UBC Utilities Leads Alternative Energy Project to Reduce Greenhouse Gas Emissions. [Online]. http://climateaction.ubc.ca/2009/02/26/ubc-utilities-leads-alternative-energy-projectto-reduce-greenhouse-gas-emissions [15] UBC Sustainability. (2011) Carbon Footprint Reduction. [Online]. http://sustain.ubc.ca/campus-sustainability/carbonfootprint-reduction [16] "UBC Vancouver Campus - 2010 GHG emissions Inventory," 2010. [17] Stantec Consulting, "Alternative Energy Feasibility Report for University of British Columbia, Phase Two – Step Three (Final)," 2010. [18] Pierre Ouillet, David Woodson, John Metras, Nancy Knight, and Peter Smailes, "UBC Vancouver District Energy System Steam to Hot Water Conversion," UBC Board of Governors, 2011. [19] John Metras. et al. (2011) Briefing on Alternative Energy Special Project (AESP). [Online]. http://www.projectservices.lbs.ubc.ca/About%20Us/Powerpoint/Alternative%20Energ y%20Special%20Project%20Version%20Sept%203%20%20%20Briefing%20Sept%204%202009.pptx [20] Shahrzad Rostamirad, "Intelligent load shedding scheme for frequency control in communities with local alternative generation and limited main grid support," UBC, MASc Thesis 2011. [21] UBC Public Affairs. (2011) Pioneering UBC clean energy project gets $11.2 million in new government support. [Online]. http://www.publicaffairs.ubc.ca/2011/02/24/pioneering-ubc-clean-energy-project-gets11-2-million-in-new-government-support/ [22] The Biomass Magazine. (2010, February) UBC to install biomass gasifier. [Online]. http://www.biomassmagazine.com/articles/3496/ubc-to-install-biomass-gasifier/ [23] IEA Energy Technology Essentials, "Biomass for Power Generation and CHP," 2007. [24] Globe Comunnincations. (2010) Nexterra to power UBC. [Online]. http://www.globenet.com/articles/2010/august/17/nexterra-to-power-ubc.aspx [25] Nexterra Systems Corporation. (2011) Nexterra's Gasification technology. [Online]. http://www.nexterra.ca/technology/index.cfm [26] Nexterra Systems Corporation. (2011) Nexterra's Gasification Technology (Print View). [Online]. http://www.nexterra.ca/technology/print_view.html [27] Nexterra Systems Corporation. (201) What is Gasification? [Online]. http://www.nexterra.ca/technology/gasification.cfm [28] UBC Physics and Astronomy. (2011) Experimental and Theoretical Particle/Subatomic Physics, & String Theory . [Online]. http://www.physics.ubc.ca/research/particle.php [29] Robert Lasseter. et al., "Integration of Distributed Energy Resources," Consortium for Electric Reliability Technology Solutions, White paper 2002. [30] IEEE Standards Association, "IEEE Guide for Design, Operation, and Integration of Distributed Resource Island Systems with Electric Power Systems," IEEE, IEEE Std 1547.4™-2011, 2011. 74  [31] IEEE Standards Association, "IEEE Guide for Smart Grid Interoperability of Energy Technology and Information Technology Operation with the Electric Power System (EPS), End-Use Applications, and Loads," IEEE, IEEE Std 2030™-2011, 2011. [32] José Martí and i2Sim team, "Modeling Critical Infrastructure Interdependencies in Support of the Security Operations for the Vancouver 2010 Olympics," Defence R&D Canada, Technical Report 2010. [33] José Martí, Jorge Hollman, Carlos Ventura, and Juri Jaskevich, "Dynamic recovery of critical infrastructures: real-time temporal coordination," International Journal of Critical Infrastructures (IJCI), vol. 4, no. 1/2, pp. 17-31, 2008. [34] HyunJung Lee, "Infrastructure Interdependencies Simulation (I2Sim) System Model and Toolbox," The University of British Columbia, MASc Thesis 2010. [35] José Martí, K. D. Srivastava, Juri Jatskevich, and Jorge Hollman, "Dynamic Islanding of National Critical Infrastructures to Survive," Critical Interdependent Systems (CIS) Laboratory, UBC, Public Safety and Emergency Preparedness Canada (PSEPC),Consultation paper on the modernization of the Emergency Preparedness Act 2005. [36] "Simulink® Getting Started Guide R2011b," The MathWorks, Inc., 2011. [37] Lu Liu, "Prototyping and Cells Modeling of the Infrastructure Interdependencies," UBC, MASC Thesis 2007. [38] James Stewart, "Functions and Models, Limits and Derivatives (Continuity)," in Calculus 7E Early Trascendentals.: Cengage Learning, 2008, ch. 1 & 2. [39] BC Provincial Government, "Methodology for Reporting B.C. Public Sector Greenhouse Gas Emissions," Ministry of Environment, Victoria BC, 2011. [40] BC Provincial Government, "Emission Offsets Regulation," Ministry of Environment, Victoria BC, Act, Greenhouse Gas Reduction Targets B.C. Reg. 393/2008, 2008. [41] BC Hydro. (2011) Climate Action & Greenhouse Gases. [Online]. http://www.bchydro.com/about/our_commitment/sustainability/greenhouse_gases.html #emission [42] BC Provincial Government, "British Columbia Greenhouse Gas Inventory Report 2008," Ministry of Environment, Victoria BC, 2010. [43] "BC Hydro Annual Report 2011," BC Hydro, 2011. [44] Montgomery Watson, "National Master Plan for Development of Waste-to-Energy in India," Technical Memorandum. [45] Carolyn Kamper and Tim Lesiuk, "Forest Carbon Offset Protocol," BG Provincial Government, The Climate Action Secretariat, Victoria, Information Webinar 2010. [46] Coro Strandberga, "Steps to Going Carbon Neutral…Measure, Reduce and Offset.," Strandberg Consulting, 2008. [47] Pacific Carbon Trust. (2011) About Pacific Carbon Trust. [Online]. http://www.pacificcarbontrust.com/About/tabid/57/Default.aspx [48] Pacific Carbon Trust. (2011) Buy Offsets from PCT. [Online]. http://www.pacificcarbontrust.com/BuyOffsetsfromPCT/tabid/64/Default.aspx  75  [49] BC Provincial Government, "British Columbia Carbon Tax," Ministry of Small Business and Revenue, Victoria BC, Notice 2008. [50] Rui Ren, "I2Sim Financial Model and its application to UBC's Living Lab Projects," UBC, MASc Thesis 2011.  76  Appendices Appendix A Electrical Controller Level-2 M file function controller(block) % Level-2 M file S-Function for times two demo. % Copyright 1990-2004 The MathWorks, Inc. % $Revision: 1.1.6.1 $ setup(block); %endfunction function setup(block) %% Register number of input and output ports block.NumInputPorts = 4; block.NumOutputPorts = 4; %% Setup functional port properties to dynamically inherited. block.SetPreCompInpPortInfoToDynamic; block.SetPreCompOutPortInfoToDynamic; % Allow multidimensional signals block.AllowSignalsWithMoreThan2D = true; % Override input port properties for i=1:block.NumInputPorts block.InputPort(i).Dimensions = 1; block.InputPort(i).DatatypeID = 0; % double block.InputPort(i).Complexity = 'Real'; block.InputPort(i).DirectFeedthrough = true; end block.OutputPort(1).Dimensions block.OutputPort(1).DatatypeID block.OutputPort(1).Complexity  = 1; %Percentage of Electricity offpeak = 0; % double = 'Real';  block.OutputPort(2).Dimensions block.OutputPort(2).DatatypeID block.OutputPort(2).Complexity  = 1; %Electricity (Percentage) consumed by UBC Campus = 0; % double = 'Real';  block.OutputPort(3).Dimensions block.OutputPort(3).DatatypeID block.OutputPort(3).Complexity  = 1; %Differencce Peak electricity if produced, else 0 = 0; % double = 'Real';  block.OutputPort(4).Dimensions block.OutputPort(4).DatatypeID block.OutputPort(4).Complexity  = 1; %Peak electricity if produced, else 0 = 0; % double = 'Real';  % Register parameters block.NumDialogPrms = 0; %% Set block sample time to inherited block.SampleTimes = [-1 0]; %% Run accelerator on TLC block.SetAccelRunOnTLC(true);  77  %% Register methods block.RegBlockMethod('PostPropagationSetup', @DoPostPropSetup); block.RegBlockMethod('InitializeConditions', @InitConditions); block.RegBlockMethod('SetInputPortSamplingMode',@SetInputPortSamplingMode); %block.RegBlockMethod('SetInputPortDimensions', @SetInpPortDims); block.RegBlockMethod('Terminate', @Terminate); block.RegBlockMethod('Outputs', @Output); %endfunction function DoPostPropSetup(block) %% Setup Dwork block.NumDworks = 10; block.Dwork(1).Name = 'Day'; block.Dwork(1).Dimensions block.Dwork(1).DatatypeID block.Dwork(1).Complexity block.Dwork(1).UsedAsDiscState  = = = =  8761; 0; 'Real'; true;  block.Dwork(2).Name = 'Month'; block.Dwork(2).Dimensions block.Dwork(2).DatatypeID block.Dwork(2).Complexity block.Dwork(2).UsedAsDiscState  = = = =  8761; 0; 'Real'; true;  block.Dwork(3).Name = 'Year'; block.Dwork(3).Dimensions block.Dwork(3).DatatypeID block.Dwork(3).Complexity block.Dwork(3).UsedAsDiscState  = = = =  8761; 0; 'Real'; true;  block.Dwork(4).Name = 'Hour'; block.Dwork(4).Dimensions block.Dwork(4).DatatypeID block.Dwork(4).Complexity block.Dwork(4).UsedAsDiscState  = = = =  8761; 0; 'Real'; true;  block.Dwork(5).Name = 'Elect'; block.Dwork(5).Dimensions block.Dwork(5).DatatypeID block.Dwork(5).Complexity block.Dwork(5).UsedAsDiscState  = = = =  8761; 0; 'Real'; true;  block.Dwork(6).Name = 'Counter';%Contador block.Dwork(6).Dimensions = 1; block.Dwork(6).DatatypeID = 0; block.Dwork(6).Complexity = 'Real'; block.Dwork(6).UsedAsDiscState = true; block.Dwork(7).Name = 'Max';%Max block.Dwork(7).Dimensions = block.Dwork(7).DatatypeID = block.Dwork(7).Complexity = block.Dwork(7).UsedAsDiscState =  peak variable for the selection process 5; 0; 'Real'; true;  block.Dwork(8).Name = 'MaxValueAcum';%Max peak storage for each appearing one block.Dwork(8).Dimensions = 13; block.Dwork(8).DatatypeID = 0; block.Dwork(8).Complexity = 'Real'; block.Dwork(8).UsedAsDiscState = true; block.Dwork(9).Name = 'MaxValueIndex';%Max peak storage index  78  block.Dwork(9).Dimensions block.Dwork(9).DatatypeID block.Dwork(9).Complexity block.Dwork(9).UsedAsDiscState  = = = =  1; 0; 'Real'; true;  block.Dwork(10).Name = 'DateMax';%Date for Max peak variable for the selection process block.Dwork(10).Dimensions = 13; block.Dwork(10).DatatypeID = 0; block.Dwork(10).Complexity = 'Real'; block.Dwork(10).UsedAsDiscState = true; %endfunction function InitConditions(block) %% Initilize A=load('Elect2012.txt'); size(A); block.Dwork(1).Data=A(:,1); block.Dwork(2).Data=A(:,2); block.Dwork(3).Data=A(:,3); block.Dwork(4).Data=A(:,4); block.Dwork(5).Data=A(:,5); save('B.mat',  %Day %Month %Year %Hour %kW  'A');  block.Dwork(6).Data=1; %counter initialized in 1 block.Dwork(9).Data=0; %peaks counter, empty as initial condition block.Dwork(7).Data(5)=-1; %Max reference peak point starts negative %endfunction function SetInputPortSamplingMode(block, idx, fd) block.InputPort(idx).SamplingMode = fd; for i=1:block.NumOutputPorts block.OutputPort(i).SamplingMode = fd; end %endfunction function Output(block) %Starting process of peak calculation if (block.Dwork(1).Data(block.Dwork(6).Data)==22 && block.Dwork(4).Data(block.Dwork(6).Data)==8) %every 22nd at 8:00am a new bill month begin %include also finalizing process to present summary block.Dwork(9).Data = block.Dwork(9).Data+1; %count new peak block.Dwork(8).Data(block.Dwork(9).Data)=block.Dwork(7).Data(5); %append the new peak found string=[num2str(block.Dwork(7).Data(2)) '/' num2str(block.Dwork(7).Data(1)) '/' num2str(block.Dwork(7).Data(3)) ' ' num2str(block.Dwork(7).Data(4)) ':00']; %block.Dwork(10).Data(block.Dwork(9).Data)=datestr(string, 'dd/mm/yyyy HH:MM') datestr(string, 'dd/mm/yyyy HH:MM') %show in console the date for peak found block.Dwork(7).Data(5)=-1; %refresh maximum reference value if block.InputPort(2).Data > block.Dwork(8).Data(block.Dwork(9).Data) %if peak exceeds max output 0 otherwise difference block.OutputPort(3).Data=block.InputPort(2).Datablock.Dwork(8).Data(block.Dwork(9).Data); else block.OutputPort(3).Data=0; end block.OutputPort(4).Data = block.Dwork(8).Data(block.Dwork(9).Data);  %Peak value  79  else %used to send 0 to output port when no peak is produced block.OutputPort(3).Data=0; block.OutputPort(4).Data=0; end if ((block.Dwork(5).Data(block.Dwork(6).Data)-block.InputPort(4).Data) > block.Dwork(7).Data(5)) %If max found update pivot and associated date data for the point block.Dwork(7).Data(5)=block.Dwork(5).Data(block.Dwork(6).Data)-block.InputPort(4).Data; %pivot value RECALL - NEXTERRA block.Dwork(7).Data(4)=block.Dwork(4).Data(block.Dwork(6).Data); %hour block.Dwork(7).Data(3)=block.Dwork(3).Data(block.Dwork(6).Data); %day block.Dwork(7).Data(2)=block.Dwork(2).Data(block.Dwork(6).Data); %month block.Dwork(7).Data(1)=block.Dwork(1).Data(block.Dwork(6).Data); %day end %Finishing process of peak calculation %Starting process of percentages adjustment if block.Dwork(5).Data(block.Dwork(6).Data) > block.InputPort(2).Data %if load is greater than the limit, no electricity goes to boilers block.OutputPort(2).Data = (block.Dwork(5).Data(block.Dwork(6).Data)block.InputPort(4).Data)/block.InputPort(1).Data*100; block.OutputPort(1).Data = 0; else block.OutputPort(2).Data = block.Dwork(5).Data(block.Dwork(6).Data)/block.InputPort(1).Data*100; block.OutputPort(1).Data = ((block.InputPort(2).Data block.Dwork(5).Data(block.Dwork(6).Data)+block.InputPort(4).Data)/block.InputPort(1).Data*1 00) * block.InputPort(3).Data/100; end %Finishing process of percentages adjustment block.Dwork(6).Data= block.Dwork(6).Data+1; %endfunction function Terminate(block) block.Dwork(9).Data = block.Dwork(9).Data+1; %count new peak block.Dwork(8).Data(block.Dwork(9).Data)=block.Dwork(7).Data(5); %append the new peak found string=[num2str(block.Dwork(7).Data(2)) '/' num2str(block.Dwork(7).Data(1)) '/' num2str(block.Dwork(7).Data(3)) ' ' num2str(block.Dwork(7).Data(4)) ':00']; %block.Dwork(10).Data(block.Dwork(9).Data)=datestr(string, 'dd/mm/yyyy HH:MM') datestr(string, 'dd/mm/yyyy HH:MM') ListPeak= block.Dwork(8).Data; DateListPeak= block.Dwork(10).Data; save('Peaks.mat', 'ListPeak'); save('DatePeaks.mat', 'DateListPeak'); %endfunction  80  Appendix B GHG Minimization Block Level-2 M file  function Constraints(block) % Level-2 M file S-Function for times two demo. % Copyright 1990-2004 The MathWorks, Inc. % $Revision: 1.1.6.1 $ setup(block); %endfunction function setup(block) %% Register number of input and output ports block.NumInputPorts = 9; block.NumOutputPorts = 4; %% Setup functional port properties to dynamically inherited. block.SetPreCompInpPortInfoToDynamic; block.SetPreCompOutPortInfoToDynamic; % Allow multidimensional signals block.AllowSignalsWithMoreThan2D = true; block.InputPort(1).Dimensions = 1; %Gas source block.InputPort(1).DatatypeID = 0; % double block.InputPort(1).Complexity = 'Real'; block.InputPort(1).DirectFeedthrough = true; block.InputPort(2).Dimensions = 1; %Triumf energy source block.InputPort(2).DatatypeID = 0; % double block.InputPort(2).Complexity = 'Real'; block.InputPort(2).DirectFeedthrough = true; block.InputPort(3).Dimensions = 1; %Electricity Source block.InputPort(3).DatatypeID = 0; % double block.InputPort(3).Complexity = 'Real'; block.InputPort(3).DirectFeedthrough = true; block.InputPort(4).Dimensions = 1; %Biosmass Source block.InputPort(4).DatatypeID = 0; % double block.InputPort(4).Complexity = 'Real'; block.InputPort(4).DirectFeedthrough = true; block.InputPort(5).Dimensions = 1; %Feedback in kWh block.InputPort(5).DatatypeID = 0; % double block.InputPort(5).Complexity = 'Real'; block.InputPort(5).DirectFeedthrough = true; block.InputPort(6).Dimensions = 1; %Efficiency of gas block.InputPort(6).DatatypeID = 0; % double block.InputPort(6).Complexity = 'Real'; block.InputPort(6).DirectFeedthrough = true; block.InputPort(7).Dimensions = 1; %Efficiency of elec boilers block.InputPort(7).DatatypeID = 0; % double block.InputPort(7).Complexity = 'Real'; block.InputPort(7).DirectFeedthrough = true; block.InputPort(8).Dimensions block.InputPort(8).DatatypeID block.InputPort(8).Complexity  = 1; %Efficiency of biomass = 0; % double = 'Real';  81  block.InputPort(8).DirectFeedthrough = true; block.InputPort(9).Dimensions = 1; %Efficiency of Electricity for Heat Pump block.InputPort(9).DatatypeID = 0; % double block.InputPort(9).Complexity = 'Real'; block.InputPort(9).DirectFeedthrough = true; block.OutputPort(1).Dimensions block.OutputPort(1).DatatypeID block.OutputPort(1).Complexity  = 1; %Gas rate = 0; % double = 'Real';  block.OutputPort(2).Dimensions block.OutputPort(2).DatatypeID block.OutputPort(2).Complexity  = 1; %Electricity for boilers rate = 0; % double = 'Real';  block.OutputPort(3).Dimensions block.OutputPort(3).DatatypeID block.OutputPort(3).Complexity  = 1; %%Electricity for Heat Pump rate = 0; % double = 'Real';  block.OutputPort(4).Dimensions block.OutputPort(4).DatatypeID block.OutputPort(4).Complexity  = 1; %Biomass rate = 0; % double = 'Real';  % Register parameters block.NumDialogPrms  = 0;  %% Set block sample time to inherited block.SampleTimes = [-1 0]; %% Run accelerator on TLC block.SetAccelRunOnTLC(true); %% Register methods block.RegBlockMethod('PostPropagationSetup', @DoPostPropSetup); block.RegBlockMethod('InitializeConditions', @InitConditions); block.RegBlockMethod('SetInputPortSamplingMode',@SetInputPortSamplingMode); %block.RegBlockMethod('SetInputPortDimensions', @SetInpPortDims); %block.RegBlockMethod('Terminate', @Terminate); block.RegBlockMethod('Outputs', @Output); %endfunction function DoPostPropSetup(block) %% Setup Dwork block.NumDworks = 1; block.Dwork(1).Name = 'Flag'; block.Dwork(1).Dimensions block.Dwork(1).DatatypeID block.Dwork(1).Complexity block.Dwork(1).UsedAsDiscState  %check the first time step to avoid output = 1; = 0; = 'Real'; = true;  function InitConditions(block) %% Initilize block.Dwork(1).Data=1; %endfunction function SetInputPortSamplingMode(block, idx, fd) block.InputPort(idx).SamplingMode = fd; for i=1:block.NumOutputPorts block.OutputPort(i).SamplingMode = fd; end %endfunction function Output(block)  82  if block.Dwork(1).Data == 1 block.Dwork(1).Data = 10; %This is just a flag to avoid doing anything in the first timestep else if block.InputPort(5).Data > ( block.InputPort(4).Data * block.InputPort(8).Data ) %Biomass (efective) is not enough to cover all the need Energy_needed = block.InputPort(5).Data - ( block.InputPort(4).Data * block.InputPort(8).Data ); %Energy needed from Triumf, Electricity and gas block.OutputPort(4).Data = block.InputPort(4).Data; [ElectXTriumf] = Triumf(block.InputPort(2).Data, block.InputPort(3).Data, 2); %Factor is to since Energy=2*Electricity leftElect = block.InputPort(3).Data - ElectXTriumf; if Energy_needed > ElectXTriumf * block.InputPort(9).Data block.OutputPort(3).Data = ElectXTriumf; Energy_needed = Energy_needed - ElectXTriumf * block.InputPort(9).Data; if Energy_needed > ( leftElect * block.InputPort(7).Data ) %Electricity (effective) available is not enough for the remaining need block.OutputPort(1).Data = ( Energy_needed - leftElect * block.InputPort(7).Data ) / block.InputPort(6).Data; block.OutputPort(2).Data = leftElect; else block.OutputPort(1).Data = 0; block.OutputPort(2).Data = Energy_needed / block.InputPort(7).Data; end else block.OutputPort(1).Data = 0; block.OutputPort(2).Data = 0; block.OutputPort(3).Data = Energy_needed / block.InputPort(9).Data; end else block.OutputPort(1).Data block.OutputPort(2).Data block.OutputPort(3).Data block.OutputPort(4).Data end  = = = =  0; 0; 0; block.InputPort(5).Data / block.InputPort(8).Data;  end %endfunction function [ElectXTriumf] = Triumf(Energy, Electricity, Factor) %Factor is the ratio for: "Energy=Electricity*Factor" if Electricity >= Energy / Factor %Enough electricity to move Triumf energy ElectXTriumf = Energy / Factor; %Maximum can be produced based on Triumf because Energy is limiting factor else ElectXTriumf = Electricity; %Maximum can be produced based on Elect. as limiting factor end %endfunction  83  Appendix C Financial Block Level-2 M file  function Cost(block) % Level-2 M file S-Function for times two demo. % Copyright 1990-2004 The MathWorks, Inc. % $Revision: 1.1.6.1 $ setup(block); %endfunction function setup(block) %% Register number of input and output ports block.NumInputPorts = 14; block.NumOutputPorts = 0; %% Setup functional port properties to dynamically inherited. block.SetPreCompInpPortInfoToDynamic; block.SetPreCompOutPortInfoToDynamic; % Allow multidimensional signals block.AllowSignalsWithMoreThan2D = true; block.InputPort(1).Dimensions = 1; %Gas consumption block.InputPort(1).DatatypeID = 0; % double block.InputPort(1).Complexity = 'Real'; block.InputPort(1).DirectFeedthrough = true; block.InputPort(2).Dimensions = 1; %Electricity consumption block.InputPort(2).DatatypeID = 0; % double block.InputPort(2).Complexity = 'Real'; block.InputPort(2).DirectFeedthrough = true; block.InputPort(3).Dimensions = 1; %Electricity peak value block.InputPort(3).DatatypeID = 0; % double block.InputPort(3).Complexity = 'Real'; block.InputPort(3).DirectFeedthrough = true; block.InputPort(4).Dimensions = 1; %Biomass consumption block.InputPort(4).DatatypeID = 0; % double block.InputPort(4).Complexity = 'Real'; block.InputPort(4).DirectFeedthrough = true; block.InputPort(5).Dimensions = 1; %Electrical Revenue block.InputPort(5).DatatypeID = 0; % double block.InputPort(5).Complexity = 'Real'; block.InputPort(5).DirectFeedthrough = true; block.InputPort(6).Dimensions = 1; %Gas rate block.InputPort(6).DatatypeID = 0; % double block.InputPort(6).Complexity = 'Real'; block.InputPort(6).DirectFeedthrough = true; block.InputPort(7).Dimensions = 1; %Electricity Rate kWh block.InputPort(7).DatatypeID = 0; % double block.InputPort(7).Complexity = 'Real'; block.InputPort(7).DirectFeedthrough = true; block.InputPort(8).Dimensions = 1; %Electricity Peak price kW block.InputPort(8).DatatypeID = 0; % double block.InputPort(8).Complexity = 'Real'; block.InputPort(8).DirectFeedthrough = true;  84  block.InputPort(9).Dimensions = 1; %Biomass rate block.InputPort(9).DatatypeID = 0; % double block.InputPort(9).Complexity = 'Real'; block.InputPort(9).DirectFeedthrough = true; block.InputPort(10).Dimensions = 1; %Carbon tax block.InputPort(10).DatatypeID = 0; % double block.InputPort(10).Complexity = 'Real'; block.InputPort(10).DirectFeedthrough = true; block.InputPort(11).Dimensions = 1; %Carbon offset block.InputPort(11).DatatypeID = 0; % double block.InputPort(11).Complexity = 'Real'; block.InputPort(11).DirectFeedthrough = true; block.InputPort(12).Dimensions = 1; %Tonnes CO2 per kWh of electricity block.InputPort(12).DatatypeID = 0; % double block.InputPort(12).Complexity = 'Real'; block.InputPort(12).DirectFeedthrough = true; block.InputPort(13).Dimensions = 1; %Tonnes CO2 per kWh of NG block.InputPort(13).DatatypeID = 0; % double block.InputPort(13).Complexity = 'Real'; block.InputPort(13).DirectFeedthrough = true; block.InputPort(14).Dimensions = 1; %Nexterra electricity revenue price block.InputPort(14).DatatypeID = 0; % double block.InputPort(14).Complexity = 'Real'; block.InputPort(14).DirectFeedthrough = true; % Register parameters block.NumDialogPrms = 0; %% Set block sample time to inherited block.SampleTimes = [-1 0]; %% Run accelerator on TLC block.SetAccelRunOnTLC(true); %% Register methods block.RegBlockMethod('PostPropagationSetup', @DoPostPropSetup); block.RegBlockMethod('InitializeConditions', @InitConditions); block.RegBlockMethod('SetInputPortSamplingMode',@SetInputPortSamplingMode); %block.RegBlockMethod('SetInputPortDimensions', @SetInpPortDims); block.RegBlockMethod('Terminate', @Terminate); block.RegBlockMethod('Outputs', @Output); %endfunction function DoPostPropSetup(block) %% Setup Dwork block.NumDworks = 13; block.Dwork(1).Name = 'Counter'; block.Dwork(1).Dimensions = block.Dwork(1).DatatypeID = block.Dwork(1).Complexity = block.Dwork(1).UsedAsDiscState =  %Counter to keep track of the time steps 1; 0; 'Real'; true;  block.Dwork(2).Name = 'Cost'; %Total Operational COst block.Dwork(2).Dimensions = 8761; block.Dwork(2).DatatypeID = 0; block.Dwork(2).Complexity = 'Real'; block.Dwork(2).UsedAsDiscState = true;  85  block.Dwork(3).Name = 'Emissions_Gas'; %Tonnes of CO2 corresponding to Gas consumption block.Dwork(3).Dimensions = 8761; block.Dwork(3).DatatypeID = 0; block.Dwork(3).Complexity = 'Real'; block.Dwork(3).UsedAsDiscState = true; block.Dwork(4).Name = 'Emissions_Elec'; %Tonnes of CO2 corresponding to Electricity consumption block.Dwork(4).Dimensions = 8761; block.Dwork(4).DatatypeID = 0; block.Dwork(4).Complexity = 'Real'; block.Dwork(4).UsedAsDiscState = true; block.Dwork(5).Name = 'Electricity'; %Units of Electricity consummed per time step block.Dwork(5).Dimensions = 8761; block.Dwork(5).DatatypeID = 0; block.Dwork(5).Complexity = 'Real'; block.Dwork(5).UsedAsDiscState = true; block.Dwork(6).Name = 'Gas'; %Units of Gas consummed per time step block.Dwork(6).Dimensions = 8761; block.Dwork(6).DatatypeID = 0; block.Dwork(6).Complexity = 'Real'; block.Dwork(6).UsedAsDiscState = true; block.Dwork(7).Name = 'Biomass'; block.Dwork(7).Dimensions = block.Dwork(7).DatatypeID = block.Dwork(7).Complexity = block.Dwork(7).UsedAsDiscState =  %Units of Biomass consummed per time step 8761; 0; 'Real'; true;  block.Dwork(8).Name = 'Revenue'; block.Dwork(8).Dimensions = block.Dwork(8).DatatypeID = block.Dwork(8).Complexity = block.Dwork(8).UsedAsDiscState =  %Money earned for selling Nexterra electricity to Hydro 8761; 0; 'Real'; true;  block.Dwork(9).Name = 'COST_Gas'; %Total cost for Gas incl carbon tax and offset block.Dwork(9).Dimensions = 8761; block.Dwork(9).DatatypeID = 0; block.Dwork(9).Complexity = 'Real'; block.Dwork(9).UsedAsDiscState = true; block.Dwork(10).Name = 'COST_Elec'; %Total cost for Electricity including carbon offset block.Dwork(10).Dimensions = 8761; block.Dwork(10).DatatypeID = 0; block.Dwork(10).Complexity = 'Real'; block.Dwork(10).UsedAsDiscState = true; block.Dwork(11).Name = 'Cost_Biomass'; %Total cost for Biomass block.Dwork(11).Dimensions = 8761; block.Dwork(11).DatatypeID = 0; block.Dwork(11).Complexity = 'Real'; block.Dwork(11).UsedAsDiscState = true; block.Dwork(12).Name = 'Energy_Prod'; %VALUE IMPORTED FROM CAMPUS BLOCK -ENERGY PRODUCEDblock.Dwork(12).Dimensions = 1; block.Dwork(12).DatatypeID = 0; block.Dwork(12).Complexity = 'Real'; block.Dwork(12).UsedAsDiscState = true; block.Dwork(13).Name = 'Dist_efficiency'; %VALUE IMPORTED FROM CAMPUS BLOCK -DIST. EFFICIENCY  86  block.Dwork(13).Dimensions block.Dwork(13).DatatypeID block.Dwork(13).Complexity block.Dwork(13).UsedAsDiscState  = = = =  1; 0; 'Real'; true;  %endfunction function InitConditions(block) %% block.Dwork(1).Data=1; %endfunction function Terminate(block) gas_emv = block.Dwork(3).Data; gas_em = sum(gas_emv); save('EmissGas.mat', 'gas_em'); %Emissions due to Gas consumed (kWh) elec_emv = block.Dwork(4).Data; elec_em = sum(elec_emv); save('EmissElec.mat', 'elec_em'); %Emissions due to Electricity consumed (kWh) elecv = block.Dwork(5).Data; elec = sum(elecv)/1E6; save('Electricity.mat', 'elec'); %Electricity consumed (kWh) gasv = block.Dwork(6).Data; gas = sum(gasv)/1E6; save('Gas.mat', 'gas'); %Gas consumed (kWh) biomassv = block.Dwork(7).Data; biomass = sum(biomassv)/1E6; save('Biomass.mat', 'biomass'); %Biomass consumed (kWh) revenuev = block.Dwork(8).Data; revenue = sum(revenuev)/1E6; save('Revenue.mat', 'revenue'); %Revenue for Nexterra Electricity cost_gasv = block.Dwork(9).Data; cost_gas = sum(cost_gasv)/1E6; save('Gascost.mat', 'cost_gas'); %Gas cost with carbon tax/carbon offset included cost_elecv = block.Dwork(10).Data; cost_elec = sum(cost_elecv)/1E6; save('Eleccost.mat','cost_elec'); %Electricity cost with carbon offset & peak difference included cost_biov = block.Dwork(11).Data; cost_bio = sum(cost_biov)/1E6; save('Biocost.mat', 'cost_bio'); %Biomass cost rto = get_param('Case_4V2/UBC Campus','RuntimeObject'); block.Dwork(12).Data=sum(rto.Dwork(3).Data)/1E6; block.Dwork(13).Data=rto.Dwork(4).Data; SUMMARY(gcb); %endfunction function SetInputPortSamplingMode(block, idx, fd) block.InputPort(idx).SamplingMode = fd; for i=1:block.NumOutputPorts block.OutputPort(i).SamplingMode = fd;  87  end %endfunction function Output(block) if block.Dwork(1).Data > 1; %Force the function to avoid processing the first time step %calculate cost of fuel less revenue block.Dwork(9).Data(block.Dwork(1).data) = block.InputPort(1).Data*block.InputPort(6).Data; %Gas used times price per kWh block.Dwork(10).Data(block.Dwork(1).data) = block.InputPort(2).Data*block.InputPort(7).Data; %Electricity used times price per kWh block.Dwork(11).Data(block.Dwork(1).data) = block.InputPort(4).Data*block.InputPort(9).Data; %Biomass used times price per kWh if block.Dwork(1).Data > 876 %electrical revenue loss during generator downtime block.Dwork(8).Data(block.Dwork(1).Data) = block.InputPort(5).Data * (block.InputPort(14).Data-block.InputPort(7).Data); %Revenue for selling Nexterra Electricity else block.Dwork(8).Data(block.Dwork(1).Data) = 0; end %calculate carbon emission block.Dwork(3).Data(block.Dwork(1).Data) = block.InputPort(1).Data*block.InputPort(13).Data; kWh)consumption block.Dwork(4).Data(block.Dwork(1).Data) = block.InputPort(2).Data*block.InputPort(12).Data; kWh)consumption  %Calculate GHG emissions for Gas(in %Calculate GHG emissions for Elect.(in  %Gas price + Carbon tax & Offset block.Dwork(9).Data(block.Dwork(1).data) = block.Dwork(9).Data(block.Dwork(1).data) + block.Dwork(3).Data(block.Dwork(1).Data)*( block.InputPort(10).Data + block.InputPort(11).Data ); %Elec price + Carbon tax & Offset + Peak difference block.Dwork(10).Data(block.Dwork(1).data) = block.Dwork(10).Data(block.Dwork(1).data)+ block.Dwork(4).Data(block.Dwork(1).Data)* block.InputPort(11).Data+ block.InputPort(3).Data * block.InputPort(8).Data; block.Dwork(5).Data(block.Dwork(1).Data) = block.InputPort(2).Data; %electricity consumed in kWh block.Dwork(6).Data(block.Dwork(1).Data) = block.InputPort(1).Data; %gas consumed in kWh block.Dwork(7).Data(block.Dwork(1).Data) = block.InputPort(4).Data; %biomass consumed in kWh end block.Dwork(1).Data = block.Dwork(1).Data+1;  %counter increment  %endfunction  88  

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.24.1-0072464/manifest

Comment

Related Items