Bcm Weight Calculator

BCM Weight Calculator: Calculate BCM and Weight Accurately :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –light-gray: #e9ecef; –dark-gray: #6c757d; } 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: 25px; background-color: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); display: flex; flex-direction: column; align-items: center; } header { width: 100%; background-color: var(–primary-color); color: #fff; padding: 15px 0; text-align: center; border-radius: 8px 8px 0 0; margin-bottom: 25px; } header h1 { margin: 0; font-size: 2.2em; font-weight: 600; } .loan-calc-container { width: 100%; max-width: 600px; margin-bottom: 30px; padding: 20px; border: 1px solid var(–light-gray); border-radius: 5px; background-color: #fdfdfd; } .input-group { margin-bottom: 20px; width: 100%; text-align: left; } .input-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(–dark-gray); font-size: 0.95em; } .input-group input[type="number"], .input-group input[type="text"], .input-group select { width: calc(100% – 22px); padding: 10px 12px; border: 1px solid var(–light-gray); border-radius: 4px; font-size: 1em; box-sizing: border-box; transition: border-color 0.3s ease; } .input-group input[type="number"]:focus, .input-group input[type="text"]:focus, .input-group select:focus { outline: none; border-color: var(–primary-color); box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group small { display: block; margin-top: 5px; font-size: 0.85em; color: var(–dark-gray); } .error-message { color: #dc3545; font-size: 0.85em; margin-top: 5px; display: none; /* Hidden by default */ } .button-group { display: flex; justify-content: space-between; margin-top: 25px; } .btn { padding: 10px 20px; border: none; border-radius: 5px; font-size: 1em; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; font-weight: 500; } .btn-primary { background-color: var(–primary-color); color: #fff; } .btn-primary:hover { background-color: #003a7b; transform: translateY(-1px); } .btn-secondary { background-color: var(–dark-gray); color: #fff; } .btn-secondary:hover { background-color: #5a6268; transform: translateY(-1px); } .btn-reset { background-color: #ffc107; color: #212529; } .btn-reset:hover { background-color: #e0a800; transform: translateY(-1px); } #results { margin-top: 30px; padding: 20px; border: 1px solid var(–primary-color); border-radius: 5px; background-color: rgba(0, 74, 153, 0.05); text-align: center; width: 100%; box-sizing: border-box; } #results h2 { color: var(–primary-color); margin-top: 0; font-size: 1.8em; } .main-result { font-size: 2.5em; font-weight: bold; color: var(–primary-color); margin: 15px 0; padding: 10px; background-color: rgba(40, 167, 69, 0.1); border-radius: 4px; } .intermediate-values { margin-top: 15px; font-size: 1.1em; color: var(–dark-gray); } .intermediate-values div { margin-bottom: 8px; } .formula-explanation { margin-top: 20px; font-size: 0.9em; color: var(–dark-gray); text-align: left; border-top: 1px solid var(–light-gray); padding-top: 15px; } table { width: 100%; border-collapse: collapse; margin-top: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); } th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(–light-gray); } thead { background-color: var(–primary-color); color: #fff; } tbody tr:nth-child(even) { background-color: #f2f2f2; } .chart-container { width: 100%; max-width: 550px; margin: 30px auto; padding: 20px; background-color: #fff; border: 1px solid var(–light-gray); border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); } canvas { display: block; width: 100% !important; height: auto !important; } .chart-caption { text-align: center; font-size: 0.9em; color: var(–dark-gray); margin-top: 10px; } .article-section { margin-top: 40px; padding: 20px; background-color: #fff; border-radius: 5px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); } .article-section h2, .article-section h3 { color: var(–primary-color); margin-bottom: 15px; } .article-section h2 { font-size: 2em; border-bottom: 2px solid var(–primary-color); padding-bottom: 10px; } .article-section h3 { font-size: 1.5em; margin-top: 30px; } .article-section p, .article-section ul, .article-section ol { margin-bottom: 20px; font-size: 1em; } .article-section ul, .article-section ol { padding-left: 25px; } .article-section li { margin-bottom: 10px; } .article-section strong { color: var(–primary-color); } .faq-item { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed var(–light-gray); } .faq-item:last-child { border-bottom: none; } .faq-item strong { display: block; color: var(–primary-color); margin-bottom: 5px; font-size: 1.1em; } .internal-links ul { list-style: none; padding: 0; } .internal-links li { margin-bottom: 15px; } .internal-links a { color: var(–primary-color); text-decoration: none; font-weight: 500; } .internal-links a:hover { text-decoration: underline; } .internal-links span { display: block; font-size: 0.9em; color: var(–dark-gray); margin-top: 4px; } .result-tooltip { position: relative; cursor: help; border-bottom: 1px dotted var(–primary-color); } .result-tooltip .tooltip-text { visibility: hidden; width: 220px; background-color: #555; color: #fff; text-align: center; border-radius: 6px; padding: 5px 0; position: absolute; z-index: 1; bottom: 125%; left: 50%; margin-left: -110px; opacity: 0; transition: opacity 0.3s; font-size: 0.85em; line-height: 1.4; } .result-tooltip:hover .tooltip-text { visibility: visible; opacity: 1; } /* Input validation styles */ .input-error { border-color: #dc3545 !important; background-color: rgba(220, 53, 69, 0.05); } .input-error:focus { box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2); }

