npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tr0j332/thermo.eos.iapws97

v0.0.2

Published

A javascript implementation of the IAWPS formulations for the thermodynamic properties of water and steam. Change dependencies with bugs

Downloads

3

Readme

** change dependencies with bugs **


Neutrium.thermo.IAPWS97

Introduction

Neutrium.thermo.IAPWS97 is a javascript implementation of the IAPWS formulations of the thermodynamic properties of water and steam. The IAPWS papers implemented in Neutrium.thermo.IAPWS97 are as follows:

For specific details on range of applicability for the IAPWS please refer to the Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam 2007.

Getting Started

Installing

You can install the Neutrium implementation of the IAPWS97 equation of state package using npm.

npm install @tr0j332/thermo.eos.iapws97 --save

Including

Typescript

In typescript you can include the package as follows:

import {IAPWS97_EoS} from "@neutrium/thermo.eos.iapws97"

let EoS = new IAPWS97_EOS();

This module is built with the declaration files so type hinting should work once the module has been imported.

Node

var EoS = require('@neutrium/thermo.eos.iapws97');

Browsers

Since version 2.0.0 this module has been converted to a commonjs (node) package. To use it in a browser environment you will need to use a tool like browserify to convert it to a web bundle.

Unicode Notes

This package makes use of utf8 characters for variable names and therefore should be handled appropriately. For example if bundled for browser use it would be included as follows:

<script charset="utf-8" src="path-to-lib/IAPWS97-bundle.js"></script>

Usage

Calculating Properties

Steam and water properties can be calculated using the solve method and a supported combination of pressure (Pa), temperature (K), enthalpy (kJ/kg.K) and entropy (kJ/K.kg). For example (in typescript):

import {IAPWS97_EOS} from "@neutrium/thermo.eos.iapws97"

let EoS = new IAPWS97_EOS();
let inputs = {
    "p" => 101325,
    "t" => 300
}

let state = EoS.solve(inputs);

The supported input combinations are Pressure/Temperature, Pressure/Enthalpy, Pressure/Entropy and Enthalpy/Entropy.

Return Values

If your specified values lie within the applicable range for the IAWPS formulations you will be return an object containing the following properties:

{
	p, 		// Pressure, p, Pa
	t, 		// Temperature, t, K
	v, 		// Specific volume, v, m^3/kg
	rho,	// Density, rho, kg/m^3
	u,		// Specific internal energy, u, kJ/kg
	s,		// Specific entropy, s, kJ/kg
	h, 		// Specific enthalpy, h, kJ/kg.K
	cp,		// Specific isobaric heat capacity, Cp kJ/kg.K
	cv,		// Specific isochoric heat capacity, Cv
	w,		// Speed of Sound, w, m/s
	mu,		// Viscosity cP,
	k,		// Thermal Conductivity W/m.K
	sigma,	// Surface Tension mN/m
	epsilon,// Dielectric constant
	ic		// Ionisation constant
}

Typescript

If you are using Typescript the return valve from the solve method will be an instance of the State class from the @neutrium/thermo package.

Errors

If you try and calculate the properties outside the range of applicability as specified by IAWPS an exception will be thrown.

@neutrium/quantity Support

This package allows properties of the State class to be converted to Neutrium Quantities.

Simply request the results of the solve method as quantities:

var result = IAPWS97_EoS.solve(3000000, 300).asQty();

This will allow you to easily convert each property as required:

var psi = result.p.to('psi');

See the NeutriumJS.Quantity readme for more info.

Testing

This pacakge is currently tested using all applicable tests provided in the IAWPS papers listed above. To run the tests, after cloning and installing package dependences via npm and run npm task build at the terminal.

Donations

NeutriumJS is free software, but you can support the developers by donating here.

Release Notes

| Version | Notes | |:-------:|:------| | 1.0.0 | Initial Release | | 1.0.5 | Add UMD definition | | 1.1.0 | Optional NeutriumJS.convert support | | 1.1.1 | Change P and T keys to lower case | | 1.1.2 | Added exception throwing for out of range case | | 1.1.3 | Bug fixes for exception throwing logic | | 1.2.0 | Renamed package to NeutriumJS.thermo.IAPWS97 | | 2.0.0 | Rename package, switch to Typescript and convert to npm module |

License

Creative Commons Attribution 4.0 International