Calculate Max Dry Unit Weight

Calculate Max Dry Unit Weight – Soil Mechanics Calculator body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f8f9fa; color: #333; line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 960px; margin: 20px auto; padding: 20px; background-color: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } header { background-color: #004a99; color: #fff; padding: 20px; text-align: center; border-radius: 8px 8px 0 0; margin-bottom: 20px; } header h1 { margin: 0; font-size: 2.2em; } .calculator-section { margin-bottom: 30px; padding: 25px; border: 1px solid #e0e0e0; border-radius: 8px; background-color: #fdfdfd; } .calculator-section h2 { color: #004a99; margin-top: 0; border-bottom: 2px solid #004a99; padding-bottom: 10px; margin-bottom: 20px; } .input-group { margin-bottom: 15px; display: flex; flex-direction: column; } .input-group label { font-weight: bold; margin-bottom: 5px; color: #555; } .input-group input[type="number"], .input-group input[type="text"], .input-group select { padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 1em; box-sizing: border-box; } .input-group input[type="number"]:focus, .input-group input[type="text"]:focus, .input-group select:focus { border-color: #004a99; outline: none; box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: #777; margin-top: 5px; } .error-message { color: #dc3545; font-size: 0.8em; margin-top: 5px; display: none; /* Hidden by default */ } .button-group { display: flex; gap: 10px; margin-top: 20px; justify-content: center; flex-wrap: wrap; } button { padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease, transform 0.2s ease; } button.primary { background-color: #004a99; color: #fff; } button.primary:hover { background-color: #003366; transform: translateY(-1px); } button.secondary { background-color: #6c757d; color: #fff; } button.secondary:hover { background-color: #5a6268; transform: translateY(-1px); } button.success { background-color: #28a745; color: #fff; } button.success:hover { background-color: #218838; transform: translateY(-1px); } #results { margin-top: 30px; padding: 25px; border: 1px solid #d4edda; border-radius: 8px; background-color: #e9f7ef; text-align: center; } #results h3 { color: #155724; margin-top: 0; margin-bottom: 15px; } .result-item { margin-bottom: 10px; font-size: 1.1em; } .result-item strong { color: #004a99; } .primary-result { font-size: 1.8em; font-weight: bold; color: #004a99; background-color: #fff3cd; padding: 15px; border-radius: 5px; margin-top: 15px; display: inline-block; border: 2px solid #ffeeba; } .formula-explanation { font-size: 0.9em; color: #555; margin-top: 15px; font-style: italic; } table { width: 100%; border-collapse: collapse; margin-top: 20px; margin-bottom: 20px; } th, td { border: 1px solid #ddd; padding: 10px; text-align: left; } th { background-color: #004a99; color: #fff; font-weight: bold; } tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1em; font-weight: bold; color: #004a99; margin-bottom: 10px; text-align: left; } canvas { display: block; margin: 20px auto; max-width: 100%; background-color: #fff; border-radius: 5px; box-shadow: 0 0 5px rgba(0,0,0,0.1); } .article-section { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; } .article-section h2 { color: #004a99; margin-bottom: 15px; font-size: 1.8em; } .article-section h3 { color: #0056b3; margin-top: 20px; margin-bottom: 10px; font-size: 1.4em; } .article-section p { margin-bottom: 15px; } .article-section ul, .article-section ol { margin-left: 20px; margin-bottom: 15px; } .article-section li { margin-bottom: 8px; } .faq-item { margin-bottom: 15px; padding: 10px; border-left: 3px solid #004a99; background-color: #f9f9f9; border-radius: 4px; } .faq-item strong { color: #004a99; display: block; margin-bottom: 5px; } .internal-links { margin-top: 30px; padding: 20px; background-color: #eef7ff; border-radius: 8px; border: 1px solid #cce5ff; } .internal-links h3 { color: #004a99; margin-top: 0; margin-bottom: 15px; } .internal-links ul { list-style: none; padding: 0; margin: 0; } .internal-links li { margin-bottom: 10px; } .internal-links a { color: #004a99; text-decoration: none; font-weight: bold; } .internal-links a:hover { text-decoration: underline; } .internal-links p { font-size: 0.9em; color: #555; margin-top: 5px; } @media (max-width: 768px) { .container { margin: 10px; padding: 15px; } header h1 { font-size: 1.8em; } button { width: 100%; margin-bottom: 10px; } .button-group { flex-direction: column; align-items: center; } }

