8
SOFTWARE FOR THE SIMULATION OF POWER PLANT PROCESSES PART B Brian Elmegaard Department of Mechanical Engineering Technical University of Denmark (DTU) Nils Koppels Alle, Building 402, DK-2800 Kgs. Lyngby, DENMARK Phone: (+45) 4525 4169, Fax: (+45) 4593 5215, E-mail: [email protected] Niels Houbak Department of Mechanical Engineering Technical University of Denmark (DTU) Nils Koppels Alle, Building 402, DK-2800 Kgs. Lyngby, DENMARK Phone: (+45) 4525 4154, Fax: (+45) 4593 5215, E-mail: [email protected] ABSTRACT Modelling of energy systems has been in- creasingly more important. In particular the dynamic behaviour is critical when operating the systems closer to the limits (either of the process, the materials, the emissions or the economics, etc.). This enforces strong re- quirements on both the models and their nu- merical solution with respect to both accu- racy and efficiency. In this paper we give a survey on simulation of energy systems, from models and modelling, over numeri- cal methods to implementational techniques. The paper is the second part of two papers covering important aspects of the different phases of modelling in general and mod- elling of an (energy) system. Part A, also gives a short introduction to robust numerical methods which it is strongly recommended to use. In this part, Part B, we present a sur- vey of available, commercial and university simulators, a few important aspects of the implementation of the energy system simula- tor DNA and a short tricky example showing that too simple models may result in unex- pected problems. INTRODUCTION During the last ten to twenty years, there has been a tremendous development of soft- ware for modelling and simulation of energy (or process) systems. The need for pre- cise information about the behaviour of such systems has increased in connection with a higher degree of integration of processes, optimization of processes, getting closer to the limits of strength of the material due to temperature, pressure, or dimensions, or a need for better control of the processes due to for example quality of the product. It is straightforward to divide these sim- ulation programs into various groups: gen- eral simulators, application specific or com- ponent specific simulators. When buying expensive equipment the customer may have included in the deal a simulator that could be used for training of the operators. This is the component specific case, where only the manufacturer may actu- ally make changes in the underlying model. Often it is a non-trivial task to make serious changes to the overall structure of such a model because the model is tailored to the problem.

Partbsoftware for the Simulation of Power Plant Processes

Embed Size (px)

DESCRIPTION

Uploaded from Google Docs

Citation preview

Page 1: Partbsoftware for the Simulation of Power Plant Processes

SOFTWARE FOR THE SIMULATION OF POWER PLANT PROCESSESPART B

Brian ElmegaardDepartment of Mechanical EngineeringTechnical University of Denmark (DTU)

Nils Koppels Alle, Building 402, DK-2800 Kgs. Lyngby, DENMARKPhone: (+45) 4525 4169, Fax: (+45) 4593 5215, E-mail: [email protected]

Niels HoubakDepartment of Mechanical EngineeringTechnical University of Denmark (DTU)

Nils Koppels Alle, Building 402, DK-2800 Kgs. Lyngby, DENMARKPhone: (+45) 4525 4154, Fax: (+45) 4593 5215,

E-mail: [email protected]

ABSTRACT

Modelling of energy systems has been in-creasingly more important. In particular thedynamic behaviour is critical when operatingthe systems closer to the limits (either of theprocess, the materials, the emissions or theeconomics, etc.). This enforces strong re-quirements on both the models and their nu-merical solution with respect to both accu-racy and efficiency. In this paper we givea survey on simulation of energy systems,from models and modelling, over numeri-cal methods to implementational techniques.The paper is the second part of two paperscovering important aspects of the differentphases of modelling in general and mod-elling of an (energy) system. Part A, alsogives a short introduction to robust numericalmethods which it is strongly recommendedto use. In this part, Part B, we present a sur-vey of available, commercial and universitysimulators, a few important aspects of theimplementation of the energy system simula-tor DNA and a short tricky example showingthat too simple models may result in unex-pected problems.

INTRODUCTIONDuring the last ten to twenty years, there

has been a tremendous development of soft-ware for modelling and simulation of energy(or process) systems. The need for pre-cise information about the behaviour of suchsystems has increased in connection with ahigher degree of integration of processes,optimization of processes, getting closer tothe limits of strength of the material due totemperature, pressure, or dimensions, or aneed for better control of the processes dueto for example quality of the product.

