Calculating Saturated Unit Weight with Dry Density

Saturated Unit Weight Calculator | Dry Density Calculation body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; background-color: #f8f9fa; color: #333; margin: 0; padding: 20px; } .container { max-width: 960px; margin: 20px auto; background-color: #ffffff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 74, 153, 0.1); display: flex; flex-direction: column; } header { text-align: center; padding-bottom: 20px; border-bottom: 1px solid #e0e0e0; margin-bottom: 20px; } h1 { color: #004a99; margin-bottom: 10px; } .calculator-section { margin-bottom: 30px; padding: 20px; border: 1px solid #e0e0e0; border-radius: 6px; } .calculator-section h2 { color: #004a99; margin-top: 0; text-align: center; margin-bottom: 20px; } .input-group { margin-bottom: 18px; text-align: left; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: #004a99; } .input-group input[type="number"], .input-group select { width: calc(100% – 20px); padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; box-sizing: border-box; } .input-group input[type="number"]:focus, .input-group select:focus { border-color: #004a99; outline: none; box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85rem; color: #666; margin-top: 5px; } .error-message { color: #dc3545; font-size: 0.85rem; margin-top: 5px; display: none; } .button-group { display: flex; justify-content: space-between; margin-top: 20px; flex-wrap: wrap; gap: 10px; } .button-group button { padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1rem; font-weight: bold; transition: background-color 0.3s ease; } .btn-primary { background-color: #004a99; color: white; } .btn-primary:hover { background-color: #003b7a; } .btn-secondary { background-color: #6c757d; color: white; } .btn-secondary:hover { background-color: #5a6268; } .btn-copy { background-color: #28a745; color: white; } .btn-copy:hover { background-color: #218838; } #results { margin-top: 30px; padding: 20px; border: 1px dashed #004a99; border-radius: 6px; background-color: #eef7ff; text-align: center; } #results h3 { color: #004a99; margin-top: 0; margin-bottom: 15px; } .result-item { margin-bottom: 10px; font-size: 1.1rem; } .result-label { font-weight: bold; color: #004a99; } .result-value { font-weight: bold; color: #333; font-size: 1.3rem; } #primary-result { font-size: 1.8rem; color: #004a99; background-color: #cce5ff; padding: 15px; border-radius: 5px; margin-bottom: 15px; font-weight: bolder; } #formula-explanation { font-size: 0.9rem; color: #555; margin-top: 15px; } table { width: 100%; border-collapse: collapse; margin-top: 20px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); } th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; } th { background-color: #004a99; color: white; font-weight: bold; } tr:nth-child(even) { background-color: #f2f2f2; } caption { caption-side: top; font-weight: bold; color: #004a99; font-size: 1.1rem; margin-bottom: 10px; text-align: left; } .chart-container { width: 100%; margin-top: 30px; padding: 20px; border: 1px solid #e0e0e0; border-radius: 6px; background-color: #fefefe; text-align: center; } canvas { max-width: 100%; height: auto; } .article-section { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; } .article-section h2, .article-section h3 { color: #004a99; margin-bottom: 15px; } .article-section p, .article-section ul, .article-section ol { margin-bottom: 15px; color: #444; } .article-section ul, .article-section ol { padding-left: 25px; } .article-section li { margin-bottom: 8px; } .faq-item { margin-bottom: 15px; padding: 10px; border-left: 3px solid #004a99; background-color: #f8f9fa; border-radius: 4px; } .faq-item strong { color: #004a99; } .internal-links { margin-top: 20px; padding: 15px; background-color: #eef7ff; border-radius: 5px; border: 1px solid #b3d7ff; } .internal-links h3 { color: #004a99; margin-top: 0; } .internal-links ul { list-style: none; padding: 0; margin: 0; } .internal-links li { margin-bottom: 8px; } .internal-links a { color: #004a99; text-decoration: none; font-weight: bold; } .internal-links a:hover { text-decoration: underline; } .internal-links span { font-size: 0.9rem; color: #555; display: block; margin-top: 3px; }

