2026-02-27 16:03:49 +08:00
|
|
|
|
namespace MembranePoreTester.Models
|
|
|
|
|
|
{
|
2026-04-12 20:22:21 +08:00
|
|
|
|
public class TestLiquid : IEquatable<TestLiquid>
|
2026-02-27 16:03:49 +08:00
|
|
|
|
{
|
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
public double SurfaceTension { get; set; } // mN/m, 25°C
|
|
|
|
|
|
|
|
|
|
|
|
// Cγ 值
|
|
|
|
|
|
public double C_Pa => 2860 * SurfaceTension;
|
|
|
|
|
|
public double C_cmHg => 2.15 * SurfaceTension;
|
|
|
|
|
|
public double C_psi => 0.415 * SurfaceTension;
|
|
|
|
|
|
|
2026-04-12 20:22:21 +08:00
|
|
|
|
private static readonly List<TestLiquid> _predefined = new()
|
2026-02-27 16:03:49 +08:00
|
|
|
|
{
|
|
|
|
|
|
new TestLiquid { Name = "水", SurfaceTension = 72.0 },
|
|
|
|
|
|
new TestLiquid { Name = "石油馏分", SurfaceTension = 30.0 },
|
|
|
|
|
|
new TestLiquid { Name = "乙醇", SurfaceTension = 22.3 },
|
2026-03-19 20:40:54 +08:00
|
|
|
|
new TestLiquid { Name = "液态石蜡", SurfaceTension = 34.7 },
|
|
|
|
|
|
new TestLiquid { Name = "BSD16", SurfaceTension = 16.0 } // 新增
|
2026-02-27 16:03:49 +08:00
|
|
|
|
};
|
2026-04-12 20:22:21 +08:00
|
|
|
|
|
|
|
|
|
|
// 返回可修改的全局液体列表(允许在运行时添加自定义液体便于恢复选择)
|
|
|
|
|
|
public static List<TestLiquid> Predefined => _predefined;
|
|
|
|
|
|
|
|
|
|
|
|
public override string ToString() => Name;
|
|
|
|
|
|
|
|
|
|
|
|
public bool Equals(TestLiquid other)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (other is null) return false;
|
|
|
|
|
|
// 以 Name 为主键判断相等,SurfaceTension 可作为辅助信息
|
|
|
|
|
|
return string.Equals(Name, other.Name, StringComparison.Ordinal);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj) => Equals(obj as TestLiquid);
|
|
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode() => Name?.GetHashCode() ?? 0;
|
2026-02-27 16:03:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|