seuif97


Nameseuif97 JSON
Version 2.2.0 PyPI version JSON
download
home_pagehttps://github.com/thermalogic/RustSEUIF97
SummaryThe Python API of the high-speed IAPWS-IF97 package in Rust
upload_time2023-09-04 03:56:19
maintainer
docs_urlNone
authorCheng Maohua
requires_python>=3.0
licenseMIT
keywords iapws-if97 if97
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SEUIF97

The version of **seuif97 2**  is the Python API of the high-speed IAPWS-IF97 package in Rust. It is suitable for computation-intensive calculations, such as heat cycle calculations, simulations of non-stationary processes, real-time process monitoring and optimizations.   
 
Through the high-speed package, the results of the IAPWS-IF97 are accurately produced at about 5-20x speed-up compared to  using the `powi()` of the Rust standard library in the `for`loop directly when computing the basic equations of Region 1,2,3.

**The Fast Methods**

1. The multi-step method unleashes the full power of the compiler optimizations while using `powi()` with the `for` loop
2. The recursive  method computes the polynomial values of the base variable and its derivatives

In the package, [36 thermodynamic, transport and  further properties](#properties) can be calculated. 

The following 12 input pairs are implemented:

```txt
  (p,t) (p,h) (p,s) (p,v) 
  
  (p,x) (t,x) (h,x) (s,x) 

  (t,h) (t,s) (t,v) 

  (h,s)
```

## The functions 

The two types of functions are provided in the package

 1. the input propertry pairs and the property ID([o_id](#properties)) to get the value of the specified property

 2. the input propertry pairs to get the one of  `p`,`t`,`h`,`s`,`v` or `x` directly

### The input propertry pairs and the property ID 

```python 
  ??(in1,in2,o_id)
```

* the first,second input parameters : the input propertry pairs
* the third input parametes: the property ID of the calculated property - [o_id](#properties)
* the return: the calculated property value of o_id

```python
pt(p,t,o_id)
ph(p,h,o_id)
ps(p,s,o_id)
pv(p,v,o_id)

th(t,h,o_id)
ts(t,s,o_id)
tv(t,v,o_id)

hs(h,s,o_id)

px(p,x,o_id)
tx(p,x,o_id)
hx(h,x,o_id)
sx(s,x,o_id)
```

### The input propertry pairs 

```python 
  ??2?(in1,in2)
```

* the `?` in `2?` is the one of `p`,`t`,`h`,`s`,`v` or `x`

```python
pt2h(p, t)  pt2s(p, t)  pt2v(p, t)  pt2x(p, t)
ph2t(p, h)  ph2s(p, h)  ph2v(p, h)  ph2x(p, h)   
ps2t(p, s)  ps2h(p, s)  ps2v(p, s)  ps2x(p, s)  
pv2t(p, v)  pv2h(p, v)  pv2s(p, v)  pv2x(p, v)  

hs2t(h, s)  hs2p(h, s)  hs2v(p, s)  hs2x(h, s)    

th2p(t, h)  th2s(t, h)  th2v(t, h)  th2x(t, h)   
ts2p(t, s)  ts2h(t, s)  th2v(t, s)  ts2x(t, s)  
tv2p(t, v)  tv2h(t, v)  tv2s(t, v)  tv2x(t, v)  

px2t(p, x)  px2h(p, x)  px2s(p, x)  px2v(p, x)
tx2p(t, x)  tx2h(t, x)  tx2s(t, x)  tx2v(t, x)

hx2p(h, x)  hx2t(h, x)  hx2s(h, x)  hx2v(h, x)
sx2p(s, x)  sx2t(s, x)  sx2h(s, x)  sx2v(s, x)
```

## Example

```python
from seuif97 import *

OH=4

p=16.0
t=535.1
# ??(in1,in2,o_id)
h=pt(p,t,OH)
# ??2?(in1,in2)
s=pt2s(p,t)
print(f"p={p}, t={t} h={h:.3f} s={s:.3f}")
```
**The Examples**

* [T-S Diagram](https://github.com/thermalogic/RustSEUIF97/blob/seuif97/demo_using_lib/Diagram_T-S.py)

* [H-S Diagram](https://github.com/thermalogic/RustSEUIF97/blob/seuif97/demo_using_lib/Diagram_H-S.py)

* [H-S Diagram of Steam Turbine Expansion](https://github.com/thermalogic/RustSEUIF97/blob/seuif97/demo_using_lib/Turbine_H-S.py)

* [The Hybrid Steady-state Simulator of Rankine Cycle in Python](https://github.com/thermalogic/PyRankine)

![T-S Diagram](https://github.com/thermalogic/RustSEUIF97/raw/seuif97/img/T-S.jpg)

## Properties

| Propertry                             |    Unit     | Symbol | o_id  | o_id(i32)|
| ------------------------------------- | :---------: |:------:|------:|:--------:|
| Pressure                              |     MPa     |      p |   OP  |       0  |
| Temperature                           |     °C      |      t |   OT  |       1  |
| Density                               |   kg/m³     |      ρ |   OD  |       2  |
| Specific Volume                       |   m³/kg     |      v |   OV  |       3  |
| Specific enthalpy                     |    kJ/kg    |      h |   OH  |       4  |
| Specific entropy                      |  kJ/(kg·K)  |      s |   OS  |       5  |
| Specific exergy                       |    kJ/kg    |      e |   OE  |       6  |
| Specific internal energy              |    kJ/kg    |      u |   OU  |       7  |
| Specific isobaric heat capacity       |  kJ/(kg·K)  |     cp |  OCP  |       8  |
| Specific isochoric heat capacity      |  kJ/(kg·K)  |     cv |  OCV  |       9  |
| Speed of sound                        |     m/s     |      w |   OW  |       10 |
| Isentropic exponent                   |             |     k  |  OKS  |       11 |
| Specific Helmholtz free energy        |    kJ/kg    |     f  |   OF  |       12 |
| Specific Gibbs free energy            |    kJ/kg    |     g  |   OG  |       13 |
| Compressibility factor                |             |     z  |   OZ  |       14 |
| Steam quality                         |             |     x  |   OX  |       15 |
| Region                                |             |     r  |   OR  |       16 |
| Isobari cubic expansion coefficient   |     1/K     |   ɑv   |  OEC  |       17 |
| Isothermal compressibility            |    1/MPa    |    kT  |  OKT  |       18 |
| Partial derivative (∂V/∂T)p           |  m³/(kg·K)  |(∂V/∂T)p| ODVDT |       19 |
| Partial derivative (∂V/∂p)T           | m³/(kg·MPa) |(∂v/∂p)t| ODVDP |       20 |
| Partial derivative (∂P/∂T)v           |    MPa/K    |(∂p/∂t)v| ODPDT |       21 |
| Isothermal throttling coefficient     | kJ/(kg·MPa) |   δt   | OIJTC |       22 |
| Joule-Thomson coefficient             |    K/MPa    |    μ   | OJTC  |       23 |
| Dynamic viscosity                     |   Pa·s      |    η   |  ODV  |       24 |
| Kinematic viscosity                   |    m²/s     |    ν   |  OKV  |       25 |
| Thermal conductivity                  |   W/(m.K)   |    λ   |  OTC  |       26 |
| Thermal diffusivity                   |    m²/s     |    a   |  OTD  |       27 |
| Prandtl number                        |             |    Pr  |  OPR  |       28 |
| Surface tension                       |    N/m      |    σ   |  OST  |       29 |
| Static Dielectric Constant            |             |    ε   | OSDC  |       30 |
| Isochoric pressure coefficient        |    1/K      |    β   | OPC   |       31 |
| Isothermal stress coefficient         |   kg/m³     |    βp  | OBETAP|       32 |
| Fugacity coefficient                  |             |    fi  |   OFI |       33 |
| Fugacity                              |     MPa     |     f* |   OFU |       34 |
| Relative pressure coefficient         |     1/K     |    αp  | OAFLAP|        35|








            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/thermalogic/RustSEUIF97",
    "name": "seuif97",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.0",
    "maintainer_email": "",
    "keywords": "IAPWS-IF97,IF97",
    "author": "Cheng Maohua",
    "author_email": "cmh@seu.edu.cn",
    "download_url": "https://files.pythonhosted.org/packages/fd/de/5851def0874f7500dae62b720926aa8cd8b841da658fa595a96e46bb7668/seuif97-2.2.0.tar.gz",
    "platform": null,
    "description": "# SEUIF97\r\n\r\nThe version of **seuif97 2**  is the Python API of the high-speed IAPWS-IF97 package in Rust. It is suitable for computation-intensive calculations, such as heat cycle calculations, simulations of non-stationary processes, real-time process monitoring and optimizations.   \r\n \r\nThrough the high-speed package, the results of the IAPWS-IF97 are accurately produced at about 5-20x speed-up compared to  using the `powi()` of the Rust standard library in the `for`loop directly when computing the basic equations of Region 1,2,3.\r\n\r\n**The Fast Methods**\r\n\r\n1. The multi-step method unleashes the full power of the compiler optimizations while using `powi()` with the `for` loop\r\n2. The recursive  method computes the polynomial values of the base variable and its derivatives\r\n\r\nIn the package, [36 thermodynamic, transport and  further properties](#properties) can be calculated. \r\n\r\nThe following 12 input pairs are implemented:\r\n\r\n```txt\r\n  (p,t) (p,h) (p,s) (p,v) \r\n  \r\n  (p,x) (t,x) (h,x) (s,x) \r\n\r\n  (t,h) (t,s) (t,v) \r\n\r\n  (h,s)\r\n```\r\n\r\n## The functions \r\n\r\nThe two types of functions are provided in the package\r\n\r\n 1. the input propertry pairs and the property ID([o_id](#properties)) to get the value of the specified property\r\n\r\n 2. the input propertry pairs to get the one of  `p`,`t`,`h`,`s`,`v` or `x` directly\r\n\r\n### The input propertry pairs and the property ID \r\n\r\n```python \r\n  ??(in1,in2,o_id)\r\n```\r\n\r\n* the first,second input parameters : the input propertry pairs\r\n* the third input parametes: the property ID of the calculated property - [o_id](#properties)\r\n* the return: the calculated property value of o_id\r\n\r\n```python\r\npt(p,t,o_id)\r\nph(p,h,o_id)\r\nps(p,s,o_id)\r\npv(p,v,o_id)\r\n\r\nth(t,h,o_id)\r\nts(t,s,o_id)\r\ntv(t,v,o_id)\r\n\r\nhs(h,s,o_id)\r\n\r\npx(p,x,o_id)\r\ntx(p,x,o_id)\r\nhx(h,x,o_id)\r\nsx(s,x,o_id)\r\n```\r\n\r\n### The input propertry pairs \r\n\r\n```python \r\n  ??2?(in1,in2)\r\n```\r\n\r\n* the `?` in `2?` is the one of `p`,`t`,`h`,`s`,`v` or `x`\r\n\r\n```python\r\npt2h(p, t)  pt2s(p, t)  pt2v(p, t)  pt2x(p, t)\r\nph2t(p, h)  ph2s(p, h)  ph2v(p, h)  ph2x(p, h)   \r\nps2t(p, s)  ps2h(p, s)  ps2v(p, s)  ps2x(p, s)  \r\npv2t(p, v)  pv2h(p, v)  pv2s(p, v)  pv2x(p, v)  \r\n\r\nhs2t(h, s)  hs2p(h, s)  hs2v(p, s)  hs2x(h, s)    \r\n\r\nth2p(t, h)  th2s(t, h)  th2v(t, h)  th2x(t, h)   \r\nts2p(t, s)  ts2h(t, s)  th2v(t, s)  ts2x(t, s)  \r\ntv2p(t, v)  tv2h(t, v)  tv2s(t, v)  tv2x(t, v)  \r\n\r\npx2t(p, x)  px2h(p, x)  px2s(p, x)  px2v(p, x)\r\ntx2p(t, x)  tx2h(t, x)  tx2s(t, x)  tx2v(t, x)\r\n\r\nhx2p(h, x)  hx2t(h, x)  hx2s(h, x)  hx2v(h, x)\r\nsx2p(s, x)  sx2t(s, x)  sx2h(s, x)  sx2v(s, x)\r\n```\r\n\r\n## Example\r\n\r\n```python\r\nfrom seuif97 import *\r\n\r\nOH=4\r\n\r\np=16.0\r\nt=535.1\r\n# ??(in1,in2,o_id)\r\nh=pt(p,t,OH)\r\n# ??2?(in1,in2)\r\ns=pt2s(p,t)\r\nprint(f\"p={p}, t={t} h={h:.3f} s={s:.3f}\")\r\n```\r\n**The Examples**\r\n\r\n* [T-S Diagram](https://github.com/thermalogic/RustSEUIF97/blob/seuif97/demo_using_lib/Diagram_T-S.py)\r\n\r\n* [H-S Diagram](https://github.com/thermalogic/RustSEUIF97/blob/seuif97/demo_using_lib/Diagram_H-S.py)\r\n\r\n* [H-S Diagram of Steam Turbine Expansion](https://github.com/thermalogic/RustSEUIF97/blob/seuif97/demo_using_lib/Turbine_H-S.py)\r\n\r\n* [The Hybrid Steady-state Simulator of Rankine Cycle in Python](https://github.com/thermalogic/PyRankine)\r\n\r\n![T-S Diagram](https://github.com/thermalogic/RustSEUIF97/raw/seuif97/img/T-S.jpg)\r\n\r\n## Properties\r\n\r\n| Propertry                             |    Unit     | Symbol | o_id  | o_id(i32)|\r\n| ------------------------------------- | :---------: |:------:|------:|:--------:|\r\n| Pressure                              |     MPa     |      p |   OP  |       0  |\r\n| Temperature                           |     \u00b0C      |      t |   OT  |       1  |\r\n| Density                               |   kg/m\u00b3     |      \u03c1 |   OD  |       2  |\r\n| Specific Volume                       |   m\u00b3/kg     |      v |   OV  |       3  |\r\n| Specific enthalpy                     |    kJ/kg    |      h |   OH  |       4  |\r\n| Specific entropy                      |  kJ/(kg\u00b7K)  |      s |   OS  |       5  |\r\n| Specific exergy                       |    kJ/kg    |      e |   OE  |       6  |\r\n| Specific internal energy              |    kJ/kg    |      u |   OU  |       7  |\r\n| Specific isobaric heat capacity       |  kJ/(kg\u00b7K)  |     cp |  OCP  |       8  |\r\n| Specific isochoric heat capacity      |  kJ/(kg\u00b7K)  |     cv |  OCV  |       9  |\r\n| Speed of sound                        |     m/s     |      w |   OW  |       10 |\r\n| Isentropic exponent                   |             |     k  |  OKS  |       11 |\r\n| Specific Helmholtz free energy        |    kJ/kg    |     f  |   OF  |       12 |\r\n| Specific Gibbs free energy            |    kJ/kg    |     g  |   OG  |       13 |\r\n| Compressibility factor                |             |     z  |   OZ  |       14 |\r\n| Steam quality                         |             |     x  |   OX  |       15 |\r\n| Region                                |             |     r  |   OR  |       16 |\r\n| Isobari cubic expansion coefficient   |     1/K     |   \u0251v   |  OEC  |       17 |\r\n| Isothermal compressibility            |    1/MPa    |    kT  |  OKT  |       18 |\r\n| Partial derivative (\u2202V/\u2202T)p           |  m\u00b3/(kg\u00b7K)  |(\u2202V/\u2202T)p| ODVDT |       19 |\r\n| Partial derivative (\u2202V/\u2202p)T           | m\u00b3/(kg\u00b7MPa) |(\u2202v/\u2202p)t| ODVDP |       20 |\r\n| Partial derivative (\u2202P/\u2202T)v           |    MPa/K    |(\u2202p/\u2202t)v| ODPDT |       21 |\r\n| Isothermal throttling coefficient     | kJ/(kg\u00b7MPa) |   \u03b4t   | OIJTC |       22 |\r\n| Joule-Thomson coefficient             |    K/MPa    |    \u03bc   | OJTC  |       23 |\r\n| Dynamic viscosity                     |   Pa\u00b7s      |    \u03b7   |  ODV  |       24 |\r\n| Kinematic viscosity                   |    m\u00b2/s     |    \u03bd   |  OKV  |       25 |\r\n| Thermal conductivity                  |   W/(m.K)   |    \u03bb   |  OTC  |       26 |\r\n| Thermal diffusivity                   |    m\u00b2/s     |    a   |  OTD  |       27 |\r\n| Prandtl number                        |             |    Pr  |  OPR  |       28 |\r\n| Surface tension                       |    N/m      |    \u03c3   |  OST  |       29 |\r\n| Static Dielectric Constant            |             |    \u03b5   | OSDC  |       30 |\r\n| Isochoric pressure coefficient        |    1/K      |    \u03b2   | OPC   |       31 |\r\n| Isothermal stress coefficient         |   kg/m\u00b3     |    \u03b2p  | OBETAP|       32 |\r\n| Fugacity coefficient                  |             |    fi  |   OFI |       33 |\r\n| Fugacity                              |     MPa     |     f* |   OFU |       34 |\r\n| Relative pressure coefficient         |     1/K     |    \u03b1p  | OAFLAP|        35|\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "The Python API of the high-speed IAPWS-IF97 package in Rust",
    "version": "2.2.0",
    "project_urls": {
        "Homepage": "https://github.com/thermalogic/RustSEUIF97"
    },
    "split_keywords": [
        "iapws-if97",
        "if97"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fdde5851def0874f7500dae62b720926aa8cd8b841da658fa595a96e46bb7668",
                "md5": "841894bd83eba2f4e7e9e566970812a3",
                "sha256": "7314165b6951949202145912717761ed69e6108559a89137e98cbe54b81b5517"
            },
            "downloads": -1,
            "filename": "seuif97-2.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "841894bd83eba2f4e7e9e566970812a3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.0",
            "size": 78534,
            "upload_time": "2023-09-04T03:56:19",
            "upload_time_iso_8601": "2023-09-04T03:56:19.329488Z",
            "url": "https://files.pythonhosted.org/packages/fd/de/5851def0874f7500dae62b720926aa8cd8b841da658fa595a96e46bb7668/seuif97-2.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-04 03:56:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thermalogic",
    "github_project": "RustSEUIF97",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "seuif97"
}
        
Elapsed time: 0.73806s