BCM Weight Calculator

Enter the surface area of the reservoir or formation in square kilometers.
Enter the average depth of the reservoir or formation in meters.
Enter the average density of the rock material in kilograms per cubic meter (e.g., sandstone is ~2600-2700 kg/m³).
Enter the percentage of the rock volume that is pore space (e.g., 20% for typical reservoirs).

Calculation Results

Formula Used:

1. Total Rock Volume (m³) = Reservoir Area (km²) * 1,000,000 m²/km² * Average Depth (m)
2. Pore Volume (m³) = Total Rock Volume (m³) * (Pore Space Saturation (%) / 100)
3. Reservoir Volume in BCM = Pore Volume (m³) / 1,000,000,000 m³/BCM
4. Total Weight (kg) = Total Rock Volume (m³) * Rock Density (kg/m³)

Key Assumptions:

– Uniform reservoir area, depth, rock density, and pore space saturation. – Rock density refers to the bulk density of the solid rock material, not the fluid within pores. – BCM (Billion Cubic Meters) represents the volume of the fluid-filled pore space.

Comparison of Total Rock Volume vs. Pore Volume at varying depths.

What is a BCM Weight Calculator?

A BCM weight calculator is a specialized tool designed to quantify the volume of subsurface resources, typically in the context of oil, gas, or water reservoirs, and to estimate the associated weight of the rock formation. The "BCM" stands for Billion Cubic Meters, a standard unit for measuring vast quantities of fluid or gas within geological formations. This calculator takes key geological and physical parameters as input to provide these crucial metrics. Understanding these values is fundamental for resource estimation, economic viability assessments, and engineering planning in the energy and water management sectors.

Who Should Use It: Geologists, petroleum engineers, reservoir engineers, environmental scientists, mining engineers, and project managers involved in subsurface resource exploration, extraction, or management will find this calculator invaluable. It aids in estimating the potential yield of a reservoir, understanding the mass of the rock surrounding it, and making informed decisions regarding drilling, extraction strategies, and environmental impact assessments.

Common Misconceptions: A frequent misunderstanding is that BCM directly represents the extractable resource. BCM is the total pore volume, which may or may not be fully saturated with a valuable commodity. Another misconception is that the weight calculated is the weight of the extractable fluid; it is the weight of the rock matrix itself across the specified volume. Furthermore, the calculator assumes uniform properties, which is rarely the case in real geological formations; these results should be seen as estimates based on average or representative values.

BCM Weight Calculator Formula and Mathematical Explanation

The BCM weight calculator employs a series of straightforward physics and geometry principles to estimate both the volume in Billion Cubic Meters and the mass of the rock formation. The process involves converting surface area and depth into a total volume, accounting for the porous nature of the rock, and then calculating the weight based on the rock's density.

