Thermodynamical properties of planetary fluid envelopes