It is straightforward to divide these sim-ulation programs into various groups: gen-eral simulators, application specific or com-ponent specific simulators.

When buying expensive equipment thecustomer may have included in the deal asimulator that could be used for training ofthe operators. This is the component specificcase, where only the manufacturer may actu-ally make changes in the underlying model.Often it is a non-trivial task to make seriouschanges to the overall structure of such amodel because the model is tailored to theproblem.

Page 2: Partbsoftware for the Simulation of Power Plant Processes

Application specific codes often offer ahigher degree of freedom. In the design ofthe code, special attention has been paidto how problems traditionally are describedwithin that specific application area. Pro-grams for simulating the behaviour of elec-trical (or other types of) networks are of thatnature.

General tools for simulating any system donot exist but there are tools (often equationbased) where the user may type in almostany set of equations that he/she thinks de-scribe the system. In most cases the solvermay then actually produce reasonable re-sults. From the above, it is clear, that themore the user wants the tool-producer totake responsibility for in the model, the lessinfluence does the user have on the model tobe solved.

This part B of the paper includes a sur-vey of a number of the available tools andthe inter-play between mathematical modeland numerical methods. We give a descrip-tion of the tabular representation of an en-ergy system model as it is implemented inthe component-based code DNA, and we ex-emplify whhat problems may develop whensimple component models are connected ina system model.

AVAILABLE SIMULATION TOOLSIt is a fact that a very high number of codes

for simulation of energy systems are avail-able. This may be verified by a search onthe interduct home page [2], which does noteven contain all codes described in literature.On the other hand, it is also possible to verifythat many of the tools:

• are specific to a narrow range of prob-lems,

• are difficult to learn,

• do not handle model problems robustly,

• are not very well documented in litera-ture, and/or

• are very expensive.

Before initiating a work on developing asimulation tool, Perstrup [22] made an as-sessment of codes available then. The mainpremise for the assessment was the desirefor a tool with an extendible component li-brary which might be applied for both steadystate and dynamic simulation of all kinds ofthermal energy systems, particularly powerplants. One further specification followingfrom this premise was that the code shouldbe equipped with a well documented, effi-cient solver for AE, ODE, and DAE systems,i.e., a standard solver. The result of this as-sessment was that no code fulfilling the re-quirements existed. Though, this assess-ment since then has been maintained dur-ing the works described in [10, 20], it is nota complete overview of energy system sim-ulation codes available. Below, we presentthe current status of our survey of availablecodes. Surveys with focus on overall fea-turs of different codes is given in [3, 23, 17]The presented codes are, to our knowledge,maintained and in use:

Aspen Plus is a commercial program whichis developed for chemical processesand is often used in gas turbine applica-tions. For steam plants its use is morelimited. It is intended for steady stateprocess simulation and uses a sequen-tial solver [3, 17].

Camel is developed at the University ofRome [14, 15]. It is based on a welldocumented tabular description of themodel and may be applied for bothsteady state and dynamic simulation.The latter is based on the assumptionthat dynamics may be calculated asa sequence of quasi-stationary steady-states, i.e., an explicit first-order Eu-ler integration method. The solutionmethod is sequential in the equations.

Code written by Consonni This is asteady-state solver which has beenused in a variety of gas turbine andsteam turbine system models [5, 6]

Cycle Tempo This program has a very high-

Page 3: Partbsoftware for the Simulation of Power Plant Processes

level graphical user interface, Guide,[25]and is suited for steady state simula-tions both for power and refrigerationsystems. The solver of the program is amixture between sequential and simul-taneous methods, such that the linearbalance equations are solved simulta-neously, whereas the constitutive equa-tions of the components are formulatedexplicitly in one unknown and evaluatedin an inner loop for each outer loop eval-uation of the balance equations [21].Cycle Tempo is commercially availableand is developed at Delft University ofTechnology.

DIMAP [1, 19] has been developed at Uni-versity of Padova, Italy, and has beenused in a number of studies of differ-ent cycles for steady state operation.The program has been extended witha graphical user interface. The pro-gram has a sparse matrix Newton solverwhich is applied in a special way to sep-arated parts of the system of equations.

