def ideal_gas(phase,
              pore_pressure='pore.pressure',
              pore_temperature='pore.temperature',
              **kwargs):
    r"""
    Uses ideal gas law to calculate the molar density of an ideal gas

    Parameters
    ----------
    phase : OpenPNM Phase Object
        The Phase object for which these values are being calculated.  This
        controls the length of the calculated array, and also provides access
        to other necessary thermofluid properties.

    pore_temperature : string
        The dictionary key containing the density in kg/m3

    pore_pressure : string
        The dictionary key containing the pressure values in Pascals (Pa)

    Returns
    -------
    rho, the density in [mol/m3]

    Notes
    -----
    This method uses the SI value for the ideal gas constant, hence the need to
    provide the temperature and pressure in SI.  In general, OpenPNM use SI
    throughout for consistency.

    """
    R = 8.31447
    P = phase[pore_pressure]
    T = phase[pore_temperature]
    value = P/(R*T)
    return value
dataset/ETHPy150Open PMEAL/OpenPNM/OpenPNM/Phases/models/molar_density.py/ideal_gas/original