Calculate Max Dry Unit Weight

Your essential tool for determining the densest possible state of soil.

Soil Compaction Calculator

Enter the weight of the soil sample after it has been completely dried in an oven.
The internal volume of the mold used to compact the soil.
The ratio of the weight of water to the dry weight of soil, expressed as a percentage.
The ratio of the density of soil solids to the density of water (typically around 2.65 for many soils).

Calculation Results

Maximum Dry Unit Weight (γd_max):
Dry Unit Weight (γd): g/cm³
Void Ratio (e):
Degree of Saturation (S): %
The maximum dry unit weight (γd_max) is calculated using the principles of soil mechanics, often derived from compaction test results (like the Proctor test) or estimated using specific gravity and optimal water content. The formula used here is: γd_max = (Gs * γw) / (1 + e_min) where Gs is the specific gravity of soil solids, γw is the unit weight of water (approx. 1 g/cm³), and e_min is the minimum void ratio achievable at maximum compaction. This calculator estimates γd_max based on provided inputs, assuming optimal conditions.

Compaction Data Table

Soil Compaction Characteristics
Parameter Value Unit
Oven-Dry Weight of Sample g
Volume of Compaction Mold cm³
Water Content %
Specific Gravity of Solids (Gs)
Unit Weight of Water (γw) 1.0 g/cm³
Calculated Dry Unit Weight (γd) g/cm³
Calculated Void Ratio (e)
Calculated Degree of Saturation (S) %
Estimated Max Dry Unit Weight (γd_max) g/cm³

What is Maximum Dry Unit Weight?

The maximum dry unit weight, often denoted as γd_max or ρd_max, is a fundamental property in geotechnical engineering and soil mechanics. It represents the heaviest possible weight of a soil per unit volume when it is in a completely dry state (i.e., no water content) and compacted to its densest achievable state. This value is crucial for understanding soil behavior under load, particularly in construction applications like foundations, road bases, and earth dams.

Essentially, achieving the maximum dry unit weight means minimizing the void space between soil particles. This is typically accomplished by applying a specific amount of compactive effort and achieving an optimal water content. When soil is denser, it generally exhibits higher strength, lower compressibility, and reduced permeability, making it more suitable for engineering purposes.

Who Should Use It?

Professionals in various fields rely on the concept and calculation of maximum dry unit weight:

  • Geotechnical Engineers: To assess soil suitability for construction projects, design foundations, and analyze slope stability.
  • Civil Engineers: For designing road subgrades, embankments, and other earth structures.
  • Construction Managers: To ensure proper soil compaction during site preparation and building.
  • Environmental Engineers: When designing liners for landfills or assessing groundwater flow through soil.
  • Soil Scientists: To understand soil structure and its impact on agricultural productivity and water retention.

Common Misconceptions

Several misconceptions surround the maximum dry unit weight:

  • It's the absolute densest possible state: While it's the densest achievable under specific compaction conditions (like a standard Proctor test), theoretically, even denser states might be possible with extreme pressures or different particle arrangements.
  • Higher is always better: While higher density often implies better strength, the *optimal* water content at which this maximum density is achieved is equally important. Soil that is too dry or too wet at maximum density can still perform poorly.
  • It's a fixed value for a soil type: The maximum dry unit weight can vary slightly depending on the compactive effort applied. The standard Proctor test provides a benchmark, but field compaction might involve different energy levels.

Maximum Dry Unit Weight Formula and Mathematical Explanation

The calculation of maximum dry unit weight (γd_max) is intrinsically linked to soil compaction characteristics, typically determined through laboratory tests like the Standard Proctor Test or Modified Proctor Test. These tests involve compacting soil samples at various water contents using a standardized hammer and number of blows. The dry unit weight is then calculated for each water content, and a compaction curve is plotted. The peak of this curve represents the maximum dry unit weight.