DNA is developed by several authors at theTechnical University of Denmark. It issuited for both steady state and dy-namic simulations [9, 10, 11]. Presently,there is no graphical interface, so DNAis a model description language. It hasbeen integrated with the emacs editorand is free. The program uses a New-ton solver to solve the system of equa-tions, and it has a sparse linear equationsolver. The robustness of the solver isimproved by a preprocessing, sequen-tial solution step. The differential equa-tions are solved by a fourth order BDFmethod with variable step size and han-dling of discontinuities.

Dymola is a commercial solver for dynamicsystems. It is the only simulation toolthat is currently available for the simula-tion language Modelica, which is basedon object oriented modelling and pro-gramming features. It has not yet beenextensively used for energy systems,

but the language is under developmentfor this purpose and may be useful inthe future. In Dymola, Modelica code isconverted to C, and compiled to an ex-ecutable which can be run interactivelyfrom Dymola.

Dymola includes several standardsolvers for ODE/DAE’s and handlesdiscontinuities efficiently.

EES is a general equation solver with fea-tures for calculation of properties of alarge number of fluids and solids. Ex-perience shows that EES is very easyto use even for unexperienced users,e.g., students. EES is mainly intendedfor steady state simulation and it usesa robust implementation of the Newtonmethod including sparse matrix tech-niques. It may be used for dynamicsimulation as well, but the implementedODE solver has limited efficiency.

ESMS is developed at the University ofFlorence[4]. It is suited for simulation ofsteady state processes and includes agraphical user interface. The solver is aspecially implemented simultaneous lin-ear equation solver.

GT Pro is a commercial program for steadystate simulation of power plants. It usesa sequential solution method[17].

Gate Cycle is a commercial program forsteady state simulation of power plants.It uses a sequential solution method[17].

Hysys is a commercial simulator for chemi-cal processes for both steady state anddynamic simulation. It uses a sequentialsolution method.

ICAS is developed at the Technical Univer-sity of Denmark and is a highly inte-grated software package for analysis ofchemical process plants.

MMS/ACSL is a commercial simulator fordynamic systems [8]. MMS is a graphi-cal extension to the ACSL modelling lan-guage – a preprocessor that generates

Page 4: Partbsoftware for the Simulation of Power Plant Processes

ACSL code. The ACSL model is trans-lated to Fortran code which is compiledto an executable and may then be run.The solver is a sequential method, butdoes not handle algebraic loops [20].

Matlab/Simulink is a commercial systemfor simulation of dynamic systems ingeneral. Thus, media properties arenot available, but have to be imple-mented. Simulink is mainly intended forcontrol system design and is not verywell suited for closed loop systems, asis very often the case for energy systemmodels. As a Matlab-based system ithas access to all the mathematical anal-ysis features available in Matlab. This in-cludes several solvers for ODE systems.

Prosim is a commercial steady state simu-lation tool based on a sequential solver.It is so integrated into Autocad, that thisis needed in order to run Prosim[3, 17].

Vissim is a commercial system for simu-lation of dynamic systems in general.Thus, media properties are not avail-able, but have to be implemented. Theprogram has several solvers for ODE’sincluded.

Windali This program is developed at theTechnical University of Denmark, as acode for dynamic simulation of DAEsystems. It is closely integrated withthe Windows platform and utilizes dy-namic link libraries for integration be-tween code and solvers. The programis available from [24]. It includes severalstandard DAE Solvers.

Some of the codes, e.g. [18], are the resultof student or research projects and have assuch often been developed for a special pur-pose and later extended to a more generalapplicability. This naturally leads to assump-tions and neglects at the early developmentstages. This have to lead to limitations in ex-tendibility. However, it is also our experiencefrom the development of DNA, that even if

the code has been developed with general-ity as a main aim, there will unavoidably bemade decisions in the earlier stages of thedevelopment of the code, which will lead todifficulties when extending the code.

TABULAR MODEL REPRESENTATION INDNA

DNA [9, 10, 20, 22] is an example of an en-ergy system simulation tool which has bothsteady state and dynamic simulation fea-tures and has proven useful through sev-eral research and student projects involv-ing simulation of e.g., steam power, gas tur-bines, fuel drying, pyrolysis and gasifica-tion, fuel cells, and heat exchanger networks[7, 10, 12, 13, 16].

