IEEE Circuits and Systems Magazine - Q1 2023 - 50

two-dimensional case is only found in connectors to describe
contact surfaces.
1) One-Dimensional Case: The reader may notice
that in fact we already used the finite-volume approach,
thanks to its intuitiveness, when modeling
the rod of Section V-A. In the more general
case where fluid motion is present, like in pipes,
one can resort to a scheme like the one in Fig. 6.
In the shown example, a pipe is represented by a sequence
of storage elements, summing up to the entire
volume of the pipe, alternated with transfer elements to
model the transport of fluid along the pipe. Fig. 6 also
comprehends the pipe wall, in the form of a sequence of
(solid) storage elements with one side exchanging heat
with the fluid, and the other exposed with a VHP connector
to the outside environment. It is worth noticing
that the structure in Fig. 6 does not depend on the internals
of the composing elements taken from Fig. 5, hence
being general with respect to the involved substances
property calculation and to the used exchange correlations.
This is another example of how EBM relieves the
analyst from repetitive and error-prone modeling tasks.
2) Three-Dimensional Case: This is typically seen
when modeling temperature distributions in solids,
that adopting the finite-volume approach are
decomposed into parallelepiped elements. For
simplicity we discuss here the uniform grid case,
i.e., all the elements have the same size: generalization
to structured grids is straightforward but
would add further complexity and obfuscate the
concepts being presented.
Though model optimization is beyond the scope of
this tutorial, we have to notice here that a naïve modeling
approach would impact computational efficiency up
to a relevant extent. We thus first show the most natural
and human-readable way to proceed, then explain why
with present Modelica tools this produces inefficient
code, and finally suggest a (less readable) efficient modeling
alternative, to be preferred until compilers evolve
to close the evidenced gap.
The most human-readable approach to finite-volume
3D discretisation consists of first creating a model of
the individual volume with connectors on each side, as
shown in Fig. 7 , and then building a 3D array of such
models, using for loops with connect statements. For
the individual volume, denoting by T the temperature of
one such element, by ℓx, ℓy and ℓx its dimensions along
the three Cartesian axes, and by the subscripts top,
bottom, left, right, front and rear the six heat ports
HPf for its faces, one gets to the model
ρcTTHPQ
HP TT GHPQ
()  =∑ =
=+
Gf =







λ
λ

λ
ff f
()
()
.
..
{, ,, ,, }
Tf to bo
T


xy

05
()
z
yz
0.5x

05
.
xz
y
,{ ,}fleri
=
Tf fr re
=
(31)
,{ ,}
where c and λ are respectively the material specific heat
and thermal conductivity, possibly temperature-dependent,
while the density ρ is taken as constant. Center
to face conductances are here approximated assuming
a planar geometry, which is acceptable for the typical
purposes of our models; of course more precise approximations
could be used without impairing the structure
of the model and the consequent modularity.
Once the element is described as per (31), constructing
a parallelepiped solid just amounts to connect elements
via three sets of three nested for loops each,
using connect statements to link volumes with their
=
.
ftobolerifrref flow
=
flow,{, ftobolerifrre
,{ ,}
,, ,, ,}
Figure 6. One-dimensional exchanging fluid stream, modeled
as a series of alternating storage and transfer components,
with containment wall; see Fig. 5 for the definition of
component types and their roles.
50
IEEE CIRCUITS AND SYSTEMS MAGAZINE
Figure 7. Basic building block of a naïve spatial discretisation.
Finite volume model with six thermal ports.
FIRST QUARTER 2023

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