Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 4.39 KB

README.md

File metadata and controls

37 lines (23 loc) · 4.39 KB

SOFC PoliMi

A library showing how a Solide-Oxide Fuel Cell dynamic model for plant-wide studies might be modelled in Modelica, as presented in the paper doi:10.1109/CCTA54093.2023.10252534.

The library does not use Modelica.Media for fluid property computation, but rather fully equation-based fluid models. There are two main reasons behind that:

  1. this component is then used as a part of the model of the SOS-CO2 oxy-combution power plant, which is not publicly available at the moment, which also uses real gas models based on Peng-Robinson's implicit equation of state, which is written in a fully declarative way using implicit equations only;
  2. the model is meant for simulation studies but also for direct optimal control computations using gradient-based methods; this preferably requires the model to be fully based on equations, so that efficient code for Jacobian and Hessian computation can be automatically generated by differentiating them.

In its present form, this package is not really meant to be used as a re-usable component library, as it is actually a fragment of a larger project that is currently not available as open-source. It is rather meant to have the following purposes:

  • as a companion to the scientific publication(s) describing and using it, allowing readers to reproduce the results, providing fully access to implementation details, and allowing people to build upon it, e.g. by writing variants of the model for other types of fuel cells;
  • as a non-trivial, publicly available industrial benchmark for Modelica simulation tools;
  • as a non-trivial, publicly available industrial benchmark for steady-state initialization of complex Modelica thermo-fluid models, using homotopy-based strategies;
  • as a non-trivial industrial benchmark for applications of Modelica equation-based model to direct optimal control.

Content

The package contains a 1D dynamic model of a SOFC, including all the sub-components required to build it, as well as equation-based models of ideal gas mixtures. The package is self-contained, only depending on the Modelica Standard Library version 4.0.0.

How to use

The Modelica code is meant to run on all Modelica tools supporting the latest Modelica language specification. The simulation models were tested successfully using Dymola 2024x and OpenModelica 1.24.0; the library is also tested on a nightly basis with the latest development version of OpenModelica, see the test report.

To run the model in Dymola, it is suggested to run a script such as start_up_dymola.mos to enable parallelization and to directly solve the initialization problem using homotopy, rather than trying first without it (spoiler alert: it won't work, the initialization problems are simply too hard to be solved without homotopy).

Some vendor-specific annotations were added to successfully run the models in OpenModelica:

  • __OpenModelica_tearingSelect was added to some variable declarations to make sure that the right tearing variables (pressures, temperatures, compositions, and currents) are selected when solving the steady-state initialization problem. Dymola automatically selects them based on structural analysis and proprietary heuristics;
  • __OpenModelica_commandLineOptions = "--maxSizeNonlinearTearing=40000" was added to the simulation models in order to make sure that tearing is applied to the steady-state initialization problem, whose size is currently larger than default maximum size for applying tearing in OpenModelica;

Other tools may need similar hints to successfully solve the initialization problem. Feel free to contact the developers @casella and @matteodepascali if you run the model with other tools and you want to report success or issues.

Versions

At the moment there is no official release for this library, please use the HEAD revision on the master branch.

Bibliography

M. L. De Pascali, A. Donazzi, E. Martelli and F. Casella, "A Control-Oriented Modelica 1-D Model of a Planar Solid-Oxide Fuel Cell for Oxy-Combustion Cycles," 2023 IEEE Conference on Control Technology and Applications (CCTA), Bridgetown, Barbados, 2023, pp. 394-399, doi:10.1109/CCTA54093.2023.10252534. Winner of the Outstanding Student Paper Award.