DNA includes

• a modified Newton method solver forsteady state models,

• an up to fourth order, variable step sizeBDF solver for dynamic simulation,

• an extendible component model librarywhich is compiled into the code, and

• routines for calculation of state variableproperties, transport properties and ra-diative properties of fluids and solids,e.g., ideal gas mixtures, water/steam,carbon dioxide and solid fuels andashes.

DNA is a modelling language and the sys-tem model written by the user is compiledand simulated in one run.

During the compilation, the input is an-alyzed, information is re-organized, andstored properly in a set of tables. Thr simula-tion part is based upon standard solvers im-plemented with sparse matrix technique forefficiency.

The system models in DNA consistof components which have a number ofbranches connecting the component to itssurroundings and parameters determiningthe characteristics of the component. Thebranches of two or more components are

Page 5: Partbsoftware for the Simulation of Power Plant Processes

connected at nodes in order to form a sys-tem. The tabular representation of the modelmakes it possible to automatically generatemass and energy balances for all compo-nents and nodes. Thus, the component mod-eller only has to implement the constitutiveequations of the component type in a model.The tables also allows to exploit the sparsityof the system of equations and this feature isused in the solver.

From Physical to Mathematical Model

The mathematical model is a result of thephysical model specified by the user as inputto DNA. From this an internal, tabular repre-sentation of the model is generated. The ta-ble connects component and the connectednodes to the information about the compo-nent as is specified in the component library.

An important feature obtained by carefulimplementation of the tabular representationis that DNA will check for and issue errorsif the system of equations resulting from thespecified model does not have the samenumber of variables and equations, both instatic parts and the dynamic parts of the sys-tem.

In order to have a complete tabular struc-ture describing an energy system model, theinput model specification generates a fewmore tables, e.g., for storage of gas mixturecompositions.

A node-oriented description of the connec-tions in the system is generated in order tocheck consistency.

From Mathematical to NumericalModel

The core tables for the solution process aregenerated from the above described tables.Three tables are necessary:

• The "‘variable table"’ holds informationabout all variables in the system. It hasa column for each variable, describingthe type of variable and the componentit is connected to and its value.

• The "‘residual table"’ stores informationabout the equations (residuals) in themodel. Each column holds informationabout an equation: The type of equa-tion, the component or node it comesfrom, and the value.

An equation is either conservation of en-ergy or mass for a component or a node,a constitutive equation, or an equationrelating dynamic variables to their timederivatives according to the Nordsieckformulation [20].

• The incidence matrix describing the en-tries of the Jacobian matrix. It is imple-mented using sparse matrix techniquesas described in part A of the paper.

During the solution process these tablesand the system table are frequently in-spected when the residual values or the Ja-cobian of the system is to be calculated.

It should be noted that the above descrip-tion does not cover all details of the imple-mentation, and that it is elaborated further in[10, 20]. The source code is available fromhttp://www.et.dtu.dk/software/dna.

In order to minimize the use of RAM in thecomputer, the complete set of tables in DNAis stored compactly in three one-column ar-rays, see [20].

LINEARLY DEPENDENT MODELSThe model displayed in figure 1 is a very

simplified example of what may easily hap-pen when applying standard, simple com-ponents to a simple (at first sight) problem.A heat source with negligible pressure lossprovides hot water (100°C) for two parallely-coupled heat sinks both with a constant pres-sure loss of 9 bar. Both sinks cool the waterto 10°C. The distribution of heat between thetwo sinks is fifty-fifty. A pump is used for rais-ing the pressure to make the fluid circulate inthe system.

Usually, a system model is built iterativelyby inserting components one by one to cre-ate the complete model. In the presentmodel it is easy to create the system as long

Page 6: Partbsoftware for the Simulation of Power Plant Processes

Q̇1

Q̇2Q̇3

Figure 1: Sketch of a simple, problematicmodel

as the cycle is not closed, i.e., a system withinlet of water to the pump and outlet from thesinks may be made without problems. How-ever, if the connection of the sink outlets tothe pump inlet is made, the system can nolonger be solved. The reason is that the con-stant pressure loss assumption of both thesinks generates two equations both speci-fying the absolute pressure into the pump.This is a linear dependency in the system,which cannot be solved. Another way to ex-press this is: In the outer loop adding anynumber to the mass flows will make no dif-ference.

