There are different way to use non-ideal formulation, you can use formulation of yourself as variable or in blank material or even if its in its list use thermodynamic properties option or material library.
To make clear what this question is about: it is about real gases, not ideal gases. Comsol library models do not handle that by default, so the links given above do not add any value here.
Near critical point (high pressures & temperatures, gases and liquids do not behave as ideal gases anymore, for instance surface tension effects do not exist)
I know its not Comsol, but Ansys seems to have such capabilities build-in, which could be integrated into Comsol relatively easily (since it's simple to add own materials and equations). See this link