# Energy Equation

Energy equation in nanoFluidX is implemented so that it accommodates for conduction and convection heat transfer with initial or Dirichlet boundary conditions.

The rate of temperature change of a specific material is given by:

$$\frac{dT}{dt}=\frac{1}{{c}_{p}\rho}\nabla \left(\text{\kappa}\nabla T\right)$$

Where,- $t$
- Time
- $T$
- Temperature
- $k$
- Coefficient of thermal conductivity
- $\rho $
- Density
- ${c}_{p}$
- Specific heat capacity of the material

In SPH form the above analytic expression becomes:

$${\left(\frac{dT}{dt}\right)}_{i}=\frac{1}{{c}_{p,i}}{\displaystyle \sum}_{j}\frac{4{m}_{j}}{{\rho}_{i}{\rho}_{j}}\frac{{\kappa}_{i}{\kappa}_{j}}{{\kappa}_{i}+{\kappa}_{j}}{T}_{ij}\frac{\nabla {W}_{ij}}{\left|{r}_{ij}\right|}\cdot n$$

Where,- $i$ and $j$ indices
- Stand for owner and neighboring particles respectively
- $\mathrm{ij}$ index
- Difference between the respective variables of particle $i$ and particle $j$
- $m$
- Mass of particle
- $\nabla W$
- Gradient of the kernel
- $r$
- Position vector
- $n$
- Unit coordinate vector

If you want to use the energy transport option, you need to turn the feature on by
setting the `energy_transport` flag in Simulation parameters to
true. Once this step is completed, you can opt for desired output, which can be
either temperature or rate of temperature change (flux). The code will not work if
an output is required and the energy transport flag is turned off.

Finally, set up the phase parameters, which are initial temperature
(

`temp_0`) in [K], evolve temperature flag (`evolve_temp`), specific heat capacity of the material (`heat_cap`) in [J/kg/K] and heat conduction coefficient of the material (`heat_cond`) in [W/m/K].Note: Regarding the

`evolve_temp`flag, this parameter is valid only for WALL or MOVINGWALL phases. If the`evolve_temp`flag is set to false, or if it is not defined (default is false), the set initial temperature will remain constant throughout the simulation. If set to true, the initial temperature will evolve in time and the temperature of the WALL or MOVINGWALL will be influenced by any surrounding phase. For FLUID phases, the temperature always evolves.