On the Modular Modelling for Dynamical Simulation with Application to Fluid Systems
Total Page:16
File Type:pdf, Size:1020Kb
On the Modular Modelling for Dynamical Simulation with Application to Fluid Systems CARL-JOHAN SJÖSTEDT Licentiate thesis TRITA – MMK 2005:30 Department of Machine Design ISSN 1400-1179 Royal Institute of Technology ISRN/KTH/MMK/R-05/30-SE SE-100 44 Stockholm TRITA – MMK 2005:30 ISSN 1400-1179 ISRN/KTH/MMK/R-05/30-SE On the Modular Modelling for Dynamical Simulation with Application to Fluid Systems Carl-Johan Sjöstedt Licentiate thesis Academic thesis, which with the approval of Kungliga Tekniska Högskolan, will be presented for public review in fulfilment of the requirements for a Licentiate of Engineering in Machine Design. The public review is held at Kungliga Tekniska Högskolan, Machine Design, Brinellvägen 83, room A425 at 10.00, 2005-12-06 Abstract This licentiate thesis highlights some topics on modular modelling for dynamical simulation with application to fluid systems. The results are based on experience from the development of the fuel cell component simulation environment NFCCPP. The general application is cross-enterprise simulation of technical systems. There are four main topics: component definition including selection of interfaces, lumped modelling of fluid components, the use of dynamical equations to reduce simulation time in large systems and methods of to protect the intellectual property (IP) of a component. An overview of different dynamical fluid simulation tools such as HOPSAN, MATLAB/Simulink and Easy5 is presented. Special focus is on interfaces, where different approaches for representing interfaces are presented using an illustrative example. Selecting interfaces is however not a separated task from how to set up and solve the underlying equations, which also is shown. Equations to model a lumped component are derived, to get a mathematical background to what problems there are to solve. These equations are derived especially to be applicable in block model software simulation tools such as MATLAB/Simulink. The equations are also compared with the bond-graph approach of representing dynamical systems. A twin- screw compressor is modelled in MATLAB/Simulink as an implementation of these equations. A method to decrease the simulation time in dynamical fluid system is also presented. The technique is to add virtual mass in the force equation to get a slower acceleration of the fluid. Using this slower response, it is possible to use larger time-steps when integrating the equations and thus the total simulation time can be reduced. The error introduced using this method is a modelling error in the time domain, and it is comparable with using unit transmission lines (UTL:s), as does HOPSAN. The protection of the intellectual property (IP) of a component model is presented. The concept of clamping is thoroughly explained, as it often is overlooked in conventional IP- protection. Three concepts for code protection are presented: “Centralised simulation with remote user control”, “Localised simulation with simulation-time model usage control” and “Parallel distributed simulation”. The NFCCPP implementation of the concept “Localised simulation with simulation-time model usage control” is presented in more detail. I II Acknowledgements After having written an academic thesis, there are several people to thank. Many people have contributed either directly or indirectly to this study. First I would like to those who made this research possible, and they are Johnny Oscarsson at OpCon Autorotor, and CLEPA who were involved in setting up this project. I would like to thank all the NFCCPP project members: especially Peter Prenninger, Ian Faye, Thomas Huelshorst, Ashley Kells, Ian Harkness and Carsten Schönfelder for the co- writing of Paper B in this thesis, and giving me the honour to present it. Thank you Ralph Schleicher for inspiring me to write Paper C, Les Smith for providing useful references and giving me insight on thermodynamics, and Jan-Michael Graehn & Gunter Wiedemann for co-running the code protection project. De-Jiu Chen deserves however most credits for that project, thank you also for valuable comments on this thesis. I would also like to thank my supervisor Prof. Jan-Gunnar Persson for many fruitful discussions and for giving me the opportunity to write this thesis. My room-mates over the years: Jesper Brauer, Jan Johansson and Anna Hedlund-Åström need an extra thank you for letting me know all there is to know about the academic world and PhD studies. I have certainly not forgotten about all the other colleagues at Machine Design, thank you all for a good time and for helping me out in many ways! Finally I would like to thank my family for all support, especially my mother and soon-to- be wife Tania for proof-reading this thesis. III IV Thesis contents and division of work This thesis consists of a summary and three appended papers. These papers will be referred to as Paper A, Paper B and Paper C in the thesis. A. Carl-Johan Sjöstedt, Modelling of displacement compressors using MATLAB/Simulink software, proceedings from NordDesign 2004, Tampere University, Tampere, Finland, 2004, pp192-200 B. Carl-Johan Sjöstedt, De-Jiu Chen, Peter Prenninger, Ian Faye, Thomas Huelshorst, Ashley Kells, Ian Harkness, Carsten Schönfelder, Virtual Component Testing for PEM Fuel Cell Systems, Proceedings from the 3rd European Fuel Cell Forum, Lucerne Switzerland, 2005 Division of work: Carl-Johan Sjöstedt was the presenting author and wrote most of the “Standardization of simulation modules and interfaces” part, and contributed to the “Model encryption and protection” part. C. Carl-Johan Sjöstedt, Jan-Gunnar Persson, The design of modular dynamical fluid simulation systems, Proceedings from the OST Conference, KTH Machine Design, Stockholm, Sweden, 2005 Division of work: Carl-Johan Sjöstedt wrote most of the paper; Jan-Gunnar Persson assisted with the formulas and provided ideas. All results in the summary are by Carl-Johan Sjöstedt, if not explicitly stated. The results concerning code protection are from a sub-project in NFCCPP initiated by Ian Faye, where most work should be credited to De-Jiu Chen. V VI Table of contents ABSTRACT ................................................................................................................................................... I ACKNOWLEDGEMENTS..............................................................................................................................III THESIS CONTENTS AND DIVISION OF WORK................................................................................................V TABLE OF CONTENTS ............................................................................................................................... VII 1. INTRODUCTION ...............................................................................................................................1 2. THEORETICAL FRAMEWORK....................................................................................................1 2.1. THE VALUE OF SIMULATIONS IN THE DESIGN PROCESS ................................................................1 2.2. LUMPED MODELLING/DISCRETISATION ........................................................................................3 2.3. STATE OF THE ART IN MODULAR DYNAMICAL FLUID SIMULATION ..............................................4 Dedicated fluid power systems ..............................................................................................................4 Multiphysic simulation systems .............................................................................................................5 Generic simulation software..................................................................................................................5 2.4. MODEL COMPONENTS AND INTERFACES ......................................................................................6 Example application, a controlled valve...............................................................................................7 2.5. CODE PROTECTION .......................................................................................................................8 3. RESEARCH APPROACH...............................................................................................................10 4. RESULTS ...........................................................................................................................................10 4.1. NFCCPP SIMULATION MODEL – IN OVERVIEW..........................................................................10 4.2. NFCCPP CODE PROTECTION SOLUTION.....................................................................................11 1. Centralised simulation with remote user control............................................................................11 2. Localised simulation with simulation-time model usage control ...................................................12 3. Parallel distributed simulation........................................................................................................12 Selected concept...................................................................................................................................12 4.3. GOVERNING EQUATIONS ............................................................................................................13 4.4. USING DYNAMICAL EQUATIONS TO SOLVE LARGE SYSTEMS .....................................................15 4.5. PROOF-OF-CONCEPT SCREW-COMPRESSOR APPLICATION ..........................................................15