Step-by-Step Derivation

  1. Calculating Total Rock Volume: We first determine the total three-dimensional volume occupied by the rock formation. This is achieved by multiplying the reservoir's surface area by its average depth. Since the area is given in square kilometers (km²) and depth in meters (m), a unit conversion is necessary. We convert km² to m² by multiplying by 1,000,000 (since 1 km = 1000 m, so 1 km² = 1000m * 1000m = 1,000,000 m²).
    Formula: Total Rock Volume (m³) = Reservoir Area (km²) * 1,000,000 * Average Depth (m)
  2. Determining Pore Volume: Not all of the rock volume is empty space; a significant portion is solid rock. The pore space is where fluids (like oil, gas, or water) reside. We calculate the volume of this pore space by multiplying the Total Rock Volume by the percentage of pore space saturation.
    Formula: Pore Volume (m³) = Total Rock Volume (m³) * (Pore Space Saturation (%) / 100)
  3. Converting to BCM: The standard unit for large-scale reservoir volumes is Billion Cubic Meters (BCM). To convert the calculated Pore Volume from cubic meters (m³) to BCM, we divide by one billion (1,000,000,000).
    Formula: Reservoir Volume (BCM) = Pore Volume (m³) / 1,000,000,000
  4. Calculating Total Rock Weight: To find the total weight of the rock formation within the defined volume, we use the formula: Weight = Volume × Density. We use the Total Rock Volume (not just the pore volume) for this calculation, as we are interested in the mass of the rock matrix itself. The density is provided in kg/m³, and the volume is in m³, resulting in a weight in kilograms (kg).
    Formula: Total Weight (kg) = Total Rock Volume (m³) * Rock Density (kg/m³)

Variable Explanations

Understanding each input is crucial for accurate calculations and meaningful interpretation.

Variable Meaning Unit Typical Range
Reservoir Area The surface area of the geological formation or reservoir being analyzed. km² 0.1 – 10,000+
Average Depth The typical vertical thickness of the reservoir or formation. m 10 – 5,000+
Rock Density The mass per unit volume of the rock material itself. Varies based on rock type (e.g., sandstone, limestone, shale). kg/m³ 2000 – 3000
Pore Space Saturation The proportion of the rock's total volume that is void space (pores), which can be filled with fluids. % 5 – 50

Practical Examples (Real-World Use Cases)

Let's explore a couple of scenarios to see how the BCM weight calculator works in practice.

Example 1: Estimating a Gas Reservoir

A geological survey identifies a potential gas reservoir with the following characteristics:

  • Reservoir Area: 50 km²
  • Average Depth: 200 m
  • Rock Type: Sandstone with an average Rock Density of 2650 kg/m³
  • Pore Space Saturation: 15%

Using the calculator:

  • Total Rock Volume = 50 km² * 1,000,000 m²/km² * 200 m = 10,000,000,000 m³
  • Pore Volume = 10,000,000,000 m³ * (15 / 100) = 1,500,000,000 m³
  • Reservoir Volume (BCM) = 1,500,000,000 m³ / 1,000,000,000 = 1.5 BCM
  • Total Rock Weight = 10,000,000,000 m³ * 2650 kg/m³ = 26,500,000,000 kg (or 26.5 million metric tons)

Interpretation: This formation holds an estimated 1.5 Billion Cubic Meters of pore space. The total mass of the rock matrix in this section is approximately 26.5 million metric tons. This information is vital for estimating potential gas reserves and understanding the scale of the geological structure.

Example 2: Analyzing an Aquifer

An environmental assessment team is studying a large underground aquifer:

  • Reservoir Area: 250 km²
  • Average Depth: 80 m
  • Rock Type: Porous Limestone with an average Rock Density of 2750 kg/m³
  • Pore Space Saturation: 25%

Using the calculator:

  • Total Rock Volume = 250 km² * 1,000,000 m²/km² * 80 m = 20,000,000,000 m³
  • Pore Volume = 20,000,000,000 m³ * (25 / 100) = 5,000,000,000 m³
  • Reservoir Volume (BCM) = 5,000,000,000 m³ / 1,000,000,000 = 5.0 BCM
  • Total Rock Weight = 20,000,000,000 m³ * 2750 kg/m³ = 55,000,000,000 kg (or 55 million metric tons)

Interpretation: The aquifer contains a substantial pore volume of 5 BCM. The surrounding rock formation weighs approximately 55 million metric tons. This calculation helps in understanding the groundwater storage capacity and the physical characteristics of the aquifer system. For detailed water resource management, you might look into groundwater recharge rates.

How to Use This BCM Weight Calculator

