{"id":25015442,"url":"https://github.com/sctg-development/aga8-js","last_synced_at":"2025-04-12T23:24:40.033Z","repository":{"id":273545119,"uuid":"920090510","full_name":"sctg-development/aga8-js","owner":"sctg-development","description":"Typescript binding for the NIST AGA8 DETAIL, GROSS and GERG2008 equations of state","archived":false,"fork":false,"pushed_at":"2025-04-04T07:16:54.000Z","size":2527,"stargazers_count":17,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T08:24:33.398Z","etag":null,"topics":["aga8","equation-of-state","gerg2008","tailwindcss","thermodynamics","vue3"],"latest_commit_sha":null,"homepage":"https://aga8.lasersmart.work","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sctg-development.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["sctg-development"]}},"created_at":"2025-01-21T14:50:20.000Z","updated_at":"2025-04-01T14:31:21.000Z","dependencies_parsed_at":"2025-02-13T19:20:53.418Z","dependency_job_id":"8ec5d4ac-e4eb-4c41-96aa-2101a9e8a00b","html_url":"https://github.com/sctg-development/aga8-js","commit_stats":null,"previous_names":["sctg-development/aga8-js"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Faga8-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Faga8-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Faga8-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Faga8-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sctg-development","download_url":"https://codeload.github.com/sctg-development/aga8-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248644709,"owners_count":21138615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aga8","equation-of-state","gerg2008","tailwindcss","thermodynamics","vue3"],"created_at":"2025-02-05T08:29:58.571Z","updated_at":"2025-04-12T23:24:40.021Z","avatar_url":"https://github.com/sctg-development.png","language":"C++","funding_links":["https://github.com/sponsors/sctg-development"],"categories":[],"sub_categories":[],"readme":"# AGA8 GERG-2008, GROSS and DETAIL Gas Properties Calculator\r\n\r\n[![npm version](https://badge.fury.io/js/@sctg%2Faga8-js.svg)](https://www.npmjs.com/package/@sctg/aga8-js)\r\n[![Build Status](https://github.com/sctg-development/aga8-js/actions/workflows/build.yaml/badge.svg)](https://github.com/sctg-development/aga8-js/actions/workflows/build.yaml)\r\n[![License](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\r\n[![Documentation](https://img.shields.io/badge/docs-latest-brightgreen.svg)](https://sctg-development.github.io/aga8-js/)\r\n\r\nHigh-performance WebAssembly implementation of the GERG-2008 equation of state and AGA8 methods for natural gas properties calculations. This package provides JavaScript/TypeScript bindings to the industry-standard algorithms for precise gas property calculations.\r\n\r\n## Star the project\r\n\r\n**If you appreciate my work, please consider giving it a star! 🤩**\r\n\r\n## 🌟 Features\r\n\r\n- **Three Calculation Methods**:\r\n  - 📊 GERG-2008 (Reference equations for high-accuracy calculations)\r\n  - 🔍 Detail (AGA8 Part 1 method for precise gas mixtures)\r\n  - 📈 Gross (AGA8 Part 2 method for simplified calculations)\r\n  \r\n- **Complete Gas Support**:\r\n  - 🧪 Full support for all 21 gas components defined by AGA8\r\n  - 🎯 High-precision calculations for natural gas mixtures\r\n  - 🌡️ Wide range of temperature and pressure conditions\r\n\r\n- **Technical Excellence**:\r\n  - ⚡ WebAssembly-powered for near-native performance\r\n  - 📦 Tree-shakeable npm package\r\n  - 💪 TypeScript type definitions included\r\n  - 📚 Comprehensive [API documentation](https://sctg-development.github.io/aga8-js/)\r\n\r\n## 🚀 Live AGA8 Demo\r\n\r\nTry it now at [Lasersmart AGA8](https://aga8.lasersmart.work/)!\r\n\r\n[\u003cimg width=\"1164\" alt=\"AGA8 Calculator Demo\" src=\"https://github.com/user-attachments/assets/76c1deaa-9519-4bb4-916b-22e31a6eb06b\" /\u003e](https://aga8.lasersmart.work/)\r\n\r\nView the demo source code in our [Vue.js implementation](https://github.com/sctg-development/aga8-js/tree/main/src/aga8-vue).\r\n\r\n## 🚀 Live sonic nozzle Demo\r\n\r\nTry it now at [Lasersmart Sonic Nozzle](https://sonic.lasersmart.work/)!\r\n\r\n\u003cimg width=\"640\" alt=\"image\" src=\"https://github.com/user-attachments/assets/02364ea3-ce60-4160-a65f-97d8801d9aa9\" /\u003e\r\n\r\n\r\n## 📦 Installation\r\n\r\n```bash\r\nnpm install @sctg/aga8-js\r\n```\r\n\r\n## 💻 Quick Start\r\n\r\n```typescript\r\nimport { AGA8wasm, type GasMixture } from '@sctg/aga8-js';\r\n\r\n// Initialize AGA8 module\r\nconst AGA8 = await AGA8wasm();\r\nAGA8.SetupGERG();\r\n\r\n// Define gas mixture (94% methane, 5% CO2, 1% helium)\r\nconst mixture: GasMixture = {\r\n    methane: 0.94,\r\n    nitrogen: 0,\r\n    carbon_dioxide: 0.05,\r\n    ethane: 0,\r\n    propane: 0,\r\n    isobutane: 0,\r\n    n_butane: 0,\r\n    isopentane: 0,\r\n    n_pentane: 0,\r\n    n_hexane: 0,\r\n    n_heptane: 0,\r\n    n_octane: 0,\r\n    n_nonane: 0,\r\n    n_decane: 0,\r\n    hydrogen: 0,\r\n    oxygen: 0,\r\n    carbon_monoxide: 0,\r\n    water: 0,\r\n    hydrogen_sulfide: 0,\r\n    helium: 0.01,\r\n    argon: 0\r\n}\r\n\r\n// Calculate properties\r\nconst molarMass = AGA8.MolarMassGERG(mixture);\r\nconst { D: density } = AGA8.DensityGERG(0, 400, 50000, mixture);\r\nconst properties = AGA8.PropertiesGERG(400, density, mixture);\r\n\r\nconsole.log('Results:', {\r\n  molarMass: `${molarMass.toFixed(4)} g/mol`,\r\n  density: `${density.toFixed(4)} mol/L`,\r\n  compressibility: properties.Z.toFixed(6),\r\n  soundSpeed: `${properties.W.toFixed(2)} m/s`\r\n});\r\n```\r\n\r\n## Samples\r\n\r\n- [sonic-nozzle-flow.ts](src/examples/sonic-nozzle-flow.ts): Calculate the flow rate through a sonic nozzle\r\n- [gas-properties-calculations.ts](src/examples/gas-properties-calculations.ts): Calculate gas properties for a mixture using GERG-2008\r\n\r\n## 📚 Documentation\r\n\r\n- [API Reference](https://sctg-development.github.io/aga8-js/)\r\n- [GERG-2008 Method](https://sctg-development.github.io/aga8-js/GERG2008_8h.html)\r\n- [Detail Method](https://sctg-development.github.io/aga8-js/Detail_8h.html)\r\n- [Gross Method](https://sctg-development.github.io/aga8-js/Gross_8h.html)\r\n\r\n## 🛠️ Development\r\n\r\n### Prerequisites\r\n\r\n- Node.js ≥ 22.0.0\r\n- Emscripten SDK ≥ 4.0.0\r\n- CMake ≥ 3.10\r\n\r\n### Building from Source\r\n\r\n```bash\r\n# Emscripten SDK installation\r\n# Clone repository\r\ngit clone https://github.com/emscripten-core/emsdk.git\r\ncd emsdk\r\n# Download and install the 4.0.1 SDK\r\n./emsdk install 4.0.1\r\n./emsdk activate 4.0.1\r\nsource ./emsdk_env.sh\r\n```\r\n\r\n```bash\r\n# WebAssembly module build\r\n# Clone repository\r\ngit clone https://github.com/sctg-development/aga8-js.git\r\ncd aga8-js\r\n\r\n# Install dependencies\r\nnpm install\r\n\r\n# Build WebAssembly module\r\nnpm run build\r\n\r\n# Run tests\r\nnpm test\r\n```\r\n\r\n## 🤝 Contributing\r\n\r\nWe welcome contributions!\r\n\r\n## 📄 License\r\n\r\n- **AGA8-JS**: GNU Affero General Public License v3.0\r\n- **Original AGA8 Implementation**: Public Domain (NIST)\r\n\r\n## 🙏 Acknowledgments\r\n\r\n- Original AGA8 implementation by the National Institute of Standards and Technology (NIST)\r\n- WebAssembly port, AGA8 modifications and maintenance by Ronan LE MEILLAT\r\n\r\n## 📧 Support\r\n\r\n- Create an [Issue](https://github.com/sctg-development/aga8-js/issues)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsctg-development%2Faga8-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsctg-development%2Faga8-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsctg-development%2Faga8-js/lists"}