Trying to simulate this system in DNA re-sults in the error message, that one too manyconditions on the system operation has beenassigned. Removing any of the conditionsdoes not solve the problem; DNA initiatesthe solution procedure and responds with anerror message: The system of equations iswrong with some variables being overspeci-fied, some being underspecified.

The solution is to decouple the pressuresout of the two heat sinks. There are (at least)two ways to do this. Either, an insignificantmass flow dependency on the pressure lossmay be introduced (a new component modelis added to the simulator), or an expansionvalve may be inserted between either of thesinks and the connection (an artificial com-ponent is introduced in the system model).

This example shows that even very simpleproblems may cause modelling problems,but also that modelling creativity may pro-vide simple solutions to such problems. The

problem is easily recognized here, but if it ap-pears during the refinement or extension ofa complete power plant model it is difficult tofind.

CONCLUSIONIn this paper, parts A and B, we have pre-

sented a survey of methods applicable in theimplementation of energy system simulationsoftware with focus on the implementation ofinternal model representation and numericalsolvers. In this part B, we have presented alist of software and their main features withrespect to the scope of the paper.

The DNA code was originally designed forlarge static problems; hence it was built witha Newton solver for the non-linear equationsand sparse matrix technique for the linearequations. Em-phasis was put on havinga complete component description includingconsistency checks, in one routine per com-ponent. Thus, evaluating the complete sys-tem model corresponds to calling the appro-priate component routines in a systematicmatter. The feature of including the compo-sition of some of the fluids in the equationsystem was not in the original design but hasbeen added later.

The extension of the code with dynamiccapabilities did require several projects. Inparticular the implementation of the handlingof discontinuities was a time-consumingtask. It was in principle also this fea-ture (or the lack of available discontinuitysolvers) that caused an own-developmentof the DEA solver in DNA. Using the BDFmethod in a Nordsieck-formulation with amaximum (user-determined) order was sim-ply a choice.

The conclusion is that all codes, includ-ing DNA, which have been presented inmore detail, do have defiencies resultingfrom early assumptions in the implementa-tion. These result in limitations in applica-bility and extendibility in further work on acode. We have described the implementa-tion of DNA in detail in order to provide aninsight in a way a code may represent a com-

Page 7: Partbsoftware for the Simulation of Power Plant Processes

plete model and solve it numerically.Even if the code has been carefully im-

plemented, a simple model of a simple en-ergy system may result in problems and re-quire the user to make innovative modellingefforts.

REFERENCES[1] C. R. Altafini, A. Mirandola, and A. Stop-

pato. Analysis and simulation of anintegrated gasification combined cyclepower plant. In A. Bejan, M. Feidt, M. J.Moran, and G. Tsatsaronis, editors, Ef-ficiency, Cost, Optimization, Simulationand Environmental Aspects of EnergySystems and Processes, pages 641–648, 1998.

[2] Anonymous. Home page of interduct.http://www.interduct.tudelft.nl/,1994–2001.

[3] Mohsen Assadi, Per Rosén, and NiklasÅgren. Utvärdering av olika värme-balansprogram, (comparison of differ-ent heat balance programs). TechnicalReport LUTMDN/TMVK–3173–SE, De-partment of Heat and Power Engineer-ing, Lund Institute of Technology, Swe-den, 1995.

[4] C. Carcasci and B. Facchini. A numeri-cal method for power plant simulations.Journal of Energy Resources Technol-ogy, 118:36–43, March 1996.

[5] S. Consonni and E. D. Larson.Biomass–gasifier/aeroderivative gasturbine cycles: Part b—performancecalculations and economic assessment.Transactions of the ASME—Journal ofGas Turbines and Power, 118:516–525,July 1996.

[6] Stefano Consonni. Combined cycles forhigh performance, low cost, low envi-ronmental impact waste-to-energy sys-tem. Munich, Germany, May 2000.ASME.

[7] Pietro de Faveri Tron and GiacintoCarapelli. Analysis of an ifgt (indirectlyfired gas turbine). Technical report, De-partment of Energy Engineering, Tech-nical University of Denmark, 2000.

