lx
2025-07-07 c3904896ecb869d4147b749b00db9e88736bf444
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using ErrorAnalysis.Repository;
using ErrorAnalysis.Service.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ErrorAnalysis.Service
{
    public class ErrorRatioCalc
    {
        public static ErrorRatioResult GetErrorRatioResult() { return new ErrorRatioResult(); }
 
        private static ErrorRatio GetFirstErrorRatio(string connectionString, string modelID, double porosity, double sw, double speed)
        {
            var coWOLRepository = new COWOLRepository(connectionString);
            var cWolRes = coWOLRepository.GetWOL(modelID, 0);
            var oWolRes = coWOLRepository.GetWOL(modelID, 100);
 
            var mergePDEV = PDEVCalcService.GetMergePDEV(connectionString, modelID, porosity, speed);
 
            var poroFiledName = $"WLPu" + porosity;
            var property = cWolRes.GetType().GetProperty(poroFiledName);
 
            var errorRatio = mergePDEV / ((double)property.GetValue(cWolRes) - (double)property.GetValue(cWolRes));
 
            return new ErrorRatio { Pass = 1, ErrorRatioValue = errorRatio, Porosity = porosity };
        }
    }
}