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?