Fundamental equation of thermodynamics for magnetocaloric materials The fundamental equation of thermodynamics, as us chemists (and chemical engineers!) are used to seeing it, is 

$$ dG = - S~dT + V~dP + \sum_{i}\mu_i~dN_i$$

This gives the Gibbs free energy as a function of temperature, pressure, and composition, assuming there are no other relevant forces other than mechanical pressure.  

The other day I watched a video on the magnetocaloric effect.  Obviously, there are non-pressure magnetic forces acting in such systems.  What's the proper form of the fundamental equation for magnetocaloric materials?  

Suppose that the magnetocaloric material used is chemically pure and non-reactive during the magnetization process.  Then we could get rid of the $\sum_{i}\mu_i~dN_i$ term.  I suppose its also reasonable to assume that pressure is constant during magnetization / demagnetization process, and that the volume of the material is unchanged by magnetization so probably we could dispense with the $V~dP$ term as well (is that true?). 

That leaves us with $dG = -S~dT + \rm{MAGNETIC~STUFF}$.  The $\rm{MAGNETIC ~STUFF}$ term probably has a $B$ or $H$ or something like that in it to represent the imposed magnetic field, but what else goes in there?
The fundamental equation for paramagnetic system is as follows
$$dU=TdS+BdM+\mu dN$$
Where B is the external magnetic field intensity and M is the magnetic moment (Here I have neglected the P-V work of the system). For your chemically pure and non-reactive system the above equation simplifies to
$$dU=TdS+BdM$$
Using Legendre Transformations:
$$y(0)=U(S,M)$$
$$dy(0)=dU=TdS+BdM$$
$$dy(1)=dA(T,M)=-SdT+BdM$$
$$dy(2)=dG(T,B)=-SdT-MdB$$ 
Now changing the order of the equation, we can find enthalpy,
$$y(0)=U(M,S)$$
$$dy(0)=dU=BdM+TdS$$
$$dy(1)=dH(S,B)=-MdB+TdS$$