From ddbd26e2ded601f2c7b316d97cae3f8e383dc2f4 Mon Sep 17 00:00:00 2001 From: srebughini Date: Tue, 21 May 2024 09:30:24 +0200 Subject: [PATCH] Add python API --- _docs/api/python.md | 165 ++++++++++++++++++++++++++++++++++++++++++ _includes/topnav.html | 2 +- 2 files changed, 166 insertions(+), 1 deletion(-) diff --git a/_docs/api/python.md b/_docs/api/python.md index d87437ca..046a5538 100644 --- a/_docs/api/python.md +++ b/_docs/api/python.md @@ -2,6 +2,171 @@ permalink: /docs/api-python/ ---

Python version

+The Python version of ASALI is composed by the **API version** to estimate themodynamic/transport properties and **[ASALIPY](https://github.com/srebughini/ASALIPY)** to model catalytic reactors. + +## API version +The [Python](https://it.mathworks.com/campaigns/products/trials.html?s_eid=ppc_29775072802&q=matlab) API can be inlcuded in your code as follow: +```python +# Class initialization and set up composition, pressure and temperature +asali = Asali(373.15, 4e05) +asali.mole_composition = {"H2": 0.1, "O2": 0.2, "N2": 0.7} + +# Properties evaluation +cp = asali.species_mass_specific_heat +diff = asali.mixture_diffusion +``` +To convert the Asali database into Python code run `python database-generator.py` + +## **Available thermodynamic and transport properties** +ASALI estimates different thermodynamic and transport properties (`p` is the Asali object): +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionEstimated propertyReturn typeUnit dimension
p.densityMixture densityfloatkg/m3
p.mixture_molecular_weightMixture molecular weight floatg/mol
p.mixture_thermal_conductivityMixture thermal conductivity floatW/m/K
p.mixture_viscosityMixture viscosity floatPa*s
p.mixture_molar_specific_heatMixture specific heat floatJ/kmol/K
p.mixture_mass_specific_heatMixture specific heat floatJ/kg/K
p.mixture_molar_enthalpyMixture enthalpyfloatJ/kmol
p.mixture_mass_enthalpyMixture enthalpyfloatJ/kg
p.mixture_molar_entropyMixture entropyfloatJ/kmol/K
p.mixture_mass_entropyMixture entropyfloatJ/kg/K
p.mixture_diffusionMixture diffusivityfloatm2/s
p.specie_thermal_conductivitySingle specie thermal conductivity1D arrayW/m/K
p.specie_viscositySingle specie viscosity1D arrayPa*s
p.SpeciesMolarSpecificHeatSingle specie specific heat1D arrayJ/kmol/K
p.species_mass_specific_heatSingle specie specific heat1D arrayJ/kg/K
p.specie_molar_enthalpySingle specie enthalpy1D arrayJ/kmol
p.specie_mass_enthalpySingle specie enthalpy1D arrayJ/kmol
p.specie_molar_entropySingle specie entropy1D arrayJ/kmol/K
p.specie_mass_entropySingle specie entropy1D arrayJ/kg/K
p.mean_gas_velocitySingle gas velocity1D arraym/s
p.mean_free_pathSingle mean free path1D arraym
p.binary_diffusionSingle binary diffusion2D arraym2/s
+
+ +## ASALIPY: Python package to model catalytic reactors The python API version of ASALI is called [ASALIPY](https://github.com/srebughini/ASALIPY) and its [conda package](https://anaconda.org/ASALIcode/asali) can be installed as follow: ```bash diff --git a/_includes/topnav.html b/_includes/topnav.html index dc0ca574..9fca3415 100644 --- a/_includes/topnav.html +++ b/_includes/topnav.html @@ -19,7 +19,7 @@