IEEE Circuits and Systems Magazine - Q1 2023 - 49

If the containment boundary is not adiabatic, at least
one heat port (scalar version of vHP in Section VII-A,
with one T and one Qflow); we denote by m the number of
such connectors.
Two equations to compute the contained mass M and
the contained energy E, most frequently in the form
Mp hV
EM h
= ρ(, )

=−


ρ ph
(, )
p



where derivatives with time and with spatial coordinates
appear.
Few modeling languages offer native support for par(28)
where
V is the volume and the other symbols have the
known meaning; ρ(p,h) represents the dependence of
density on pressure and specific enthalpy as dictated
by the model of the contained substance (in our context
a single species).
Two equations to compute the time derivatives of M
and E, that is,

Mw
Ew hQ

=∑
=∑
n
i=
n
i11flowii j
==
1
i
actualStream()+∑m
,j
(29)
where wi is the flow rate at the i-th pwh connector and
Qflow, j the heat rate at the j-th heat port; the Modelica
clause actualstream takes the correct enthalpy (that
of the contained flow or that presented from outside the
connector) depending on the sign of each wi.
Equations to present at connectors the thermodynamic
state (p,h) of the contained fluid, i.e.,
pp in
hh in
TT ph jm
i
i
j
== ...
== ...
== ...
(, )
1
1
1
tial derivatives, and when present, this support tends
to be geared to a particular domain (a notable case is
gPROMS [28] for the process industry). As such, in general
it is the task of the model and library developer to
take care of spatial discretisation to represent the distributions
with a finite number of variables.
There are two main approaches to this problem,
namely the finite-volume and the finite-element one. We
stick here to the former, in which the region of space
where variables are distributed is decomposed in volumes,
where the value of the distributed variables is assumed
uniform, and that exchange energy and possibly
mass with the neighboring volumes and/or the region
boundaries. There is a lot of mathematics involved that
we are not discussing in this article; the interested reader
can refer, e.g., to [29], [30], as well as to works like
[31], [32] for the case of modern ICs.
Below we briefly treat the one-dimensional case, typically
found in fluid elements as happens, e.g., for the
temperature along a duct, and the three-dimensional
case, which is typically seen when modeling temperature
distributions in solids. The reason is that in ducts
we can assume thermal properties to be constant over a
surface orthogonal to the duct axis, whence the 1D case,
and that we do not need to model three-dimensional
fluid motion, whence the 3D case for solids only. The
(30)
Listing 5 illustrates (omitting unnecessary Modelica
lines) how the above applies to describing a volume containing
an ideal gas, with two pwh connectors pwh_a,
pwh_b and one heat port hp.
C. Managing Spatial Discretisation
In the context we address, one often encounters variables
with a spatial distribution: think for example of
the pressure and temperature profiles along a pipe in
a heat exchanger, or the temperature field in a silicon
die. Such variables depend on both time and space,
hence in the most general case on four independent
coordinates, one temporal and three spatial. Moreover,
their behavior depends on transport phenomena,
i.e., their value at a certain point in space is influenced
by values at infinitely close other points. As a
result, when spatially distributed variables come into
play, models contain partial differential equations,
FIRST QUARTER 2023
Listing 5. Example component code-volume with ideal gas.
IEEE CIRCUITS AND SYSTEMS MAGAZINE
49

IEEE Circuits and Systems Magazine - Q1 2023

Table of Contents for the Digital Edition of IEEE Circuits and Systems Magazine - Q1 2023

