Calculating Weight on Bit from Acceleration

Weight on Bit Calculator: Calculate Downhole Force Accurately :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –shadow-color: rgba(0, 0, 0, 0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 1000px; margin: 20px auto; padding: 20px; background-color: #fff; box-shadow: var(–shadow-color) 0 5px 15px; border-radius: 8px; } h1, h2, h3 { color: var(–primary-color); text-align: center; margin-bottom: 1.5em; } .calc-header { text-align: center; margin-bottom: 2em; } .calc-header h1 { font-size: 2.5em; margin-bottom: 0.5em; } .calc-header p { font-size: 1.1em; color: #555; } .loan-calc-container { background-color: #fff; padding: 25px; border-radius: 8px; box-shadow: var(–shadow-color) 0 2px 10px; margin-bottom: 30px; } .input-group { margin-bottom: 20px; padding: 10px; border: 1px solid #eee; border-radius: 5px; transition: border-color 0.3s ease; } .input-group:focus-within { border-color: var(–primary-color); } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group select { width: calc(100% – 24px); padding: 12px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; box-sizing: border-box; transition: border-color 0.3s ease; } .input-group input[type="number"]:focus, .input-group select:focus { border-color: var(–primary-color); outline: none; } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; display: block; } .error-message { color: #dc3545; font-size: 0.9em; margin-top: 5px; display: none; } .error-message.visible { display: block; } .button-group { display: flex; justify-content: space-between; margin-top: 25px; flex-wrap: wrap; gap: 10px; } .button-group button { padding: 12px 20px; border: none; border-radius: 5px; font-size: 1em; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; flex: 1; min-width: 150px; } .button-group button:hover { transform: translateY(-2px); } .btn-calculate { background-color: var(–primary-color); color: white; } .btn-calculate:hover { background-color: #003366; } .btn-reset { background-color: #6c757d; color: white; } .btn-reset:hover { background-color: #5a6268; } .btn-copy { background-color: var(–success-color); color: white; } .btn-copy:hover { background-color: #218838; } .results-container { margin-top: 30px; padding: 25px; background-color: var(–primary-color); color: white; border-radius: 8px; text-align: center; } .results-container h2 { color: white; margin-bottom: 0.8em; font-size: 1.8em; } .primary-result { font-size: 2.5em; font-weight: bold; margin-bottom: 0.5em; color: #fff; display: block; } .primary-result-label { font-size: 1.1em; color: rgba(255, 255, 255, 0.9); display: block; margin-bottom: 1.5em; } .intermediate-results div { margin-bottom: 15px; font-size: 1.1em; } .intermediate-results span { font-weight: bold; color: #fff; } .formula-explanation { margin-top: 15px; font-size: 0.95em; color: rgba(255, 255, 255, 0.8); border-top: 1px solid rgba(255, 255, 255, 0.2); padding-top: 15px; } .chart-container, .table-container { margin-top: 30px; padding: 25px; background-color: #fff; border-radius: 8px; box-shadow: var(–shadow-color) 0 2px 10px; } .chart-container h3, .table-container h3 { margin-top: 0; text-align: left; color: var(–primary-color); } canvas { display: block; margin: 20px auto; max-width: 100%; height: auto; } table { width: 100%; border-collapse: collapse; margin-top: 20px; } th, td { border: 1px solid #ddd; padding: 12px; text-align: left; } thead { background-color: var(–primary-color); color: white; } tbody tr:nth-child(even) { background-color: #f2f2f2; } /* Article Styling */ article { margin-top: 40px; background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: var(–shadow-color) 0 5px 15px; } article h2 { text-align: left; margin-bottom: 1.2em; font-size: 2em; border-bottom: 2px solid var(–primary-color); padding-bottom: 0.3em; } article h3 { text-align: left; margin-top: 1.5em; margin-bottom: 0.8em; font-size: 1.5em; color: var(–primary-color); } article p, article ul, article ol { margin-bottom: 1.2em; font-size: 1.1em; } article ul, article ol { padding-left: 25px; } article li { margin-bottom: 0.8em; } article strong { color: var(–primary-color); } article code { background-color: #e9ecef; padding: 2px 5px; border-radius: 3px; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; } .faq-item { margin-bottom: 1.5em; padding-bottom: 1em; border-bottom: 1px dashed #eee; } .faq-item:last-child { border-bottom: none; padding-bottom: 0; } .faq-item strong { color: var(–primary-color); display: block; margin-bottom: 0.5em; font-size: 1.2em; } .internal-links { margin-top: 2em; padding-top: 1.5em; border-top: 2px solid var(–primary-color); } .internal-links ul { list-style: none; padding: 0; } .internal-links li { margin-bottom: 1em; } .internal-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; font-size: 1.15em; } .internal-links a:hover { text-decoration: underline; } .internal-links p { font-style: italic; color: #555; font-size: 1em; } /* Responsive adjustments */ @media (max-width: 768px) { .container { margin: 10px; padding: 15px; } .calc-header h1 { font-size: 2em; } .button-group button { flex: 1 1 100%; min-width: unset; } .results-container { padding: 20px; } .primary-result { font-size: 2em; } canvas { height: 300px; } table, th, td { font-size: 0.9em; } }

Weight on Bit Calculator

Accurately calculate the downhole force exerted by your drill bit to optimize drilling performance.

Drill String Parameters

Total weight of the drill collars in the borehole.
Total length of the drill collars.
Outer diameter of the drill collars.
Density of the drilling fluid.
Diameter of the wellbore.
Standard gravitational acceleration.

Weight on Bit Results

Weight on Bit (lb)
Buoyancy Effect: lb
Effective Weight in Mud: lb
Mud Hydrostatic Force: lb
The Weight on Bit (WOB) is calculated as the effective weight of the drill collars in the borehole, adjusted for buoyancy. The formula is: WOB = (Drill Collar Weight) – (Buoyancy Effect) Where Buoyancy Effect = (Drill Collar Weight) * (1 – (Mud Weight * Volume Correction Factor) / (Material Density of Drill Collar)) For simplicity in this calculator, we assume material density and directly use mud hydrostatic force. Simplified: WOB = Effective Weight in Mud

WOB vs. Mud Weight Impact

Legend:

  • Calculated WOB
  • Effective Weight in Mud

Drill Collar Properties

Property Value Unit
Drill Collar Weight lb
Drill Collar Length ft
Drill Collar Outer Diameter in
Mud Weight lb/gal
Borehole Diameter in
Material Density (Assumed Steel) 490 lb/ft³
Drill Collar Inner Diameter in
Drill Collar Volume ft³
Mud Volume in Annulus ft³
Total Mud Volume ft³

Understanding Weight on Bit (WOB) Calculation

What is Weight on Bit (WOB)?

Weight on Bit (WOB) refers to the downward force applied to the drill bit at the end of the drill string. It is a critical parameter in drilling operations, directly influencing drilling efficiency, rate of penetration (ROP), and the longevity of the drill bit. Effectively managing WOB ensures that the drill bit is applied to the formation with the optimal force to break rock efficiently without causing excessive wear or damage.

Drilling engineers, geologists, and rig personnel should use WOB calculations to optimize drilling parameters. Understanding WOB helps in making informed decisions about how much force to apply during drilling. It's crucial for maximizing ROP, minimizing non-productive time (NPT), and reducing operational costs.

A common misconception is that simply increasing WOB always leads to faster drilling. While a certain amount of WOB is necessary, excessive WOB can lead to bit damage, increased torque, reduced hole cleaning efficiency, and potential stuck pipe incidents. Conversely, insufficient WOB may result in slow drilling rates and inefficient rock destruction. Accurate calculation using tools like this Weight on Bit Calculator is paramount.

Weight on Bit (WOB) Formula and Mathematical Explanation

The fundamental principle behind calculating Weight on Bit involves determining the total downward force exerted by the drill string, accounting for the effects of buoyancy in the drilling fluid. While the "true" Weight on Bit is the force directly applied to the formation, the calculated WOB from surface parameters is the effective weight of the drill collars and lower drill string components.

The calculation can be approached in several ways. A common method considers the effective weight of the drill collars suspended in the drilling mud.

The core components of the calculation are:

  • Drill Collar Weight: The actual weight of the drill collars in air.
  • Buoyancy Effect: The upward force exerted by the drilling fluid, reducing the apparent weight of the submerged drill collars.
  • Mud Hydrostatic Force: The pressure exerted by the mud column acting on the submerged portion of the drill collars.

The simplified formula used in this calculator is:

WOB = Effective Weight in Mud

And the Effective Weight in Mud is derived from:

Effective Weight in Mud = (Drill Collar Weight in Air) - (Buoyancy Effect)

The Buoyancy Effect is calculated using the volume of the submerged object (drill collars) and the density of the fluid (mud):

Buoyancy Effect = Volume of Submerged Object * Density of Fluid * Gravity

In our calculator, we simplify this by calculating the Mud Hydrostatic Force acting on the submerged collars, which is equivalent to the buoyancy effect in many practical scenarios for WOB estimation based on drill collar weight.

Mud Hydrostatic Force = Mud Weight * Volume of Submerged Collars (Units must be consistent)

The direct application of WOB requires considering the weight of the drill collars and the mud's hydrostatic pressure.

Variables and Units Table:

Variable Meaning Unit Typical Range
WOB Weight on Bit Pounds (lb) 0 – 60,000+ lb (depends on formation and bit type)
Drill Collar Weight Total weight of drill collars in air Pounds (lb) 10,000 – 100,000+ lb
Drill Collar Length Total length of drill collars Feet (ft) 100 – 1,000+ ft
Drill Collar Outer Diameter (OD) Outer diameter of drill collars Inches (in) 3 – 7 in
Mud Weight Density of drilling fluid Pounds per Gallon (lb/gal) 8 – 18 lb/gal
Borehole Diameter Diameter of the wellbore Inches (in) 6 – 17.5 in
Material Density (Steel) Density of the drill collar material Pounds per cubic foot (lb/ft³) ~490 lb/ft³
Gravity Acceleration due to gravity ft/s² ~32.174 ft/s²

Practical Examples (Real-World Use Cases)

Understanding WOB is crucial for effective drilling. Here are practical examples demonstrating its calculation and implications.

Example 1: Standard Drilling Operation

A drilling operation uses a drill string with 600 feet of 6-inch OD drill collars. The total weight of these collars in air is 75,000 lb. The drilling fluid has a density of 12 lb/gal, and the borehole diameter is 8.5 inches.

Inputs:

  • Drill Collar Weight: 75,000 lb
  • Drill Collar Length: 600 ft
  • Drill Collar Outer Diameter: 6 in
  • Mud Weight: 12 lb/gal
  • Borehole Diameter: 8.5 in
  • Gravity: 32.174 ft/s²

Calculation Steps:

  1. Calculate Drill Collar Inner Diameter (assuming standard wall thickness for 6″ OD collars, e.g., 1-inch wall): ID = 6 – (2 * 1) = 4 inches.
  2. Calculate Drill Collar Volume: Volume per foot = π/4 * (OD² – ID²) * (1 ft / 12 in)² Volume per foot = π/4 * (6² – 4²) * (1/144) ≈ 0.0909 ft³/ft Total Collar Volume = 0.0909 ft³/ft * 600 ft ≈ 54.54 ft³
  3. Calculate Mud Hydrostatic Force (Buoyancy effect proxy): First, convert Mud Weight to lb/ft³: 12 lb/gal * (7.48 gal/ft³) ≈ 89.76 lb/ft³ Mud Hydrostatic Force = Total Collar Volume * Mud Weight (lb/ft³) Mud Hydrostatic Force = 54.54 ft³ * 89.76 lb/ft³ ≈ 4894.7 lb
  4. Calculate WOB: WOB = Drill Collar Weight – Mud Hydrostatic Force WOB = 75,000 lb – 4894.7 lb ≈ 70,105.3 lb

Result Interpretation: The effective Weight on Bit is approximately 70,105.3 lb. This value is less than the collar weight in air due to the buoyancy of the mud. This informs the driller about the actual downward force applied to the bit.

Example 2: High Mud Weight Scenario

Consider the same drill string setup but with a higher mud weight of 15 lb/gal to manage formation pressures.

Inputs:

  • Drill Collar Weight: 75,000 lb
  • Drill Collar Length: 600 ft
  • Drill Collar Outer Diameter: 6 in
  • Mud Weight: 15 lb/gal
  • Borehole Diameter: 8.5 in
  • Gravity: 32.174 ft/s²

Calculation Steps (relevant changes):

  1. Drill Collar dimensions and volume remain the same: ≈ 54.54 ft³.
  2. Calculate Mud Hydrostatic Force (Buoyancy effect proxy): Convert Mud Weight: 15 lb/gal * (7.48 gal/ft³) ≈ 112.2 lb/ft³ Mud Hydrostatic Force = 54.54 ft³ * 112.2 lb/ft³ ≈ 6119.4 lb
  3. Calculate WOB: WOB = 75,000 lb – 6119.4 lb ≈ 68,880.6 lb

Result Interpretation: With a higher mud weight, the buoyancy effect (Mud Hydrostatic Force) increases, resulting in a lower effective Weight on Bit (approx. 68,880.6 lb) compared to the previous example. This highlights how mud properties significantly impact achievable WOB and must be accounted for in drilling plans. A driller might need to adjust surface applied force if a specific WOB target is critical. This emphasizes the importance of considering parameters like mud density in drilling calculations.

How to Use This Weight on Bit Calculator

Using the Weight on Bit calculator is straightforward and designed for quick, accurate results. Follow these steps to get your WOB estimate:

  1. Input Drill String Parameters: Enter the known values for your drill collars and drilling fluid. This includes:
    • The total weight of your drill collars in air (lb).
    • The total length of your drill collars (ft).
    • The outer diameter of your drill collars (in).
    • The current mud weight (lb/gal).
    • The diameter of the borehole (in).
    • The local acceleration due to gravity (ft/s² – standard value is usually sufficient).
    Pay close attention to the units specified for each input field.
  2. Review Helper Text: Each input field has accompanying helper text to clarify what information is required. If you're unsure about a specific parameter, refer to your drilling logs or consult with your rig supervisor.
  3. Perform Calculation: Click the "Calculate WOB" button. The calculator will process your inputs in real-time.
  4. Interpret Results:
    • Primary Result (Weight on Bit): This is the main output, displayed prominently in pounds (lb). It represents the effective downward force applied to the drill bit.
    • Intermediate Values: You'll see the calculated Buoyancy Effect and Effective Weight in Mud. These provide insights into the forces acting on the drill string within the borehole.
    • Formula Explanation: A brief description of the formula used is provided for transparency.
    • Chart & Table: The dynamic chart visualizes the relationship between key variables, and the table summarizes the input parameters and derived collar properties.
  5. Decision Making: Compare the calculated WOB against target WOB values recommended for your specific drill bit and formation type. If the calculated WOB is significantly different from the target, you may need to adjust the drill collar assembly, mud weight, or other drilling parameters. For instance, if your WOB is too low, you might consider adding more drill collars or increasing mud density (within safe limits). If it's too high, you might need to reduce the WOB applied from surface or modify the drill collar configuration.
  6. Copy Results: Use the "Copy Results" button to easily transfer the primary result, intermediate values, and key assumptions to your reports or notes.
  7. Reset: Click "Reset" to clear all fields and restore them to their default, sensible values for a fresh calculation.

Key Factors That Affect Weight on Bit Results

Several factors influence the calculated and actual Weight on Bit, impacting drilling performance. Understanding these is crucial for effective drilling operations.

  • Drill Collar Configuration: The number, length, outer diameter, and inner diameter of drill collars are primary determinants of the drill string's weight and volume, directly impacting WOB and buoyancy. A heavier and larger-diameter collar assembly will inherently contribute more weight.
  • Mud Weight (Density): This is a crucial factor. Higher mud weight increases the buoyancy effect, reducing the effective WOB. Conversely, lower mud weight lessens buoyancy, potentially increasing WOB. Maintaining precise mud weight is vital for consistent WOB control and wellbore stability. This is a key consideration when performing drilling fluid calculations.
  • Drill String Vibrations and Dynamics: While this calculator provides a static WOB estimate, real-world drilling involves dynamic forces. Vibrations, stick-slip, and torsional oscillations can cause instantaneous fluctuations in WOB, making it difficult to maintain a constant force.
  • Hole Cleaning Efficiency: Inadequate hole cleaning can lead to packed-off conditions or increased torque, which can indirectly affect the perceived or controlled WOB at the bit. The flow rate and properties of the drilling mud play a role here.
  • Formation Hardness and Type: While not directly part of the WOB calculation itself, the hardness and type of rock being drilled dictate the optimal WOB required for efficient penetration. This calculator helps determine the available WOB, which is then compared to the required WOB for the formation.
  • Drilling Fluid Properties (Viscosity and Rheology): Beyond density, mud viscosity and rheological properties influence cuttings transport and friction within the annulus. These can indirectly affect downhole dynamics and the ability to transmit surface-applied forces effectively.
  • Torque and Drag: High torque and drag in the wellbore can consume a portion of the applied force, reducing the effective WOB at the bit. Understanding and mitigating these forces is essential for successful drilling, especially in extended reach or complex well trajectories. Torque and drag calculations are often performed alongside WOB analysis.
  • Wellbore Geometry (Inclination and Azimuth): In deviated or horizontal wells, the weight of the drill string can be supported by the low side of the wellbore, reducing the effective WOB. Gravitational effects become more pronounced, and friction plays a larger role in transmitting force.

Frequently Asked Questions (FAQ)

Q1: What is the difference between WOB in air and WOB in mud?

WOB in air is simply the actual weight of the drill collars. WOB in mud, or effective WOB, is the apparent weight of the drill collars when submerged in drilling fluid. It's reduced due to the upward buoyant force exerted by the mud.

Q2: Why is controlling WOB important?

Controlling WOB is vital for optimizing the Rate of Penetration (ROP), minimizing drill bit wear, preventing damage to the drill bit and drill string, and ensuring efficient hole cleaning. The correct WOB maximizes rock destruction while minimizing mechanical stress.

Q3: Can I apply WOB directly from surface measurements?

Surface weight indicators measure the total weight of the drill string hanging on the hook. To determine WOB at the bit, you must subtract the weight of the entire drill string above the bit, accounting for buoyancy. This calculator focuses on the contribution of drill collars to WOB.

Q4: What happens if I apply too much WOB?

Excessive WOB can lead to premature drill bit failure (e.g., dulling, chipping of cutters), increased torque, reduced hole cleaning efficiency, potential for stuck pipe, and damage to the drill string components.

Q5: What happens if I apply too little WOB?

Insufficient WOB will result in a slow drilling rate (low ROP), inefficient rock destruction, and potentially vibrations or "bouncing" of the bit, which can also cause wear and damage.

Q6: Does the type of drill bit affect the required WOB?

Yes, absolutely. Different drill bit types (e.g., PDC, roller cone) are designed to operate optimally within specific WOB ranges. Manufacturers provide recommended WOB ranges for their bits, which must be considered alongside the calculated available WOB.

Q7: How is gravity accounted for in WOB calculations?

Gravity is inherent in the definition of weight (mass * gravity). Standard gravitational acceleration is used to convert mass to weight and is part of the physics governing fluid pressure and object weight. The standard value is usually sufficient unless drilling at extreme altitudes or latitudes.

Q8: Can this calculator determine the actual force applied to the formation?

This calculator provides an estimate of the effective weight of the drill collars in mud, which is a primary component of the total WOB. It doesn't account for friction, torque, or the dynamic forces of the entire drill string. For precise downhole WOB, advanced Measurement While Drilling (MWD) tools are used. However, this tool provides a crucial surface-based estimation for planning and initial assessment. A more comprehensive drilling performance analysis would integrate these factors.

var chart = null; // Global variable to hold the chart instance function validateInput(id, minValue, maxValue) { var input = document.getElementById(id); var errorElement = document.getElementById(id + 'Error'); var value = parseFloat(input.value); errorElement.innerText = "; errorElement.classList.remove('visible'); input.style.borderColor = '#ced4da'; // Reset border color if (isNaN(value)) { errorElement.innerText = 'Please enter a valid number.'; errorElement.classList.add('visible'); input.style.borderColor = '#dc3545'; return false; } if (minValue !== undefined && value maxValue) { errorElement.innerText = 'Value too high.'; errorElement.classList.add('visible'); input.style.borderColor = '#dc3545'; return false; } return true; } function calculateWOB() { var drillCollarWeight = parseFloat(document.getElementById('drillCollarWeight').value); var drillCollarLength = parseFloat(document.getElementById('drillCollarLength').value); var drillCollarDiameter = parseFloat(document.getElementById('drillCollarDiameter').value); var mudWeight = parseFloat(document.getElementById('mudWeight').value); var boreholeDiameter = parseFloat(document.getElementById('boreholeDiameter').value); var gravity = parseFloat(document.getElementById('gravity').value); var resultsContainer = document.getElementById('resultsContainer'); var primaryResultElement = document.getElementById('primaryResult'); var buoyancyEffectElement = document.getElementById('buoyancyEffect').getElementsByTagName('span')[0]; var effectiveWeightElement = document.getElementById('effectiveWeight').getElementsByTagName('span')[0]; var mudHydrostaticForceElement = document.getElementById('mudHydrostaticForce').getElementsByTagName('span')[0]; // Table elements var tableDcWeight = document.getElementById('tableDcWeight'); var tableDcLength = document.getElementById('tableDcLength'); var tableDcOdm = document.getElementById('tableDcOdm'); var tableMudWeight = document.getElementById('tableMudWeight'); var tableBhDiameter = document.getElementById('tableBhDiameter'); var tableMaterialDensity = document.getElementById('tableMaterialDensity'); // Assumed steel density var tableDcIdm = document.getElementById('tableDcIdm'); var tableDcVolume = document.getElementById('tableDcVolume'); var tableMudAnnulusVolume = document.getElementById('tableMudAnnulusVolume'); var tableTotalMudVolume = document.getElementById('tableTotalMudVolume'); // Validation var isValid = true; isValid = validateInput('drillCollarWeight', 0) && isValid; isValid = validateInput('drillCollarLength', 0) && isValid; isValid = validateInput('drillCollarDiameter', 0) && isValid; isValid = validateInput('mudWeight', 0) && isValid; isValid = validateInput('boreholeDiameter', 0) && isValid; isValid = validateInput('gravity', 0) && isValid; if (!isValid) { resultsContainer.style.display = 'none'; return; } // Constants and Conversions var IN_TO_FT = 1 / 12; var GAL_TO_FT3 = 7.48052; // Gallons to cubic feet var STEEL_DENSITY_LB_FT3 = 490; // Approximate density of steel // Calculate Drill Collar Inner Diameter (assuming a standard wall thickness ratio for simplicity, e.g., ~1 inch wall for 6″ OD) // This is an approximation. Real ID depends on specific collar grade. var assumedWallThickness = Math.max(0.5, drillCollarDiameter * 0.15); // Crude estimation, minimum 0.5 inch var drillCollarInnerDiameter = Math.max(1, drillCollarDiameter – 2 * assumedWallThickness); // Ensure positive ID, min 1 inch for calculation // Calculate Drill Collar Volume var collarOD_ft = drillCollarDiameter * IN_TO_FT; var collarID_ft = drillCollarInnerDiameter * IN_TO_FT; var collarArea = Math.PI / 4 * (Math.pow(collarOD_ft, 2) – Math.pow(collarID_ft, 2)); var drillCollarVolume = collarArea * drillCollarLength; // ft³ // Calculate Mud Weight in lb/ft³ var mudWeight_lb_ft3 = mudWeight * GAL_TO_FT3; // Calculate Mud Hydrostatic Force (proxy for Buoyancy Effect) // Force = Volume * Density var mudHydrostaticForce = drillCollarVolume * mudWeight_lb_ft3; // lb // Calculate Effective Weight in Mud var effectiveWeight = drillCollarWeight – mudHydrostaticForce; // lb // Final Weight on Bit (Simplified: Assuming effective weight of collars is the main contributor) var wob = effectiveWeight; // lb // Ensure WOB is not negative, though theoretically possible if mud is extremely dense and collars are light/large volume if (wob < 0) wob = 0; // Display Results primaryResultElement.innerText = wob.toFixed(2); buoyancyEffectElement.innerText = mudHydrostaticForce.toFixed(2); effectiveWeightElement.innerText = effectiveWeight.toFixed(2); mudHydrostaticForceElement.innerText = mudHydrostaticForce.toFixed(2); // Same as buoyancy effect in this simplified model resultsContainer.style.display = 'block'; // Update Table tableDcWeight.innerText = drillCollarWeight.toFixed(0); tableDcLength.innerText = drillCollarLength.toFixed(1); tableDcOdm.innerText = drillCollarDiameter.toFixed(2); tableMudWeight.innerText = mudWeight.toFixed(2); tableBhDiameter.innerText = boreholeDiameter.toFixed(2); tableMaterialDensity.innerText = STEEL_DENSITY_LB_FT3.toFixed(0); tableDcIdm.innerText = drillCollarInnerDiameter.toFixed(2); tableDcVolume.innerText = drillCollarVolume.toFixed(2); // Calculate Mud Volume in Annulus var boreholeOD_ft = boreholeDiameter * IN_TO_FT; var annulusArea = Math.PI / 4 * (Math.pow(boreholeOD_ft, 2) – Math.pow(collarOD_ft, 2)); var mudAnnulusVolume = annulusArea * drillCollarLength; // ft³ tableMudAnnulusVolume.innerText = mudAnnulusVolume.toFixed(2); // Total Mud Volume (simplistic: assuming mud fills annulus AND collar volume for buoyancy calc) // A more accurate buoyancy would use mud in annulus + mud inside collars if applicable. // For this WOB estimation, we used collar volume * mud density. // Let's use the collar volume for consistency with the primary calculation. tableTotalMudVolume.innerText = (mudAnnulusVolume + drillCollarVolume).toFixed(2); // Represents volume displaced by collars updateChart(drillCollarWeight, mudWeight, wob, effectiveWeight); } function resetCalculator() { document.getElementById('drillCollarWeight').value = '50000'; document.getElementById('drillCollarLength').value = '500'; document.getElementById('drillCollarDiameter').value = '6'; document.getElementById('mudWeight').value = '10'; document.getElementById('boreholeDiameter').value = '8.5'; document.getElementById('gravity').value = '32.174'; document.getElementById('resultsContainer').style.display = 'none'; updateChart(50000, 10, 0, 0); // Reset chart with initial values // Reset error messages var errorElements = document.querySelectorAll('.error-message'); for (var i = 0; i < errorElements.length; i++) { errorElements[i].innerText = ''; errorElements[i].classList.remove('visible'); } var inputElements = document.querySelectorAll('.input-group input, .input-group select'); for (var i = 0; i < inputElements.length; i++) { inputElements[i].style.borderColor = '#ced4da'; } } function copyResults() { var primaryResult = document.getElementById('primaryResult').innerText; var buoyancy = document.getElementById('buoyancyEffect').innerText; var effectiveWeight = document.getElementById('effectiveWeight').innerText; var mudHydrostatic = document.getElementById('mudHydrostaticForce').innerText; var dcWeight = document.getElementById('tableDcWeight').innerText; var dcLength = document.getElementById('tableDcLength').innerText; var dcOdm = document.getElementById('tableDcOdm').innerText; var mudWeight = document.getElementById('tableMudWeight').innerText; var bhDiameter = document.getElementById('tableBhDiameter').innerText; var assumptions = "Key Assumptions:\n" + "Drill Collar Weight: " + dcWeight + " lb\n" + "Drill Collar Length: " + dcLength + " ft\n" + "Drill Collar OD: " + dcOdm + " in\n" + "Mud Weight: " + mudWeight + " lb/gal\n" + "Borehole Diameter: " + bhDiameter + " in"; var resultsText = "Weight on Bit Results:\n" + "———————-\n" + "Weight on Bit (WOB): " + primaryResult + "\n" + "Buoyancy Effect: " + buoyancy + "\n" + "Effective Weight in Mud: " + effectiveWeight + "\n" + "Mud Hydrostatic Force: " + mudHydrostatic + "\n\n" + assumptions; // Use navigator.clipboard for modern browsers if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(resultsText).then(function() { alert('Results copied to clipboard!'); }).catch(function(err) { console.error('Failed to copy: ', err); fallbackCopyTextToClipboard(resultsText); }); } else { fallbackCopyTextToClipboard(resultsText); } } function fallbackCopyTextToClipboard(text) { var textArea = document.createElement("textarea"); textArea.value = text; textArea.style.position="fixed"; textArea.style.left="-9999px"; textArea.style.top="-9999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'successful' : 'unsuccessful'; alert('Fallback: Copying text command was ' + msg); } catch (err) { console.error('Fallback: Oops, unable to copy', err); } document.body.removeChild(textArea); } function updateChart(initialDcWeight, initialMudWeight, initialWob, initialEffectiveWeight) { var ctx = document.getElementById('wobChart').getContext('2d'); // Define range of mud weights to plot var minMudWeight = 8; var maxMudWeight = 18; var mudWeightSteps = 10; var mudWeights = []; for (var i = 0; i <= mudWeightSteps; i++) { mudWeights.push(minMudWeight + (maxMudWeight – minMudWeight) * i / mudWeightSteps); } var wobData = []; var effectiveWeightData = []; var initialDcWeightVal = parseFloat(document.getElementById('drillCollarWeight').value) || initialDcWeight; // Use current input value or fallback for (var i = 0; i < mudWeights.length; i++) { var currentMudWeight = mudWeights[i]; // Recalculate collar volume, etc. (needed if collar dimensions change, but assume fixed for chart) var drillCollarLengthVal = parseFloat(document.getElementById('drillCollarLength').value) || 500; var drillCollarDiameterVal = parseFloat(document.getElementById('drillCollarDiameter').value) || 6; var assumedWallThickness = Math.max(0.5, drillCollarDiameterVal * 0.15); var drillCollarInnerDiameterVal = Math.max(1, drillCollarDiameterVal – 2 * assumedWallThickness); var collarOD_ft = drillCollarDiameterVal * (1 / 12); var collarID_ft = drillCollarInnerDiameterVal * (1 / 12); var collarArea = Math.PI / 4 * (Math.pow(collarOD_ft, 2) – Math.pow(collarID_ft, 2)); var drillCollarVolumeVal = collarArea * drillCollarLengthVal; var mudWeight_lb_ft3 = currentMudWeight * 7.48052; var mudHydrostaticForce = drillCollarVolumeVal * mudWeight_lb_ft3; var currentEffectiveWeight = initialDcWeightVal – mudHydrostaticForce; var currentWob = Math.max(0, currentEffectiveWeight); // WOB cannot be negative wobData.push(currentWob); effectiveWeightData.push(currentEffectiveWeight); } if (chart) { chart.destroy(); // Destroy previous chart instance } chart = new Chart(ctx, { type: 'line', data: { labels: mudWeights.map(function(mw) { return mw.toFixed(1) + ' lb/gal'; }), datasets: [{ label: 'Calculated WOB (lb)', data: wobData, borderColor: 'var(–primary-color)', backgroundColor: 'rgba(0, 74, 153, 0.1)', fill: false, tension: 0.1, pointRadius: 3, pointHoverRadius: 6 }, { label: 'Effective Weight in Mud (lb)', data: effectiveWeightData, borderColor: 'var(–success-color)', backgroundColor: 'rgba(40, 167, 69, 0.1)', fill: false, tension: 0.1, pointRadius: 3, pointHoverRadius: 6 }] }, options: { responsive: true, maintainAspectRatio: true, scales: { x: { title: { display: true, text: 'Mud Weight (lb/gal)', color: 'var(–primary-color)', font: { weight: 'bold' } }, grid: { color: '#e0e0e0' } }, y: { title: { display: true, text: 'Force (lb)', color: 'var(–primary-color)', font: { weight: 'bold' } }, grid: { color: '#e0e0e0' }, beginAtZero: false // Start from a reasonable baseline } }, plugins: { title: { display: true, text: 'WOB vs. Mud Weight', font: { size: 16, weight: 'bold' }, color: 'var(–primary-color)' }, legend: { position: 'top', } }, hover: { mode: 'index', intersect: false } } }); } // Initial chart rendering on page load document.addEventListener('DOMContentLoaded', function() { // Set initial values from HTML inputs if available, otherwise use defaults var initialDcWeight = parseFloat(document.getElementById('drillCollarWeight').value) || 50000; var initialMudWeight = parseFloat(document.getElementById('mudWeight').value) || 10; // Calculate initial WOB and effective weight for chart rendering var initialEffectiveWeight = initialDcWeight – 0; // Placeholder, actual calculation needed if default effective weight is desired var initialWob = Math.max(0, initialEffectiveWeight); updateChart(initialDcWeight, initialMudWeight, initialWob, initialEffectiveWeight); });

Leave a Comment