Saturated Unit Weight Calculator

Calculate the saturated unit weight of soil using its dry density and water content.

Saturated Unit Weight Calculation

Enter the dry density of the soil.
Enter the gravimetric water content (e.g., 25 for 25%).
Enter the specific gravity (Gs) of soil solids.

Calculation Results

Saturated Unit Weight: –
Void Ratio (e):
Saturated Unit Weight (γ_sat): g/cm³
Unit Weight of Water (γ_w): g/cm³
The saturated unit weight (γ_sat) is calculated using the formula: γ_sat = (Gs + e) / (1 + e) * γ_w where Gs is the specific gravity of solids, e is the void ratio, and γ_w is the unit weight of water. The void ratio (e) is derived from dry density (ρ_d), specific gravity (Gs), and water unit weight (γ_w): e = (Gs * γ_w / ρ_d) – 1

Saturated Unit Weight vs. Dry Density

A visual representation of how saturated unit weight changes with dry density, keeping other factors constant.

Saturated Unit Weight Calculation Variables
Variable Meaning Unit Typical Range
ρ_d (Dry Density) Mass of dry soil solids per unit volume of total soil g/cm³ 1.3 – 1.9
w (Water Content) Gravimetric water content % 10% – 60% (or higher for loose soils)
Gs (Specific Gravity) Ratio of the density of soil solids to the density of water N/A 2.65 – 2.85 (typical for most mineral soils)
e (Void Ratio) Ratio of the volume of voids to the volume of solids N/A 0.1 – 2.0 (highly variable)
γ_w (Unit Weight of Water) Density of water under standard conditions g/cm³ ~1.0
γ_sat (Saturated Unit Weight) Total unit weight of soil when all voids are filled with water g/cm³ 1.7 – 2.2

What is Saturated Unit Weight?

Saturated unit weight refers to the total weight of a soil mass divided by its total volume when all the void spaces within the soil are completely filled with water. This is a critical parameter in geotechnical engineering, particularly when assessing the stability of slopes, foundations, and retaining structures. Understanding saturated unit weight is fundamental for anyone involved in soil mechanics and civil engineering projects. It represents a 'worst-case scenario' for soil density under saturated conditions, which often occurs below the water table or in areas experiencing heavy rainfall.

Who should use it: Geotechnical engineers, civil engineers, construction managers, soil scientists, and environmental engineers use saturated unit weight extensively in their calculations and designs. It is essential for determining soil bearing capacity, settlement, and the effectiveness of drainage systems.

Common misconceptions: One common misconception is that saturated unit weight is the same as the moist unit weight. While related, saturated unit weight specifically assumes the soil is 100% saturated. Another misconception is that it's the maximum possible unit weight; that would be the dry unit weight at optimum moisture content during compaction, which is typically higher than the saturated unit weight for the same soil. The saturated unit weight is about the weight when fully submerged.

Saturated Unit Weight Formula and Mathematical Explanation

The calculation of saturated unit weight is derived from the fundamental relationships between volume, weight, and the constituents of soil (solids and voids). Here's a breakdown of the formula and its components. The primary formula used is:

γ_sat = (Gs + e) / (1 + e) * γ_w

This formula directly relates saturated unit weight (γ_sat) to the specific gravity of solids (Gs), the void ratio (e), and the unit weight of water (γ_w).

However, often the void ratio (e) is not directly measured but must be calculated from more commonly available properties like dry density (ρ_d), specific gravity (Gs), and the unit weight of water (γ_w). The relationship is:

ρ_d = Gs * γ_w / (1 + e)

Rearranging this to solve for the void ratio (e):

e = (Gs * γ_w / ρ_d) – 1

Once the void ratio (e) is determined, it can be substituted back into the primary formula for γ_sat. For most geotechnical calculations involving water, the unit weight of water (γ_w) is taken as approximately 1 g/cm³ or 9.81 kN/m³.

