pyCalor


NamepyCalor JSON
Version 1.0.7 PyPI version JSON
download
home_pageNone
SummaryA Python module for performing thermodynamic calculations used in teaching ME40 at the University of California, Berkeley.
upload_time2025-07-23 20:51:23
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords thermodynamics chemistry physics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pyCalor

This Python module was developed in the Department of Mechanical Engineering at the University of California, Berkeley. It is used for teaching undergraduate thermodynamics (ME40).

The software package contains classes `state` and `process`. The following is the description of their use. You can also get the built-in information by typing the following statements in the Python command line:  

`from pyCalor import thermo as th`

`print(th.state.__doc__)`   

`print(th.process.__doc__)`  


## Class **state**  

A call

`from pyCalor import thermo as th`

`st = th.state(substance, property1=value1, property2=value2, name="A")`  

creates an object of class `state`. Each such object contains the following fields:  


| - | name | description |
| :-----------: | :--------------: | :-------------------------: |
| `st.p` | pressure | (in units of kPa)  |
| `st.t` | temperature | (in units of K)  |
| `st.v` | specific volume | (in units of m3/kg)  |
| `st.u` | specific energy | (in units of kJ/kg)  |
| `st.h` | specific enthalpy | (in units of kJ/kg)  |
| `st.s` | specific entropy | (in units of kJ/kg K)  |
| `st.x` | quality | (fraction)  |
| `st.molW` | molecular weight | (in units of kg/kmol)  |
| `st.R` | gas constant | (in units of kJ/kg K)  |
| `st.substance` | 'water', 'air', 'nitrogen', ... | ()  |

The property values are in the “base units”; they can be viewed by issuing a command:

`state.units`

Examples:

`from pyCalor import thermo as th`

`th.state.units`

`st1 = th.state('water', p=(1,'bar'), v=0.1, name="1")`

`st1.plot("pv") # supported plots are: "pv","Ts","ph"`

`st2 = th.state('R134a', x=1, t=300, name="B")`  

`st2.plot("Ts", isoProp="v")`

`st3 = th.state('air', p=(1,'Mpa'), t=(10,'c'))` 

`st3.name = "2a"`

This information can also be viewed in the programming environment; 

`th.state.__doc__`  
  

## Class process

A call

`from pyCalor import thermo as th`

`pr = th.process([(state1,state2),(state2,state3),...])`

creates an object of class process. An object of this class represent a simple process, from `st1` to `st2`,

`pr = th.process(st1,st2)`

a simple cyclic process,

`pr = th.process([(st1,st2),(st2,st3),(st3,st4),(st4,st1)])`,

which can also be created as 

`pr = th.process(st1,st2,st3,st4,st1)`,

or any complex process, but for a single working fluid.  

You can access process object properties by the following calls

|  |  description |
| :----------- | :--------------: |
| `pr.StateList` | returns a list of `state` objects| 
| `pr.isoProp(st1,st2)` | returns a dictionary of `{isoProperty: value,...}` for process `st1` → `st2` |

Once you created process object `pr`, you can display its states on a thermodynamic diagram via  

`pr.plot('ts')`   

