Since its 3.3 release, Modelica offers the possibility to specify models of dynamical systems with multiple modes having different DAE-based dynamics. However, the handling of such models by the current Modelica tools is not satisfactory, with mathematically sound models yielding exceptions at runtime. In this article, we propose several contributions to this multifaceted issue, namely: an efficient and scalable multimode extension of the structural analysis of Modelica models; a systematic way of rewriting a multimode Modelica model, based on this analysis, so that the rewritten model is guaranteed to be correctly compiled by state-of-the-art Modelica tools; a proposal for the handling of the consistent initialization of multimode models; multimode structural analysis algorithms that handle both multiple modes and mode change events in a unified framework, coupled with a compile-time algorithm for identifying and quantifying impulsive behaviors at mode changes. Our approach is illustrated on relevant example models, and the performance of our implementations is assessed on a variable dimension large-scale model.
CoSApp, for Collaborative System Approach, is an object-oriented Python framework that allows domain experts and system architects to create, assemble, simulate and design complex systems. The API of CoSApp is focused on simplicity and explicit declaration of design problems. Special attention is given to modularity; a very flexible mechanism of solver assembly allows users to construct complex, customized simulation workflows. CoSApp handles steadystate simulation, as well as time-dependent dynamic systems, and multimode systems with event-based mode transitions.
22 December 2023 in Swedish Aerospace Conference, FT2025
A key feature of the Modelica language is its object-oriented nature: components are instances of classes and they can aggregate other components, so that extremely large models can be efficiently designed as ``trees of components''. However, the structural analysis of Modelica models, a necessary step for generating simulation code, often relies on the flattening of this hierarchical structure, which undermines the scalability of the language and results in widely-used Modelica tools not being able to compile and simulate such large models. In this paper, we propose a novel method for the modular structural analysis of Modelica models. An adaptation of Pryce's Sigma-method for non-square DAE systems, along with a carefully crafted notion of component interface, make it possible to fully exploit the object tree structure of a model. The structural analysis of a component class can be performed once and for all, only requiring the information provided by the interface of its child components. The resulting method alleviates the exponential computation costs that can be yielded by model flattening; hence, its scalability makes it ideally suited for the modeling and simulation of large cyber-physical systems.
The study of heat transfers requires computations on very fine meshes, and the discretization of the Navier- Stokes equations at low-Mach number on such meshes induces the solving of symmetric linear systems with up to billions of unknowns. Here, a two-level method is first presented, that uses an arbitrary coarse grid to reduce computational costs for this solving. However, the coarse grid generated can count up to millions of cells: direct solvings on this level are thus out of reach, but iterative solvings involve a large number of communications, dramatically impairing parallel performances. To this effect, two methods are developed in order to reduce the number of iterations on the coarse level, that are easy to implement in any adequately designed Deflated Conjugate Gradients solver. Using this novel method, computational times for massively parallel simulations of a turbulent flow around a turbine blade are decreased by up to 49 %.