Calculating Soil Saturated Weight

Soil Saturated Weight Calculator & Guide :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –white: #fff; –border-color: #ddd; –shadow-color: rgba(0, 0, 0, 0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; display: flex; justify-content: center; padding: 20px 0; } .container { width: 100%; max-width: 960px; margin: 0 auto; background-color: var(–white); padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px var(–shadow-color); display: flex; flex-direction: column; align-items: center; } h1, h2, h3 { color: var(–primary-color); text-align: center; margin-bottom: 20px; } h1 { font-size: 2.5em; } h2 { font-size: 1.8em; border-bottom: 2px solid var(–primary-color); padding-bottom: 10px; } h3 { font-size: 1.4em; margin-top: 25px; } .calculator-wrapper { width: 100%; max-width: 600px; margin-bottom: 40px; border: 1px solid var(–border-color); border-radius: 8px; padding: 25px; background-color: var(–white); } .input-group { margin-bottom: 20px; width: 100%; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group input[type="text"], .input-group select { width: calc(100% – 22px); /* Adjust for padding and border */ padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; box-sizing: border-box; } .input-group select { cursor: pointer; } .input-group small { display: block; margin-top: 5px; font-size: 0.85em; color: #666; } .error-message { color: red; font-size: 0.85em; margin-top: 5px; display: none; /* Hidden by default */ height: 1.2em; } .button-group { display: flex; justify-content: space-between; gap: 10px; margin-top: 25px; } .btn { padding: 12px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease; flex-grow: 1; text-align: center; white-space: nowrap; } .btn-primary { background-color: var(–primary-color); color: var(–white); } .btn-primary:hover { background-color: #003366; } .btn-secondary { background-color: #6c757d; color: var(–white); } .btn-secondary:hover { background-color: #5a6268; } .btn-success { background-color: var(–success-color); color: var(–white); } .btn-success:hover { background-color: #218838; } #result { margin-top: 30px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–primary-color); color: var(–white); text-align: center; box-shadow: 0 2px 10px rgba(0, 74, 153, 0.3); min-height: 120px; display: flex; flex-direction: column; justify-content: center; align-items: center; } #result h3 { color: var(–white); margin-bottom: 10px; font-size: 1.6em; } #result .value { font-size: 2.5em; font-weight: bold; margin-bottom: 5px; } #result .unit { font-size: 1.2em; opacity: 0.9; } #result .formula-explanation { font-size: 0.9em; margin-top: 15px; opacity: 0.8; border-top: 1px solid rgba(255, 255, 255, 0.3); padding-top: 10px; } .intermediate-results, .key-assumptions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; width: 100%; } .intermediate-results > div, .key-assumptions > div { background-color: var(–white); border: 1px solid var(–border-color); border-radius: 6px; padding: 15px; text-align: center; box-shadow: 0 2px 8px var(–shadow-color); flex: 1 1 200px; /* Grow, shrink, basis */ min-width: 180px; } .intermediate-results h4, .key-assumptions h4 { color: var(–primary-color); margin-top: 0; margin-bottom: 10px; font-size: 1.1em; } .intermediate-results .value, .key-assumptions .value { font-size: 1.8em; font-weight: bold; color: var(–primary-color); } .intermediate-results .unit, .key-assumptions .unit { font-size: 0.9em; color: #555; } table { width: 100%; border-collapse: collapse; margin-top: 30px; margin-bottom: 30px; box-shadow: 0 2px 8px var(–shadow-color); } th, td { border: 1px solid var(–border-color); padding: 12px; text-align: left; } th { background-color: var(–primary-color); color: var(–white); font-weight: bold; } td { background-color: var(–white); } thead th { background-color: var(–primary-color); } caption { font-size: 1.1em; margin-bottom: 10px; color: var(–text-color); font-weight: bold; text-align: left; } canvas { display: block; margin: 20px auto; max-width: 100%; border: 1px solid var(–border-color); border-radius: 4px; background-color: var(–white); } .chart-container { width: 100%; margin-top: 30px; padding: 20px; background-color: var(–white); border: 1px solid var(–border-color); border-radius: 8px; box-shadow: 0 2px 8px var(–shadow-color); } .chart-container h3 { text-align: center; margin-top: 0; margin-bottom: 20px; } #chart { display: block; width: 100%; max-width: 700px; /* Control chart width */ margin: 0 auto; } .article-content { width: 100%; margin-top: 40px; text-align: left; } .article-content p { margin-bottom: 15px; } .article-content a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .article-content a:hover { text-decoration: underline; } .article-content ul, .article-content ol { margin-left: 20px; margin-bottom: 15px; } .article-content li { margin-bottom: 8px; } .article-content h2, .article-content h3 { text-align: left; } .article-content .faq-question { font-weight: bold; color: var(–primary-color); margin-top: 20px; margin-bottom: 5px; display: block; } .article-content .faq-answer { margin-left: 15px; margin-bottom: 15px; display: block; } .related-links { margin-top: 30px; padding: 20px; background-color: var(–white); border: 1px solid var(–border-color); border-radius: 8px; box-shadow: 0 2px 8px var(–shadow-color); } .related-links h3 { text-align: left; margin-top: 0; margin-bottom: 15px; } .related-links ul { list-style: none; padding: 0; margin: 0; } .related-links li { margin-bottom: 10px; } .related-links a { font-weight: normal; text-decoration: underline; } .related-links a:hover { font-weight: bold; } .related-links p { font-size: 0.9em; color: #555; margin-top: 5px; } @media (max-width: 768px) { h1 { font-size: 2em; } h2 { font-size: 1.5em; } #result .value { font-size: 2em; } .btn { padding: 10px 15px; font-size: 0.95em; } .intermediate-results > div, .key-assumptions > div { flex-basis: 150px; } } @media (max-width: 480px) { .container { padding: 20px 15px; } .button-group { flex-direction: column; } .btn { width: 100%; margin-bottom: 10px; } .btn:last-child { margin-bottom: 0; } .intermediate-results > div, .key-assumptions > div { flex-basis: 100%; } }

