  Metallic open cell foams have multiple applications in industry, e. g. as
catalyst supports in chemical processes. Their regular or heterogeneous
microscopic structure determines the macroscopic thermodynamic and chemical
properties. We present an object-oriented python library that generates state
space models for simulation and control from the microscopic foam data, which
can be imported from the image processing tool iMorph. The foam topology and
the 3D geometric data are the basis for discrete modeling of the balance laws
using the cell method. While the material structure imposes a primal chain
complex to define discrete thermodynamic driving forces, the internal energy
balance is evaluated on a second chain complex, which is constructed by
topological duality. The heat exchange between the solid and the fluid phase is
described based on the available surface data. We illustrate in detail the
construction of the dual chain complexes, and we show how the structured
discrete model directly maps to the software objects of the python code. As a
test case, we present simulation results for a foam with a Kelvin cell
structure, and compare them to a surrogate finite element model with
homogeneous parameters.