While the calculator provides a direct estimation, the underlying principles involve several key soil properties. The theoretical maximum dry unit weight can be estimated using the following relationship, derived from the phase relationships in soil mechanics:

γd_max = (Gs * γw) / (1 + e_min)

Let's break down the variables:

Variables in the Maximum Dry Unit Weight Formula
Variable Meaning Unit Typical Range
γd_max Maximum Dry Unit Weight kN/m³ or lb/ft³ (or g/cm³ for calculator) Varies widely based on soil type and compaction effort
Gs Specific Gravity of Soil Solids Dimensionless 2.5 – 2.8 (common for many mineral soils)
γw Unit Weight of Water kN/m³ or lb/ft³ (or g/cm³ for calculator) Approx. 9.81 kN/m³ or 62.4 lb/ft³ or 1.0 g/cm³
e_min Minimum Void Ratio Dimensionless 0.3 – 1.0 (highly dependent on soil gradation and particle shape)

In the context of the calculator provided, we are estimating the Dry Unit Weight (γd) and Void Ratio (e) at the given water content, and then using the Specific Gravity (Gs) to infer a potential Maximum Dry Unit Weight (γd_max). The calculator uses the following relationships:

  1. Dry Unit Weight (γd): Calculated as the oven-dry weight of the sample divided by the mold volume.
    γd = Sample Weight / Mold Volume
  2. Void Ratio (e): Calculated using the dry unit weight, specific gravity, and the unit weight of water.
    e = (Gs * γw / γd) - 1
  3. Degree of Saturation (S): Calculated using the void ratio and water content.
    S = (w * Gs) / e (where w is water content expressed as a decimal)
  4. Estimated Maximum Dry Unit Weight (γd_max): This is often determined experimentally. However, for estimation purposes, we can relate it to the calculated void ratio. A common assumption is that the soil at its maximum dry unit weight is close to saturation or has a specific minimum void ratio. For simplicity in this calculator, we are presenting the calculated γd and e, and providing a theoretical γd_max based on a typical minimum void ratio assumption or derived from the Proctor curve concept. The calculator's primary output for γd_max is an estimation based on typical soil behavior and the provided Gs, assuming an optimal void ratio is achieved. A more accurate γd_max requires a full compaction test. The formula presented in the results section is the theoretical basis.

The calculator helps visualize these relationships. By inputting basic soil properties, you can estimate key compaction parameters.

Practical Examples (Real-World Use Cases)

Understanding and calculating the maximum dry unit weight is vital for numerous practical applications in civil engineering and construction. Here are a couple of examples:

Example 1: Road Embankment Construction

Scenario: A civil engineering team is constructing a highway embankment using locally sourced clayey soil. They need to ensure the soil is compacted to achieve sufficient strength and stability to support the pavement layers and withstand traffic loads.

Inputs:

  • Oven-Dry Weight of Sample: 480 g
  • Volume of Compaction Mold: 1000 cm³
  • Water Content: 18%
  • Specific Gravity of Soil Solids (Gs): 2.68

Calculation using the calculator:

  • Dry Unit Weight (γd): 480 g / 1000 cm³ = 0.48 g/cm³
  • Void Ratio (e): (2.68 * 1.0 / 0.48) – 1 ≈ 4.58
  • Degree of Saturation (S): (0.18 * 2.68) / 4.58 ≈ 10.5%
  • Estimated Max Dry Unit Weight (γd_max): Based on typical compaction curves for clay, the optimal water content might be around 20-25%, yielding a γd_max of approximately 1.70-1.85 g/cm³. The calculator might estimate a value within this range based on Gs and typical e_min assumptions. Let's assume the calculator estimates γd_max = 1.75 g/cm³.

Interpretation: The current sample (γd = 0.48 g/cm³) is very loose and has a low degree of saturation. This indicates it is far from its maximum possible density. The engineering team must increase the compactive effort and potentially adjust the water content closer to the optimal range (around 20-25%) to achieve the target γd_max of 1.75 g/cm³. This density is required for the embankment's structural integrity.

