From 72a20adc878ad7345aeb0cafac20964c1f131034 Mon Sep 17 00:00:00 2001 From: DXC Date: Fri, 10 Jul 2026 14:48:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(gas.py):=20=E4=BF=AE=E5=A4=8D=E7=90=86?= =?UTF-8?q?=E6=83=B3=E6=B0=94=E4=BD=93=E5=AE=9A=E5=BE=8B=E6=B8=A9=E5=BA=A6?= =?UTF-8?q?=E9=A1=B9=E9=87=8D=E5=A4=8D=E7=9B=B8=E5=8A=A0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gas_density() 函数第 36 行: - 原代码: (local_temperature_kelvin + standard_temperature) / standard_temperature 物理错误:T_K 已在第32行完成 °C→K 转换(+273.15),这里又加了一次 273.15, 导致体积修正因子偏大约 2 倍(对 7.4°C 数据:553.7/273.15≈2.03 而非正确的 280.55/273.15≈1.03) - 修复: local_temperature_kelvin / standard_temperature 符合理想气体定律 V₂ = V₁ × (P₁/P₂) × (T₂/T₁) 影响范围:所有通过 gas_flux_column() 计算的通量值,修复后通量约为原值的 2 倍 --- .idea/dataSources.xml | 17 +++++++++++++++++ src/gasflux/gas.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .idea/dataSources.xml diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml new file mode 100644 index 0000000..91b8d44 --- /dev/null +++ b/.idea/dataSources.xml @@ -0,0 +1,17 @@ + + + + + sqlite.xerial + true + org.sqlite.JDBC + jdbc:sqlite:D:\111\office\ZHLduijie\6\UAV-CO2\web_api_data\outputs\gasflux.db + $ProjectFileDir$ + + + file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.51.1/org/xerial/sqlite-jdbc/3.51.1.0/sqlite-jdbc-3.51.1.0.jar + + + + + \ No newline at end of file diff --git a/src/gasflux/gas.py b/src/gasflux/gas.py index 4e5620f..280e3ca 100644 --- a/src/gasflux/gas.py +++ b/src/gasflux/gas.py @@ -33,7 +33,7 @@ def gas_density(local_pressure: float, local_temperature_celsius: float, gas: st local_volume = ( gas_variables["standard_molar_volume"] * (gas_variables["standard_pressure"] / local_pressure) - * ((local_temperature_kelvin + gas_variables["standard_temperature"]) / gas_variables["standard_temperature"]) + * (local_temperature_kelvin / gas_variables["standard_temperature"]) ) # m3⋅mol-1 return mass(gas) / 1000 / local_volume