MOSILAB: Development of a Modelica based generic simulation tool supporting model structural dynamics Christoph Nytsch-Geusen (Contact: christoph.nytsch@first.fhg.de) Thilo Ernst, André Nordwig Peter Schneider, Peter Schwarz, Matthias Vetter, Christof Wittwer Andreas Holm, Thierry Nouidui, Jürgen Leopold, Gerhard Schmidt Ulrich Doll, Alexander Mattes Overview GENSIM Project Motivation: Model Structural Dynamics Modelica Language Extension MOSILAB Simulator MOSILAB Development Environment MOSILAB Applications Summary Seite 2
Project GENSIM - Objectives Joint project of the six Fraunhofer Institutes FIRST, IIS/EAS, ISE, IBP, IPK and IWU A) Generic simulation tool MOSILAB for heterogeneous technical systems - Model structural dynamics of equations and objects - Interfaces for simulator coupling (e.g. Simulink, FEM-tools) Integration framework - Object-oriented, non-causal and equation based modelling (Modelica ) - Mixed continuous/discrete (hybrid) systems - Integrated development environment for modelling and simulation (MOSILAB-IDE) - Open, scalable system architecture (embedded applications web-services/grid) - Supported platforms: Windows, Unix, MacOS X B) Model libraries and their application in three technical domains - Fuel cell systems (Time scale: seconds to hours) - Hygrothermal building analysis (Time scale: hours to years) - Cutting tool systems (Time scale: milliseconds to seconds) Seite 3 Project GENSIM - Roles and cooperation of the project partners Numerical algorithms Simulator development FIRST, IIS, ISE Model compiler Spezielle spezielle Bibliotheken Bibliotheken Special Libraries Description techniques GUI-elements Base Libraries Interfaces - Generic simulation system - Support - Requirements - Knowledge - User feedback Fuel cell systems ISE + IIS/EAS Cutting tool systems IPK + IWU Hygro-thermal Building analysis IBP + FIRST spezielle Special Algorithmen algorithms Seite 4
Model structural dynamics in the analysis of technical systems Heterogeneous technical systems show a high degree of structural dynamics during simulation: - Change of the structure of the system model (e.g. model of a flying object on the ground or in the air) - Change of the qualitative model behaviour (e.g. laminar or turbulent flow condition) - Adaptation of the modelling depth / -precision Example: transport car on a ramp Start (car and balll) Collision of car and ramp end Ball in free fall Bounce of the ball Behavioural model (Statechart) Simulation practice: available simulation tools insufficiently support model structural dynamics Seite 5 Modelica Language Extension - Motivation Idea: Encapsulation of replaceable behaviour Re-use of behaviour objects State dependent reconfiguration of objects with behaviour-subobjects Realisation? Extension of the Modelica syntax (MOSILA): Object oriented statecharts State-type, transitions, entry and exit actions, hierarchical statecharts etc. Dynamical objects prefix dynamic, o := new O, add(), remove() etc. Sum Connector prefix sum, motivated by dynamic terms within equations Seite 6
Modelica Language Extension Example Landing Device (1) Initial Conditions m0 = 100 kg (20 kg + 80 kg fuel) v0 = 0 m/s, s0 = 100 m, v_min = -5 m/s Effects Gravitation Booster (F = 1200 N, m = -10 kg/s) model Body extends BodyInterface(p.m=100); Real a=0, v=0, s=100; equation der(v) = a; der(s) = v; a = p.f / p.m; end Body; model Gravity extends BodyInterface; parameter Real g=9.81; equation p.f = - p.m * g; end Gravity; Model class diagram model Booster extends BodyInterface; discrete Boolean empty=false; Real m; equation p.m = m; empty = (not m>20); der(m) = if empty then 0 else -10; p.f = if empty then 0 else 1200; end Booster; Dynamical object declaration model System Body body; dynamic Gravity gr; dynamic Booster boost; end System; Seite 7 Modelica Language Extension Example Landing Device (2) Object oriented statecharts model System statechart state SystemSC extends State; state Moving extends State; state SlowDown extends State; State declaration end SlowDown; State falling, State start(isinitial=true); SlowDown slowdown; transition t2 : falling -> slowdown event sw guard sw==1 action body.add(boost); end transition; transition t3 : slowdown -> falling event sw guard sw==0 Entry action end transition; Statechart diagram end Moving; State stop, start(isinitial=true); Moving moving; entry action Transition implementation gr := new Gravity(); boost := new Boost(empty=false); end entry; end SystemSC; end System; Seite 8
MOSILAB Development Environment Modeling Mode Simulation workflow Class-browser Graphical Editors (UML H ): Class-diagrams Statechart-diagrams Collaboration-diagrams Text editor (Modelica/MOSILA) Information density Seite 9 MOSILAB Development Environment Simulation Mode Simulation Mode: Definition of simulation projects Model compilation Definition and control of simulation experiments Seite 10
MOSILAB Development Environment Postprocessing Mode Monitors for model state variables Seite 11 MOSILAB Simulator Dataflow within the simulation kernel MOSILA- Compiler MOSILA Model Classes Executable Simulator C++ Simulator- Kernel Classes C++ Model Classes MOSILA Standard- Library gcc/g++ Compiler C++ Experiment 010110101 O10100101 111010101 MOSILAB- IDE MOSILAB-Simulator Possible configurations of MOSILAB: Small monolithic simulator e.g. embedded systems Standard simulator with MOSILAB-IDE standard users MOSILAB as WebServices E-Sciences, GRID applications Seite 12
MOSILAB Simulator Model structural dynamics in the simulation main loop o := new O() add(o) Numerical algorithms: Trapez, Euler, IDA Seite 13 MOSILAB-Applications Model structural dynamics in the stack model (Simple-/detailed model) Model structural dynamics in a component model (Simple and detailed hygrothermal model) Simulation of fuel cell systems Schneide Schneide Schneide Model structural dynamics in a tool model (Contact with work piece exists or not exists) Hygrothermal building simulation Simulation of cutting tool systems Seite 14
Application Fuel Cell Systems Development of models for fuel cell systems with different levels of detail Design and improvement of control strategies for fuel cell systems Seite 15 Application - Fuel Cell Systems: Combination of model structural dynamics and simulator coupling Device Subsystem Symplified Mechanics system model System Plant components, Sensorics Thermodynamics Complete system (FS, Heatingsystem, Building, ) Controller Fuel cell stack Stack Stack model model Chemical effects Fluidics Electr./mag. Fields Electrical load model Channelmodel (CFD) MOSILAB-Framework System model (MOSILA) Stack model (MOSILA) Simulator coupling Channel Electrical model (commercial load model CFD-Solver) (MOSILA) Interface Interface Interface Simulation time Seite 16
Application Hygrothermal Building Analysis Development of hygrothermal building model, including the physical models of: Validation of the building Building component hygrothermal simulation (WUFI) model with test rooms at IBP Thermal building simulation (SMILE) Analysis of the interaction between the hygrothermal component behaviour and the room climate Seite 17 Application Cutting Tool Systems F(t) M(t) Analysed Cutting Tool applications Drilling and Milling Integration of simplified fast Modelica models with detailled slow FE-models Parametrization of Modelica-models by using FE-models MOSILAB produces time series of boundary conditions for the FE-models Seite 18
Summary Model Structural Dynamics SciTE-Editor with Modelica-Mode (will be soon as possible available at - New method for the behaviour-description of simulation models http://www.modelica.org) - Realisation of dynamic object structures during the runtime Modelica Language Extension (MOSILA) An offer from the GENSIM project to the Modelica community: - Supports Model Structural Dynamics - Object-oriented statecharts, object dynamics MOSILAB Simulation environment for complex, heterogeneous technical systems - Current MOSILAB prototype supports the most important elements of Modelica - Numerical framework of algorithms for switched ADGL-systems Outlook, future works - Integration of further Modelica elements in MOSILAB (to be 100 percent Modelica compatible) - Integration complex numerical algorithms in MOSILAB - Coupling with standard- and specialised-simulators (Simulink, FEM-tools) - Completion of the MOSILAB-IDE - Evaluation of MOSILAB with the help of the three technical Application areas Seite 19