#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES).
#
# Copyright (c) 2018-2024 by the software owners: The Regents of the
# University of California, through Lawrence Berkeley National Laboratory,
# National Technology & Engineering Solutions of Sandia, LLC, Carnegie Mellon
# University, West Virginia University Research Corporation, et al.
# All rights reserved.  Please see the files COPYRIGHT.md and LICENSE.md
# for full copyright and license information.
#################################################################################
"""Information about units of measure and mapping between Pyomo function names
and external function names.
"""

__author__ = "John Eslick"

from pyomo.environ import units as pu

external_function_map = {
    # Thermo properties as a function of delta and tau
    "p_func": {  # pressure
        "fname": "p",
        "units": pu.kPa,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "p(comp, delta, tau)",
    },
    "u_func": {  # internal energy
        "fname": "u",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "u(comp, delta, tau)",
    },
    "s_func": {  # entropy
        "fname": "s",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "s(comp, delta, tau)",
    },
    "h_func": {  # enthalpy
        "fname": "h",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "h(comp, delta, tau)",
    },
    "g_func": {  # Gibbs free energy
        "fname": "g",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "g(comp, delta, tau)",
    },
    "f_func": {  # Helmholtz free energy
        "fname": "f",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "f(comp, delta, tau)",
    },
    "cv_func": {  # constant volume heat capacity
        "fname": "cv",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "cv(comp, delta, tau)",
    },
    "cp_func": {  # constant pressure heat capacity
        "fname": "cp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "cp(comp, delta, tau)",
    },
    "w_func": {  # speed of sound
        "fname": "w",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "w(comp, delta, tau)",
    },
    "v_func": {  # specific volume
        "fname": "v",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "v(comp, delta, tau)",
    },
    "mu_func": {  # viscosity
        "fname": "mu",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "mu(comp, delta, tau)",
    },
    "lambda_func": {  # thermal conductivity
        "fname": "lambda",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "lambda(comp, delta, tau)",
    },
    "sigma_func": {  # surface tension
        "fname": "sigma",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "sigma(comp, delta, tau)",
    },
    # Functions of (h, p)
    "t_hp_func": {  # temperature
        "fname": "T_hp",
        "units": pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "T(comp, enthalpy, pressure)",
    },
    "tau_hp_func": {  # Tc/T
        "fname": "tau_hp",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "tau(comp, enthalpy, pressure)",
    },
    "vf_hp_func": {  # vapor fraction
        "fname": "vf_hp",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "vf(comp, enthalpy, pressure)",
    },
    "u_hp_func": {  # internal energy
        "fname": "u_hp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "u(comp, enthalpy, pressure)",
    },
    "s_hp_func": {  # entropy
        "fname": "s_hp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "s(comp, enthalpy, pressure)",
    },
    "g_hp_func": {  # Gibbs free energy
        "fname": "g_hp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "g(comp, enthalpy, pressure)",
    },
    "f_hp_func": {  # Helmholtz free energy
        "fname": "f_hp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "f(comp, enthalpy, pressure)",
    },
    "cv_hp_func": {  # constant volume heat capacity
        "fname": "cv_hp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cv(comp, enthalpy, pressure)",
    },
    "cp_hp_func": {  # constant pressure heat capacity
        "fname": "cp_hp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cp(comp, enthalpy, pressure)",
    },
    "w_hp_func": {  # speed of sound
        "fname": "w_hp",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "w(comp, enthalpy, pressure)",
    },
    "v_hp_func": {  # specific volume
        "fname": "v_hp",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "v(comp, enthalpy, pressure)",
    },
    "mu_hp_func": {  # viscosity
        "fname": "mu_hp",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "mu(comp, enthalpy, pressure)",
    },
    "lambda_hp_func": {  # thermal conductivity
        "fname": "lambda_hp",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "lambda(comp, enthalpy, pressure)",
    },
    "sigma_hp_func": {  # surface tension
        "fname": "sigma_hp",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "sigma(comp, enthalpy, pressure)",
    },
    "h_vap_hp_func": {  # vapor enthalpy
        "fname": "h_vap_hp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "h_vap(comp, enthalpy, pressure)",
    },
    "u_vap_hp_func": {  # internal energy
        "fname": "u_vap_hp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "u_vap(comp, enthalpy, pressure)",
    },
    "s_vap_hp_func": {  # entropy
        "fname": "s_vap_hp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "s_vap(comp, enthalpy, pressure)",
    },
    "g_vap_hp_func": {  # Gibbs free energy
        "fname": "g_vap_hp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "g_vap(comp, enthalpy, pressure)",
    },
    "f_vap_hp_func": {  # Helmholtz free energy
        "fname": "f_vap_hp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "f_vap(comp, enthalpy, pressure)",
    },
    "cv_vap_hp_func": {  # constant volume heat capacity
        "fname": "cv_vap_hp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cv_vap(comp, enthalpy, pressure)",
    },
    "cp_vap_hp_func": {  # constant pressure heat capacity
        "fname": "cp_vap_hp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cp_vap(comp, enthalpy, pressure)",
    },
    "w_vap_hp_func": {  # speed of sound
        "fname": "w_vap_hp",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "w_vap(comp, enthalpy, pressure)",
    },
    "v_vap_hp_func": {  # specific volume
        "fname": "v_vap_hp",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "v_vap(comp, enthalpy, pressure)",
    },
    "mu_vap_hp_func": {  # viscosity
        "fname": "mu_vap_hp",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "mu_vap(comp, enthalpy, pressure)",
    },
    "lambda_vap_hp_func": {  # thermal conductivity
        "fname": "lambda_vap_hp",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "lambda_vap(comp, enthalpy, pressure)",
    },
    "sigma_vap_hp_func": {  # surface tension
        "fname": "sigma_vap_hp",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "sigma_vap(comp, enthalpy, pressure)",
    },
    "h_liq_hp_func": {  # liquid enthalpy
        "fname": "h_liq_hp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "h_liq(comp, enthalpy, pressure)",
    },
    "u_liq_hp_func": {  # internal energy
        "fname": "u_liq_hp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "u_liq(comp, enthalpy, pressure)",
    },
    "s_liq_hp_func": {  # entropy
        "fname": "s_liq_hp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "s_liq(comp, enthalpy, pressure)",
    },
    "g_liq_hp_func": {  # Gibbs free energy
        "fname": "g_liq_hp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "g_liq(comp, enthalpy, pressure)",
    },
    "f_liq_hp_func": {  # Helmholtz free energy
        "fname": "f_liq_hp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "f_liq(comp, enthalpy, pressure)",
    },
    "cv_liq_hp_func": {  # constant volume heat capacity
        "fname": "cv_liq_hp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cv_liq(comp, enthalpy, pressure)",
    },
    "cp_liq_hp_func": {  # constant pressure heat capacity
        "fname": "cp_liq_hp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cp_liq(comp, enthalpy, pressure)",
    },
    "w_liq_hp_func": {  # speed of sound
        "fname": "w_liq_hp",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "w_liq(comp, enthalpy, pressure)",
    },
    "v_liq_hp_func": {  # specific volume
        "fname": "v_liq_hp",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "v_liq(comp, enthalpy, pressure)",
    },
    "mu_liq_hp_func": {  # viscosity
        "fname": "mu_liq_hp",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "mu_liq(comp, enthalpy, pressure)",
    },
    "lambda_liq_hp_func": {  # thermal conductivity
        "fname": "lambda_liq_hp",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "lambda_liq(comp, enthalpy, pressure)",
    },
    "sigma_liq_hp_func": {  # surface tension
        "fname": "sigma_liq_hp",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "sigma_liq(comp, enthalpy, pressure)",
    },
    # Functions of (s, p)
    "t_sp_func": {  # temperature
        "fname": "T_sp",
        "units": pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "T(comp, entropy, pressure)",
    },
    "tau_sp_func": {  # Tc/T
        "fname": "tau_sp",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "tau(comp, entropy, pressure)",
    },
    "vf_sp_func": {  # vapor fraction
        "fname": "vf_sp",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "vf(comp, entropy, pressure)",
    },
    "u_sp_func": {  # internal energy
        "fname": "u_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "u(comp, entropy, pressure)",
    },
    "h_sp_func": {  # enthalpy
        "fname": "h_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "h(comp, entropy, pressure)",
    },
    "g_sp_func": {  # Gibbs free energy
        "fname": "g_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "g(comp, entropy, pressure)",
    },
    "f_sp_func": {  # Helmholtz free energy
        "fname": "f_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "f(comp, entropy, pressure)",
    },
    "cv_sp_func": {  # constant volume heat capacity
        "fname": "cv_sp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "cv(comp, entropy, pressure)",
    },
    "cp_sp_func": {  # constant pressure heat capacity
        "fname": "cp_sp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "cp(comp, entropy, pressure)",
    },
    "w_sp_func": {  # speed of sound
        "fname": "w_sp",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "w(comp, entropy, pressure)",
    },
    "v_sp_func": {  # specific volume
        "fname": "v_sp",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "v(comp, entropy, pressure)",
    },
    "mu_sp_func": {  # viscosity
        "fname": "mu_sp",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "mu(comp, entropy, pressure)",
    },
    "lambda_sp_func": {  # thermal conductivity
        "fname": "lambda_sp",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "lambda(comp, entropy, pressure)",
    },
    "sigma_sp_func": {  # surface tension
        "fname": "sigma_sp",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "sigma(comp, entropy, pressure)",
    },
    "s_vap_sp_func": {  # vapor entropy
        "fname": "s_vap_sp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "s_vap(comp, entropy, pressure)",
    },
    "u_vap_sp_func": {  # internal energy
        "fname": "u_vap_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "u_vap(comp, entropy, pressure)",
    },
    "h_vap_sp_func": {  # enthalpy
        "fname": "h_vap_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "h_vap(comp, entropy, pressure)",
    },
    "g_vap_sp_func": {  # Gibbs free energy
        "fname": "g_vap_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "g_vap(comp, entropy, pressure)",
    },
    "f_vap_sp_func": {  # Helmholtz free energy
        "fname": "f_vap_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "f_vap(comp, entropy, pressure)",
    },
    "cv_vap_sp_func": {  # constant volume heat capacity
        "fname": "cv_vap_sp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "cv_vap(comp, entropy, pressure)",
    },
    "cp_vap_sp_func": {  # constant pressure heat capacity
        "fname": "cp_vap_sp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "cp_vap(comp, entropy, pressure)",
    },
    "w_vap_sp_func": {  # speed of sound
        "fname": "w_vap_sp",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "w_vap(comp, entropy, pressure)",
    },
    "v_vap_sp_func": {  # specific volume
        "fname": "v_vap_sp",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "v_vap(comp, entropy, pressure)",
    },
    "mu_vap_sp_func": {  # viscosity
        "fname": "mu_vap_sp",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "mu_vap(comp, entropy, pressure)",
    },
    "lambda_vap_sp_func": {  # thermal conductivity
        "fname": "lambda_vap_sp",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "lambda_vap(comp, entropy, pressure)",
    },
    "sigma_vap_sp_func": {  # surface tension
        "fname": "sigma_vap_sp",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "sigma_vap(comp, entropy, pressure)",
    },
    "s_liq_sp_func": {  # liquid entropy
        "fname": "s_liq_sp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "s_liq(comp, entropy, pressure)",
    },
    "u_liq_sp_func": {  # internal energy
        "fname": "u_liq_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "u_liq(comp, entropy, pressure)",
    },
    "h_liq_sp_func": {  # enthalpy
        "fname": "h_liq_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "h_liq(comp, entropy, pressure)",
    },
    "g_liq_sp_func": {  # Gibbs free energy
        "fname": "g_liq_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "g_liq(comp, entropy, pressure)",
    },
    "f_liq_sp_func": {  # Helmholtz free energy
        "fname": "f_liq_sp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "f_liq(comp, entropy, pressure)",
    },
    "cv_liq_sp_func": {  # constant volume heat capacity
        "fname": "cv_liq_sp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "cv_liq(comp, entropy, pressure)",
    },
    "cp_liq_sp_func": {  # constant pressure heat capacity
        "fname": "cp_liq_sp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "cp_liq(comp, entropy, pressure)",
    },
    "w_liq_sp_func": {  # speed of sound
        "fname": "w_liq_sp",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "w_liq(comp, entropy, pressure)",
    },
    "v_liq_sp_func": {  # specific volume
        "fname": "v_liq_sp",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "v_liq(comp, entropy, pressure)",
    },
    "mu_liq_sp_func": {  # viscosity
        "fname": "mu_liq_sp",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "mu_liq(comp, entropy, pressure)",
    },
    "lambda_liq_sp_func": {  # thermal conductivity
        "fname": "lambda_liq_sp",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "lambda_liq(comp, entropy, pressure)",
    },
    "sigma_liq_sp_func": {  # surface tension
        "fname": "sigma_liq_sp",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg / pu.K, pu.kPa],
        "doc": "sigma_liq(comp, entropy, pressure)",
    },
    # Functions of (u, p)
    "t_up_func": {  # temperature
        "fname": "T_up",
        "units": pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "T(comp, internal energy, pressure)",
    },
    "tau_up_func": {  # Tc/T
        "fname": "tau_up",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "tau(comp, internal energy, pressure)",
    },
    "vf_up_func": {  # vapor fraction
        "fname": "vf_up",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "vf(comp, internal energy, pressure)",
    },
    "h_up_func": {  # enthalpy
        "fname": "h_up",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "h(comp, internal energy, pressure)",
    },
    "s_up_func": {  # entropy
        "fname": "s_up",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "s(comp, internal energy, pressure)",
    },
    "g_up_func": {  # Gibbs free energy
        "fname": "g_up",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "g(comp, internal energy, pressure)",
    },
    "f_up_func": {  # Helmholtz free energy
        "fname": "f_up",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "f(comp, internal energy, pressure)",
    },
    "cv_up_func": {  # constant volume heat capacity
        "fname": "cv_up",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cv(comp, internal energy, pressure)",
    },
    "cp_up_func": {  # constant pressure heat capacity
        "fname": "cp_up",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cp(comp, internal energy, pressure)",
    },
    "w_up_func": {  # speed of sound
        "fname": "w_up",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "w(comp, internal energy, pressure)",
    },
    "v_up_func": {  # specific volume
        "fname": "v_up",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "v(comp, internal energy, pressure)",
    },
    "mu_up_func": {  # viscosity
        "fname": "mu_up",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "mu(comp, internal energy, pressure)",
    },
    "lambda_up_func": {  # thermal conductivity
        "fname": "lambda_up",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "lambda(comp, internal energy, pressure)",
    },
    "sigma_up_func": {  # surface tension
        "fname": "sigma_up",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "sigma(comp, internal energy, pressure)",
    },
    "u_vap_up_func": {  # vapor internal energy
        "fname": "u_vap_up",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "u_vap(comp, internal energy, pressure)",
    },
    "h_vap_up_func": {  # enthalpy
        "fname": "h_vap_up",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "h_vap(comp, internal energy, pressure)",
    },
    "s_vap_up_func": {  # entropy
        "fname": "s_vap_up",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "s_vap(comp, internal energy, pressure)",
    },
    "g_vap_up_func": {  # Gibbs free energy
        "fname": "g_vap_up",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "g_vap(comp, internal energy, pressure)",
    },
    "f_vap_up_func": {  # Helmholtz free energy
        "fname": "f_vap_up",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "f_vap(comp, internal energy, pressure)",
    },
    "cv_vap_up_func": {  # constant volume heat capacity
        "fname": "cv_vap_up",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cv_vap(comp, internal energy, pressure)",
    },
    "cp_vap_up_func": {  # constant pressure heat capacity
        "fname": "cp_vap_up",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cp_vap(comp, internal energy, pressure)",
    },
    "w_vap_up_func": {  # speed of sound
        "fname": "w_vap_up",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "w_vap(comp, internal energy, pressure)",
    },
    "v_vap_up_func": {  # specific volume
        "fname": "v_vap_up",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "v_vap(comp, internal energy, pressure)",
    },
    "mu_vap_up_func": {  # viscosity
        "fname": "mu_vap_up",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "mu_vap(comp, internal energy, pressure)",
    },
    "lambda_vap_up_func": {  # thermal conductivity
        "fname": "lambda_vap_up",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "lambda_vap(comp, internal energy, pressure)",
    },
    "sigma_vap_up_func": {  # surface tension
        "fname": "sigma_vap_up",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "sigma_vap(comp, internal energy, pressure)",
    },
    "u_liq_up_func": {  # liquid internal energy
        "fname": "u_liq_up",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "u_liq(comp, internal energy, pressure)",
    },
    "h_liq_up_func": {  # enthalpy
        "fname": "h_liq_up",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "h_liq(comp, internal energy, pressure)",
    },
    "s_liq_up_func": {  # entropy
        "fname": "s_liq_up",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "s_liq(comp, internal energy, pressure)",
    },
    "g_liq_up_func": {  # Gibbs free energy
        "fname": "g_liq_up",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "g_liq(comp, internal energy, pressure)",
    },
    "f_liq_up_func": {  # Helmholtz free energy
        "fname": "f_liq_up",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "f_liq(comp, internal energy, pressure)",
    },
    "cv_liq_up_func": {  # constant volume heat capacity
        "fname": "cv_liq_up",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cv_liq(comp, internal energy, pressure)",
    },
    "cp_liq_up_func": {  # constant pressure heat capacity
        "fname": "cp_liq_up",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "cp_liq(comp, internal energy, pressure)",
    },
    "w_liq_up_func": {  # speed of sound
        "fname": "w_liq_up",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "w_liq(comp, internal energy, pressure)",
    },
    "v_liq_up_func": {  # specific volume
        "fname": "v_liq_up",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "v_liq(comp, internal energy, pressure)",
    },
    "mu_liq_up_func": {  # viscosity
        "fname": "mu_liq_up",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "mu_liq(comp, internal energy, pressure)",
    },
    "lambda_liq_up_func": {  # thermal conductivity
        "fname": "lambda_liq_up",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "lambda_liq(comp, internal energy, pressure)",
    },
    "sigma_liq_up_func": {  # surface tension
        "fname": "sigma_liq_up",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.kJ / pu.kg, pu.kPa],
        "doc": "sigma_liq(comp, internal energy, pressure)",
    },
    # Functions of (T, p)
    "h_vap_tp_func": {  # enthalpy
        "fname": "h_vap_tp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "h_vap(comp, temperature, pressure)",
    },
    "u_vap_tp_func": {  # internal energy
        "fname": "u_vap_tp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "u_vap(comp, temperature, pressure)",
    },
    "s_vap_tp_func": {  # entropy
        "fname": "s_vap_tp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "s_vap(comp, temperature, pressure)",
    },
    "g_vap_tp_func": {  # Gibbs free energy
        "fname": "g_vap_tp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "g_vap(comp, temperature, pressure)",
    },
    "f_vap_tp_func": {  # Helmholtz free energy
        "fname": "f_vap_tp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "f_vap(comp, temperature, pressure)",
    },
    "cv_vap_tp_func": {  # constant volume heat capacity
        "fname": "cv_vap_tp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "cv_vap(comp, temperature, pressure)",
    },
    "cp_vap_tp_func": {  # constant pressure heat capacity
        "fname": "cp_vap_tp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "cp_vap(comp, temperature, pressure)",
    },
    "w_vap_tp_func": {  # speed of sound
        "fname": "w_vap_tp",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "w_vap(comp, temperature, pressure)",
    },
    "v_vap_tp_func": {  # specific volume
        "fname": "v_vap_tp",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "v_vap(comp, temperature, pressure)",
    },
    "mu_vap_tp_func": {  # viscosity
        "fname": "mu_vap_tp",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "mu_vap(comp, temperature, pressure)",
    },
    "lambda_vap_tp_func": {  # thermal conductivity
        "fname": "lambda_vap_tp",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "lambda_vap(comp, temperature, pressure)",
    },
    "sigma_vap_tp_func": {  # surface tension
        "fname": "sigma_vap_tp",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "sigma_vap(comp, temperature, pressure)",
    },
    "h_liq_tp_func": {  # enthalpy
        "fname": "h_liq_tp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "h_liq(comp, temperature, pressure)",
    },
    "u_liq_tp_func": {  # internal energy
        "fname": "u_liq_tp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "u_liq(comp, temperature, pressure)",
    },
    "s_liq_tp_func": {  # entropy
        "fname": "s_liq_tp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "s_liq(comp, temperature, pressure)",
    },
    "g_liq_tp_func": {  # Gibbs free energy
        "fname": "g_liq_tp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "g_liq(comp, temperature, pressure)",
    },
    "f_liq_tp_func": {  # Helmholtz free energy
        "fname": "f_liq_tp",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "f_liq(comp, temperature, pressure)",
    },
    "cv_liq_tp_func": {  # constant volume heat capacity
        "fname": "cv_liq_tp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "cv_liq(comp, temperature, pressure)",
    },
    "cp_liq_tp_func": {  # constant pressure heat capacity
        "fname": "cp_liq_tp",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "cp_liq(comp, temperature, pressure)",
    },
    "w_liq_tp_func": {  # speed of sound
        "fname": "w_liq_tp",
        "units": pu.m / pu.s,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "w_liq(comp, temperature, pressure)",
    },
    "v_liq_tp_func": {  # specific volume
        "fname": "v_liq_tp",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "v_liq(comp, temperature, pressure)",
    },
    "mu_liq_tp_func": {  # viscosity
        "fname": "mu_liq_tp",
        "units": pu.uPa * pu.s,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "mu_liq(comp, temperature, pressure)",
    },
    "lambda_liq_tp_func": {  # thermal conductivity
        "fname": "lambda_liq_tp",
        "units": pu.mW / pu.m / pu.K,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "lambda_liq(comp, temperature, pressure)",
    },
    "sigma_liq_tp_func": {  # surface tension
        "fname": "sigma_liq_tp",
        "units": pu.mN / pu.m,
        "arg_units": [pu.dimensionless, pu.K, pu.kPa],
        "doc": "sigma_liq(comp, temperature, pressure)",
    },
    # Dimensionless Helmholtz energy to calculate other thermo properties
    "phi0_func": {  # ideal part
        "fname": "phi0",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
        "doc": "phi0(comp, delta, tau)",
    },
    "phi0_d_func": {  # ideal part derivative wrt delta
        "fname": "phi0_d",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
    },
    "phi0_dd_func": {  # ideal part second derivative wrt delta
        "fname": "phi0_dd",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
    },
    "phi0_t_func": {  # ideal part derivative wrt tau
        "fname": "phi0_t",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
    },
    "phi0_dt_func": {  # ideal part second derivative wrt delta and tau
        "fname": "phi0_dt",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
    },
    "phi0_tt_func": {  # ideal part second derivative wrt tau
        "fname": "phi0_tt",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
    },
    "phir_func": {  # residual part
        "fname": "phir",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
    },
    "phir_d_func": {  # residual part derivative wrt delta
        "fname": "phir_d",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
    },
    "phir_dd_func": {  # residual part second derivative wrt delta
        "fname": "phir_dd",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
    },
    "phir_t_func": {  # residual part derivative wrt tau
        "fname": "phir_t",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
    },
    "phir_dt_func": {  # residual part second derivative wrt delta and tau
        "fname": "phir_dt",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
    },
    "phir_tt_func": {  # residual part second derivative wrt tau
        "fname": "phir_tt",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless, pu.dimensionless],
    },
    # Phase specific functions of pressure and tau
    "hvpt_func": {  # vapor enthalpy
        "fname": "hvpt",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kPa, pu.dimensionless],
        "doc": "h_v(p, tau)",
        "latex_symbol": "h_v",
    },
    "hlpt_func": {  # liquid enthalpy
        "fname": "hlpt",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kPa, pu.dimensionless],
    },
    "svpt_func": {  # vapor entropy
        "fname": "svpt",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kPa, pu.dimensionless],
    },
    "slpt_func": {  # liquid entropy
        "fname": "slpt",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kPa, pu.dimensionless],
    },
    "uvpt_func": {  # vapor internal energy
        "fname": "uvpt",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kPa, pu.dimensionless],
    },
    "ulpt_func": {  # liquid internal energy
        "fname": "ulpt",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kPa, pu.dimensionless],
    },
    "delta_liq_func": {  # liquid density
        "fname": "delta_liq",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.kPa, pu.dimensionless],
    },
    "delta_vap_func": {  # vapor density
        "fname": "delta_vap",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.kPa, pu.dimensionless],
    },
    # saturation curve as a function of tau
    "p_sat_func": {
        "fname": "p_sat",
        "units": pu.kPa,
        "arg_units": [pu.dimensionless, pu.dimensionless],
    },
    "delta_sat_v_func": {
        "fname": "delta_sat_v",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless],
    },
    "delta_sat_l_func": {
        "fname": "delta_sat_l",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.dimensionless],
    },
    # saturation curve as a function of T
    "p_sat_t_func": {
        "fname": "p_sat_t",
        "units": pu.kPa,
        "arg_units": [pu.dimensionless, pu.K],
    },
    "h_liq_sat_t_func": {
        "fname": "h_liq_sat_t",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K],
    },
    "h_vap_sat_t_func": {
        "fname": "h_vap_sat_t",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K],
    },
    "s_liq_sat_t_func": {
        "fname": "s_liq_sat_t",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.K],
    },
    "s_vap_sat_t_func": {
        "fname": "s_vap_sat_t",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.K],
    },
    "u_liq_sat_t_func": {
        "fname": "u_liq_sat_t",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K],
    },
    "u_vap_sat_t_func": {
        "fname": "u_vap_sat_t",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.K],
    },
    "v_liq_sat_t_func": {
        "fname": "v_liq_sat_t",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.K],
    },
    "v_vap_sat_t_func": {
        "fname": "v_vap_sat_t",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.K],
    },
    # saturation curve as a function of p
    "tau_sat_func": {
        "fname": "tau_sat",
        "units": pu.dimensionless,
        "arg_units": [pu.dimensionless, pu.kPa],
    },
    "t_sat_func": {
        "fname": "T_sat",
        "units": pu.K,
        "arg_units": [pu.dimensionless, pu.kPa],
    },
    "h_liq_sat_p_func": {
        "fname": "h_liq_sat_p",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kPa],
    },
    "h_vap_sat_p_func": {
        "fname": "h_vap_sat_p",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kPa],
    },
    "s_liq_sat_p_func": {
        "fname": "s_liq_sat_p",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kPa],
    },
    "s_vap_sat_p_func": {
        "fname": "s_vap_sat_p",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless, pu.kPa],
    },
    "u_liq_sat_p_func": {
        "fname": "u_liq_sat_p",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kPa],
    },
    "u_vap_sat_p_func": {
        "fname": "u_vap_sat_p",
        "units": pu.kJ / pu.kg,
        "arg_units": [pu.dimensionless, pu.kPa],
    },
    "v_liq_sat_p_func": {
        "fname": "v_liq_sat_p",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.kPa],
    },
    "v_vap_sat_p_func": {
        "fname": "v_vap_sat_p",
        "units": pu.m**3 / pu.kg,
        "arg_units": [pu.dimensionless, pu.kPa],
    },
    # Parameters (these functions take no arguments)
    "mw_func": {
        "fname": "mw",
        "units": pu.g / pu.mol,
        "arg_units": [pu.dimensionless],
    },
    "sgc_func": {
        "fname": "sgc",
        "units": pu.kJ / pu.kg / pu.K,
        "arg_units": [pu.dimensionless],
    },
    "t_star_func": {
        "fname": "t_star",
        "units": pu.K,
        "arg_units": [pu.dimensionless],
    },
    "rho_star_func": {
        "fname": "rho_star",
        "units": pu.kg / pu.m**3,
        "arg_units": [pu.dimensionless],
    },
    "pc_func": {
        "fname": "pc",
        "units": pu.kPa,
        "arg_units": [pu.dimensionless],
    },
    "tc_func": {
        "fname": "tc",
        "units": pu.K,
        "arg_units": [pu.dimensionless],
    },
    "rhoc_func": {
        "fname": "rhoc",
        "units": pu.kg / pu.m**3,
        "arg_units": [pu.dimensionless],
    },
    "pt_func": {
        "fname": "pt",
        "units": pu.kPa,
        "arg_units": [pu.dimensionless],
    },
    "tt_func": {
        "fname": "tt",
        "units": pu.K,
        "arg_units": [pu.dimensionless],
    },
    "rhot_l_func": {
        "fname": "rhot_l",
        "units": pu.kg / pu.m**3,
        "arg_units": [pu.dimensionless],
    },
    "rhot_v_func": {
        "fname": "rhot_v",
        "units": pu.kg / pu.m**3,
        "arg_units": [pu.dimensionless],
    },
    "pmin_func": {
        "fname": "pmin",
        "units": pu.kPa,
        "arg_units": [pu.dimensionless],
    },
    "tmin_func": {
        "fname": "tmin",
        "units": pu.K,
        "arg_units": [pu.dimensionless],
    },
    "pmax_func": {
        "fname": "pmax",
        "units": pu.kPa,
        "arg_units": [pu.dimensionless],
    },
    "tmax_func": {
        "fname": "tmax",
        "units": pu.K,
        "arg_units": [pu.dimensionless],
    },
}