Variable Explanations

To understand the calculation, it's crucial to define each variable:

  • γ_sat (Saturated Unit Weight): This is the value we aim to calculate. It represents the total weight of the soil mass per unit volume when it is fully saturated with water. Higher saturated unit weights generally indicate denser, more stable soil under saturated conditions, assuming other factors remain constant.
  • Gs (Specific Gravity of Solids): The ratio of the density of the soil solids to the density of water. It's a measure of how heavy the soil particles themselves are. Typical mineral soils have Gs values around 2.65 to 2.85.
  • e (Void Ratio): The ratio of the volume of void space (air and water) to the volume of solid particles in the soil. A higher void ratio means more pore space, which can hold more water, impacting its saturated weight.
  • γ_w (Unit Weight of Water): The weight of water per unit volume. This is a fundamental constant, typically taken as 1 g/cm³ or 62.4 lb/ft³ at standard temperature and pressure.
  • ρ_d (Dry Density): The mass of dry soil solids per unit volume of the total soil mass (solids + voids). This is often a primary measurement taken in the field or lab.
  • w (Water Content): The gravimetric ratio of the mass of water to the mass of dry solids in the soil, usually expressed as a percentage. While not directly in the main formula for γ_sat when using e, it's related to e and Gs through the degree of saturation. When the soil is saturated (S=100%), w = e/Gs.

Variables Table

Variable Meaning Unit Typical Range
ρ_d (Dry Density) Mass of dry soil solids per unit volume of total soil g/cm³ 1.3 – 1.9
w (Water Content) Gravimetric water content % 10% – 60% (or higher for loose soils)
Gs (Specific Gravity) Ratio of the density of soil solids to the density of water N/A 2.65 – 2.85 (typical for most mineral soils)
e (Void Ratio) Ratio of the volume of voids to the volume of solids N/A 0.1 – 2.0 (highly variable)
γ_w (Unit Weight of Water) Density of water under standard conditions g/cm³ ~1.0
γ_sat (Saturated Unit Weight) Total unit weight of soil when all voids are filled with water g/cm³ 1.7 – 2.2

Practical Examples (Real-World Use Cases)

The saturated unit weight is a crucial metric in various real-world scenarios for geotechnical analysis.

Example 1: Foundation Design for a Building

A civil engineer is designing the foundation for a new building. The soil investigation reveals a sandy soil with a dry density (ρ_d) of 1.75 g/cm³ and a specific gravity of solids (Gs) of 2.68. The water table is located at a depth where the soil will be saturated.

Inputs:

  • Dry Density (ρ_d): 1.75 g/cm³
  • Specific Gravity (Gs): 2.68
  • Unit Weight of Water (γ_w): 1.0 g/cm³

Calculation Steps:

  1. Calculate Void Ratio (e): e = (Gs * γ_w / ρ_d) – 1 e = (2.68 * 1.0 / 1.75) – 1 e = 1.531 – 1 = 0.531
  2. Calculate Saturated Unit Weight (γ_sat): γ_sat = (Gs + e) / (1 + e) * γ_w γ_sat = (2.68 + 0.531) / (1 + 0.531) * 1.0 γ_sat = (3.211) / (1.531) * 1.0 γ_sat ≈ 2.097 g/cm³

Interpretation: The saturated unit weight of this sandy soil is approximately 2.097 g/cm³. This value is essential for calculating the effective stress on the foundation soil and determining the soil's bearing capacity, ensuring the foundation is stable under saturated conditions.

Example 2: Slope Stability Analysis

A geotechnical engineer is assessing the stability of a natural slope composed of clayey soil. Field tests indicate a dry density (ρ_d) of 1.50 g/cm³ and a specific gravity (Gs) of 2.70. The slope is often saturated due to groundwater seepage.

Inputs:

  • Dry Density (ρ_d): 1.50 g/cm³
  • Specific Gravity (Gs): 2.70
  • Unit Weight of Water (γ_w): 1.0 g/cm³

