Files
ASTM-D7896-19TransientHot-W…/ViewModels/MeasurementResult.cs
2026-05-20 19:46:52 +08:00

39 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using CommunityToolkit.Mvvm.ComponentModel;
namespace ASTM_D7896_Tester.ViewModels;
public partial class MeasurementResult : ObservableObject
{
[ObservableProperty]
private int _index;
[ObservableProperty]
private double _thermalConductivity; // W/m·K
[ObservableProperty]
private double _thermalDiffusivity; // ×10⁻⁶ m²/s
[ObservableProperty]
private double _specificHeatCapacity; // 比热容 J/(kg·K)
public void CalculateVhcAndCp(double density)
{
CalculateVhc(); // 先计算 VHC
if (density > 0)
SpecificHeatCapacity = VolumetricHeatCapacity * 1000 / density; // 注意单位转换
else
SpecificHeatCapacity = 0;
}
[ObservableProperty]
private double _volumetricHeatCapacity; // kJ/m³·K (自动计算)
public void CalculateVhc()
{
if (ThermalDiffusivity > 0)
VolumetricHeatCapacity = ThermalConductivity / (ThermalDiffusivity * 1e-6) / 1000.0;
else
VolumetricHeatCapacity = 0;
}
}