Example 2: Foundation Design for a Building

Scenario: A geotechnical engineer is evaluating a sandy soil deposit for the foundation of a commercial building. They need to determine the soil's bearing capacity, which is influenced by its density.

Inputs:

  • Oven-Dry Weight of Sample: 550 g
  • Volume of Compaction Mold: 1000 cm³
  • Water Content: 10%
  • Specific Gravity of Soil Solids (Gs): 2.65

Calculation using the calculator:

  • Dry Unit Weight (γd): 550 g / 1000 cm³ = 0.55 g/cm³
  • Void Ratio (e): (2.65 * 1.0 / 0.55) – 1 ≈ 3.82
  • Degree of Saturation (S): (0.10 * 2.65) / 3.82 ≈ 6.9%
  • Estimated Max Dry Unit Weight (γd_max): For sands, the optimal water content is usually low, and compaction is achieved primarily through mechanical effort. A typical γd_max for dense sand could be around 1.80-2.00 g/cm³. Let's assume the calculator estimates γd_max = 1.90 g/cm³.

Interpretation: The current sample has a dry unit weight of 0.55 g/cm³, which is quite loose. The calculated void ratio is high, and the degree of saturation is low. To achieve adequate bearing capacity for the building foundation, the soil needs to be significantly densified. Field compaction methods (like vibratory rolling) should be employed to bring the soil's density closer to the estimated γd_max of 1.90 g/cm³. This will increase its shear strength and reduce potential settlement.

How to Use This Maximum Dry Unit Weight Calculator

Our calculator simplifies the process of estimating key soil compaction parameters. Follow these steps for accurate results:

  1. Gather Soil Data: Obtain the following information for your soil sample:
    • Oven-Dry Weight of Soil Sample (g): The weight of the soil after all moisture has been removed in an oven.
    • Volume of Compaction Mold (cm³): The internal volume of the container used for compaction.
    • Water Content (%): The moisture content of the soil sample, expressed as a percentage of the dry weight.
    • Specific Gravity of Soil Solids (Gs): The ratio of the density of the soil solids to the density of water.
  2. Input Values: Enter the collected data into the corresponding fields in the calculator. Ensure you use the correct units (grams for weight, cm³ for volume, percent for water content).
  3. Calculate: Click the "Calculate" button. The calculator will process your inputs.
  4. Review Results: The results section will display:
    • Maximum Dry Unit Weight (γd_max): The primary highlighted result, representing the densest possible dry state of the soil under typical compaction.
    • Dry Unit Weight (γd): The calculated dry density of the soil sample based on your inputs.
    • Void Ratio (e): The ratio of the volume of voids to the volume of solids in the soil.
    • Degree of Saturation (S): The percentage of the void space filled with water.
    • Formula Explanation: A brief description of the underlying principles.
  5. Interpret the Data: Compare the calculated Dry Unit Weight (γd) to the estimated Maximum Dry Unit Weight (γd_max). If γd is significantly lower than γd_max, it indicates the soil is not yet adequately compacted and requires further compactive effort or moisture adjustment. The Degree of Saturation (S) also provides insight into the soil's condition.
  6. Use the Table and Chart: The table summarizes all input and calculated values. The chart visually represents the relationship between water content and dry unit weight (though this calculator focuses on a single point, the chart structure is illustrative of a compaction curve).
  7. Copy Results: Use the "Copy Results" button to save or share the calculated values and key assumptions.
  8. Reset: Click "Reset" to clear the fields and return to default values for a new calculation.

Decision-Making Guidance

The primary decision hinges on comparing the calculated Dry Unit Weight (γd) with the Maximum Dry Unit Weight (γd_max).

  • If γd is close to γd_max (e.g., within 90-95% of the target), the soil is considered well-compacted for many applications.
  • If γd is significantly lower than γd_max, the soil requires more compaction. This might involve increasing the compactive energy (more passes with equipment, heavier equipment) or adjusting the water content. For optimal compaction, the water content should be near the 'optimum moisture content' (OMC) that corresponds to the γd_max.
  • The Degree of Saturation (S) is also important. Compaction is typically most effective when the water content is slightly below saturation. Very high saturation can lead to lower strength and increased pore pressures.