Our BCM Weight Calculator is designed for ease of use, providing quick and accurate estimations. Follow these simple steps:

  1. Input Reservoir Area: Enter the surface area of the geological formation or reservoir in square kilometers (km²). This defines the horizontal extent of your calculation.
  2. Input Average Depth: Provide the average vertical thickness of the reservoir in meters (m). This, combined with the area, gives you the gross volume.
  3. Input Rock Density: Specify the average density of the rock material in kilograms per cubic meter (kg/m³). This value is crucial for weight calculation and depends on the specific geology (e.g., sandstone, limestone). Consult geological reports or standard references for typical values.
  4. Input Pore Space Saturation: Enter the percentage (%) of the rock's total volume that consists of pore spaces. This is where fluids are held. Typical values range from 5% to 50%, depending on the rock type and geological conditions.
  5. Click 'Calculate': Once all fields are populated, click the "Calculate" button. The results will update instantly.

How to Read Results:

  • Main Result (BCM): This is the primary output, showing the estimated volume of the reservoir's pore space in Billion Cubic Meters. It represents the total capacity for fluids or gases.
  • Total Rock Volume (m³): The gross three-dimensional volume of the rock formation, including both solid rock and pore space.
  • Pore Volume (m³): The volume of just the empty pore spaces within the rock, expressed in cubic meters.
  • Total Weight (kg): The estimated total mass of the rock matrix within the specified volume, in kilograms. This gives an idea of the physical scale of the geological structure.

Decision-Making Guidance:

The outputs from this calculator are estimates. They serve as a starting point for more detailed analyses.

  • Resource Potential: A higher BCM value suggests a larger potential storage capacity for resources like oil, gas, or water. This needs to be combined with information on reservoir *quality* (permeability, porosity effectiveness) and *hydrocarbon saturation* to estimate recoverable reserves. Consult our guide on estimating reservoir quality for more insights.
  • Engineering & Logistics: The total rock volume and weight can inform decisions about drilling feasibility, the type of equipment needed, and potential ground stability issues. Consider factors like geotechnical surveying.
  • Economic Viability: For resource extraction, the BCM is a key input for reserve calculations. When combined with estimated recovery factors and commodity prices, it helps determine the economic potential.

Use the 'Reset' button to clear all fields and start over. The 'Copy Results' button allows you to easily transfer the calculated values and assumptions to other documents or reports.

Key Factors That Affect BCM and Weight Results

While the calculator uses a simplified model, several real-world factors can significantly influence the actual BCM and weight of a geological formation. Understanding these nuances is critical for accurate resource assessment and project planning.

  • Geological Heterogeneity: Real geological formations are rarely uniform. Reservoir area, depth, rock density, and pore space saturation can vary significantly across the formation. Our calculator uses average values, but actual conditions may differ, leading to deviations in calculated BCM and weight. Detailed seismic and well log data are needed for more precise mapping.
  • Rock Type Variations: Different rock types (e.g., sandstone, shale, limestone, conglomerate) have inherently different densities and porosity characteristics. The assumed average rock density is a simplification. If the formation comprises multiple rock types, a weighted average or zone-specific calculations are necessary. This impacts both the total rock weight and the pore volume.
  • Compaction and Pressure: As depth increases, the overlying rock layers exert significant pressure, leading to compaction. This compaction can reduce pore space volume and increase rock density, particularly in softer sedimentary rocks. These effects are not directly modeled but influence the actual measured properties. Understanding the impact of geopressure is vital.
  • Diagenesis and Cementation: Over geological time, rocks undergo processes like diagenesis (changes after initial deposition). Cementation, where minerals precipitate in pore spaces, can significantly reduce pore volume and increase effective rock density. This directly affects the available storage space (BCM) and the overall mass.
  • Fluid Content and Type: While the calculator focuses on rock volume and weight, the type and amount of fluid filling the pore space are crucial for resource evaluation. The density of the fluid itself (oil, gas, water) affects the *total* mass of the reservoir contents, though not the mass of the rock matrix. The effective stress on the rock is also influenced by pore fluid pressure.
  • Structural Complexity: Faults, fractures, and folds can compartmentalize reservoirs, alter their effective shape and volume, and influence fluid flow. These complexities mean the simple geometric calculation of volume may not accurately represent the continuous extent of the reservoir. Analyzing structural geology is key for understanding reservoir compartmentalization.
  • Temperature Gradients: Temperature affects the density of both rock and fluids. Higher temperatures can slightly decrease rock density and significantly alter fluid properties (especially gas). While the rock density input is usually measured at standard conditions, subsurface temperatures can be substantially different.