Soil Saturated Weight Calculator

Accurately determine the saturated weight of your soil samples for engineering and construction projects.

Soil Saturated Weight Calculator

The mass of dry soil per unit volume, typically measured before saturation.
The ratio of the volume of voids to the volume of solid particles in the soil.
The ratio of the density of soil solids to the density of water.
Standard density of water is 1.0 g/cm³ at 4°C.

Saturated Soil Weight (kN/m³)

Volume of Voids

Volume of Solids

Total Volume

Water Content (w)

%

Dry Unit Weight (kN/m³)

kN/m³

Saturated Unit Weight (kN/m³)

kN/m³

Impact of Void Ratio on Saturated Unit Weight

What is Soil Saturated Weight?

Soil saturated weight, more precisely referred to as saturated unit weight (soil saturated weight calculation is crucial in geotechnical engineering. It represents the weight of a soil sample when all its pore spaces are completely filled with water. This state is fundamental for understanding soil behavior under various loading conditions, especially in saturated environments like below the water table. Knowing the soil saturated weight helps engineers predict issues like slope stability, bearing capacity of foundations, and settlement. This soil saturated weight metric is vital for accurately assessing the soil's properties.

Who should use it? Geotechnical engineers, civil engineers, construction managers, geologists, and researchers involved in soil mechanics, foundation design, earthwork, and environmental engineering frequently utilize soil saturated weight calculations. It's also relevant for anyone involved in large-scale earthmoving or projects where soil is expected to become fully saturated.

Common misconceptions: A common misunderstanding is that saturated weight is simply the dry weight plus the weight of water filling the pores. While conceptually similar, the precise calculation involves densities and volume ratios. Another misconception is that saturated weight is constant for a given soil type; in reality, it depends on the soil's void ratio and the specific gravity of its solids. This soil saturated weight calculator aims to clarify these points.

Soil Saturated Weight Formula and Mathematical Explanation

The saturated unit weight (soil saturated weight of a soil is derived from its fundamental properties. We assume a representative unit volume of soil, typically 1 cubic meter (m³), to simplify calculations. The formula can be expressed in several ways, but one of the most direct involves the specific gravity of solids (Gs), the void ratio (e), the unit weight of water (\(\gamma_w\)), and often the dry unit weight (\(\gamma_d\)).

A common and useful formula for saturated unit weight (\(\gamma_{sat}\)) is:

\(\gamma_{sat} = \frac{(Gs + e) \gamma_w}{1 + e}\)

Alternatively, if the dry unit weight (\(\gamma_d\)) and void ratio (e) are known, the saturated unit weight can be calculated as:

\(\gamma_{sat} = \gamma_d \left( \frac{Gs + e}{1 + e} \right) \times \frac{1}{Gs}\) — This is incorrect, should be: \(\gamma_{sat} = \gamma_d + \frac{e \cdot \gamma_w}{1+e}\) (if using dry unit weight and void ratio) A more robust derivation from basic principles is often preferred.

Let's break down the derivation using a unit volume of soil (1 m³):

  1. We have a total volume (\(V_{total} = 1 \, m^3\)).
  2. This volume consists of solid particles (\(V_s\)) and voids (\(V_v\)). So, \(V_{total} = V_s + V_v\).
  3. The void ratio is defined as \(e = \frac{V_v}{V_s}\). From this, we can express \(V_v = e \cdot V_s\).
  4. Substituting into the total volume equation: \(V_{total} = V_s + e \cdot V_s = V_s (1 + e)\).
  5. Since \(V_{total} = 1 \, m^3\), we have \(1 = V_s (1 + e)\), which means \(V_s = \frac{1}{1 + e}\) m³ (for our unit volume).
  6. Then, the volume of voids is \(V_v = e \cdot V_s = \frac{e}{1 + e}\) m³ (for our unit volume).
  7. The specific gravity of solids is \(Gs = \frac{\rho_s}{\rho_w}\), where \(\rho_s\) is the density of soil solids and \(\rho_w\) is the density of water. Therefore, \(\rho_s = Gs \cdot \rho_w\).
  8. The mass of solids (\(M_s\)) in our unit volume is \(M_s = \rho_s \cdot V_s = (Gs \cdot \rho_w) \cdot \frac{1}{1 + e}\).
  9. When saturated, the voids are completely filled with water. The mass of water (\(M_w\)) in our unit volume is \(M_w = \rho_w \cdot V_v = \rho_w \cdot \frac{e}{1 + e}\).
  10. The total mass of the saturated soil (\(M_{sat}\)) is \(M_{sat} = M_s + M_w = \frac{Gs \cdot \rho_w}{1 + e} + \frac{\rho_w \cdot e}{1 + e} = \rho_w \frac{Gs + e}{1 + e}\).
  11. Unit weight is mass times gravitational acceleration (g). However, in many soil mechanics contexts, density (mass/volume) is used interchangeably with unit weight (weight/volume), especially when g is implicitly included or when units like kN/m³ are used where 'kilo' implies force. For clarity and consistency with common engineering practice (using g ≈ 9.81 m/s²), we often work with mass densities first. If we need weight, we multiply by g. The standard density of water (\(\rho_w\)) is approximately 1000 kg/m³, which corresponds to a unit weight (\(\gamma_w\)) of 9.81 kN/m³.
  12. To get the saturated unit weight (\(\gamma_{sat}\)), we use the derived mass relation and convert to weight per unit volume. If \(\rho_w\) is in g/cm³ (e.g., 1.0), then \(\gamma_w\) in kN/m³ is typically 9.81. The formula becomes: \(\gamma_{sat} (\text{in g/cm}^3) = \frac{(Gs + e)\rho_w}{1 + e}\) To convert to kN/m³: \(\gamma_{sat} (\text{in kN/m}^3) = \frac{(Gs + e)}{1 + e} \cdot \gamma_w (\text{in kN/m}^3)\) where \(\gamma_w\) is the unit weight of water (approx. 9.81 kN/m³).

Variable Explanations:

Variable Meaning Unit Typical Range
Soil Saturated Weight (\(\gamma_{sat}\)) The weight of a unit volume of soil when all pore spaces are filled with water. kN/m³ (or g/cm³) 15 – 22 kN/m³ (varies greatly)
Specific Gravity of Solids (\(G_s\)) Ratio of the density of soil solids to the density of water. Dimensionless 2.6 – 2.8 (common for many soils)
Void Ratio (e) Ratio of the volume of voids to the volume of solids. Dimensionless 0.1 – 2.0 (can be higher for organic soils)
Density of Water (\(\rho_w\)) Mass of water per unit volume. g/cm³ ~1.0
Unit Weight of Water (\(\gamma_w\)) Weight of water per unit volume. kN/m³ ~9.81 (at standard conditions)
Dry Soil Density (\(\rho_d\)) Mass of dry soil solids per unit volume of the soil sample. g/cm³ 1.3 – 1.9
Water Content (w) Ratio of the mass of water to the mass of solids, expressed as a percentage. % 5 – 50% (highly variable)

Practical Examples (Real-World Use Cases)

Example 1: Foundation Design for a Bridge Abutment

A geotechnical engineer is designing the foundation for a bridge abutment. The soil at the site is a dense sand with a measured void ratio (e) of 0.55. The specific gravity of the sand particles (\(G_s\)) is determined to be 2.65. The foundation will be below the water table, so the soil will be saturated. The engineer needs to calculate the saturated unit weight (soil saturated weight to assess bearing capacity.

Inputs:

  • Void Ratio (e) = 0.55
  • Specific Gravity of Solids (\(G_s\)) = 2.65
  • Density of Water (\(\rho_w\)) = 1.0 g/cm³ (standard)
  • Unit Weight of Water (\(\gamma_w\)) = 9.81 kN/m³

Calculation using the calculator:

  • First, the calculator calculates the dry unit weight if dry density was provided, or it uses the formula directly. Assuming dry density isn't directly input but derived or not needed for the main formula:
  • Saturated Soil Weight (Primary Result): Using \(\gamma_{sat} = \frac{(Gs + e) \gamma_w}{1 + e}\) \(\gamma_{sat} = \frac{(2.65 + 0.55) \times 9.81}{1 + 0.55} = \frac{3.20 \times 9.81}{1.55} \approx \frac{31.392}{1.55} \approx 20.25\) kN/m³
  • Intermediate/Derived values:
    • Dry Unit Weight (if calculated from Gs and e): \(\gamma_d = \frac{G_s \gamma_w}{1+e} = \frac{2.65 \times 9.81}{1.55} \approx 16.81\) kN/m³
    • Saturated Unit Weight (derived from dry): \(\gamma_{sat} = \gamma_d \frac{Gs + e}{Gs} \times \frac{Gs}{1+e} \times \frac{1+e}{1+e}\) – Let's use the more direct formula. A calculation might show:
    • Water Content (w): \(w = \frac{e}{G_s} = \frac{0.55}{2.65} \approx 0.2075\) or 20.75%

Interpretation: A saturated unit weight of 20.25 kN/m³ indicates the soil is relatively dense when saturated. This value will be used in bearing capacity equations to ensure the foundation can safely support the bridge loads without excessive settlement or shear failure.

Example 2: Embankment Construction near a Water Body

An engineer is planning an embankment for a road that will run adjacent to a river, where the soil will likely be saturated due to high groundwater levels. The soil is a clayey silt with a dry density (\(\rho_d\)) of 1.55 g/cm³ and a specific gravity (\(G_s\)) of 2.70. The calculated void ratio (e) for this soil is 1.10.

Inputs:

  • Dry Soil Density (\(\rho_d\)) = 1.55 g/cm³
  • Specific Gravity of Solids (\(G_s\)) = 2.70
  • Void Ratio (e) = 1.10
  • Density of Water (\(\rho_w\)) = 1.0 g/cm³
  • Unit Weight of Water (\(\gamma_w\)) = 9.81 kN/m³

Calculation using the calculator:

  • The calculator will first convert dry density to dry unit weight: \(\gamma_d = \rho_d \times g = 1.55 \, \text{g/cm}^3 \times 9.81 \, \text{kN/m}^3 / (1 \, \text{g/cm}^3) = 15.21\) kN/m³ (approx.)
  • Primary Result (Soil Saturated Weight): Using \(\gamma_{sat} = \frac{(Gs + e) \gamma_w}{1 + e}\) \(\gamma_{sat} = \frac{(2.70 + 1.10) \times 9.81}{1 + 1.10} = \frac{3.80 \times 9.81}{2.10} \approx \frac{37.278}{2.10} \approx 17.75\) kN/m³
  • Intermediate/Derived values:
    • Water Content (w): \(w = \frac{e}{G_s} = \frac{1.10}{2.70} \approx 0.4074\) or 40.74%
    • Saturated Unit Weight (derived): approx. 17.75 kN/m³

Interpretation: The saturated unit weight of 17.75 kN/m³ suggests this soil is significantly heavier when saturated compared to its dry state (which would be around 15.21 kN/m³). This increased weight impacts the stability calculations for the embankment, potentially requiring wider base slopes or soil reinforcement to prevent failure under saturated conditions. Understanding this soil saturated weight is key to a safe design.

How to Use This Soil Saturated Weight Calculator

  1. Identify Your Soil Properties: Gather the necessary data for your soil sample. You will typically need the void ratio (e), the specific gravity of soil solids (\(G_s\)), and the unit weight of water (\(\gamma_w\)). Sometimes, dry density (\(\rho_d\)) is provided instead of or in addition to void ratio.
  2. Input Values: Enter the known values into the corresponding fields: "Dry Soil Density," "Void Ratio," "Specific Gravity of Soil Solids," and "Density of Water." Ensure you use consistent units (g/cm³ for densities, dimensionless for ratios). The calculator defaults water density to 1.0 g/cm³ and unit weight of water to 9.81 kN/m³.
  3. Check for Errors: The calculator performs inline validation. If you enter non-numeric values, negative numbers, or values outside plausible ranges, an error message will appear below the input field. Correct these before proceeding.
  4. Calculate: Click the "Calculate" button.
  5. Read the Results: The primary result, "Saturated Soil Weight," will be displayed prominently. You will also see key intermediate values like the volume of voids, solids, total volume, water content, dry unit weight, and the derived saturated unit weight.
  6. Interpret the Results: Understand what the soil saturated weight value means in the context of your project. Higher values indicate denser, heavier saturated soil, which has implications for stability and settlement.
  7. Reset or Copy: Use the "Reset" button to clear the fields and start over with default values. Use the "Copy Results" button to copy all calculated values and key assumptions to your clipboard for documentation or further analysis.

Decision-Making Guidance: The calculated soil saturated weight is a critical input for various geotechnical analyses. For example, if the saturated unit weight is higher than anticipated, it might necessitate adjustments to foundation design, slope angles, or dewatering strategies. Always consult with a qualified geotechnical engineer for critical decisions based on these calculations.

Key Factors That Affect Soil Saturated Weight Results

  • Void Ratio (e): This is perhaps the most influential factor. A higher void ratio means more pore space, which will be filled with water when saturated, significantly increasing the total weight per unit volume. For example, a loose sand will have a higher void ratio than a dense sand, leading to a higher saturated unit weight for the same solids.
  • Specific Gravity of Soil Solids (\(G_s\)): Soils composed of minerals with higher specific gravity (e.g., dense, heavy minerals) will naturally have a higher saturated unit weight, assuming other factors like void ratio remain constant. Most common soil minerals fall within a narrow range, so this is often less variable than void ratio.
  • Unit Weight of Water (\(\gamma_w\)): While typically assumed constant at 9.81 kN/m³ (or 1.0 g/cm³), variations in water temperature and salinity can slightly alter its density. In most standard geotechnical applications, this is considered a fixed value.
  • Soil Type and Particle Characteristics: While \(G_s\) captures the mineral density, the particle shape and arrangement (influenced by the soil saturated weight calculation process) affect the achievable void ratio. Well-graded soils tend to have lower void ratios than poorly graded ones. Organic soils may have lower \(G_s\) and higher void ratios.
  • Degree of Saturation: This calculator specifically addresses *fully saturated* conditions. In partially saturated soils, the pore spaces contain both air and water, resulting in a lower saturated weight than the fully saturated state. The degree of saturation is critical for accurate analysis.
  • Compaction Effort: The effort put into compacting soil during construction directly impacts its dry density and, consequently, its void ratio. Higher compaction generally leads to lower void ratios and thus can reduce the saturated unit weight (or increase the dry unit weight significantly).
  • Presence of Fines (Silts and Clays): While clays have a lower \(G_s\) than sands, they can achieve very high water contents and potentially high saturated unit weights if their structure leads to high void ratios. However, their behavior also involves plasticity and cohesion, which are not directly captured by saturated unit weight alone.

Frequently Asked Questions (FAQ)

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

A1: Dry unit weight is the weight of soil per unit volume when the pore spaces contain only air (or are partially filled, but the water mass is not considered). Saturated unit weight is the weight of soil per unit volume when all pore spaces are completely filled with water. Saturated unit weight is always greater than dry unit weight for the same soil.

Q2: Does the calculator account for the weight of soil solids?

A2: Yes, the formula inherently accounts for the weight of soil solids through the specific gravity of solids (\(G_s\)) and the volume of solids derived from the void ratio.

Q3: Can I use this calculator if my soil is only partially saturated?

A3: No, this calculator is specifically designed for *fully saturated* conditions. For partially saturated soils, you would need to know the degree of saturation and use a different calculation that accounts for the air in the pores.

Q4: What are typical units for soil saturated weight?

A4: The most common units in geotechnical engineering are kilonewtons per cubic meter (kN/m³). Alternatively, grams per cubic centimeter (g/cm³) or pounds per cubic foot (pcf) might be used depending on the region and context.

Q5: How does soil type affect saturated weight?

A5: Soil type influences both the specific gravity of solids and the achievable void ratio. For example, gravels and dense sands tend to have lower void ratios and higher saturated weights than loose silts or organic clays, assuming similar solid densities.

Q6: Is there a direct relationship between dry density and saturated unit weight?

A6: Yes, they are related through the void ratio and specific gravity. If you know the dry density (\(\rho_d\)), you can calculate the void ratio (\(e = \frac{G_s \rho_w}{\rho_d} – 1\)) and then use that to find the saturated unit weight. Our calculator may derive one from the other if sufficient data is provided.

Q7: Why is saturated unit weight important for slope stability?

A7: Saturated soil is heavier and can exert greater forces. This increased weight adds to the driving forces acting on a potential slip surface, reducing the resisting forces (due to effective stress reduction). Higher saturated unit weight can therefore decrease slope stability.

Q8: What if the density of water is different from 1.0 g/cm³?

A8: The calculator allows you to input the density of water. While 1.0 g/cm³ is standard for freshwater at 4°C, brackish or saltwater, or soils at significantly different temperatures, might have slightly different water densities. Ensure your input reflects the conditions of your project.

© 2023 Your Company Name. All rights reserved.

var Gs = 2.65; // Specific Gravity of Soil Solids var e = 0.75; // Void Ratio var rho_w = 1.0; // Density of Water in g/cm³ var gamma_w = 9.81; // Unit Weight of Water in kN/m³ var rho_d = 1.60; // Dry Soil Density in g/cm³ (optional, can be derived) var defaultValues = { soilDensity: 1.60, voidRatio: 0.75, specificGravity: 2.65, waterDensity: 1.0 }; function validateInput(id, value, min, max) { var errorElement = document.getElementById(id + "Error"); var isValid = true; errorElement.style.display = 'block'; if (value === "") { errorElement.textContent = "This field is required."; isValid = false; } else if (isNaN(value)) { errorElement.textContent = "Please enter a valid number."; isValid = false; } else if (value max) { errorElement.textContent = "Value cannot be greater than " + max + "."; isValid = false; } else { errorElement.textContent = ""; errorElement.style.display = 'none'; isValid = true; } return isValid; } function calculateSoilSaturatedWeight() { var soilDensityInput = document.getElementById("soilDensity"); var voidRatioInput = document.getElementById("voidRatio"); var specificGravityInput = document.getElementById("specificGravity"); var waterDensityInput = document.getElementById("waterDensity"); var soilDensityVal = parseFloat(soilDensityInput.value); var voidRatioVal = parseFloat(voidRatioInput.value); var specificGravityVal = parseFloat(specificGravityInput.value); var waterDensityVal = parseFloat(waterDensityInput.value); var soilDensityError = document.getElementById("soilDensityError"); var voidRatioError = document.getElementById("voidRatioError"); var specificGravityError = document.getElementById("specificGravityError"); var waterDensityError = document.getElementById("waterDensityError"); var allValid = true; // Input validation allValid &= validateInput("soilDensity", soilDensityVal, 0.1, 2.5); // Typical range for dry density g/cm³ allValid &= validateInput("voidRatio", voidRatioVal, 0, 5); // Void ratio can be > 1 for loose soils allValid &= validateInput("specificGravity", specificGravityVal, 1.5, 4.0); // Typical range for Gs allValid &= validateInput("waterDensity", waterDensityVal, 0.9, 1.1); // Water density range if (!allValid) { resetResults(); return; } // Assign validated values to global vars for chart/calculations rho_d = soilDensityVal; // Use the input if provided and valid e = voidRatioVal; Gs = specificGravityVal; rho_w = waterDensityVal; gamma_w = rho_w * 9.81; // Recalculate gamma_w if rho_w changes // Calculations based on the formula: gamma_sat = (Gs + e) * gamma_w / (1 + e) // We'll use the inputed values directly. If dry density is provided, we can ensure consistency. var voidVolume = (e / (1 + e)).toFixed(4); // Assuming V_total = 1 m³ var solidVolume = (1 / (1 + e)).toFixed(4); // Assuming V_total = 1 m³ var totalVolume = (parseFloat(voidVolume) + parseFloat(solidVolume)).toFixed(4); // Should be ~1.0000 // Calculate Water Content (w) in percentage var waterContent = (e / Gs) * 100; if (isNaN(waterContent) || waterContent < 0) waterContent = 0; waterContent = waterContent.toFixed(2); // Calculate Dry Unit Weight (if dry density was entered and validated) // gamma_d = rho_d * g. If rho_d is in g/cm³, then gamma_d in kN/m³ is rho_d * 9.81 var dryUnitWeight = (rho_d * gamma_w).toFixed(2); // Using input dry density // Calculate Saturated Unit Weight (Primary Result) var saturatedUnitWeight = ((Gs + e) * gamma_w) / (1 + e); if (isNaN(saturatedUnitWeight) || saturatedUnitWeight < 0) saturatedUnitWeight = 0; saturatedUnitWeight = saturatedUnitWeight.toFixed(2); // Calculate Saturated Unit Weight also derived from Dry Unit Weight // gamma_sat = gamma_d + (e * gamma_w) / (1 + e) — This is not universally correct. // Let's stick to the main formula using Gs and e for the primary result. // We can add a derived saturated unit weight for comparison or validation if needed. // For now, we'll display the primary calculation and use derived values where relevant. var derivedSaturatedUnitWeight = saturatedUnitWeight; // For now, primary result is the derived one. // Update Intermediate Results document.querySelector("#voidVolume .value").textContent = voidVolume; document.querySelector("#solidVolume .value").textContent = solidVolume; document.querySelector("#totalVolume .value").textContent = totalVolume; // Update Key Assumptions / Derived Values document.querySelector("#waterContentCalc .value").textContent = waterContent; document.querySelector("#dryUnitWeight .value").textContent = dryUnitWeight; // Display calculated from input rho_d document.querySelector("#saturatedUnitWeightDerived .value").textContent = derivedSaturatedUnitWeight; // Primary result // Update Primary Result Display document.getElementById("result").querySelector(".value").textContent = saturatedUnitWeight; document.getElementById("result").querySelector(".unit").textContent = "kN/m³"; // Assuming gamma_w is in kN/m³ document.getElementById("resultLabel").innerHTML = "Saturated Soil Weight (kN/m³)"; // Update Formula Explanation var formulaExplanation = "Formula Used: γsat = ((Gs + e) * γw) / (1 + e)"; formulaExplanation += "Where: Gs = Specific Gravity of Solids, e = Void Ratio, γw = Unit Weight of Water."; document.getElementById("result").querySelector(".formula-explanation").innerHTML = formulaExplanation; updateChart(); } function resetCalculator() { document.getElementById("soilDensity").value = defaultValues.soilDensity; document.getElementById("voidRatio").value = defaultValues.voidRatio; document.getElementById("specificGravity").value = defaultValues.specificGravity; document.getElementById("waterDensity").value = defaultValues.waterDensity; // Clear errors document.getElementById("soilDensityError").textContent = ""; document.getElementById("voidRatioError").textContent = ""; document.getElementById("specificGravityError").textContent = ""; document.getElementById("waterDensityError").textContent = ""; resetResults(); updateChart(); // Reset chart to defaults too } function resetResults() { document.getElementById("result").querySelector(".value").textContent = "–"; document.getElementById("result").querySelector(".unit").textContent = ""; document.getElementById("resultLabel").innerHTML = "Saturated Soil Weight (kN/m³)"; document.getElementById("result").querySelector(".formula-explanation").innerHTML = ""; document.querySelector("#voidVolume .value").textContent = "–"; document.querySelector("#solidVolume .value").textContent = "–"; document.querySelector("#totalVolume .value").textContent = "–"; document.querySelector("#waterContentCalc .value").textContent = "–"; document.querySelector("#dryUnitWeight .value").textContent = "–"; document.querySelector("#saturatedUnitWeightDerived .value").textContent = "–"; // Clear canvas if reset var canvas = document.getElementById('soilChart'); var ctx = canvas.getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height); } function copyResults() { var resultValue = document.getElementById("result").querySelector(".value").textContent; var resultUnit = document.getElementById("result").querySelector(".unit").textContent; var formulaExp = document.getElementById("result").querySelector(".formula-explanation").textContent; var voidVolValue = document.querySelector("#voidVolume .value").textContent; var voidVolUnit = document.querySelector("#voidVolume .unit").textContent; var solidVolValue = document.querySelector("#solidVolume .value").textContent; var solidVolUnit = document.querySelector("#solidVolume .unit").textContent; var totalVolValue = document.querySelector("#totalVolume .value").textContent; var totalVolUnit = document.querySelector("#totalVolume .unit").textContent; var waterContValue = document.querySelector("#waterContentCalc .value").textContent; var waterContUnit = document.querySelector("#waterContentCalc .unit").textContent; var dryUnitWValue = document.querySelector("#dryUnitWeight .value").textContent; var dryUnitWUnit = document.querySelector("#dryUnitWeight .unit").textContent; var satUnitWDerivedValue = document.querySelector("#saturatedUnitWeightDerived .value").textContent; var satUnitWDerivedUnit = document.querySelector("#saturatedUnitWeightDerived .unit").textContent; var copyText = "Soil Saturated Weight Calculation Results:\n\n"; copyText += "Primary Result:\n"; copyText += "Saturated Soil Weight: " + resultValue + " " + resultUnit + "\n"; copyText += "Formula: " + formulaExp.replace(//g, ' ') + "\n\n"; // Basic text conversion copyText += "Intermediate Values:\n"; copyText += "Volume of Voids: " + voidVolValue + " " + voidVolUnit + "\n"; copyText += "Volume of Solids: " + solidVolValue + " " + solidVolUnit + "\n"; copyText += "Total Volume: " + totalVolValue + " " + totalVolUnit + "\n\n"; copyText += "Key Derived Values:\n"; copyText += "Water Content: " + waterContValue + " " + waterContUnit + "\n"; copyText += "Dry Unit Weight: " + dryUnitWValue + " " + dryUnitWUnit + "\n"; copyText += "Saturated Unit Weight (Derived): " + satUnitWDerivedValue + " " + satUnitWDerivedUnit + "\n\n"; copyText += "Assumptions/Inputs Used:\n"; copyText += "Void Ratio (e): " + document.getElementById("voidRatio").value + "\n"; copyText += "Specific Gravity (Gs): " + document.getElementById("specificGravity").value + "\n"; copyText += "Density of Water (ρw): " + document.getElementById("waterDensity").value + " g/cm³\n"; copyText += "Unit Weight of Water (γw): " + (document.getElementById("waterDensity").value * 9.81).toFixed(2) + " kN/m³\n"; var textArea = document.createElement("textarea"); textArea.value = copyText; textArea.style.position = "fixed"; textArea.style.left = "-9999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied!' : 'Copying failed!'; // Display a temporary message to the user (optional) var tempMsg = document.createElement("div"); tempMsg.textContent = msg; tempMsg.style.cssText = "position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: #004a99; color: white; padding: 15px; border-radius: 5px; z-index: 1000; opacity: 0.9;"; document.body.appendChild(tempMsg); setTimeout(function(){ document.body.removeChild(tempMsg); }, 2000); } catch (err) { console.error('Fallback: Oops, unable to copy', err); } document.body.removeChild(textArea); } // Charting Logic var soilChart; function updateChart() { var canvas = document.getElementById('soilChart'); var ctx = canvas.getContext('2d'); // Clear previous chart ctx.clearRect(0, 0, canvas.width, canvas.height); var GsInput = parseFloat(document.getElementById("specificGravity").value) || defaultValues.specificGravity; var rho_wInput = parseFloat(document.getElementById("waterDensity").value) || defaultValues.waterDensity; var gamma_wInput = rho_wInput * 9.81; // Update gamma_w based on input rho_w var voidRatios = [0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6]; // Range of void ratios to plot var saturatedUnitWeights = []; var dryUnitWeights = []; // Calculate dry unit weight for comparison for (var i = 0; i < voidRatios.length; i++) { var current_e = voidRatios[i]; // Calculate Saturated Unit Weight var gamma_sat = ((GsInput + current_e) * gamma_wInput) / (1 + current_e); saturatedUnitWeights.push(gamma_sat); // Calculate Dry Unit Weight based on Gs and current_e // gamma_d = (Gs * gamma_w) / (1 + e) var gamma_d = (GsInput * gamma_wInput) / (1 + current_e); dryUnitWeights.push(gamma_d); } // Chart configuration var chartHeight = canvas.height; var chartWidth = canvas.width; var padding = 40; var chartAreaHeight = chartHeight – 2 * padding; var chartAreaWidth = chartWidth – 2 * padding; // Find max values for scaling var maxY = Math.max(…saturatedUnitWeights, …dryUnitWeights); var minY = Math.min(…dryUnitWeights); // Min dry unit weight will be lowest // Draw axes ctx.strokeStyle = '#ccc'; ctx.lineWidth = 1; ctx.font = '12px Arial'; ctx.fillStyle = '#333'; // Y-axis ctx.beginPath(); ctx.moveTo(padding, padding); ctx.lineTo(padding, chartHeight – padding); ctx.stroke(); // Y-axis labels ctx.textAlign = 'right'; ctx.fillText(maxY.toFixed(1), padding – 5, padding); ctx.fillText(((minY + maxY) / 2).toFixed(1), padding – 5, chartHeight / 2 + padding/2); ctx.fillText(minY.toFixed(1), padding – 5, chartHeight – padding); // X-axis ctx.beginPath(); ctx.moveTo(padding, chartHeight – padding); ctx.lineTo(chartWidth – padding, chartHeight – padding); ctx.stroke(); // X-axis labels ctx.textAlign = 'center'; for (var i = 0; i < voidRatios.length; i++) { var xPos = padding + (i + 1) * (chartAreaWidth / voidRatios.length); ctx.fillText(voidRatios[i].toFixed(1), xPos, chartHeight – padding + 15); } // Draw grid lines (optional) ctx.strokeStyle = '#eee'; ctx.lineWidth = 0.5; // Horizontal grid lines for(var i = 0; i < 3; i++){ // 3 grid lines for y-axis var yPos = padding + i * (chartAreaHeight / 2); ctx.beginPath(); ctx.moveTo(padding, yPos); ctx.lineTo(chartWidth – padding, yPos); ctx.stroke(); } // Vertical grid lines for(var i = 0; i < voidRatios.length -1 ; i++){ var xPos = padding + (i + 1) * (chartAreaWidth / voidRatios.length); ctx.beginPath(); ctx.moveTo(xPos, padding); ctx.lineTo(xPos, chartHeight – padding); ctx.stroke(); } // Draw Saturated Unit Weight line ctx.strokeStyle = 'var(–primary-color)'; ctx.lineWidth = 2; ctx.beginPath(); ctx.moveTo(padding, chartHeight – padding); // Start at 0 void ratio (conceptually) for (var i = 0; i < voidRatios.length; i++) { var x = padding + (i + 1) * (chartAreaWidth / voidRatios.length); var y = chartHeight – padding – ((saturatedUnitWeights[i] – minY) / (maxY – minY)) * chartAreaHeight; if (i === 0) ctx.moveTo(x, y); else ctx.lineTo(x, y); } ctx.stroke(); ctx.fillStyle = 'var(–primary-color)'; ctx.font = 'bold 12px Arial'; ctx.fillText('Saturated Unit Weight (kN/m³)', padding + 5, padding + 15); // Draw Dry Unit Weight line ctx.strokeStyle = 'var(–success-color)'; ctx.lineWidth = 2; ctx.beginPath(); ctx.moveTo(padding, chartHeight – padding); // Start at 0 void ratio (conceptually) for (var i = 0; i < voidRatios.length; i++) { var x = padding + (i + 1) * (chartAreaWidth / voidRatios.length); var y = chartHeight – padding – ((dryUnitWeights[i] – minY) / (maxY – minY)) * chartAreaHeight; if (i === 0) ctx.moveTo(x, y); else ctx.lineTo(x, y); } ctx.stroke(); ctx.fillStyle = 'var(–success-color)'; ctx.font = 'bold 12px Arial'; ctx.fillText('Dry Unit Weight (kN/m³)', padding + 5, padding + 30); // Add labels and title ctx.textAlign = 'center'; ctx.fillStyle = '#000'; ctx.font = '14px Arial'; ctx.fillText('Void Ratio (e)', chartWidth / 2, chartHeight – padding + 30); ctx.font = '18px Arial'; ctx.fillText('Unit Weight vs. Void Ratio', chartWidth / 2, padding / 2); } // Initial calculation and chart render on page load document.addEventListener('DOMContentLoaded', function() { calculateSoilSaturatedWeight(); updateChart(); });

Leave a Comment