Calculation Steps:

  1. Calculate Void Ratio (e): e = (Gs * γ_w / ρ_d) – 1 e = (2.70 * 1.0 / 1.50) – 1 e = 1.80 – 1 = 0.80
  2. Calculate Saturated Unit Weight (γ_sat): γ_sat = (Gs + e) / (1 + e) * γ_w γ_sat = (2.70 + 0.80) / (1 + 0.80) * 1.0 γ_sat = (3.50) / (1.80) * 1.0 γ_sat ≈ 1.944 g/cm³

Interpretation: The saturated unit weight of the clayey soil is approximately 1.944 g/cm³. This higher saturated unit weight, compared to its dry counterpart, increases the driving forces (gravity acting on the soil mass) in slope stability calculations, potentially reducing the factor of safety. This highlights the importance of considering saturation in slope stability analysis.

How to Use This Saturated Unit Weight Calculator

Our Saturated Unit Weight Calculator is designed for ease of use, providing accurate results quickly. Follow these simple steps:

  1. Input Dry Density: Enter the measured dry density of the soil in grams per cubic centimeter (g/cm³). This is often obtained from laboratory testing (e.g., compaction tests) or field density tests.
  2. Input Water Content: Provide the gravimetric water content of the soil, expressed as a percentage (e.g., enter 25 for 25%). Ensure this is the water content at which you are evaluating saturation, or if calculating from dry density, assume full saturation (w = e/Gs).
  3. Input Specific Gravity: Enter the specific gravity of the soil solids (Gs). This value is typically around 2.65 for quartz-based soils but can vary for other minerals.
  4. Click Calculate: Once all values are entered, click the "Calculate" button.

How to read results:

  • Primary Result (Saturated Unit Weight): The most prominent value displayed is the calculated saturated unit weight (γ_sat) in g/cm³. This represents the soil's total weight per unit volume when fully saturated.
  • Intermediate Values: You will also see the calculated Void Ratio (e) and the Unit Weight of Water (γ_w), which are key components of the calculation.
  • Formula Explanation: A brief explanation of the formulas used is provided for clarity.

Decision-making guidance: The calculated saturated unit weight is crucial for comparing different soil types, assessing potential loads on structures, and performing stability analyses. For instance, a higher saturated unit weight suggests a heavier soil mass when saturated, which increases the load on underlying strata and potentially impacts bearing capacity. Conversely, a lower saturated unit weight might indicate a soil that is less dense and potentially less stable under saturated conditions. This tool helps engineers make informed decisions based on accurate soil property calculations.

Key Factors That Affect Saturated Unit Weight Results

While the calculation itself is straightforward, several underlying factors significantly influence the soil properties that feed into the saturated unit weight calculation, and thus the final result. Understanding these is vital for accurate soil property assessment.

  • Soil Particle Specific Gravity (Gs): Soils composed of heavier minerals (like those with high iron content) will naturally have a higher Gs. This directly increases the calculated void ratio and, consequently, the saturated unit weight. For typical quartz-based soils, Gs is relatively constant, but variations occur.
  • Void Ratio (e): This is perhaps the most influential factor. A higher void ratio, resulting from looser packing of soil particles (common in sands and gravels, or poorly compacted clays), means more space to be filled with water. This significantly increases the saturated unit weight. Conversely, well-graded and highly compacted soils have lower void ratios and thus lower saturated unit weights.
  • Compaction Effort: The degree to which a soil is compacted in construction projects directly impacts its dry density and void ratio. Higher compaction effort leads to a lower void ratio and a higher dry density, which in turn affects the saturated unit weight calculation. Poorly compacted soils will have higher void ratios.
  • Soil Type and Gradation: Different soil types (clays, silts, sands, gravels) have inherently different particle characteristics and packing arrangements, leading to varying void ratios and specific gravities. Well-graded soils (containing a wide range of particle sizes) tend to pack more densely, resulting in lower void ratios than poorly graded soils.
  • Presence of Organic Matter: Organic soils generally have lower specific gravities (Gs) and higher void ratios due to their porous structure. This can lead to significantly lower saturated unit weights compared to inorganic soils with similar particle sizes. This is important for organic soil characterization.
  • Degree of Saturation: While this calculator assumes full saturation (100%), real-world conditions can vary. Partially saturated soils will have a moist unit weight that is less than the saturated unit weight because the pore spaces contain both air and water. The calculation of moist unit weight requires knowledge of the degree of saturation.
  • Water Unit Weight (γ_w): Although usually taken as a constant (1.0 g/cm³), variations in water temperature and salinity can slightly alter its density. However, for most practical engineering purposes, this effect is negligible compared to variations in soil properties.

