Modelling of Energy in Transit Using Python
Modelling of Energy in Transit Using Python
ISSN No:-2456-2165
Abstract:- In this paper, an attempt has been made to on the direction, the work can be done by or on the system.
develop a Python module for evaluating energy in transit The former is considered positive, whereas the latter is
(viz., heat and work). The work considered in this article considered negative. Work is a path function because it not
is non-dissipative displacement work. Functions for only depends on the initial and final state but also on the path
constant pressure, volume, and temperature were followed between two states. The work can further be divided
developed, along with adiabatic and polytropic processes. into many parts; one such category of work is non-
Also, the sensible and latent heat were also transformed dissipative/displacement work. For a closed system, it's the
into functions. The modules NumPy and Matplotlib were area under the 𝑝 − 𝑣 graph as this is non-dissipative, so the
used to perform the stipulated task. The correctness of path is quasistatic/reversible.
codes was checked against four different numerical
problems, and it has been observed that the program For a general polytropic process represented by process
results match exactly with the results in the literature. As 𝑛
𝑝𝑣 = 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡, the work done depends on the index 𝑛.
a result, the developed functions thus developed have
shown high accuracy with the least effort and error in all Fig. 1. Shows the impact of the variation of 𝑛 on the area under
the cases. the curve (work done by a closed system), whereas Table 1.
tells about the different processes based on the index 𝑛.
Keywords:- Energy in Transit; Thermodynamic Processes;
Heat; Work; Python Programming; NumPy; Matplotlib. TABLE I: Index 𝑛 and its equivalent process [1]
n Process 𝒑 − 𝒗 relation
I. INTRODUCTION 0 Isobaric process (p=constant) 𝑝=𝑐
1 Isothermal process for an ideal 𝑝𝑣 = 𝑐
The concept of energy in transit describes that the system gas (T=constant)
cannot store the energy in the form of work or heat it will be 1.4 Adiabatic process (no heat 𝑝𝑣 𝛾 = 𝑐
in a transition state, which means there will be an interaction interaction)
between the system and its surroundings. Here mainly ∞ Isochoric process (constant 𝑣=𝑐
discussion of work and heat interactions between the system volume)
and surroundings for a closed system has been done. In this
closed system, there will be a energy transfer, but no mass The general procedure is to integrate the process from
transfer occurs. On the other hand, in an open system, there some initial state to the final state to obtain the work
will be a transfer of mass; as the mass is being transferred, interaction, as shown in Eq. (1). Therefore, the final
there won't be a fixed amount of matter to gain or lose energy. expressions of work interaction in all the processes are listed
in Table 2.
2
𝑊 = ∫1 𝑝𝑑𝑣
(1)
Polytropic process 𝑝1 𝑣1 − 𝑝2 𝑣2
(𝑝𝑣 𝑛 = 𝑐) 𝑛−1
Fig. 1: Variation of closed system work as a function of
index 𝑛 . Adiabatic process (𝑝𝑣 𝛾 = 𝑝1 𝑣1 − 𝑝2 𝑣2
𝑐) 𝛾−1
Thermodynamic work is said to be done by a system if
the sole effect on the things external to the system can be Isochoric process (𝑣 = 𝑐) 0
reduced to raising weight [1]. The weight may not be raised in
actual cases by the effect can be that of raising weights. Based
v=linspace(v2,v3,30)
c=p2*v2**n
p=c/v**n