|
@@ -1,56 +1,76 @@
|
|
|
package com.hb.proj.analysis.service;
|
|
|
|
|
|
-import com.hb.proj.model.LiquidPO;
|
|
|
import com.hb.proj.model.WellAnalysisParamPO;
|
|
|
import com.hb.proj.model.WellMeasurePO;
|
|
|
import com.hb.proj.model.WellPumpPO;
|
|
|
-import com.hb.proj.model.WellRtDataVO;
|
|
|
|
|
|
public class ProduceParamCalculator {
|
|
|
|
|
|
- public WellAnalysisParamPO calc(WellMeasurePO measure,WellPumpPO pump,WellRtDataVO wellRt,LiquidPO liquid) {
|
|
|
+ public static WellAnalysisParamPO calc(WellMeasurePO measure,WellPumpPO pump,Double rtFreq) {
|
|
|
+
|
|
|
WellAnalysisParamPO analyParam=new WellAnalysisParamPO();
|
|
|
+ analyParam.setRefMeasureId(measure.getMeasureId());
|
|
|
+ analyParam.setRefPumpId(pump.getPumpId());
|
|
|
+
|
|
|
+ //含水率原值为百分数,计算时要*0.01
|
|
|
+ Double waterRatio=measure.getWaterRatio()!=null?(measure.getWaterRatio().doubleValue()*0.01):null;
|
|
|
|
|
|
/**
|
|
|
* 计量油量=计量液量*(1-含水率)
|
|
|
* 计量水量=计量液量*含水率
|
|
|
*/
|
|
|
- analyParam.setMeteredOilYield(measure.getMeteredLiquidYield()*(1-measure.getWaterRatio()));
|
|
|
- analyParam.setMeteredWaterYield(measure.getMeteredLiquidYield()*measure.getWaterRatio());
|
|
|
+ if(isNotNull(measure.getMeteredLiquidYield(),waterRatio)) {
|
|
|
+ analyParam.setMeteredOilYield(measure.getMeteredLiquidYield()*(1-waterRatio));
|
|
|
+ analyParam.setMeteredWaterYield(measure.getMeteredLiquidYield()*waterRatio);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 测量油量=测量液量*(1-含水率)
|
|
|
* 测量水量=测量液量*(1-含水率)
|
|
|
*/
|
|
|
- analyParam.setMeasureOilYield(measure.getMeasureLiquidYield()*(1-measure.getWaterRatio()));
|
|
|
- analyParam.setMeasureWaterYield(measure.getMeasureLiquidYield()*measure.getWaterRatio());
|
|
|
+ if(isNotNull(measure.getMeasureLiquidYield(),waterRatio)) {
|
|
|
+ analyParam.setMeasureOilYield(measure.getMeasureLiquidYield()*(1-waterRatio));
|
|
|
+ analyParam.setMeasureWaterYield(measure.getMeasureLiquidYield()*waterRatio);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 泵理论排量=截面积*柱塞冲程*spm*24*60*泵系数
|
|
|
+ * 泵理论排量=截面积*柱塞冲程*spm*24*60*泵系数*0.000001
|
|
|
* 理论排量按每分钟1冲次,泵系数为1计算。
|
|
|
* 新泵时为1,长期使用小于1,用于修正泵理论排量
|
|
|
* spm 冲次频率(每分钟) 目前固定为1
|
|
|
*/
|
|
|
- pump.setSpm(1);
|
|
|
- double tempYield=pump.getPi()*Math.pow(pump.getBasicDiam()/2,2)*pump.getStroke()*pump.getPumpCoeff()*pump.getSpm()*24*60;
|
|
|
- pump.setTheoryVolume(tempYield);
|
|
|
+ if(isNotNull(pump.getBasicDiam(),pump.getStroke(),pump.getPumpCoeff())){
|
|
|
+ pump.setSpm(1);
|
|
|
+ double tempYield=pump.getPi()*Math.pow(pump.getBasicDiam()/2,2)*pump.getStroke()*pump.getPumpCoeff()*pump.getSpm()*24*60*0.000001;
|
|
|
+ pump.setTheoryVolume(tempYield);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 理论液量=泵理论排量*冲次
|
|
|
*/
|
|
|
- analyParam.setTheoryLiquidYield(pump.getTheoryVolume()*wellRt.getFreq());
|
|
|
+ if(pump.getTheoryVolume()!=null) {
|
|
|
+ analyParam.setTheoryLiquidYield(pump.getTheoryVolume()*rtFreq);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 测量泵效=测量液量/理论液量
|
|
|
* 校准泵效=计量液量/理论液量
|
|
|
* 综合泵效=弹性伸缩*泵充满度*漏失系数*地表体积系数
|
|
|
*/
|
|
|
+ if(isNotNull(measure.getMeasureLiquidYield(),measure.getMeteredLiquidYield(),analyParam.getTheoryLiquidYield())) {
|
|
|
+ analyParam.setMeasuredPumpEff(measure.getMeasureLiquidYield()/analyParam.getTheoryLiquidYield());
|
|
|
+ analyParam.setCorrectPumpEff(measure.getMeteredLiquidYield()/analyParam.getTheoryLiquidYield());
|
|
|
+ }
|
|
|
+ if(isNotNull(measure.getElasticCoeff(),pump.getFillDegree(),pump.getLeakCoeff(),measure.getSurfaceCompCoe())) {
|
|
|
+ analyParam.setComPumpEff(measure.getElasticCoeff()*pump.getFillDegree()*pump.getLeakCoeff()*measure.getSurfaceCompCoe());
|
|
|
+ }
|
|
|
|
|
|
- analyParam.setMeasuredPumpEff(measure.getMeasureLiquidYield()/analyParam.getTheoryLiquidYield());
|
|
|
- analyParam.setCorrectPumpEff(measure.getMeteredLiquidYield()/analyParam.getTheoryLiquidYield());
|
|
|
- analyParam.setComPumpEff(measure.getElasticCoeff()*pump.getFillDegree()*pump.getLeakCoeff()*measure.getSurfaceCompCoe());
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -58,16 +78,22 @@ public class ProduceParamCalculator {
|
|
|
* 实际油量=实际液量*(1-含水率),用于绘制IPR曲线
|
|
|
* 实际水量=实际液量´含水率,用于绘制IPR曲线
|
|
|
*/
|
|
|
- analyParam.setRealLiquidYield(analyParam.getCorrectPumpEff()*analyParam.getTheoryLiquidYield());
|
|
|
- analyParam.setRealOilYield(analyParam.getRealLiquidYield()*(1-measure.getWaterRatio()));
|
|
|
- analyParam.setRealWaterYield(analyParam.getRealLiquidYield()*measure.getWaterRatio());
|
|
|
+ if(isNotNull(analyParam.getCorrectPumpEff(),analyParam.getTheoryLiquidYield(),analyParam.getRealLiquidYield(),waterRatio)) {
|
|
|
+ analyParam.setRealLiquidYield(analyParam.getCorrectPumpEff()*analyParam.getTheoryLiquidYield());
|
|
|
+ analyParam.setRealOilYield(analyParam.getRealLiquidYield()*(1-waterRatio));
|
|
|
+ analyParam.setRealWaterYield(analyParam.getRealLiquidYield()*waterRatio);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 深度压差(m)=折算动液面深度-折算静液面深度
|
|
|
* 流动压差(Mpa)=油藏压力-井底生产压力=深度压差*混液密度*g/1000
|
|
|
*/
|
|
|
- analyParam.setDiffPressBtmflow(analyParam.getDiffPressDepth()*measure.getMixLiquidDensity()*measure.getGravity()/1000);
|
|
|
+ if(isNotNull(analyParam.getDiffPressDepth(),measure.getMixLiquidDensity(),measure.getGravity())) {
|
|
|
+ analyParam.setDiffPressBtmflow(analyParam.getDiffPressDepth()*measure.getMixLiquidDensity()*measure.getGravity()/1000);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 油指数_J=功图液量/流动压差
|
|
@@ -75,27 +101,26 @@ public class ProduceParamCalculator {
|
|
|
* 计量指数_J=计量液量/流动压差
|
|
|
* 计量指数_K=计量液量/深度压差
|
|
|
*/
|
|
|
+ if(isNotNull(analyParam.getDiagramLiquidYield(),analyParam.getDiffPressBtmflow(),analyParam.getDiffPressDepth())) {
|
|
|
+ analyParam.setProductIndexJ(analyParam.getDiagramLiquidYield()/analyParam.getDiffPressBtmflow());
|
|
|
+ analyParam.setProductIndexK(analyParam.getDiagramLiquidYield()/analyParam.getDiffPressDepth());
|
|
|
+ }
|
|
|
|
|
|
- analyParam.setProductIndexJ(analyParam.getDiagramLiquidYield()/analyParam.getDiffPressBtmflow());
|
|
|
- analyParam.setProductIndexK(analyParam.getDiagramLiquidYield()/analyParam.getDiffPressDepth());
|
|
|
-
|
|
|
- analyParam.setMeteredProductIndexJ(measure.getMeteredLiquidYield()/analyParam.getDiffPressBtmflow());
|
|
|
- analyParam.setMeteredProductIndexK(measure.getMeteredLiquidYield()/analyParam.getDiffPressDepth());
|
|
|
+ if(isNotNull(measure.getMeteredLiquidYield(),analyParam.getDiffPressBtmflow(),analyParam.getDiffPressDepth())) {
|
|
|
+ analyParam.setMeteredProductIndexJ(measure.getMeteredLiquidYield()/analyParam.getDiffPressBtmflow());
|
|
|
+ analyParam.setMeteredProductIndexK(measure.getMeteredLiquidYield()/analyParam.getDiffPressDepth());
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
- * 折算静深度=静液面深度-(套压(MPa)/(液体密度(kg/l)*重力加速度(m/s2)))*1000
|
|
|
- * 套管压力不为零时的静液面深度.计算折算深度时要用对应时间的套压
|
|
|
- *
|
|
|
- * 折算动深度=校正动液面深度-(套压(MPa)/(液体密度(kg/l)*重力加速度(m/s2)))*1000
|
|
|
- * 套管压力不为零时的动液面深度。计算折算深度时要用对应时间的套压
|
|
|
- *
|
|
|
- * 套压:指动液面设备返回的套压值
|
|
|
- * 校正液面深度,手动计算保存后,折算动液面深度也要跟随变化吧
|
|
|
- */
|
|
|
- Double disD=liquid.getCasingPressDev()*1000/(measure.getMixLiquidDensity()*measure.getGravity());
|
|
|
- analyParam.setCvtStaticLiquidDepth(measure.getStaticLiquidDepth()-disD);
|
|
|
- analyParam.setCvtStaticLiquidDepth(liquid.getLiquidDepth()-disD);
|
|
|
|
|
|
+
|
|
|
return analyParam;
|
|
|
}
|
|
|
+
|
|
|
+ private static boolean isNotNull(Double... vals) {
|
|
|
+ boolean rst=true;
|
|
|
+ for(Double val : vals) {
|
|
|
+ rst=val!=null && rst;
|
|
|
+ }
|
|
|
+ return rst;
|
|
|
+ }
|
|
|
}
|