• 露点温度 海平面气压 场面气压 计算公式 类


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace LuDianOperation
    {
        public class Ludian
        {
            //基于马哥拉斯改进公式计算水汽压与露点温度
    
            public double T { get; set; }
            public double F { get; set; }
            private double Pa { get; set; }
            private double a { get; set; }
            private double b { get; set; }
    
            public static readonly double E0 = 6.1078;
    
            //海平面气压
            // P0=Ps×10^[h/18400(1+Tm/273)]
    
            //P0为海平面气压,单位hPa;
            //Ps为本站气压,单位hPa;
            //h为气压传感器拔海高度,单位为m;
            //Tm为气柱平均温度,单位为℃,Tm=(t+t12)/2+h/400;
            //t为干球温度,单位℃;
            //t12为观测前12小时气温,单位℃。
    
            /// <summary>
            /// 获得海平面气压
            /// </summary>
            /// <param name="CurrentT">当前时间的温度</param>
            /// <param name="T12">12个小时之前的温度</param>
            /// <param name="CurrentStationPS">当前站点的气压</param>
            /// <param name="HaibaH">气压传感器拔海高度(海拔高度)</param>
            /// <returns>海平面气压(double)</returns>
            public double GetHaiPingMianQiYa(double CurrentT, double T12, double CurrentStationPS, double HaibaH)
            {
                try
                {
                    //Tm=(t+t12)/2+h/400;
                    double Tm = (CurrentT + T12) / 2 + HaibaH / 400;
                    //[h/18400(1+Tm/273)]
                    double centerDataOne = HaibaH / (18400 * (1 + Tm / 273));
                    //10^[h/18400(1+Tm/273)]
                    double centerDataTwo = Math.Pow(10.0, centerDataOne);
                    //Ps×10^[h/18400(1+Tm/273)]
                    return Math.Round(CurrentStationPS * centerDataTwo, 1);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    return 0.0;
                }
            }
    
            /// <summary>
            /// 无参数构造函数
            /// </summary>
            public Ludian()
            { 
                
            }
    
            /// <summary>
            /// 构造函数
            /// </summary>
            /// <param name="t">温度</param>
            /// <param name="f">湿度</param>
            public Ludian(double t, double f)
            {
                this.T = t;
                this.F = f;
                if (this.T > 0)
                {
                    this.a = 7.69;
                    this.b = 243.92;
                }
                else
                {
                    this.a = 9.5;
                    this.b = 265.5;
                }
            }
    
            #region 露点温度以及饱和水气压
            /// <summary>
            /// 获得饱和水蒸气压
            /// </summary>
            /// <returns></returns>
            public double GetES()
            {
                double Center = (a * this.T) / (b + this.T);
                return Math.Round(E0 * Math.Pow(10.0, Center), 1);
            }
    
            /// <summary>
            /// 计算中间变量
            /// </summary>
            /// <returns></returns>
            private double E()
            {
                return GetES() * F * 0.01;
            }
    
            /// <summary>
            /// 计算出露点温度
            /// </summary>
            /// <returns>double</returns>
            public double GetTd()
            {
                double ESS = E();
                double AAA = b * Math.Log10(ESS / E0);
                double BBB = a - Math.Log10(ESS / E0);
                return Math.Round(AAA / BBB, 1);
            }
    
            #endregion
    
    
    
            #region 水气压
            /// <summary>
            /// 根据水面温度获得水汽压
            /// </summary>
            /// <returns></returns>
            public double GetEShuiQIYA(double Ts)
            {
                double Two = 17.269 * ((Ts - 273.16) / (Ts - 35.86));
                return Math.Round(610.78 * Math.Exp(Two), 1);
            }
    
            /// <summary>
            /// 干湿球算法求水汽压
            /// </summary>
            /// <param name="FSS">相对湿度</param> 
            /// <returns></returns>
            public double GetEShuiQIYA()
            {
                return Math.Round((this.F * GetES() / 100), 2);
            }
    
            #endregion
    
        }
    }
    
  • 相关阅读:
    关于加密程序
    C++11的新特性lambda的小试牛刀RAII
    自动生成makefile的脚本
    关于pcre正则表达式库libpcre
    利用PHP执行SQL文件,将SQL文件导入到数据库
    Linux 系统是否适合于您?
    一个少年电脑病毒作者的独白
    PHP编程效率的20个要点
    JVM源码分析之javaagent原理完全解读
    如何更好的利用Node.js的性能极限
  • 原文地址:https://www.cnblogs.com/lierjie/p/4812875.html
Copyright © 2020-2023  润新知