Key Factors That Affect Maximum Dry Unit Weight Results

Several factors influence the maximum dry unit weight achievable for a given soil. Understanding these is crucial for accurate predictions and effective field compaction:

  1. Soil Type and Gradation: The particle size distribution (gradation) and shape significantly impact how soil particles can pack together. Well-graded soils (containing a wide range of particle sizes) can achieve higher densities than poorly graded or uniformly graded soils because the smaller particles can fill the voids between larger ones. Angular particles tend to interlock better than rounded particles, potentially leading to higher densities.
  2. Compactive Effort: This refers to the energy applied to the soil during compaction. Higher compactive effort (e.g., using heavier equipment, more passes, or higher impact energy like in the Modified Proctor test compared to the Standard Proctor test) generally results in a higher maximum dry unit weight and a lower optimum moisture content.
  3. Water Content: Water acts as a lubricant, allowing soil particles to move closer together. However, too much water can prevent particles from packing densely, leading to a lower dry unit weight. There is an 'optimum moisture content' (OMC) at which the maximum dry unit weight is achieved for a given compactive effort. This calculator estimates γd_max, but the relationship with water content is key.
  4. Specific Gravity of Soil Solids (Gs): Soils with higher specific gravity (meaning their solids are inherently denser) will generally have a higher maximum dry unit weight, assuming similar particle packing. This is directly incorporated into the formula γd_max = (Gs * γw) / (1 + e_min).
  5. Particle Shape and Surface Texture: Flatter or elongated particles may not pack as efficiently as more spherical particles, potentially leading to lower maximum dry unit weights. Surface texture (smooth vs. rough) can also influence inter-particle friction and packing.
  6. Presence of Organic Matter: Organic soils typically have lower maximum dry unit weights and higher optimum moisture contents compared to mineral soils due to the lower density and compressibility of organic components.
  7. Initial State of the Soil: The condition of the soil before compaction (e.g., its initial density and moisture content) can influence the effectiveness of the applied compactive effort.

Frequently Asked Questions (FAQ)

Q1: What is the difference between dry unit weight and maximum dry unit weight?

Dry unit weight (γd) is the weight of the soil solids per unit volume of the total soil mass at a specific water content. Maximum dry unit weight (γd_max) is the highest possible dry unit weight achievable for that soil under a specific compactive effort, typically occurring at the optimum moisture content.

Q2: How is the maximum dry unit weight typically determined in the field?

In the field, engineers use standardized laboratory tests (like the Proctor test) to determine the target γd_max and OMC. Then, during construction, they use nuclear density gauges or other field testing methods to measure the in-situ dry unit weight and water content, comparing them against the laboratory-determined targets. Compaction equipment and techniques are adjusted as needed.

Q3: Can I use this calculator for any type of soil?

This calculator provides an estimation based on fundamental soil properties like specific gravity. It's most applicable to granular soils (sands, gravels) and fine-grained soils (silts, clays) where these parameters are known. However, for critical projects, laboratory compaction tests (Proctor tests) are essential for accurate determination.

Q4: What is the unit weight of water (γw) used in the calculation?

The standard unit weight of water is approximately 1.0 g/cm³ (or 9.81 kN/m³ or 62.4 lb/ft³). The calculator uses 1.0 g/cm³ for consistency with the input units.

Q5: Does the calculator account for different types of compaction tests (Standard vs. Modified Proctor)?

This calculator provides an estimation based on the provided inputs and general soil mechanics principles. It does not directly simulate the specific compactive energies of Standard or Modified Proctor tests. These tests yield different γd_max and OMC values for the same soil. The calculator's γd_max output is a theoretical estimate.

Q6: What happens if the calculated Dry Unit Weight (γd) is higher than the estimated Maximum Dry Unit Weight (γd_max)?

This scenario is unlikely if the inputs are correct and the γd_max is a valid estimate for the soil. If it occurs, it might indicate an error in input data, an unrealistic specific gravity value, or that the estimated γd_max is too low for the soil type and potential compaction. It could also suggest the soil sample tested was already highly compacted.

