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 🙏

© 2026 – Pkg Stats / Ryan Hefner

wet-air

v0.4.7

Published

A wet air library

Downloads

79

Readme

wetAir

🗂️ 介绍

一个用于湿空气计算的 TypeScript 类,主要用于暖通空调(HVAC)领域的热力学计算。

🏷️ 软件架构

采用 ts 编写,使用面向对象编程思想,运用策略、工厂模式将湿空气的属性封装在类中,提供一系列的方法用于计算湿空气的属性。

✨ 功能和实现

  1. 核心功能:

    • 计算湿空气的各种物理参数,包括:
    • 干球温度、湿球温度、露点温度
    • 相对湿度、含湿量
    • 比焓、比容
    • 水蒸气分压力、饱和水蒸气分压力
    • 湿空气密度
  2. 主要计算原理:

    • 使用 ASHRAE(美国采暖、制冷与空调工程师学会)标准公式
    • 基于理想气体状态方程和热力学第一定律
    • 包含了多个经验公式和预计算常量
  3. 重要静态方法和属性:

    • PRECISION: 计算精度控制
    • Ra/Rv: 干空气和水蒸气的气体常数
    • ATMOSPHERIC_PRESSURE: 标准大气压
    • calcPvs(): 计算饱和蒸气压,使用缓存优化性能
    • calcPv(): 计算水蒸气分压力
    • calcEnthalpy(): 计算比焓值
    • calcHumidity(): 计算含湿量
  4. 构造函数特点:

    • 需要提供两个已知参数来初始化对象
    • 支持多种参数组合(如干球温度+湿球温度、干球温度+相对湿度等)
    • 包含参数有效性验证
  5. 注意事项:

    • 所有温度单位为摄氏度(℃)
    • 压力单位为千帕(KPa)
    • 含湿量单位为 kg/kg
    • 焓值单位为 kJ/kg
    • 包含参数范围检查,防止不合理的输入
  6. 特殊功能:

    • 使用缓存优化饱和蒸气压计算
    • 支持多种参数组合的相互转换
    • 包含数值求解方法(如二分法)用于复杂计算

🎯 使用场景:

  1. HVAC(暖通空调)系统设计
  2. 空气处理过程计算
  3. 湿空气热力学分析
  4. 环境控制系统

🔨 使用说明

const air = new WetAir({
  t: 25,
  tw: 20,
});

📝 注意事项:

  1. 所有温度值均为摄氏度
  2. 含湿量是质量比,不是体积比
  3. 相对湿度是 0-100%之间的值
  4. 这些参数之间存在相互关系,不能随意赋值
  5. 在实际应用中,通常只需要知道其中两个参数,就可以计算出其他参数

⚙️ 接口定义

  1. 接口名称:WetAirState

    • 这是一个用于表示湿空气物理状态的接口定义
  2. 属性说明:

  • t(干球温度)

    • 单位:摄氏度(℃)
    • 用途:表示空气的实际温度,是日常所说的温度
  • tw(湿球温度)

    • 单位:摄氏度(℃)
    • 用途:表示空气在水分蒸发达到饱和时的温度,用于计算湿度
  • td(露点温度)

    • 单位:摄氏度(℃)
    • 用途:表示空气冷却到饱和状态时的温度,用于判断结露可能性
  • h(比焓值)

    • 单位:千焦/千克(kJ/kg)
    • 用途:表示单位质量湿空气所含的总能量
  • d(含湿量)

    • 单位:千克/千克(Kg/kg)
    • 用途:表示单位质量干空气中所含水蒸气的质量
  • rh(相对湿度)

    • 单位:百分比(%)
    • 用途:表示空气中水蒸气的实际含量与同温度下饱和含量的比值.