Frequently Asked Questions (FAQ)

Q1: What does BCM stand for, and why is it used?

BCM stands for Billion Cubic Meters. It's used as a standard unit for measuring very large volumes of fluids or gases, commonly encountered in oil, gas, and water reservoirs, making it easier to compare resource quantities on a global scale.

Q2: Is the calculated BCM the amount of oil or gas I can extract?

No. The BCM represents the total pore volume available for fluids. The amount of extractable resource (reserves) depends on factors like the percentage of the pore space filled with the resource (saturation), the type of resource, and the reservoir's permeability and economic conditions.

Q3: Does the weight calculation include the weight of the fluid in the pores?

No, the weight calculation provided here is for the rock matrix only, using the total rock volume and rock density. To find the total mass of the reservoir (rock + fluid), you would need to calculate the weight of the pore fluids separately using their respective densities and the pore volume.

Q4: How accurate is the Rock Density input?

Rock density is a critical input. Typical ranges are provided, but actual density varies significantly by rock type, mineral composition, porosity, and depth (due to compaction). Consulting detailed geological reports for the specific area is recommended for the most accurate density value.

Q5: What if my reservoir has irregular shapes or varying depths?

This calculator uses average values for area and depth. For irregular shapes or significant variations, it's best to divide the reservoir into smaller, more uniform zones, calculate each zone separately, and then sum the results. Advanced geological modeling software is typically used for complex formations. Consider exploring geological modeling techniques.

Q6: Can this calculator be used for mining or other excavation projects?

While the principles of volume and density apply, the term BCM is specific to fluid reservoirs. For mining, you would typically calculate total volume and weight of the ore body or overburden using similar formulas but might use different units (e.g., tonnes, cubic yards) and terminology. The concept of pore space saturation would be less relevant unless dealing with fluids within the mined material.

Q7: How does pore space saturation affect the results?

Pore space saturation directly impacts the calculated Pore Volume (m³) and, consequently, the Reservoir Volume (BCM). A higher saturation percentage means a larger proportion of the total rock volume is available for fluid storage. It does not affect the total rock weight calculation, which uses the gross rock volume.

Q8: What is a reasonable range for Pore Space Saturation?

Typical pore space saturation (porosity) values for sedimentary rocks range widely, from as low as 5% in tightly cemented sandstones or shales to over 50% in some unconsolidated sands or highly fractured carbonates. A common range for oil and gas reservoirs is often between 10% and 30%. Water aquifers might have higher average porosities.

Q9: Does ambient temperature affect the rock density?

Yes, rock density can be slightly affected by temperature, but typically much less so than fluid densities. The primary influence of temperature in subsurface calculations is often on the fluid properties (especially gas expansion) and potentially on rock properties at extreme depths and temperatures, leading to thermal expansion or changes in mineral stability. For most practical reservoir calculations, rock density is assumed constant unless very high temperatures are involved.

Related Tools and Internal Resources

