312 lines
13 KiB
HTML
312 lines
13 KiB
HTML
<div class="container">
|
|
<div class="row">
|
|
<div class="col-xs-6">
|
|
<h1>Rod String & Pump</h1>
|
|
<br />
|
|
<div id="output">
|
|
<canvas id="taperCanvas" width="300" height="500"></canvas>
|
|
<!-- <%= channels["poc.well_setup"].value %> -->
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-xs-5">
|
|
<br />
|
|
<ul class="nav nav-tabs" id="taperTabs" role="tablist">
|
|
</ul>
|
|
<table class="table tablestriped" >
|
|
<thead>
|
|
<tr><th>Measurement</th><th>Value</th></tr>
|
|
</thead>
|
|
<tbody id="data_table">
|
|
|
|
<tr><td>Length</td><td><span id="tLength"></span> ft.</td></tr>
|
|
<tr><td>Diameter</td><td><span id="tDiameter"></span> in.</td></tr>
|
|
<tr><td>Material</td><td><span id="tMaterial"></span></td></tr>
|
|
<tr><td>Damping Factor</td><td><span id="tDamping"></span></td></tr>
|
|
</tbody>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-xs-5">
|
|
<h1>Motor Data</h1>
|
|
<table class="table tablestriped" >
|
|
<thead>
|
|
<tr><th>Measurement</th><th>Value</th></tr>
|
|
</thead>
|
|
<tbody id="motor_data_table">
|
|
<tr><td>Volts</td><td><span id="mVolts"></span> V</td></tr>
|
|
<tr><td>Hertz</td><td><span id="mHertz"></span> Hz</td></tr>
|
|
<tr><td>Poles</td><td><span id="mPoles"></span></td></tr>
|
|
<tr><td>Amps</td><td><span id="mAmps"></span> A</td></tr>
|
|
<tr><td>Horsepower</td><td><span id="mHorsepower"></span> HP</td></tr>
|
|
<tr><td>Service Factor</td><td><span id="mServiceFactor"></span></td></tr>
|
|
<tr><td>RPM</td><td><span id="mRPM"></span> RPM</td></tr>
|
|
<tr><td>Motor Sheave</td><td><span id="mMotorSheave"></span> in.</td></tr>
|
|
<tr><td>Gearbox Rating</td><td><span id="mGbxRating"></span> x 1000 in-lbs</td></tr>
|
|
<tr><td>Gearbox Ratio</td><td><span id="mGbxRatio"></span></td></tr>
|
|
<tr><td>Gearbox Limit</td><td><span id="mGbxLimit"></span></td></tr>
|
|
<tr><td>Gearbox Sheave</td><td><span id="mGbxSheave"></span> in.</td></tr>
|
|
<tr><td>Max Frequency</td><td><span id="mMaxFreq"></span> Hz</td></tr>
|
|
<tr><td>Min RPM</td><td><span id="mMinRPM"></span> RPM</td></tr>
|
|
<tr><td>Max RPM</td><td><span id="mMaxRPM"></span> RPM</td></tr>
|
|
</tbody>
|
|
|
|
</table>
|
|
</div>
|
|
|
|
<div class="col-xs-5 col-xs-offset-1">
|
|
<h1>Well Parameters</h1>
|
|
<table class="table tablestriped" >
|
|
<thead>
|
|
<tr><th>Measurement</th><th>Value</th></tr>
|
|
</thead>
|
|
<tbody id="well_data_table">
|
|
<tr><td>API Gravity Oil</td><td><span id="wAPIOil"></span></td></tr>
|
|
<tr><td>Specific Gravity Water</td><td><span id="wSGWater"></span></td></tr>
|
|
<tr><td>Young's Modulus (Steel)</td><td><span id="wYMSteel"></span> x 10^6</td></tr>
|
|
<tr><td>Young's Modulus (Fiberglass)</td><td><span id="wYMFiberglass"></span> x 10^6</td></tr>
|
|
<tr><td>Water Cut</td><td><span id="wWaterCut"></span> %</td></tr>
|
|
<tr><td>Casing ID</td><td><span id="wCasingID"></span> in.</td></tr>
|
|
<tr><td>Tubing OD</td><td><span id="wTubingOD"></span> in.</td></tr>
|
|
<tr><td>Tubing ID</td><td><span id="wTubingID"></span> in.</td></tr>
|
|
<tr><td>Tubing Anchor Depth</td><td><span id="wAnchorDepth"></span> ft.</td></tr>
|
|
<tr><td>Pump Diameter</td><td><span id="wPumpDiameter"></span> in.</td></tr>
|
|
<tr><td>Pump Constant</td><td><span id="wPumpConstant"></span></td></tr>
|
|
<tr><td>Structural Rating</td><td><span id="wStructuralRating"></span> x 100 lbs.</td></tr>
|
|
<tr><td>Motor Control Mode</td><td><span id="wMotorControlMode"></span></td></tr>
|
|
<tr><td>Total Vertical Depth</td><td><span id="wTotalVerticalDepth"></span> ft.</td></tr>
|
|
<tr><td>Well Type</td><td><span id="wWellType"></span></td></tr>
|
|
<tr><td>Surface Stroke Length</td><td><span id="wSurfaceStrokeLength"></span> in.</td></tr>
|
|
</tbody>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- {"backupData":{
|
|
a"Youngs_Modulus_Steel":"30.5",
|
|
"unitConfig":{
|
|
a"SG_Water":"1.25",
|
|
a"API_Oil":"1.1",
|
|
a"Gearbox_Sheave":"35.75",
|
|
a"Percent_Water":"91.667",
|
|
a"Total_Vertical_Depth_Input":"12000.0",
|
|
a"Tubing_Size_ID":"1.995",
|
|
a"Anchor_Depth":"8923.0",
|
|
a"motorNameplate":{
|
|
a "Volts":"480.0",
|
|
a "Hertz":"60.0",
|
|
a "Poles":"6",
|
|
a "Amps":"52.0",
|
|
a "Horsepower":"40.0",
|
|
a "ServiceFactor":"1.15",
|
|
a "RPM":"1100.0"
|
|
},
|
|
a"RPM_Minimum":"0.0",
|
|
a"Total_Vertical_Depth":"10395.0",
|
|
a"Tubing_Size_OD":"2.375",
|
|
a"Pump_Diameter":"1.25",
|
|
a"Motor_Sheave_Size":"4.75",
|
|
a"Rating_Gearbox":"320.0",
|
|
a"Gearbox_Limit":"100.0",
|
|
a"Rating_Structural":"305.0",
|
|
a"Speed_Torque_Mode":"3",
|
|
a"Pump_Constant":"0.0",
|
|
a"Gearbox_Ratio":"28.7",
|
|
"Well_Type":"0",
|
|
a"MaxFreq":"155.0",
|
|
a"RPM_Maximum":"2500.0",
|
|
a"MotorCntrlMode":"3",
|
|
"Total_Stroke_Length":"99.0"
|
|
},
|
|
"Youngs_Modulus_Fiberglass":"7.2",
|
|
"Casing_ID":"4.892",
|
|
"taper":[
|
|
{"setup":
|
|
{
|
|
"Diameter":"0.0",
|
|
"c":"0.0",
|
|
"Material":"0",
|
|
"Length":"0.0",
|
|
"RodCount":"0",
|
|
"UseRodCount":"0"
|
|
}
|
|
},
|
|
{"setup":{"Diameter":"0.75","c":"0.08","Material":"1","Length":"10095.0","RodCount":"0","UseRodCount":"0"}},{"setup":{"Diameter":"1.5","c":"0.08","Material":"1","Length":"300.0","RodCount":"0","UseRodCount":"0"}},{"setup":{"Diameter":"1.5","c":"0.08","Material":"1","Length":"0.0","RodCount":"0","UseRodCount":"0"}},{"setup":{"Diameter":"0.75","c":"0.0","Material":"1","Length":"0.0","RodCount":"0","UseRodCount":"0"}},{"setup":{"Diameter":"1.5","c":"0.0","Material":"1","Length":"0.0","RodCount":"0","UseRodCount":"0"}},{"setup":{"Diameter":"1.5","c":"0.0","Material":"1","Length":"0.0","RodCount":"0","UseRodCount":"0"}},{"setup":{"Diameter":"0.0","c":"0.0","Material":"1","Length":"0.0","RodCount":"0","UseRodCount":"0"}},{"setup":{"Diameter":"0.0","c":"0.0","Material":"1","Length":"0.0","RodCount":"0","UseRodCount":"0"}},{"setup":{"Diameter":"0.0","c":"0.0","Material":"1","Length":"0.0","RodCount":"0","UseRodCount":"0"}},{"setup":{"Diameter":"0.0","c":"0.0","Material":"1","Length":"0.0","RodCount":"0","UseRodCount":"0"}}]}} -->
|
|
|
|
<script>
|
|
var raw = <%= channels["poc.well_setup"].value %>;
|
|
// var parsed = JSON.stringify(raw);
|
|
var backupData = raw.backupData;
|
|
var taperData = backupData.taper;
|
|
var unitConfig = backupData.unitConfig;
|
|
|
|
var taper_sel = 1;
|
|
|
|
var taperLength = [];
|
|
var taperWidth = [];
|
|
var rodDepth = [];
|
|
var taperDepth = [];
|
|
|
|
var context = document.getElementById("taperCanvas").getContext("2d");
|
|
var canvas_width = $('#taperCanvas').width();
|
|
var canvas_height = $('#taperCanvas').height();
|
|
var pump_height = 100;
|
|
var taper_height = canvas_height - pump_height;
|
|
var max_width = canvas_width * 0.5;
|
|
var total_depth = parseFloat(unitConfig.Total_Vertical_Depth);
|
|
var currentDepth = 0;
|
|
for(var i = 0; i< taperData.length; i++){
|
|
if (taperData[i].setup.Length > 0.0){
|
|
$('#taperTabs').append('<li class="t_tab" id="taper'+i+'" taper='+i+'><a href="#" style="color:#337AB7">'+i+'</a></li>');
|
|
taperLength.push((taperData[i].setup.Length / total_depth) * taper_height);
|
|
taperWidth.push(taperData[i].setup.Diameter * (max_width / 2.5));
|
|
rodDepth.push(currentDepth);
|
|
taperDepth.push((currentDepth /total_depth) * taper_height);
|
|
currentDepth = currentDepth + parseFloat(taperData[i].setup.Length);
|
|
|
|
}
|
|
}
|
|
console.log({rodDepth:rodDepth});
|
|
console.log({taperDepth:taperDepth});
|
|
var drawTapers = function(active){
|
|
var horiz_space = 0;
|
|
var gradient=context.createLinearGradient((canvas_width - max_width) / 2,0,((canvas_width - max_width) / 2)+max_width,0);
|
|
gradient.addColorStop(0,"black");
|
|
gradient.addColorStop(0.5,"white");
|
|
gradient.addColorStop(1,"black");
|
|
context.fillStyle=gradient;
|
|
context.lineWidth = 2;
|
|
|
|
|
|
|
|
for (i=0;i<taperLength.length; i++){
|
|
horiz_space = (canvas_width - taperWidth[i]) / 2;
|
|
context.beginPath();
|
|
context.moveTo(horiz_space, taperDepth[i]);
|
|
context.lineTo(horiz_space + taperWidth[i], taperDepth[i]);
|
|
context.lineTo(horiz_space + taperWidth[i], taperDepth[i]+ taperLength[i]);
|
|
context.lineTo(horiz_space, taperDepth[i] + taperLength[i]);
|
|
context.lineTo(horiz_space, taperDepth[i]);
|
|
|
|
console.log(active);
|
|
if (i+1 == active){
|
|
context.strokeStyle = 'red';
|
|
} else {
|
|
context.strokeStyle = 'black';
|
|
}
|
|
// context.strokeStyle = 'black';
|
|
|
|
context.fill();
|
|
context.stroke()
|
|
context.closePath();
|
|
|
|
|
|
}
|
|
var pump_width = unitConfig.Pump_Diameter * (max_width/2.5);
|
|
horiz_space = (canvas_width - pump_width) / 2;
|
|
if (active =="Unit"){
|
|
context.strokeStyle = 'red';
|
|
} else {
|
|
context.strokeStyle = 'black';
|
|
}
|
|
// context.strokeStyle = 'blue';
|
|
context.beginPath();
|
|
context.moveTo(horiz_space, taper_height);
|
|
context.lineTo(horiz_space + pump_width, taper_height);
|
|
context.lineTo(horiz_space + pump_width, taper_height + pump_height);
|
|
context.lineTo(horiz_space, taper_height + pump_height);
|
|
context.lineTo(horiz_space, taper_height);
|
|
context.fill();
|
|
context.stroke()
|
|
context.closePath();
|
|
|
|
}
|
|
drawTapers(1);
|
|
|
|
var updateTable = function(taper_selected){
|
|
$('#data_table').html('<tr><td>Length</td><td><span id="tLength"></span> ft.</td></tr><tr><td>Diameter</td><td><span id="tDiameter"></span> in.</td></tr><tr><td>Material</td><td><span id="tMaterial"></span></td></tr><tr><td>Damping Factor</td><td><span id="tDamping"></span></td></tr>');
|
|
var material;
|
|
$('#tLength').text(taperData[taper_selected].setup.Length);
|
|
$('#tDiameter').text(taperData[taper_selected].setup.Diameter);
|
|
if (parseInt(taperData[taper_selected].setup.Material) == 1){
|
|
material = "Steel";
|
|
} else if (parseInt(taperData[taper_selected].setup.Material) == 2){
|
|
material = "Fiberglass";
|
|
}
|
|
$('#tMaterial').text(material);
|
|
$('#tDamping').text(taperData[taper_selected].setup.c);
|
|
|
|
}
|
|
|
|
updateTable(1);
|
|
|
|
|
|
$('#taper1').addClass('active');
|
|
|
|
$(".t_tab").click(function(){
|
|
$("#taperTabs>.active").removeClass('active');
|
|
$(this).addClass('active');
|
|
taper_sel = $(this).attr("taper");
|
|
if (taper_sel != "Unit"){
|
|
updateTable(taper_sel);
|
|
} else {
|
|
$("#data_table").html("<tr><td>Pump Diameter</td><td>"+ taperData["Unit"].Pump_Diameter+ " in.</td></tr>");
|
|
}
|
|
drawTapers(taper_sel);
|
|
})
|
|
|
|
|
|
$('#mVolts').text(unitConfig.motorNameplate.Volts);
|
|
$('#mHertz').text(unitConfig.motorNameplate.Hertz);
|
|
$('#mPoles').text(unitConfig.motorNameplate.Poles);
|
|
$('#mAmps').text(unitConfig.motorNameplate.Amps);
|
|
$('#mHorsepower').text(unitConfig.motorNameplate.Horsepower);
|
|
$('#mServiceFactor').text(unitConfig.motorNameplate.ServiceFactor);
|
|
$('#mRPM').text(unitConfig.motorNameplate.RPM);
|
|
|
|
$('#mMotorSheave').text(unitConfig.Motor_Sheave_Size);
|
|
$('#mGbxRating').text(unitConfig.Rating_Gearbox);
|
|
$('#mGbxRatio').text(unitConfig.Gearbox_Ratio);
|
|
$('#mGbxLimit').text(unitConfig.Gearbox_Limit);
|
|
$('#mGbxSheave').text(unitConfig.Gearbox_Sheave);
|
|
$('#mMaxFreq').text(unitConfig.MaxFreq);
|
|
$('#mMinRPM').text(unitConfig.RPM_Minimum);
|
|
$('#mMaxRPM').text(unitConfig.RPM_Maximum);
|
|
|
|
$('#wAPIOil').text(unitConfig.API_Oil);
|
|
$('#wSGWater').text(unitConfig.SG_Water);
|
|
$('#wYMSteel').text(backupData.Youngs_Modulus_Steel);
|
|
$('#wYMFiberglass').text(backupData.Youngs_Modulus_Fiberglass);
|
|
$('#wWaterCut').text(unitConfig.Percent_Water);
|
|
$('#wTubingOD').text(unitConfig.Tubing_Size_OD);
|
|
$('#wTubingID').text(unitConfig.Tubing_Size_ID);
|
|
$('#wCasingID').text(backupData.Casing_ID);
|
|
$('#wAnchorDepth').text(unitConfig.Anchor_Depth);
|
|
$('#wPumpDiameter').text(unitConfig.Pump_Diameter);
|
|
$('#wPumpConstant').text(unitConfig.Pump_Constant);
|
|
$('#wStructuralRating').text(unitConfig.Rating_Structural);
|
|
|
|
if (parseInt(unitConfig.MotorCntrlMode) == 3){
|
|
$('#wMotorControlMode').text("Torque");
|
|
} else if (parseInt(unitConfig.MotorCntrlMode) == 1) {
|
|
$('#wMotorControlMode').text("Speed");
|
|
}
|
|
|
|
$('#wTotalVerticalDepth').text(unitConfig.Total_Vertical_Depth);
|
|
|
|
if (parseInt(unitConfig.Well_Type) == 0){
|
|
$('#wWellType').text("Vertical");
|
|
} else if (parseInt(unitConfig.Well_Type) == 1) {
|
|
$('#wWellType').text("Directional");
|
|
}
|
|
|
|
$('#wSurfaceStrokeLength').text(unitConfig.Total_Stroke_Length);
|
|
|
|
|
|
|
|
</script>
|