[8] S. Murthy Divakaruni. The aplication ofsimulation in large energy system anal-ysis. Modeling, Identification and Con-trol, 6(4):231–247, 1986.

[9] B. Elmegaard, N. Houbak, andB. Lorentzen. DNA—a network basedenergy system simulator. In GiampaoloManfrida, editor, FLOWERS’97—Florence World Energy ResearchSymposium, pages 239–246. SGEdito-riale, 1997.

[10] Brian Elmegaard. Simulation of BoilerDynamics – Development, Evaluationand Application of General Energy sys-tem Simulation Tool. PhD thesis, Tech-nical University of Denmark, 1999.

[11] Brian Elmegaard and Niels Houbak.Robust implementation of process sim-ulators and their associated models. InG. Hirs, editor, Proceedings of ECOS2000, pages 325–332, 2000.

[12] Brian Elmegaard and Bjørn Qvale.Analysis of indirectly fired gas turbinefor wet biomass fuels based on com-mercial micro gas turbine data. Sub-mitted to ASME IGTI Turbo Expo 2002,Amsterdam, June 2002.

[13] Brian Elmegaard, Bjørn Qvale, Giac-into Carapelli, and Pietro de Faveri Tron.Open-cycle indirectly fired gas turbinefor wet biomass fuels. In Proceedingsof ECOS ’01, pages 361–368, 2001.

[14] Marco Francesco Falcetta and EnricoSciubba. A computational, modular ap-proach to the simulation of powerplants.Heat Recovery Systems and CombinedHeat and Power Production, 15:131–145, 1995.

Page 8: Partbsoftware for the Simulation of Power Plant Processes

[15] Marco Francesco Falcetta and EnricoSciubba. Unsteady numerical simula-tion of combined cycle plants. In R. Cai,M. J. Moran, S. Zhangz, and Y. Xiao, ed-itors, Thermodynamic Analysis and Im-provement of Energy Systems, pages224–231. Chinese Society of Engineer-ing Thermophysics and American So-ciety of Mechanical Engineers, BeijingWorld Publishing, 1997.

[16] Nicola Gelli, Giovanni Sarti, and MarcoDonati. Biomass fuelled power plants.Technical report, Technical University ofDenmark, Department of Energy Engi-neering, 2000.

[17] I. Giglmayr, M. Nixdorf, andM. Pogoreutz. Vergleich von softwarezur thermodynamischen proceßrech-nung. Forschungsvorhaben 177, VGB,Technische Universität Graz, Tech-nische Universität München, March2000.

[18] A. Korving. Cycle–tempo.http://www-pe.wbmt.tudelft.nl/

ev/cycle/cycle.html, 1999. SectionThermal Power Engineering, DelftUniversity of Technology.

[19] A. Lazzaretto et al. Dimap—a modu-lar computer code for thermodynamicexergetic and thermoeconomic simula-tion of energy systems. In R. J. Krane,editor, Thermodynamics and the de-sign, analysis and improvement of en-ergy systems. The 1995 ASME, Proc. ofthe International Mechanical Engineer-ing Congress and Exposition, volumeAES-35, pages 119–126. ASME, Amer-ican Society of Mechanical Engineers,1995.

[20] B. Lorentzen. Power Plant Simulation.PhD thesis, Technical University of Den-mark, Laboratory for Energetics, 1995.

[21] J. A. Miedema. Cycle; a General Com-puter Code for Thermodynamic CycleComputations. PhD thesis, Delft Unver-sity of Technology, 1981.

[22] Claus Perstrup. Analysis of power plantby application of network theory (in dan-ish). Master’s thesis, Technical Univer-sity of Denmark, Laboratory for Ener-getics, 1991.

[23] Robert M. Privette. Developments in theDesign of Thermal Systems, chapterComputer-aided process design trendsin the power industry, pages 16–39.Cambridge University Press, 1997.

[24] Morten Skovrup. Windali home page.Internet: http://www.et.dtu.dk/

software/windali.

[25] TNO Milieu, Energie en Procesinno-vatie and Delft University of Technol-ogy. CYCLE–TEMPO, ThermodynamicEnergy systems Massflow calculation ofPOwer processes, release 3.21 edition.