taken into account are hydrodynamic advection, eddy and molecular diffusion, and chemistry, including neutral and ion chemistry and XUV driven photochemistry. In total, 223 chemical reactions, including 32 photoreactions, are considered, and the gas is composed of 33 chemical species of which 14 are ions. The chemistry is solved in a time-dependent way with no assumption of chemical equilibrium. The full set of hydrodynamic equations are solved using the explicit scheme described in @Kaeppeli16. This scheme is ‘well-balanced’, and can therefore accurately calculate the structure of an atmosphere that is in hydrostatic equilibrium. The evolution of the thermal structure of the atmosphere is described by Eqn. \[eqn:main\_energy\]. The processes taken into account are hydrodynamic advection, heating by stellar XUV and infrared radiation, cooling by the emission of radiation to space, and thermal conduction. The effects of adiabatic cooling are present in the model. A strength of my model is the calculation of the heating rate, which is done from first-principles without the use of arbitrary free parameters such as the heating efficiency. The XUV heating model includes the effects of direct heating by absorbed XUV photons, energy released by exothermic chemical reactions, and heating of thermal electrons by collisions with 