LiquidCalculator.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. package com.hb.proj.gather.process;
  2. import org.slf4j.Logger;
  3. import org.slf4j.LoggerFactory;
  4. import com.hb.proj.gather.model.WellMeasurePO;
  5. /**
  6. * 动液面相关数据计算
  7. * @author cwen
  8. *
  9. */
  10. public class LiquidCalculator {
  11. private static final Logger logger=LoggerFactory.getLogger(LiquidCalculator.class);
  12. /**
  13. * 计算折算动液面深度
  14. * 折算液面深度( m)=校正动液面深度(m)-(套压(动液面采集值MPa)/(混液密度(kg/l)*重力加速度(m/s2)))*1000
  15. * @param liquidDepth 校正动液面深度
  16. * @param casingPreDev 动液面采集套压
  17. * @param measure 测量数据对象
  18. * @return
  19. */
  20. public static Double calcConvertLiquidDepth(Double liquidDepth,Double casingPreDev,WellMeasurePO measure) {
  21. if(liquidDepth==null || casingPreDev==null || measure==null) {
  22. return null;
  23. }
  24. if(measure==null || measure.getMixLiquidDensity()==null || measure.getGravity()==null) {
  25. return null;
  26. }
  27. try {
  28. double rst=0;
  29. rst=(casingPreDev*1000)/(measure.getMixLiquidDensity()*measure.getGravity());
  30. rst=liquidDepth-rst;
  31. rst=Math.round(rst*100)*0.01;
  32. return rst;
  33. }
  34. catch(Exception e) {
  35. logger.error("折算动液面深度计算出错:{}",e.getMessage());
  36. return null;
  37. }
  38. }
  39. /**
  40. * 计算深度压差=折算动液面深度-折算静液面深度=折算动液面深度-最后一次静液测算时的折算液面深度
  41. * @param cvtLiquidDepth 折算动液面深度
  42. * @param cvtLiquidStaticDepth 折算静液面深度
  43. * @return
  44. */
  45. public static Double calcDepthDiff(Double cvtLiquidDepth,Double cvtLiquidStaticDepth) {
  46. if(cvtLiquidDepth==null || cvtLiquidStaticDepth==null) {
  47. return null;
  48. }
  49. return cvtLiquidDepth.doubleValue()-cvtLiquidStaticDepth.doubleValue();
  50. }
  51. /**
  52. * 计算流动压差KPa【压力(KPa)=(深度差(m)*液体密度(Kg/L)*重力加速度(m/s2))】
  53. * @param depthDiff
  54. * @param lastMeasure
  55. * @return
  56. */
  57. public static Double calcFlowPreeDiff(Double depthDiff,WellMeasurePO lastMeasure) {
  58. if(depthDiff==null || lastMeasure==null) {
  59. return null;
  60. }
  61. if(lastMeasure.getMixLiquidDensity()==null || lastMeasure.getGravity()==null) {
  62. return null;
  63. }
  64. return depthDiff.doubleValue()*lastMeasure.getMixLiquidDensity().doubleValue()*lastMeasure.getGravity().doubleValue();
  65. }
  66. }