function validateInput(id, min, max) { var input = document.getElementById(id); var value = parseFloat(input.value); var errorElement = document.getElementById(id + "Error"); var isValid = true; input.classList.remove('input-error'); errorElement.style.display = 'none'; errorElement.textContent = "; if (isNaN(value)) { errorElement.textContent = "Please enter a valid number."; errorElement.style.display = 'block'; input.classList.add('input-error'); isValid = false; } else if (value max) { errorElement.textContent = "Value cannot be greater than " + max + "."; errorElement.style.display = 'block'; input.classList.add('input-error'); isValid = false; } return isValid; } function calculateBCMWeight() { var area = parseFloat(document.getElementById("reservoirArea").value); var depth = parseFloat(document.getElementById("averageDepth").value); var density = parseFloat(document.getElementById("rockDensity").value); var saturation = parseFloat(document.getElementById("poreSpaceSaturation").value); var areaError = document.getElementById("reservoirAreaError"); var depthError = document.getElementById("averageDepthError"); var densityError = document.getElementById("rockDensityError"); var saturationError = document.getElementById("poreSpaceSaturationError"); var resultsDiv = document.getElementById("results"); var isValid = true; if (isNaN(area) || area <= 0) { isValid = false; areaError.textContent = "Reservoir Area must be a positive number."; areaError.style.display = 'block'; document.getElementById("reservoirArea").classList.add('input-error'); } else { document.getElementById("reservoirArea").classList.remove('input-error'); areaError.style.display = 'none'; } if (isNaN(depth) || depth <= 0) { isValid = false; depthError.textContent = "Average Depth must be a positive number."; depthError.style.display = 'block'; document.getElementById("averageDepth").classList.add('input-error'); } else { document.getElementById("averageDepth").classList.remove('input-error'); depthError.style.display = 'none'; } if (isNaN(density) || density <= 0) { isValid = false; densityError.textContent = "Rock Density must be a positive number."; densityError.style.display = 'block'; document.getElementById("rockDensity").classList.add('input-error'); } else { document.getElementById("rockDensity").classList.remove('input-error'); densityError.style.display = 'none'; } if (isNaN(saturation) || saturation 100) { isValid = false; saturationError.textContent = "Pore Space Saturation must be between 0 and 100."; saturationError.style.display = 'block'; document.getElementById("poreSpaceSaturation").classList.add('input-error'); } else { document.getElementById("poreSpaceSaturation").classList.remove('input-error'); saturationError.style.display = 'none'; } if (!isValid) { resultsDiv.style.display = 'none'; return; } var areaSqM = area * 1000000; // Convert km² to m² var totalRockVolume = areaSqM * depth; var poreVolume = totalRockVolume * (saturation / 100); var volumeBCM = poreVolume / 1000000000; // Convert m³ to BCM var totalWeight = totalRockVolume * density; document.getElementById("mainResult").textContent = volumeBCM.toLocaleString('en-US', { minimumFractionDigits: 3, maximumFractionDigits: 3 }) + " BCM"; document.getElementById("volumeBCM").textContent = "Pore Volume (BCM): " + volumeBCM.toLocaleString('en-US', { minimumFractionDigits: 3, maximumFractionDigits: 3 }); document.getElementById("totalRockVolume").textContent = "Total Rock Volume: " + totalRockVolume.toLocaleString('en-US', { minimumFractionDigits: 0, maximumFractionDigits: 0 }) + " m³"; document.getElementById("poreVolume").textContent = "Pore Volume (m³): " + poreVolume.toLocaleString('en-US', { minimumFractionDigits: 0, maximumFractionDigits: 0 }) + " m³"; // Display weight in a more readable format, e.g., millions or billions of kg var weightFormatted = totalWeight; var weightUnit = "kg"; if (totalWeight >= 1e9) { weightFormatted = totalWeight / 1e9; weightUnit = " billion kg (metric tons)"; } else if (totalWeight >= 1e6) { weightFormatted = totalWeight / 1e6; weightUnit = " million kg (metric tons)"; } document.getElementById("results").insertAdjacentHTML('beforeend', '
Total Rock Weight: ' + weightFormatted.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) + ' ' + weightUnit + '
'); resultsDiv.style.display = 'block'; updateChart(area, depth, density, saturation); // Call chart update } function resetForm() { document.getElementById("reservoirArea").value = "100"; document.getElementById("averageDepth").value = "50"; document.getElementById("rockDensity").value = "2700"; document.getElementById("poreSpaceSaturation").value = "20"; // Clear errors document.getElementById("reservoirAreaError").style.display = 'none'; document.getElementById("averageDepthError").style.display = 'none'; document.getElementById("rockDensityError").style.display = 'none'; document.getElementById("poreSpaceSaturationError").style.display = 'none'; document.getElementById("reservoirArea").classList.remove('input-error'); document.getElementById("averageDepth").classList.remove('input-error'); document.getElementById("rockDensity").classList.remove('input-error'); document.getElementById("poreSpaceSaturation").classList.remove('input-error'); document.getElementById("results").style.display = 'none'; // Optionally reset chart to defaults or clear it updateChart(100, 50, 2700, 20); // Reset chart to default values } function copyResults() { var mainResult = document.getElementById("mainResult").textContent; var volumeBCM = document.getElementById("volumeBCM").textContent; var totalRockVolume = document.getElementById("totalRockVolume").textContent; var poreVolume = document.getElementById("poreVolume").textContent; // Find the weight element dynamically var weightElement = document.querySelector('#results .intermediate-values:last-child'); // Selects the last div added in the weight section var totalWeight = weightElement ? weightElement.textContent : "N/A"; var assumptions = "Key Assumptions:\n"; assumptions += "- Uniform reservoir area, depth, rock density, and pore space saturation.\n"; assumptions += "- Rock density refers to the bulk density of the solid rock material.\n"; assumptions += "- BCM represents the volume of the fluid-filled pore space."; var textToCopy = "BCM Weight Calculator Results:\n\n"; textToCopy += "Main Result: " + mainResult + "\n"; textToCopy += volumeBCM + "\n"; textToCopy += totalRockVolume + "\n"; textToCopy += poreVolume + "\n"; textToCopy += totalWeight + "\n\n"; textToCopy += assumptions; if (navigator.clipboard && window.isSecureContext) { navigator.clipboard.writeText(textToCopy).then(function() { alert("Results copied to clipboard!"); }).catch(function(err) { console.error("Failed to copy: ", err); // Fallback for environments where clipboard API isn't available or fails var textArea = document.createElement("textarea"); textArea.value = textToCopy; textArea.style.position = "fixed"; // Avoid scrolling to bottom document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { document.execCommand('copy'); alert("Results copied to clipboard (fallback)!"); } catch (e) { alert("Failed to copy results. Please copy manually."); } document.body.removeChild(textArea); }); } else { // Fallback for older browsers or non-secure contexts var textArea = document.createElement("textarea"); textArea.value = textToCopy; textArea.style.position = "fixed"; // Avoid scrolling to bottom document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { document.execCommand('copy'); alert("Results copied to clipboard (fallback)!"); } catch (e) { alert("Failed to copy results. Please copy manually."); } document.body.removeChild(textArea); } } // Charting Logic function updateChart(area, depth, density, saturation) { var canvas = document.getElementById('bcmChart'); var ctx = canvas.getContext('2d'); // Clear previous chart ctx.clearRect(0, 0, canvas.width, canvas.height); // Chart dimensions and padding var chartWidth = canvas.parentElement.offsetWidth; var chartHeight = chartWidth * 0.6; // Maintain aspect ratio canvas.width = chartWidth; canvas.height = chartHeight; var padding = 50; var chartAreaWidth = chartWidth – 2 * padding; var chartAreaHeight = chartHeight – 2 * padding; // Data calculation for chart – varying depth from 10m to 500m var depths = [10, 50, 100, 200, 300, 400, 500]; var totalRockVolumes = []; var poreVolumesBCM = []; for (var i = 0; i < depths.length; i++) { var currentDepth = depths[i]; var currentTotalRockVolume = area * 1000000 * currentDepth; var currentPoreVolume = currentTotalRockVolume * (saturation / 100); var currentPoreVolumeBCM = currentPoreVolume / 1000000000; totalRockVolumes.push(currentTotalRockVolume); poreVolumesBCM.push(currentPoreVolumeBCM); } // Find max values for scaling var maxTotalRockVolume = Math.max(…totalRockVolumes); var maxPoreVolumeBCM = Math.max(…poreVolumesBCM); var maxYValue = Math.max(maxTotalRockVolume, maxPoreVolumeBCM * 1e9); // Scale BCM back to m³ for comparison on same axis if needed, or use separate scales. For simplicity, let's plot BCM directly. var scaleMaxY = Math.max(…poreVolumesBCM) * 1.2; // Scale BCM for Y axis // Drawing the chart ctx.font = '14px Segoe UI'; ctx.fillStyle = '#333'; // Y-axis (BCM) ctx.beginPath(); ctx.moveTo(padding, padding); ctx.lineTo(padding, chartHeight – padding); ctx.stroke(); // X-axis (Depth) ctx.beginPath(); ctx.moveTo(padding, chartHeight – padding); ctx.lineTo(chartWidth – padding, chartHeight – padding); ctx.stroke(); // Y-axis labels and ticks var numYTicks = 5; for (var i = 0; i <= numYTicks; i++) { var y = chartHeight – padding – (i / numYTicks) * chartAreaHeight; var label = (scaleMaxY * (1 – i / numYTicks)).toFixed(1); ctx.fillText(label + " BCM", padding – 60, y + 5); ctx.beginPath(); ctx.moveTo(padding – 5, y); ctx.lineTo(padding, y); ctx.stroke(); } // X-axis labels and ticks var numXTicks = depths.length; for (var i = 0; i < numXTicks; i++) { var x = padding + (i / (numXTicks – 1)) * chartAreaWidth; var label = depths[i] + " m"; ctx.fillText(label, x – 20, chartHeight – padding + 20); ctx.beginPath(); ctx.moveTo(x, chartHeight – padding); ctx.lineTo(x, chartHeight – padding + 5); ctx.stroke(); } // Draw Data Series 1: Pore Volume (BCM) ctx.strokeStyle = 'var(–primary-color)'; ctx.lineWidth = 2; ctx.beginPath(); for (var i = 0; i < depths.length; i++) { var x = padding + (i / (depths.length – 1)) * chartAreaWidth; var y = chartHeight – padding – (poreVolumesBCM[i] / scaleMaxY) * chartAreaHeight; if (i === 0) { ctx.moveTo(x, y); } else { ctx.lineTo(x, y); } } ctx.stroke(); ctx.fillStyle = 'rgba(0, 74, 153, 0.1)'; // Semi-transparent fill ctx.lineTo(chartWidth – padding, chartHeight – padding); // Close shape for fill ctx.lineTo(padding, chartHeight – padding); ctx.fill(); // Draw Data Series 2: Total Rock Volume (represented as BCM equivalent for scale comparison, conceptually) // Note: Plotting Total Rock Volume directly on BCM axis might be misleading if magnitudes differ greatly. // Alternative: Use a secondary axis or scale. For simplicity here, we'll show it scaled. // Let's rescale based on Total Rock Volume if it's larger var scaleMaxTotalRock = Math.max(…totalRockVolumes) * 1.2; var effectiveScaleMaxY = Math.max(scaleMaxY, scaleMaxTotalRock / 1e9); // Adjust scale max based on both series if needed ctx.strokeStyle = 'var(–success-color)'; ctx.lineWidth = 2; ctx.beginPath(); for (var i = 0; i < depths.length; i++) { var x = padding + (i / (depths.length – 1)) * chartAreaWidth; // Represent Total Rock Volume on the BCM scale for comparison. This is conceptual. var y = chartHeight – padding – (totalRockVolumes[i] / (effectiveScaleMaxY * 1e9)) * chartAreaHeight; if (i === 0) { ctx.moveTo(x, y); } else { ctx.lineTo(x, y); } } ctx.stroke(); ctx.fillStyle = 'rgba(40, 167, 69, 0.1)'; // Semi-transparent fill ctx.lineTo(chartWidth – padding, chartHeight – padding); // Close shape for fill ctx.lineTo(padding, chartHeight – padding); ctx.fill(); // Legend ctx.fillStyle = '#333'; ctx.font = '12px Segoe UI'; ctx.fillText('Pore Volume (BCM)', padding + 10, padding + 20); ctx.fillStyle = 'var(–primary-color)'; ctx.fillRect(padding – 40, padding + 10, 15, 10); ctx.fillStyle = '#333'; ctx.fillText('Total Rock Volume (Scaled to BCM)', padding + 10, padding + 40); ctx.fillStyle = 'var(–success-color)'; ctx.fillRect(padding – 40, padding + 30, 15, 10); // Add Title ctx.fillStyle = 'var(–primary-color)'; ctx.font = '18px Segoe UI'; ctx.textAlign = 'center'; ctx.fillText('Volume vs. Depth Comparison', chartWidth / 2, padding – 10); } // Initial calculation and chart draw on load document.addEventListener('DOMContentLoaded', function() { calculateBCMWeight(); updateChart( parseFloat(document.getElementById("reservoirArea").value), parseFloat(document.getElementById("averageDepth").value), parseFloat(document.getElementById("rockDensity").value), parseFloat(document.getElementById("poreSpaceSaturation").value) ); });

Leave a Comment