Skip to main content

Miscellaneous utilities from Chemical, Biochemical, and Engineering Thermodynamics (5th edition) by Stan Sandler

Project description

Sandlermisc

Miscellaneous utilities from Sandler's 5th ed.

Sandlermisc implements a python interface to a few miscellaneous utilities from Chemical, Biochemical, and Engineering Thermodynamics (5th edition) by Stan Sandler (Wiley, USA). It should be used for educational purposes only.

Current utilities:

  1. ThermodynamicState: An abstract class for handling thermodynamic states for pure components
  2. ureg: a pint unit registry
  3. R: the universal gas constant as a pint Quantity
  4. DeltaH_IG and DeltaS_IG: Ideal-gas delta-h and delta-s calculations

Installation

Sandlermisc is available via pip:

pip install sandlermisc

Usage

API

ThermodynamicState is an abstract class that manages state-variable attributes:

  • T -- temperature
  • P -- pressure
  • v -- molar volume or specific volume
  • h -- molar ethalpy or specific enthapy
  • u -- molar internal energy or specific internal energy
  • s -- molar entropy or specific entropy
  • x -- vapor fraction for a saturated state

A subclass of ThermodynamicState must define the method resolve() to compute state variables from input state variables. Any instance of such a subclass will automatically compute all state variables once enough inputs are specified.

DeltaH_IG requires the temperature of state 1 (assumed in K if units not specified), the temperature of state 2, and an ideal-gas heat-capacity argument, which can be a scalar, four-element list of floats, or four-element dict with keys a, b, c, and d.

>>> from sandlermisc import DeltaH_IG
>>> DeltaH_IG(100, 200, 10)
<Quantity(1000.0, 'joule / mole')>
>>> DeltaH_IG(500, 600, [10., 0.01, 0.00002, 0.000000032]) 
<Quantity(2693.46667, 'joule / mole')>
>>> DeltaH_IG(500, 600, dict(a=10., b=0.01, c=0.00002, d=0.000000032)) 
<Quantity(2693.46667, 'joule / mole')>

DeltaS_IG requires the temperature and pressure of state 1, the temperature and pressure of state 2, the ideal-gas heat-capacity argument.

>>> from sandlermisc import DeltaS_IG 
>>> DeltaS_IG(500, 10, 600, 12, 10)                
<Quantity(0.307309799, 'joule / mole / kelvin')>

One can optionally provide a value for the gas constant R to match units of one's Cp, if necessary. By default, sandlermisc assumes Cp has energy units of J.

Release History

  • 0.4.1
    • pint incorporation
    • Full smart-resolution of ThermodynamicState
  • 0.3.2
    • bugfix: unpackCp ignored ints -- now fixed
    • bugfix: unpackCp ignored np.ndarray -- now fixed
  • 0.3.0
    • StateReporter implemented
  • 0.1.1
    • bug in converting Cp
  • 0.1.0
    • Initial release

Meta

Cameron F. Abrams – cfa22@drexel.edu

Distributed under the MIT license. See LICENSE for more information.

https://github.com/cameronabrams

Contributing

  1. Fork it (https://github.com/cameronabrams/sandlermisc/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sandlermisc-0.4.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sandlermisc-0.4.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file sandlermisc-0.4.1.tar.gz.

File metadata

  • Download URL: sandlermisc-0.4.1.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sandlermisc-0.4.1.tar.gz
Algorithm Hash digest
SHA256 9888d41a6b4052f80e15bfec73d28a9a3ae8e2d33f8c6a07476b2d6b635b9b12
MD5 29c2301b8b97c703a8cc055e3e1d0f31
BLAKE2b-256 b8c7eacf33532c847ef911d9176efd23939b47d6283bbbf1035f085c9448e926

See more details on using hashes here.

Provenance

The following attestation bundles were made for sandlermisc-0.4.1.tar.gz:

Publisher: release.yaml on cameronabrams/sandlermisc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sandlermisc-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: sandlermisc-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sandlermisc-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ed68dea8185890152033f4db5c83f472d1593f9a630888ee71a07fae8592ff03
MD5 6d963eec2d2786d5e9895b3b66dbcfd0
BLAKE2b-256 f2b6eece07789b38ded5dc132e0014a196a8808706c59f01da2019d61ae9e897

See more details on using hashes here.

Provenance

The following attestation bundles were made for sandlermisc-0.4.1-py3-none-any.whl:

Publisher: release.yaml on cameronabrams/sandlermisc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page