Home > Legacy archive > Specific versions > FARGO-AD > **Energy equation solver**

The numerical integration is done in function

`AlgoGas`

, in SourceEuler.c. All functions or routines mentioned in this section are part of SourceEuler.c, unless otherwise stated.
{{Source terms}}
First, FARGO solves . This is done in `substep3`

. We briefly describe how this new substep is incorporated in `AlgoGas`

. We denote with a superscript the gas quantities at a given time :
(a) calculation of the sound speed with function `ComputeSoundSpeed`

: . This is necesary to calculate the timestep .
(b) calculation of the pressure with function `ComputePressureField`

: . This is necesary to solve Navier-Stokes equation.
(c) `substep1`

: the radial and azimuthal velocities and are updated with the source terms of the Navier-Stokes equation. This yields and .
(d) `substep2`

: , and are updated with some artificial viscosity. This yields , and .
(e) `substep3`

: is updated with the source term of the energy equation. This is done by a predictor-corrector scheme [[Stone, J. M., & Norman, M. L. 1992, ApJS, 80, 753]]:
with . Then:
where .
{{2 - Advective transport}}
The advective transport step is described in Stone & Norman (1992). We plot in the following figure the result of the 1D Sod test.