"""Dictionaries or generators which provide propertiesfor use in the Horvath-Kawazoe method."""frompygaps.utilities.exceptionsimportParameterError#: List of parameters for an HK modelHK_KEYS={'molecular_diameter':'nm','polarizability':'nm3','magnetic_susceptibility':'nm3','surface_density':'molecules/m2',}#: List of parameters for the carbon modelPROPERTIES_CARBON={'molecular_diameter':0.34,# nm'polarizability':1.02E-3,# nm3'magnetic_susceptibility':1.35E-7,# nm3'surface_density':3.845E19,# molecules/m2}#: List of parameters for the AlSi-Oxide modelPROPERTIES_AlSi_OXIDE_ION={'molecular_diameter':0.276,# nm'polarizability':2.5E-3,# nm3'magnetic_susceptibility':1.3E-8,# nm3'surface_density':1.315E19,# molecules/m2}#: List of parameters for the AlPh-Oxide modelPROPERTIES_AlPh_OXIDE_ION={'molecular_diameter':0.260,# nm'polarizability':2.5E-3,# nm3'magnetic_susceptibility':1.3E-8,# nm3'surface_density':1.000E19,# molecules/m2}#: List of adsorbent models_ADSORBENT_MODELS={'Carbon(HK)':PROPERTIES_CARBON,'AlSiOxideIon':PROPERTIES_AlSi_OXIDE_ION,'AlPhOxideIon':PROPERTIES_AlPh_OXIDE_ION,}
[docs]defget_hk_model(model:"str | dict"):""" Get the adsorbent model for HK PSD. The ``model`` parameter is a string which names the parameters which should be returned. Alternatively, a user can implement their own adsorbent model, by passing a dict. Parameters ---------- model : str, dict Name of the model to use or a dict with the parameters. Returns ------- dict A dict with parameters for the HK model. Raises ------ ParameterError When string is not in the dictionary of models. """# If the model is a string, get a model from the _ADSORBENT_MODELSifisinstance(model,str):ifmodelnotin_ADSORBENT_MODELS:raiseParameterError(f"Model ({model}) is not an option for pore size distribution.",f"Available models are {_ADSORBENT_MODELS.keys()}")return_ADSORBENT_MODELS[model]# If the model is an dictionary, use it as isifisinstance(model,dict):forkeyinHK_KEYS.items():ifkey[0]notinmodel.keys():raiseParameterError(f"The passed dictionary must contain the parameter {key[0]} "f"in the units of {key[1]}")returnmodel# Raise error if anything else is passedraiseParameterError(f"Model parameters ({model}) not an option for pore size distribution. ",f"Available models are {_ADSORBENT_MODELS.keys()}. ""Or pass a dictionary with the required parameters")