Q7: How does the void ratio (e) relate to density?

Void ratio (e) is inversely related to density. A lower void ratio means less empty space between particles, resulting in a higher density (both dry unit weight and total unit weight). Conversely, a higher void ratio indicates a looser soil structure and lower density.

Q8: Why is achieving maximum dry unit weight important for construction?

Achieving high dry unit weight (close to γd_max) generally leads to improved engineering properties: increased shear strength (better load-bearing capacity), reduced compressibility (less settlement), and decreased permeability (better water resistance or control). This is critical for the long-term performance and stability of structures built on or with soil.

© 2023 Your Engineering Resource. All rights reserved.

var chartInstance = null; // Global variable to hold chart instance function validateInput(id, errorId, minValue, maxValue) { var input = document.getElementById(id); var errorElement = document.getElementById(errorId); var value = parseFloat(input.value); errorElement.style.display = 'none'; // Hide error by default if (isNaN(value) || input.value.trim() === "") { errorElement.textContent = "This field is required."; errorElement.style.display = 'block'; return false; } if (value < 0) { errorElement.textContent = "Value cannot be negative."; errorElement.style.display = 'block'; return false; } if (minValue !== undefined && value maxValue) { errorElement.textContent = "Value cannot exceed " + maxValue + "."; errorElement.style.display = 'block'; return false; } return true; } function calculateMaxDryUnitWeight() { var isValid = true; isValid = validateInput('sampleWeight', 'sampleWeightError') && isValid; isValid = validateInput('moldVolume', 'moldVolumeError', 0.0001) && isValid; // Volume must be positive isValid = validateInput('waterContent', 'waterContentError') && isValid; isValid = validateInput('specificGravity', 'specificGravityError', 0.0001) && isValid; // Gs must be positive if (!isValid) { document.getElementById('results').style.display = 'none'; return; } var sampleWeight = parseFloat(document.getElementById('sampleWeight').value); var moldVolume = parseFloat(document.getElementById('moldVolume').value); var waterContent = parseFloat(document.getElementById('waterContent').value) / 100.0; // Convert % to decimal var specificGravity = parseFloat(document.getElementById('specificGravity').value); var unitWeightWater = 1.0; // g/cm³ // Calculate Dry Unit Weight (γd) var dryUnitWeight = sampleWeight / moldVolume; // Calculate Void Ratio (e) var voidRatio = (specificGravity * unitWeightWater / dryUnitWeight) – 1; // Calculate Degree of Saturation (S) var degreeOfSaturation = (waterContent * specificGravity) / voidRatio; // Estimate Maximum Dry Unit Weight (γd_max) // This is a simplified estimation. A true γd_max requires a compaction test. // We'll use a common range and adjust slightly based on Gs. // A typical minimum void ratio (e_min) for dense soils might be around 0.3-0.5. // Let's assume e_min = 0.4 for estimation. var estimatedMinVoidRatio = 0.4; var estimatedMaxDryUnitWeight = (specificGravity * unitWeightWater) / (1 + estimatedMinVoidRatio); // Ensure calculated values are reasonable and handle potential division by zero or negative void ratio if (isNaN(dryUnitWeight) || isNaN(voidRatio) || isNaN(degreeOfSaturation) || isNaN(estimatedMaxDryUnitWeight)) { document.getElementById('results').style.display = 'none'; return; } // Clamp void ratio to be non-negative, as negative void ratio is physically impossible if (voidRatio 100) { degreeOfSaturation = 100; } document.getElementById('maxDryUnitWeightResult').textContent = estimatedMaxDryUnitWeight.toFixed(3); document.getElementById('maxDryUnitWeightUnit').textContent = 'g/cm³'; document.getElementById('dryUnitWeightResult').textContent = dryUnitWeight.toFixed(3); document.getElementById('voidRatioResult').textContent = voidRatio.toFixed(3); document.getElementById('degreeOfSaturationResult').textContent = (degreeOfSaturation * 100).toFixed(1); // Display as percentage // Update table document.getElementById('tableSampleWeight').textContent = sampleWeight.toFixed(2); document.getElementById('tableMoldVolume').textContent = moldVolume.toFixed(2); document.getElementById('tableWaterContent').textContent = (waterContent * 100).toFixed(1); document.getElementById('tableSpecificGravity').textContent = specificGravity.toFixed(2); document.getElementById('tableDryUnitWeight').textContent = dryUnitWeight.toFixed(3); document.getElementById('tableVoidRatio').textContent = voidRatio.toFixed(3); document.getElementById('tableDegreeOfSaturation').textContent = (degreeOfSaturation * 100).toFixed(1); document.getElementById('tableMaxDryUnitWeight').textContent = estimatedMaxDryUnitWeight.toFixed(3); document.getElementById('results').style.display = 'block'; updateChart(dryUnitWeight, waterContent * 100, estimatedMaxDryUnitWeight); // Pass water content in % } function resetCalculator() { document.getElementById('sampleWeight').value = 500; document.getElementById('moldVolume').value = 1000; document.getElementById('waterContent').value = 15; document.getElementById('specificGravity').value = 2.65; // Clear errors document.getElementById('sampleWeightError').textContent = "; document.getElementById('moldVolumeError').textContent = "; document.getElementById('waterContentError').textContent = "; document.getElementById('specificGravityError').textContent = "; document.getElementById('sampleWeightError').style.display = 'none'; document.getElementById('moldVolumeError').style.display = 'none'; document.getElementById('waterContentError').style.display = 'none'; document.getElementById('specificGravityError').style.display = 'none'; document.getElementById('results').style.display = 'none'; if (chartInstance) { chartInstance.destroy(); chartInstance = null; } document.getElementById('compactionChart').style.display = 'none'; document.getElementById('chartLegend').innerHTML = "; } function copyResults() { var resultsDiv = document.getElementById('results'); if (resultsDiv.style.display === 'none') { alert("Please calculate the results first."); return; } var textToCopy = "Maximum Dry Unit Weight Calculator Results:\n\n"; textToCopy += "Maximum Dry Unit Weight (γd_max): " + document.getElementById('maxDryUnitWeightResult').textContent + " " + document.getElementById('maxDryUnitWeightUnit').textContent + "\n"; textToCopy += "Dry Unit Weight (γd): " + document.getElementById('dryUnitWeightResult').textContent + " g/cm³\n"; textToCopy += "Void Ratio (e): " + document.getElementById('voidRatioResult').textContent + "\n"; textToCopy += "Degree of Saturation (S): " + document.getElementById('degreeOfSaturationResult').textContent + " %\n\n"; textToCopy += "Key Assumptions:\n"; textToCopy += "Unit Weight of Water (γw): 1.0 g/cm³\n"; textToCopy += "Estimated Minimum Void Ratio (e_min) for γd_max calculation: ~0.4\n"; // Reflecting the estimation logic // Use a temporary textarea to copy text var textArea = document.createElement("textarea"); textArea.value = textToCopy; textArea.style.position = "fixed"; // Avoid scrolling to bottom of page in MS Edge. 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 ? 'Results copied successfully!' : 'Failed to copy results.'; alert(msg); } catch (err) { alert('Oops, unable to copy. Please copy manually.'); } document.body.removeChild(textArea); } function updateChart(currentDryUnitWeight, currentWaterContent, estimatedMaxDryUnitWeight) { var canvas = document.getElementById('compactionChart'); var ctx = canvas.getContext('2d'); // Clear previous chart if it exists if (chartInstance) { chartInstance.destroy(); } canvas.style.display = 'block'; // Make canvas visible // Define some points for a hypothetical compaction curve // These are illustrative and not derived from the single input point var hypotheticalCurvePoints = [ {wc: 5, dw: 1.40}, // Dry side {wc: 10, dw: 1.60}, {wc: 15, dw: 1.75}, // Close to calculated input {wc: 20, dw: 1.85}, // Peak (estimated max) {wc: 25, dw: 1.80}, // Wet side {wc: 30, dw: 1.70} ]; // Find the estimated max dry unit weight from hypothetical curve if possible, otherwise use calculated var peakDw = estimatedMaxDryUnitWeight; var peakWc = currentWaterContent; // Default to current WC if peak not found // Try to find a point near the current water content in the hypothetical curve var closestPoint = hypotheticalCurvePoints.reduce((prev, curr) => (Math.abs(curr.wc – currentWaterContent) p.wc.toFixed(0) + '%'); var dataDryUnitWeight = hypotheticalCurvePoints.map(p => p.dw); // Add the single calculated point labels.push(currentWaterContent.toFixed(0) + '%'); dataDryUnitWeight.push(currentDryUnitWeight); // Sort points by water content for a smooth curve, keeping the single point separate if needed var allPoints = hypotheticalCurvePoints.map(p => ({ wc: p.wc, dw: p.dw })); allPoints.push({ wc: currentWaterContent, dw: currentDryUnitWeight }); allPoints.sort((a, b) => a.wc – b.wc); var sortedLabels = allPoints.map(p => p.wc.toFixed(0) + '%'); var sortedData = allPoints.map(p => p.dw); // Add a marker for the estimated peak var peakLabel = peakWc.toFixed(0) + '%'; if (!sortedLabels.includes(peakLabel)) { sortedLabels.push(peakLabel); sortedData.push(peakDw); sortedLabels.sort((a, b) => parseFloat(a.replace('%',")) – parseFloat(b.replace('%',"))); sortedData.sort((a, b) => parseFloat(a.replace('%',")) – parseFloat(b.replace('%',"))); } else { // Update existing peak label if it exists var peakIndex = sortedLabels.indexOf(peakLabel); if (peakIndex > -1) sortedData[peakIndex] = peakDw; } // Find max value for y-axis scaling var maxY = Math.max(…sortedData, peakDw) * 1.1; if (maxY { // Plot the single calculated point if (sortedLabels[i] === currentWaterContent.toFixed(0) + '%') { return currentDryUnitWeight; } return null; }), borderColor: 'rgb(40, 167, 69)', backgroundColor: 'rgba(40, 167, 69, 0.5)', tension: 0, fill: false, pointRadius: 6, pointBackgroundColor: 'rgb(40, 167, 69)', borderDash: [5, 5] // Dashed line for the single point }, { label: 'Estimated Peak (γd_max)', data: Array(sortedLabels.length).fill(null).map((_, i) => { // Plot the estimated peak if (sortedLabels[i] === peakLabel) { return peakDw; } return null; }), borderColor: 'rgb(255, 193, 7)', // Yellow for peak backgroundColor: 'rgba(255, 193, 7, 0.5)', tension: 0, fill: false, pointRadius: 6, pointBackgroundColor: 'rgb(255, 193, 7)', borderDash: [2, 2] // Dotted line for the peak }] }, options: { responsive: true, maintainAspectRatio: false, scales: { x: { title: { display: true, text: 'Water Content (%)' }, min: 0, max: 35 // Adjust max x-axis if needed }, y: { title: { display: true, text: 'Dry Unit Weight (g/cm³)' }, min: 0, max: maxY } }, plugins: { legend: { position: 'top', }, title: { display: true, text: 'Soil Compaction Curve (Illustrative)' } } } }); // Update legend var legendHtml = 'Chart Key:
    '; legendHtml += '
  • Compaction Curve (Illustrative)
  • '; legendHtml += '
  • Calculated Point (γd at input WC)
  • '; legendHtml += '
  • Estimated Peak (γd_max)
  • '; legendHtml += '
'; document.getElementById('chartLegend').innerHTML = legendHtml; } // Initial calculation on load if values are present document.addEventListener('DOMContentLoaded', function() { // Check if inputs have default values and trigger calculation var sampleWeightInput = document.getElementById('sampleWeight'); var moldVolumeInput = document.getElementById('moldVolume'); var waterContentInput = document.getElementById('waterContent'); var specificGravityInput = document.getElementById('specificGravity'); if (sampleWeightInput.value && moldVolumeInput.value && waterContentInput.value && specificGravityInput.value) { calculateMaxDryUnitWeight(); } });

Leave a Comment