where $V$ is volume and $M$ is mass, and subscripts are for the different components, specifically liquid, $L$, ice, $I$, soil solid matter, $S$, and gas, $G$. The density of a component, $\rho_i$ is
$$\rho_i=\frac{M_i}{V_i}$$
Volume fractions
Let $\theta_i$ represent the volume of a given component $i$ (where ice, liquid, etc, are the components) per volume, so
$$\theta_i=\frac{V_i}{V}$$
Mass fractions
Let $m_i$ represent the mass of a given component, $i$, per volume. Then
$$m_i=\frac{M_i}{V}=\rho_i\theta_i$$
Mass balance
We assume we are dealing with a closed system with respect to water - so there is no inflow or outflow. The continuity equation is:
$$\Delta M = 0$$
Therefore we have
$$\Delta(M_I+M_L+M_S+M_G)=0$$
We know that $M_S$ is constant, hence $\Delta M_S=0$. We assume that $M_G\approx0$, so $\Delta M_G=0$. Therefore
This is the mass balance equation for the situation where the water doesn't move.
Energy balance
Let $U$ (J) be the internal energy of the control volume, and $u$ (J/m$^3$) be the internal energy per unit volume. The change in internal energy is due to the exchange of energy (heat) with the surroundings. The incoming heat flux in the vertical direction is $H_{in}$ and the outgoing heat flux in the vertical direction is $H_{out}=H_{in}+\Delta H$, (both in J/m$^2$/s). Then
$$\Delta U =V\Delta u= -\Delta H\Delta x \Delta y \Delta t$$
We now have to deal with the left hand side, that is the changes in internal energy, and the right hand side, that is the net addition, or removal, of heat. These can be treated separately.
Net exchange of heat
Since we are neglecting the movement of water, we can ignore advection and have heat transport only by diffusion. Diffusive transport is described by Fick's first law
$$H=-D\frac{dT}{dz}$$
And the right hand side of the continuity equation is simply Fick's second law, which is
The internal energy takes an arbitrary value - we are only interested in relative changes in energy. Changes in energy are due to sensible and latent heat. Internal energy associated with sensible heat, $U_{SEN}$ (J) or $u_{SEN}$ (J/m$^3$), is the energy stored in a material as a function of it's temperature, such that
where $C$ is the specific heat capacity (J/kg/K - i.e. the energy per mass per degree). Note that the specific heat can, in general, change due to a change in temperature, $T$, or due to a change in amount of a component, $m$, or both.
Internal energy associated with latent heat, $U_{LAT}$ (J) or $u_{LAT}$ (J/m$^3$), is the energy stored in a material as a function of the structure of the molecules, with solids having less internal energy than liquids and liquids having less internal energy than gases. Changes in internal energy associated with latent heat occur when a material changes phase, and is given by
$$\Delta U_{LAT}=\Delta(\lambda M)$$
or
$$\Delta u_{LAT}=\Delta(\lambda m)$$
Changes in interal energy in the soil control volume
Since the soil has four components, and three of these are dynamic, the change in internal energy can be written:
Now, since we have no phase change associated with the soil solids or the gas (in this case), we can ignore the last two terms. We can also make the important assumption that the components of our soil are all in thermal equilibrium, hence
(Note, do the last two terms above explain why the apparent latent heat capacity is a function of temperature? Maybe.)
At this point, if we examine the equation above, we are left with the question, how can we know how a certain amount of net energy exchange (i.e. from the diffusion equation above) is partitioned between changes in sensible and latent heat. I'm not sure that there is a completely rigorous solution beyond this point for the general case. However, we will now make a simplifying assumption - that is, assume that the soil is completely saturated.
Changes in internal energy in a saturated soil
The change in internal energy for a saturated (with liquid or ice) soil is now given by
Now, we also know that due to freezing point depression, we have a relationship between the liquid water content, $\theta_L$ and the temperature. Lets assume that this is
$$\theta_L=f(T)$$
Hence
$$\frac{d\theta_L}{dT}=f'(T)$$
where $f(T)$ and $f'(T)$ are parametric expressions. Now we can write