## 5.22Solving for energy

Examples with energy conservation in this chapter assume is constant to produce the transport equation for in Eq. (2.65 ). When cannot be assumed to be constant, it is common to solve an equation for internal energy instead, e.g. Eq. (2.60 ) with the material derivative replaced using Eq. (2.14 ) (5.39)
This equation can be discretised to form a matrix equation , from which can be solved. The challenge is that the diﬀusion term is not expressed in terms of , so is discretised explicitly, which adversely aﬀects convergence.

To improve convergence, an implicit term is introduced which is similar in form and scale to the problem term. For energy Eq. (5.39 ), we use , where the diﬀusivity is calculated from the function of .

The extra term is both “added and subtracted” in implicit and explicit form. This has the eﬀect of increasing the contributions to matrix coeﬃcients, while cancelling out a large part of the explicit contribution from , as illustrated below The overall solution procedure involves ﬁrst updating from from thermodynamic relationships, e.g. Eq. (2.62 ). The equation for is then solved, and the subsequent solution for is converted back to .

If is expressed as a polynomial function of , Eq. (2.64 ), then is converted to using the analytical integral of Eq. (2.62 ) (5.40)

### From temperature to energy

The conversion from to is more complex because cannot be made the subject of Eq. (5.40). Instead, it can be “inverted” using an iterative scheme such as the Newton-Raphson method,8 which for this problem is: (5.41) is updated from the current using the evaluated and polynomials, Eq. (5.40 ) and Eq. (2.64 ), respectively. One iteration is often suﬃcient for the error to fall within a prescribed tolerance, but further iterations of Eq. (5.41) can be applied if necessary.

### Boundary conditions

The boundary conditions for the energy equation are generally speciﬁed in terms of . But since they must be applied to the variable being solved, they must be reposed in terms of . A ﬁxed value condition is converted to an equivalent condition , e.g. by Eq. (5.40 ). A ﬁxed gradient condition for is converted to a ﬁxed gradient for by (5.42)

8Isaac Newton,De analysi per aequationes numero terminorum inﬁnitas, 1669 and Joseph Raphson, Analysis aequationum universalis, 1690.

Notes on CFD: General Principles - 5.22 Solving for energy 