Similar to , the wellbore elements are evaluated numerically, with pressure (Equation ) and energy (Equation ) balances across each element, where ∆𝑧 is the change in element elevation, ∆𝑃 𝐿𝑜𝑠𝑠 is the pipe frictional loss, ℎ is the enthalpy, 𝑄 𝐿𝑜𝑠𝑠 is the heat exchange to the surroundings, 𝑚̇ is the fluid mass flowrate, and an "i" subscript indicates the value at the ith element. The pressure loss equation is identical to , while the energy equation includes the new heat exchange term.