Contents
IEEE Circuits and Systems Magazine - Q1 2023 - Cover1
IEEE Circuits and Systems Magazine - Q1 2023 - Cover2
IEEE Circuits and Systems Magazine - Q1 2023 - Contents
IEEE Circuits and Systems Magazine - Q1 2023 - 2
IEEE Circuits and Systems Magazine - Q1 2023 - 3
IEEE Circuits and Systems Magazine - Q1 2023 - 4
IEEE Circuits and Systems Magazine - Q1 2023 - 5
IEEE Circuits and Systems Magazine - Q1 2023 - 6
IEEE Circuits and Systems Magazine - Q1 2023 - 7
IEEE Circuits and Systems Magazine - Q1 2023 - 8
IEEE Circuits and Systems Magazine - Q1 2023 - 9
IEEE Circuits and Systems Magazine - Q1 2023 - 10
IEEE Circuits and Systems Magazine - Q1 2023 - 11
IEEE Circuits and Systems Magazine - Q1 2023 - 12
IEEE Circuits and Systems Magazine - Q1 2023 - 13
IEEE Circuits and Systems Magazine - Q1 2023 - 14
IEEE Circuits and Systems Magazine - Q1 2023 - 15
IEEE Circuits and Systems Magazine - Q1 2023 - 16
IEEE Circuits and Systems Magazine - Q1 2023 - 17
IEEE Circuits and Systems Magazine - Q1 2023 - 18
IEEE Circuits and Systems Magazine - Q1 2023 - 19
IEEE Circuits and Systems Magazine - Q1 2023 - 20
IEEE Circuits and Systems Magazine - Q1 2023 - 21
IEEE Circuits and Systems Magazine - Q1 2023 - 22
IEEE Circuits and Systems Magazine - Q1 2023 - 23
IEEE Circuits and Systems Magazine - Q1 2023 - 24
IEEE Circuits and Systems Magazine - Q1 2023 - 25
IEEE Circuits and Systems Magazine - Q1 2023 - 26
IEEE Circuits and Systems Magazine - Q1 2023 - 27
IEEE Circuits and Systems Magazine - Q1 2023 - 28
IEEE Circuits and Systems Magazine - Q1 2023 - 29
IEEE Circuits and Systems Magazine - Q1 2023 - 30
IEEE Circuits and Systems Magazine - Q1 2023 - 31
IEEE Circuits and Systems Magazine - Q1 2023 - 32
IEEE Circuits and Systems Magazine - Q1 2023 - 33
IEEE Circuits and Systems Magazine - Q1 2023 - 34
IEEE Circuits and Systems Magazine - Q1 2023 - 35
IEEE Circuits and Systems Magazine - Q1 2023 - 36
IEEE Circuits and Systems Magazine - Q1 2023 - 37
IEEE Circuits and Systems Magazine - Q1 2023 - 38
IEEE Circuits and Systems Magazine - Q1 2023 - 39
IEEE Circuits and Systems Magazine - Q1 2023 - 40
IEEE Circuits and Systems Magazine - Q1 2023 - 41
IEEE Circuits and Systems Magazine - Q1 2023 - 42
IEEE Circuits and Systems Magazine - Q1 2023 - 43
IEEE Circuits and Systems Magazine - Q1 2023 - 44
IEEE Circuits and Systems Magazine - Q1 2023 - 45
IEEE Circuits and Systems Magazine - Q1 2023 - 46
IEEE Circuits and Systems Magazine - Q1 2023 - 47
IEEE Circuits and Systems Magazine - Q1 2023 - 48
IEEE Circuits and Systems Magazine - Q1 2023 - 49
IEEE Circuits and Systems Magazine - Q1 2023 - 50
IEEE Circuits and Systems Magazine - Q1 2023 - 51
IEEE Circuits and Systems Magazine - Q1 2023 - 52
IEEE Circuits and Systems Magazine - Q1 2023 - 53
IEEE Circuits and Systems Magazine - Q1 2023 - 54
IEEE Circuits and Systems Magazine - Q1 2023 - 55
IEEE Circuits and Systems Magazine - Q1 2023 - 56
IEEE Circuits and Systems Magazine - Q1 2023 - 57
IEEE Circuits and Systems Magazine - Q1 2023 - 58
IEEE Circuits and Systems Magazine - Q1 2023 - 59
IEEE Circuits and Systems Magazine - Q1 2023 - 60
IEEE Circuits and Systems Magazine - Q1 2023 - 61
IEEE Circuits and Systems Magazine - Q1 2023 - 62
IEEE Circuits and Systems Magazine - Q1 2023 - 63
IEEE Circuits and Systems Magazine - Q1 2023 - 64
IEEE Circuits and Systems Magazine - Q1 2023 - 65
IEEE Circuits and Systems Magazine - Q1 2023 - 66
IEEE Circuits and Systems Magazine - Q1 2023 - 67
IEEE Circuits and Systems Magazine - Q1 2023 - 68
IEEE Circuits and Systems Magazine - Q1 2023 - 69
IEEE Circuits and Systems Magazine - Q1 2023 - 70
IEEE Circuits and Systems Magazine - Q1 2023 - 71
IEEE Circuits and Systems Magazine - Q1 2023 - 72
IEEE Circuits and Systems Magazine - Q1 2023 - 73
IEEE Circuits and Systems Magazine - Q1 2023 - 74
IEEE Circuits and Systems Magazine - Q1 2023 - 75
IEEE Circuits and Systems Magazine - Q1 2023 - 76
IEEE Circuits and Systems Magazine - Q1 2023 - 77
IEEE Circuits and Systems Magazine - Q1 2023 - 78
IEEE Circuits and Systems Magazine - Q1 2023 - 79
IEEE Circuits and Systems Magazine - Q1 2023 - 80
IEEE Circuits and Systems Magazine - Q1 2023 - 81
IEEE Circuits and Systems Magazine - Q1 2023 - 82
IEEE Circuits and Systems Magazine - Q1 2023 - 83
IEEE Circuits and Systems Magazine - Q1 2023 - 84
IEEE Circuits and Systems Magazine - Q1 2023 - 85
IEEE Circuits and Systems Magazine - Q1 2023 - 86
IEEE Circuits and Systems Magazine - Q1 2023 - 87
IEEE Circuits and Systems Magazine - Q1 2023 - 88
IEEE Circuits and Systems Magazine - Q1 2023 - Cover3
IEEE Circuits and Systems Magazine - Q1 2023 - Cover4
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2023Q3
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2023Q2
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2023Q1
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2022Q4
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2022Q3
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2022Q2
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2022Q1
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2021Q4
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2021q3
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2021q2
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2021q1
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2020q4
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2020q3
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2020q2
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2020q1
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2019q4
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2019q3
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2019q2
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2019q1
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2018q4
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2018q3
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2018q2
https://www.nxtbook.com/nxtbooks/ieee/circuitsandsystems_2018q1
https://www.nxtbookmedia.com