Frequently Asked Questions (FAQ)

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

Dry unit weight is the weight of soil solids per unit total volume, excluding any water. Saturated unit weight is the total weight (solids + water) per unit total volume when all voids are filled with water. Saturated unit weight is always greater than dry unit weight for the same soil.

Q2: Can saturated unit weight be less than 1.0 g/cm³?

No, it is practically impossible for the saturated unit weight of a soil to be less than 1.0 g/cm³. Since water itself has a unit weight of 1.0 g/cm³ (or more if it's denser), and soil solids are denser than water (Gs > 1), the combined weight of solids and saturated voids will always result in a saturated unit weight greater than 1.0 g/cm³.

Q3: How is water content related to saturated unit weight?

Water content (w) is directly related to the void ratio (e) and specific gravity (Gs) at saturation. Specifically, for a fully saturated soil, w = e/Gs. While the calculator uses dry density and Gs to find 'e' first, this relationship confirms that higher water content (for a given Gs and density) implies a higher degree of saturation and thus contributes to the saturated unit weight.

Q4: What if the soil is only partially saturated?

If the soil is only partially saturated, you would calculate the moist unit weight instead of the saturated unit weight. This requires knowing the degree of saturation (S) and using a different formula: γ_m = (Gs + S*e) / (1 + e) * γ_w. Our calculator specifically focuses on the 100% saturated condition.

Q5: Is the specific gravity (Gs) the same for all soils?

No, Gs varies depending on the mineral composition of the soil particles. For common soils derived from quartz and feldspar, Gs is typically around 2.65. However, soils with significant amounts of mica, iron oxides, or other heavy minerals can have higher Gs values, while organic soils have significantly lower Gs values.

Q6: How important is the unit weight of water (γ_w)?

The unit weight of water is a fundamental constant (approximately 1 g/cm³ at standard conditions). While temperature and salinity can cause minor variations, for most geotechnical calculations, using a standard value is sufficient and has a minimal impact compared to variations in soil properties like void ratio or specific gravity.

Q7: Can I use this calculator for different units (e.g., lb/ft³)?

This calculator is designed for metric units (g/cm³). To use imperial units (lb/ft³), you would need to convert your input values. For example, 1 g/cm³ is approximately 62.4 lb/ft³. You would also need to ensure the unit weight of water is consistently used in lb/ft³ (typically 62.4 lb/ft³).

Q8: What is the typical range for saturated unit weight?

For most common mineral soils, the saturated unit weight typically falls within the range of 1.7 to 2.2 g/cm³. Denser soils with low void ratios and higher Gs will be at the higher end, while lighter, more porous soils will be at the lower end. Organic soils can sometimes be even lower.

Related Tools and Internal Resources

© 2023 Your Company Name. All rights reserved.

var unitWeightWater = 1.0; // Standard unit weight of water in g/cm³ function validateInput(id, min, max, errorId, unit) { var input = document.getElementById(id); var errorElement = document.getElementById(errorId); var value = parseFloat(input.value); var isValid = true; errorElement.style.display = 'none'; input.style.borderColor = '#ccc'; if (isNaN(value)) { errorElement.textContent = 'Please enter a valid number.'; errorElement.style.display = 'block'; input.style.borderColor = '#dc3545'; isValid = false; } else if (value max) { errorElement.textContent = 'Value out of typical range (' + min + ' – ' + max + ' ' + unit + ').'; errorElement.style.display = 'block'; input.style.borderColor = '#dc3545'; isValid = false; } return isValid; } function calculateSaturatedUnitWeight() { var dryDensityInput = document.getElementById('dryDensity'); var waterContentInput = document.getElementById('waterContent'); var specificGravityInput = document.getElementById('specificGravity'); var dryDensityError = document.getElementById('dryDensityError'); var waterContentError = document.getElementById('waterContentError'); var specificGravityError = document.getElementById('specificGravityError'); var dryDensity = parseFloat(dryDensityInput.value); var waterContentPercent = parseFloat(waterContentInput.value); var specificGravity = parseFloat(specificGravityInput.value); // Input validation for typical ranges var isDryDensityValid = validateInput('dryDensity', 1.0, 2.2, 'dryDensityError', 'g/cm³'); var isWaterContentValid = validateInput('waterContent', 0, 100, 'waterContentError', '%'); // Allowing up to 100% for flexibility var isSpecificGravityValid = validateInput('specificGravity', 1.5, 3.5, 'specificGravityError', 'N/A'); if (!isDryDensityValid || !isWaterContentValid || !isSpecificGravityValid) { document.getElementById('primary-result').textContent = 'Saturated Unit Weight: Please check inputs'; document.getElementById('voidRatio').textContent = '-'; document.getElementById('saturatedUnitWeight').textContent = '-'; document.getElementById('unitWeightWater').textContent = '-'; updateChart(0, 0); // Clear chart return; } var waterContentDecimal = waterContentPercent / 100.0; // Calculate Void Ratio (e) // e = (Gs * γ_w / ρ_d) – 1 var voidRatio = (specificGravity * unitWeightWater / dryDensity) – 1; // Calculate Saturated Unit Weight (γ_sat) // γ_sat = (Gs + e) / (1 + e) * γ_w var saturatedUnitWeight = (specificGravity + voidRatio) / (1 + voidRatio) * unitWeightWater; // Display Results document.getElementById('voidRatio').textContent = voidRatio.toFixed(3); document.getElementById('saturatedUnitWeight').textContent = saturatedUnitWeight.toFixed(3); document.getElementById('unitWeightWater').textContent = unitWeightWater.toFixed(1); var primaryResultText = 'Saturated Unit Weight: ' + saturatedUnitWeight.toFixed(3) + ' g/cm³'; document.getElementById('primary-result').textContent = primaryResultText; // Update Chart updateChart(dryDensity, saturatedUnitWeight); } function resetCalculator() { document.getElementById('dryDensity').value = '1.6'; document.getElementById('waterContent').value = '25'; document.getElementById('specificGravity').value = '2.65'; document.getElementById('dryDensityError').style.display = 'none'; document.getElementById('waterContentError').style.display = 'none'; document.getElementById('specificGravityError').style.display = 'none'; document.getElementById('dryDensity').style.borderColor = '#ccc'; document.getElementById('waterContent').style.borderColor = '#ccc'; document.getElementById('specificGravity').style.borderColor = '#ccc'; document.getElementById('primary-result').textContent = 'Saturated Unit Weight: -'; document.getElementById('voidRatio').textContent = '-'; document.getElementById('saturatedUnitWeight').textContent = '-'; document.getElementById('unitWeightWater').textContent = '-'; updateChart(0, 0); // Clear chart or reset to defaults } function copyResults() { var primaryResult = document.getElementById('primary-result').textContent; var voidRatio = document.getElementById('voidRatio').textContent; var saturatedUnitWeight = document.getElementById('saturatedUnitWeight').textContent; var unitWeightWater = document.getElementById('unitWeightWater').textContent; var results = primaryResult + "\n"; results += "Void Ratio (e): " + voidRatio + "\n"; results += "Saturated Unit Weight (γ_sat): " + saturatedUnitWeight + " g/cm³\n"; results += "Unit Weight of Water (γ_w): " + unitWeightWater + " g/cm³\n"; results += "\nKey Assumptions:\n"; results += "Unit Weight of Water (γ_w) = " + unitWeightWater + " g/cm³\n"; results += "Input values: Dry Density, Water Content, Specific Gravity"; var textarea = document.createElement('textarea'); textarea.value = results; document.body.appendChild(textarea); textarea.select(); document.execCommand('copy'); textarea.remove(); var originalButtonText = document.querySelector('.btn-copy').textContent; document.querySelector('.btn-copy').textContent = 'Copied!'; setTimeout(function() { document.querySelector('.btn-copy').textContent = originalButtonText; }, 2000); } // Charting Logic var myChart; var chartData = { labels: [], datasets: [{ label: 'Saturated Unit Weight (g/cm³)', data: [], borderColor: '#004a99', backgroundColor: 'rgba(0, 74, 153, 0.2)', fill: false, tension: 0.1 }, { label: 'Dry Density (g/cm³)', data: [], borderColor: '#6c757d', backgroundColor: 'rgba(108, 117, 125, 0.2)', fill: false, tension: 0.1 }] }; function updateChart(currentDryDensity, currentSaturatedUnitWeight) { var currentMaxX = 2.2; // Max value for X-axis (Dry Density) var currentMaxY = 2.5; // Max value for Y-axis (Saturated Unit Weight) var numPoints = 20; // Number of data points for the curve // Ensure Gs and Unit Weight of Water are current values var currentGs = parseFloat(document.getElementById('specificGravity').value) || 2.65; var currentUnitWeightWater = parseFloat(document.getElementById('unitWeightWater').textContent) || 1.0; var labels = []; var saturatedUnitWeights = []; var dryDensitiesForChart = []; // Generate data points for the curve for (var i = 0; i < numPoints; i++) { var rho_d = (currentGs * currentUnitWeightWater) / (1 + (i / (numPoints – 1)) * 1.5); // Assuming void ratio ranges up to ~1.5 for demonstration if (rho_d currentMaxX) currentMaxX = rho_d * 1.1; if (gamma_sat > currentMaxY) currentMaxY = gamma_sat * 1.1; } // Add the current input point to the data if it's valid if (currentDryDensity && currentSaturatedUnitWeight && !isNaN(currentDryDensity) && !isNaN(currentSaturatedUnitWeight)) { labels.push(currentDryDensity.toFixed(2)); dryDensitiesForChart.push(currentDryDensity.toFixed(2)); saturatedUnitWeights.push(currentSaturatedUnitWeight.toFixed(2)); } chartData.labels = labels; chartData.datasets[0].data = saturatedUnitWeights; // Saturated Unit Weight curve chartData.datasets[1].data = dryDensitiesForChart; // Dry Density series (often plotted against something else, but here showing relation) var ctx = document.getElementById('unitWeightChart').getContext('2d'); if (myChart) { myChart.destroy(); } myChart = new Chart(ctx, { type: 'line', data: chartData, options: { responsive: true, maintainAspectRatio: true, scales: { x: { title: { display: true, text: 'Dry Density (g/cm³)' }, min: 0.5, max: currentMaxX < 2.2 ? 2.2 : currentMaxX }, y: { title: { display: true, text: 'Unit Weight (g/cm³)' }, min: 1.0, max: currentMaxY < 2.5 ? 2.5 : currentMaxY } }, plugins: { legend: { position: 'top', }, title: { display: true, text: 'Saturated Unit Weight vs. Dry Density Relationship' } } } }); } // Initial calculation and chart update on page load window.onload = function() { calculateSaturatedUnitWeight(); };

Leave a Comment