Diffusion and thermal diffusion in partially ionized gases in the atmospheres of the Sun and planets