to display process `pr` on a *T-s* diagram; you may likewise to make such plot in other coordinates, like `'pv'`, `'ph'`, etc.  












            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyCalor",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "thermodynamics, chemistry, physics",
    "author": null,
    "author_email": "Michael Frenklach <frenklach@berkeley.edu>, Thomas Schutzius <tschutzius@berkeley.edu>",
    "download_url": "https://files.pythonhosted.org/packages/4f/58/8e72317f8ba923d6cd221ee087736e07f6482d6b185699ba9bcdc6f68dc6/pycalor-1.0.7.tar.gz",
    "platform": null,
    "description": "# pyCalor\n\nThis Python module was developed in the Department of Mechanical Engineering at the University of California, Berkeley. It is used for teaching undergraduate thermodynamics (ME40).\n\nThe software package contains classes `state` and `process`. The following is the description of their use. You can also get the built-in information by typing the following statements in the Python command line:  \n\n`from pyCalor import thermo as th`\n\n`print(th.state.__doc__)`   \n\n`print(th.process.__doc__)`  \n\n\n## Class **state**  \n\nA call\n\n`from pyCalor import thermo as th`\n\n`st = th.state(substance, property1=value1, property2=value2, name=\"A\")`  \n\ncreates an object of class `state`. Each such object contains the following fields:  \n\n\n| - | name | description |\n| :-----------: | :--------------: | :-------------------------: |\n| `st.p` | pressure | (in units of kPa)  |\n| `st.t` | temperature | (in units of K)  |\n| `st.v` | specific volume | (in units of m3/kg)  |\n| `st.u` | specific energy | (in units of kJ/kg)  |\n| `st.h` | specific enthalpy | (in units of kJ/kg)  |\n| `st.s` | specific entropy | (in units of kJ/kg K)  |\n| `st.x` | quality | (fraction)  |\n| `st.molW` | molecular weight | (in units of kg/kmol)  |\n| `st.R` | gas constant | (in units of kJ/kg K)  |\n| `st.substance` | 'water', 'air', 'nitrogen', ... | ()  |\n\nThe property values are in the \u201cbase units\u201d; they can be viewed by issuing a command:\n\n`state.units`\n\nExamples:\n\n`from pyCalor import thermo as th`\n\n`th.state.units`\n\n`st1 = th.state('water', p=(1,'bar'), v=0.1, name=\"1\")`\n\n`st1.plot(\"pv\") # supported plots are: \"pv\",\"Ts\",\"ph\"`\n\n`st2 = th.state('R134a', x=1, t=300, name=\"B\")`  \n\n`st2.plot(\"Ts\", isoProp=\"v\")`\n\n`st3 = th.state('air', p=(1,'Mpa'), t=(10,'c'))` \n\n`st3.name = \"2a\"`\n\nThis information can also be viewed in the programming environment; \n\n`th.state.__doc__`  \n  \n\n## Class process\n\nA call\n\n`from pyCalor import thermo as th`\n\n`pr = th.process([(state1,state2),(state2,state3),...])`\n\ncreates an object of class process. An object of this class represent a simple process, from `st1` to `st2`,\n\n`pr = th.process(st1,st2)`\n\na simple cyclic process,\n\n`pr = th.process([(st1,st2),(st2,st3),(st3,st4),(st4,st1)])`,\n\nwhich can also be created as \n\n`pr = th.process(st1,st2,st3,st4,st1)`,\n\nor any complex process, but for a single working fluid.  \n\nYou can access process object properties by the following calls\n\n|  |  description |\n| :----------- | :--------------: |\n| `pr.StateList` | returns a list of `state` objects| \n| `pr.isoProp(st1,st2)` | returns a dictionary of `{isoProperty: value,...}` for process `st1` &rarr; `st2` |\n\nOnce you created process object `pr`, you can display its states on a thermodynamic diagram via  \n\n`pr.plot('ts')`   \n\nto display process `pr` on a *T-s* diagram; you may likewise to make such plot in other coordinates, like `'pv'`, `'ph'`, etc.  \n\n\n\n\n\n\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python module for performing thermodynamic calculations used in teaching ME40 at the University of California, Berkeley.",
    "version": "1.0.7",
    "project_urls": {
        "Homepage": "https://github.berkeley.edu/tschutzius/me40"
    },
    "split_keywords": [
        "thermodynamics",
        " chemistry",
        " physics"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "03c320091bb8c99704e4fdd2ece805135acb4900aed92146a0132f642787ea17",
                "md5": "801b78edb6dd473a8ddd6bcf7d1de9d8",
                "sha256": "69ccae603bac2f6efba8d2971f3651968555ba10bdc54e53f28546063617b154"
            },
            "downloads": -1,
            "filename": "pycalor-1.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "801b78edb6dd473a8ddd6bcf7d1de9d8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 22553,
            "upload_time": "2025-07-23T20:51:22",
            "upload_time_iso_8601": "2025-07-23T20:51:22.949512Z",
            "url": "https://files.pythonhosted.org/packages/03/c3/20091bb8c99704e4fdd2ece805135acb4900aed92146a0132f642787ea17/pycalor-1.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4f588e72317f8ba923d6cd221ee087736e07f6482d6b185699ba9bcdc6f68dc6",
                "md5": "03a21f09b9d02ff2e94128c469623cc7",
                "sha256": "3f9809c375e2386df8763a64606a2d3079c9f37095384d4a287b490a8969ec04"
            },
            "downloads": -1,
            "filename": "pycalor-1.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "03a21f09b9d02ff2e94128c469623cc7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 22501,
            "upload_time": "2025-07-23T20:51:23",
            "upload_time_iso_8601": "2025-07-23T20:51:23.831838Z",
            "url": "https://files.pythonhosted.org/packages/4f/58/8e72317f8ba923d6cd221ee087736e07f6482d6b185699ba9bcdc6f68dc6/pycalor-1.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-23 20:51:23",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pycalor"
}
        
Elapsed time: 1.06257s