Calculating Weight Percent Solids in a Slurry

Weight Percent Solids Calculator – Calculate Slurry Density :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ddd; –card-background: #fff; –shadow: 0 2px 5px rgba(0,0,0,0.1); –input-border: #ccc; –error-color: #dc3545; } 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-top: 20px; padding-bottom: 20px; } .container { width: 95%; max-width: 980px; margin: 0 auto; background-color: var(–card-background); padding: 25px; border-radius: 8px; box-shadow: var(–shadow); display: flex; flex-direction: column; gap: 25px; } h1, h2, h3 { color: var(–primary-color); margin-bottom: 15px; text-align: center; } h1 { font-size: 2.2em; margin-bottom: 10px; } h2 { font-size: 1.8em; margin-top: 20px; margin-bottom: 15px; } h3 { font-size: 1.4em; margin-top: 15px; margin-bottom: 10px; } .sub-heading { font-size: 1.2em; color: #555; margin-top: 0; margin-bottom: 20px; text-align: center; } .input-group { margin-bottom: 15px; padding: 10px; border: 1px solid var(–border-color); border-radius: 5px; background-color: #fefefe; } .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); padding: 10px; margin-bottom: 5px; border: 1px solid var(–input-border); border-radius: 4px; font-size: 1em; } .input-group small { display: block; color: #666; font-size: 0.85em; margin-top: 5px; } .error-message { color: var(–error-color); font-size: 0.85em; margin-top: 5px; display: none; /* Hidden by default */ } .error-message.visible { display: block; } button { padding: 12px 20px; margin-right: 10px; background-color: var(–primary-color); color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; transition: background-color 0.3s ease; } button:hover { background-color: #003366; } .reset-button { background-color: #6c757d; } .reset-button:hover { background-color: #5a6268; } .copy-button { background-color: #ffc107; color: #333; } .copy-button:hover { background-color: #e0a800; } .results-display { margin-top: 20px; padding: 20px; background-color: var(–primary-color); color: white; border-radius: 5px; text-align: center; box-shadow: inset 0 0 10px rgba(0,0,0,0.2); } .results-display h3 { color: white; margin-bottom: 15px; } .main-result { font-size: 2.5em; font-weight: bold; margin-bottom: 15px; display: block; padding: 10px; background-color: rgba(255, 255, 255, 0.15); border-radius: 4px; } .intermediate-results div, .key-assumptions div { margin-bottom: 10px; font-size: 1.1em; } .intermediate-results span, .key-assumptions span { font-weight: bold; } .chart-container { margin-top: 25px; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); text-align: center; } canvas { max-width: 100%; height: auto !important; margin: 0 auto; } table caption { font-weight: bold; margin-bottom: 10px; color: var(–primary-color); font-size: 1.2em; caption-side: top; text-align: left; } table { width: 100%; border-collapse: collapse; margin-top: 20px; } th, td { border: 1px solid var(–border-color); padding: 10px; text-align: center; } th { background-color: var(–primary-color); color: white; font-weight: bold; } tr:nth-child(even) { background-color: #f2f2f2; } td.value { font-weight: bold; color: var(–primary-color); } .formula-explanation { margin-top: 20px; padding: 15px; background-color: #e9ecef; border-left: 5px solid var(–primary-color); border-radius: 4px; font-style: italic; color: #444; } .formula-explanation strong { color: var(–primary-color); } .article-section { margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; } .article-section h2, .article-section h3 { text-align: left; margin-bottom: 15px; } .article-section p { margin-bottom: 15px; color: #333; } .article-section ul, .article-section ol { margin-left: 20px; margin-bottom: 15px; } .article-section li { margin-bottom: 8px; } .internal-links-list { list-style: none; padding: 0; } .internal-links-list li { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed #ccc; } .internal-links-list li:last-child { border-bottom: none; } .internal-links-list a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .internal-links-list a:hover { text-decoration: underline; } .internal-links-list span { display: block; font-size: 0.9em; color: #555; margin-top: 5px; } @media (max-width: 768px) { .container { padding: 15px; } h1 { font-size: 1.8em; } h2 { font-size: 1.5em; } button { width: 100%; margin-right: 0; margin-bottom: 10px; } .main-result { font-size: 2em; } }

Weight Percent Solids Calculator

Determine the concentration of solids in your slurry accurately.

Slurry Weight Percent Solids Calculator

Enter the total mass of dry solid material.
Enter the total mass of the slurry (solids + liquid).

Calculation Results

Weight Percent Solids: %
Solids to Liquid Ratio:
Liquid Weight: kg

Key Assumptions:

Dry solids contain no moisture.
Measurements are taken under consistent conditions.
Formula Used:

Weight Percent Solids is calculated by dividing the weight of the dry solids by the total weight of the slurry and multiplying by 100. It represents the proportion of solid material by mass within the liquid medium.

Weight % Solids = (Weight of Dry Solids / Total Weight of Slurry) * 100

Slurry Composition Chart

Visual representation of solids vs. liquid weight.

Slurry Solids Concentration Table

Slurry Composition Breakdown
Component Weight (kg) Percentage (%)
Dry Solids
Liquid
Total Slurry 100.00%

What is Weight Percent Solids in a Slurry?

Weight percent solids, often abbreviated as %w/w or simply % solids, is a critical parameter in understanding and managing slurries. A slurry is a pumpable mixture that contains at least a minimum amount of solid material. This solid material can range from fine powders to larger granular substances, suspended within a liquid carrier, typically water but potentially oil or other fluids. The weight percent solids quantifies precisely how much of that total mixture's mass is attributable to the solid components.

Understanding and accurately calculating the weight percent solids is fundamental across numerous industries. In mining and mineral processing, it dictates the efficiency of separation techniques and the throughput of material. In the construction industry, it's vital for concrete mixes and drilling muds. In the chemical industry, precise control over solid concentration is key for reactions, crystallization, and product quality. Even in wastewater treatment, managing the solids content in sludge is essential for effective dewatering and disposal. Essentially, anyone dealing with fluid mixtures where solid particles are a significant component needs to grasp the concept of weight percent solids.

A common misconception about weight percent solids is that it's directly equivalent to volume percent solids. While related, they are not the same, especially when solid particles have varying densities or when there's significant void space between particles. Another misconception is that a high solids percentage always means a "thicker" or "more concentrated" slurry in terms of flow properties. While often true, rheology (flow behavior) is complex and also depends on particle shape, size distribution, and inter-particle forces, not just weight percent solids. This calculation specifically addresses the mass proportion.

Accurate calculation of weight percent solids is essential for process control and optimization.

Weight Percent Solids Formula and Mathematical Explanation

The formula for calculating weight percent solids is straightforward and derived from the basic definition of percentage. It involves comparing the mass of the dry solid constituents to the total mass of the slurry mixture.

The Core Formula

The fundamental equation used in our weight percent solids calculator is:

Weight % Solids = (WSolids / WTotal Slurry) × 100

Variable Explanations

Let's break down each component of the formula:

  • WSolids: This represents the total weight (or mass) of the dry solid material in the slurry. It's crucial that this value represents only the solid components, excluding any moisture or free liquid they might inherently contain before being mixed. In practical terms, this is the weight of the solids after they have been dried.
  • WTotal Slurry: This is the total weight (or mass) of the entire slurry mixture. This includes the weight of the dry solids PLUS the weight of the liquid carrier (e.g., water) that suspends them.
  • × 100: This factor converts the resulting decimal fraction into a percentage, making the value easier to interpret as a proportion out of 100 units of mass.

Derivation and Intermediate Calculations

Often, you might know the weight of the dry solids and the weight of the liquid separately, rather than the total slurry weight directly. In such cases, the total slurry weight is simply the sum:

WTotal Slurry = WSolids + WLiquid

Substituting this into the main formula gives:

Weight % Solids = (WSolids / (WSolids + WLiquid)) × 100

Our calculator also provides the "Solids to Liquid Ratio" and "Liquid Weight" as key intermediate values.

  • Liquid Weight: This is calculated by subtracting the dry solids weight from the total slurry weight:
    Liquid Weight = Total Slurry Weight - Dry Solids Weight
  • Solids to Liquid Ratio: This is a simple ratio of the weight of solids to the weight of liquid:
    Solids to Liquid Ratio = Dry Solids Weight / Liquid Weight

Variables Table

Here's a summary of the variables involved in calculating weight percent solids:

Weight Percent Solids Variables
Variable Meaning Unit Typical Range/Notes
WSolids Weight of Dry Solids kg (or any mass unit) Must be dry; depends on process
WLiquid Weight of Liquid Carrier kg (or any mass unit) e.g., Water, oil; depends on process
WTotal Slurry Total Weight of Slurry kg (or any mass unit) WSolids + WLiquid
Weight % Solids Weight Percentage of Solids % 0% (pure liquid) to >90% (very thick slurry)
Solids to Liquid Ratio Ratio of Solid Mass to Liquid Mass Unitless Value > 1 indicates more solids than liquid by weight

Understanding this slurry solids concentration calculation is vital for efficient material handling and process control.

Practical Examples (Real-World Use Cases)

Let's illustrate the application of the weight percent solids calculation with practical examples from different industrial contexts.

Example 1: Mining Tailings Management

A mining operation is dewatering its tailings slurry before disposal. They need to know the concentration of solids in the slurry being pumped to the thickener.

Inputs:

  • Weight of Dry Solids: 80,000 kg
  • Total Weight of Slurry: 200,000 kg

Calculation using the calculator:

  • Weight Percent Solids = (80,000 kg / 200,000 kg) * 100 = 40.00%
  • Liquid Weight = 200,000 kg – 80,000 kg = 120,000 kg
  • Solids to Liquid Ratio = 80,000 kg / 120,000 kg = 0.67

Interpretation:

This means that 40% of the slurry's mass consists of dry solids, and the remaining 60% is liquid. This 40% solids concentration is a key metric for the thickener's performance. If the target is higher, adjustments to the dewatering process might be needed. This slurry dewatering optimization strategy relies heavily on this calculation.

Example 2: Concrete Mix Design

A concrete batch plant is preparing a specific mix. They need to ensure the correct proportion of cement (considered the solid) to the total mix weight.

Inputs:

  • Weight of Dry Solids (Cement): 350 kg
  • Total Weight of Concrete Mix (including aggregate, cement, water, admixtures): 1500 kg

Calculation using the calculator:

  • Weight Percent Solids = (350 kg / 1500 kg) * 100 = 23.33%
  • Liquid Weight (approx. water + other liquids) = 1500 kg – 350 kg = 1150 kg
  • Solids to Liquid Ratio = 350 kg / 1150 kg = 0.30

Interpretation:

In this concrete mix, cement constitutes approximately 23.33% of the total weight. This figure is crucial for achieving the desired strength, workability, and durability of the final concrete product. Variations in this concrete mix design ratio can significantly impact performance.

Example 3: Chemical Slurry Production

A chemical plant is producing a pigment slurry. They need to verify the concentration of pigment particles in the aqueous solution.

Inputs:

  • Weight of Dry Pigment Solids: 25 kg
  • Weight of Water: 100 kg

Calculation using the calculator (first calculate total slurry weight):

  • Total Slurry Weight = 25 kg (solids) + 100 kg (water) = 125 kg
  • Weight Percent Solids = (25 kg / 125 kg) * 100 = 20.00%
  • Solids to Liquid Ratio = 25 kg / 100 kg = 0.25

Interpretation:

The pigment slurry has a 20% solids concentration by weight. This concentration affects the opacity, color intensity, and application properties of the pigment. Maintaining this precise chemical slurry concentration control is vital for product consistency.

How to Use This Weight Percent Solids Calculator

Using our online Weight Percent Solids Calculator is designed to be simple and intuitive. Follow these steps to get your results quickly and accurately.

  1. Identify Your Inputs: You will need two key pieces of information:
    • Weight of Dry Solids: Measure or determine the exact weight of the solid material you are using. Ensure this material is *dry*, meaning any surface moisture has been accounted for or removed. Units should be consistent (e.g., kilograms, pounds).
    • Total Weight of Slurry: Measure or determine the total weight of the entire mixture – this includes both the dry solids and the liquid carrier (like water).
  2. Enter Values into the Calculator:
    • Input the 'Weight of Dry Solids' into the first field.
    • Input the 'Total Weight of Slurry' into the second field.
    Note: The calculator defaults to kilograms (kg). If you are using different units (e.g., lbs), ensure consistency. The results will be in the same unit for intermediate weights but the percentage is unitless.
  3. View Immediate Results: As soon as you enter valid numbers, the calculator will update automatically. You will see:
    • Primary Result (Main Result): The calculated Weight Percent Solids, displayed prominently.
    • Intermediate Values: Breakdown including the calculated Liquid Weight and the Solids to Liquid Ratio.
    • Chart & Table: Visual and tabular representations of the composition.
  4. Understand the Results:
    • Weight % Solids: This tells you the proportion of solid mass in your slurry. A higher percentage means a greater concentration of solids.
    • Liquid Weight: Useful for understanding the volume of liquid carrier present.
    • Solids to Liquid Ratio: A quick way to compare the mass of solids versus liquid. A ratio greater than 1 means there's more solid mass than liquid mass.
  5. Use the Action Buttons:
    • Calculate: While results update automatically, clicking this can sometimes help refresh if inputs are changed rapidly.
    • Reset: Click this to clear all fields and return them to their default example values.
    • Copy Results: Click this to copy the main result, intermediate values, and key assumptions to your clipboard for easy pasting into reports or notes.

By using this tool, you gain immediate insight into your slurry's composition, aiding in decisions related to process efficiency, material handling, and product quality. Accurate slurry composition analysis is the first step toward optimization.

Key Factors That Affect Weight Percent Solids Results

While the calculation of weight percent solids itself is a direct mathematical process, several real-world factors can influence the accuracy of your inputs and the interpretation of your results. Understanding these is crucial for reliable process control.

  1. Moisture Content in "Dry" Solids: The most critical assumption is that the input "Weight of Dry Solids" is truly dry. If the solids are damp or have absorbed some liquid from the process before being weighed, the measured weight will be artificially high. This leads to an inflated Weight Percent Solids calculation. Accurate drying procedures or accounting for inherent moisture are vital.
  2. Accurate Measurement of Total Slurry Weight: The total slurry weight is the sum of solids and liquid. Errors in measuring either component, or in measuring the final combined mixture, will directly impact the accuracy. This could be due to weighing scale calibration issues, spillage during transfer, or evaporation of the liquid component before the final weighing. Precision in weighing equipment is paramount for reliable material handling accuracy.
  3. Density Variations: While weight percent solids is a mass-based calculation, density plays a role in how slurries behave. If the density of the solid particles or the liquid carrier changes significantly (e.g., due to temperature affecting water density, or using different liquids), it can affect the relationship between weight and volume, impacting pumping and settling characteristics, even if the weight percent solids remains constant.
  4. Particle Size Distribution and Shape: Although not directly part of the weight percent solids calculation, these factors significantly influence the slurry's rheology (flow properties) and settling behavior. A slurry with a high weight percent solids but with large, dense particles might behave differently than one with fine particles at the same concentration. This affects pump selection and pipeline flow dynamics.
  5. Presence of Fines or Colloids: Very fine particles or colloidal matter can increase the effective viscosity and reduce settling rates, sometimes making the slurry appear "thicker" than its weight percent solids might suggest. They can also affect the density of the liquid phase itself. Managing these components is key to stable slurry stability management.
  6. Temperature Effects: Temperature can influence the density of the liquid carrier and, to a lesser extent, the solids. It can also affect the viscosity of the liquid and the slurry as a whole. While the direct weight calculation isn't temperature-dependent, the process conditions influenced by temperature (like fluid dynamics) are.
  7. Air Entrainment: If air is inadvertently introduced into the slurry during mixing or pumping, it can increase the total volume without significantly increasing the total weight. This can lead to an inaccurate perception of the slurry's density and concentration if volume measurements are used loosely alongside weight data. Careful process design minimizes air entrainment control.

Frequently Asked Questions (FAQ)

Q1: What is the difference between Weight Percent Solids and Volume Percent Solids?
Weight Percent Solids (WPS) measures the mass of solids relative to the total mass of the slurry (WSolids / WTotal * 100). Volume Percent Solids (VPS) measures the volume of solids relative to the total volume of the slurry (VSolids / VTotal * 100). They are not interchangeable because solids and liquids have different densities. If solids are much denser than the liquid, WPS will be lower than VPS for the same mixture. Our calculator focuses solely on weight.
Q2: Can the Weight Percent Solids be over 100%?
No, the weight percent solids calculation, as defined, cannot exceed 100%. The formula divides the weight of a component (solids) by the weight of the *total mixture* (solids + liquid). The component's weight can never be greater than the total mixture's weight. A value approaching 100% would mean the slurry is almost entirely solid material with very little liquid.
Q3: What is considered a "high" or "low" Weight Percent Solids?
"High" and "low" are relative to the specific application. For example, a 5-10% solids slurry might be considered low concentration in mining, while in wastewater treatment, 20-30% solids in sludge might be considered high. Our calculator provides the exact percentage, allowing you to compare it against your process targets. Understanding target slurry concentrations is key.
Q4: Does this calculator work for any type of liquid?
Yes, the formula for weight percent solids is independent of the liquid type. As long as you can accurately measure the weight of the dry solids and the total weight of the slurry (solids + liquid), the calculation holds true whether the liquid is water, oil, a chemical solution, etc. Consistency in measurement units is the most important factor.
Q5: My solids absorb water. How do I get the "dry" solids weight?
This is a common challenge. To get the truly "dry" solids weight, you would typically oven-dry a representative sample of the solids until their weight stabilizes, or use a known moisture content percentage provided by the manufacturer or determined through lab analysis. If you measure solids that have absorbed water, you'll need to subtract the weight of that absorbed water to find the true dry weight, which requires knowing the absorption capacity. This highlights the importance of accurate sample preparation techniques.
Q6: What if I only know the volume of solids and liquid?
If you only have volumes, you'll need the density of both the solid material and the liquid to convert volumes to weights. The formula would be: Weight = Volume × Density Once you have the weights, you can use our calculator. Be sure to use consistent units (e.g., if volume is in m³, density must be in kg/m³ to get weight in kg).
Q7: How does temperature affect the calculation?
Directly, temperature doesn't change the weight percent solids calculation itself, as weight is mass-invariant. However, temperature significantly affects the density and viscosity of the liquid carrier. This can alter the slurry's overall density and flow behavior (rheology) even if the weight percent solids remains constant. For highly precise process control, temperature must be monitored.
Q8: Can I use this calculator for calculating solids in gas (aerosols)?
This calculator is specifically designed for slurries, which are liquid-based mixtures. While the concept of mass fraction exists in aerosols (solids in gas), the fluid dynamics, measurement techniques, and typical concentration ranges are very different. This tool is not suitable for gas-phase dispersions. For related concepts, consider researching particulate matter analysis.

Related Tools and Internal Resources

© 2023 Your Company Name. All rights reserved.

var chartInstance = null; // Global variable to hold chart instance function calculateWeightPercentSolids() { var solidsWeightInput = document.getElementById("solidsWeight"); var slurryWeightInput = document.getElementById("slurryWeight"); var solidsWeightError = document.getElementById("solidsWeightError"); var slurryWeightError = document.getElementById("slurryWeightError"); var solidsWeight = parseFloat(solidsWeightInput.value); var slurryWeight = parseFloat(slurryWeightInput.value); // Reset errors solidsWeightError.innerText = "; slurryWeightError.innerText = "; solidsWeightError.classList.remove('visible'); slurryWeightError.classList.remove('visible'); var isValid = true; if (isNaN(solidsWeight) || solidsWeightInput.value.trim() === "") { solidsWeightError.innerText = "Please enter a valid number for solids weight."; solidsWeightError.classList.add('visible'); isValid = false; } else if (solidsWeight < 0) { solidsWeightError.innerText = "Solids weight cannot be negative."; solidsWeightError.classList.add('visible'); isValid = false; } if (isNaN(slurryWeight) || slurryWeightInput.value.trim() === "") { slurryWeightError.innerText = "Please enter a valid number for total slurry weight."; slurryWeightError.classList.add('visible'); isValid = false; } else if (slurryWeight slurryWeight) { slurryWeightError.innerText = "Total slurry weight cannot be less than solids weight."; slurryWeightError.classList.add('visible'); isValid = false; } if (!isValid) { // Clear results if inputs are invalid document.getElementById("mainResult").innerText = "–"; document.getElementById("weightPercentSolids").querySelector('span').innerText = "–"; document.getElementById("solidsToLiquidRatio").querySelector('span').innerText = "–"; document.getElementById("liquidWeight").querySelector('span').innerText = "–"; updateChart(0, 0); // Clear chart updateTable("–", "–", "–"); return; } var liquidWeight = slurryWeight – solidsWeight; var weightPercentSolids = (solidsWeight / slurryWeight) * 100; var solidsToLiquidRatio = (solidsWeight > 0 && liquidWeight > 0) ? (solidsWeight / liquidWeight) : (solidsWeight > 0 ? Infinity : 0); document.getElementById("mainResult").innerText = weightPercentSolids.toFixed(2) + "%"; document.getElementById("weightPercentSolids").querySelector('span').innerText = weightPercentSolids.toFixed(2); document.getElementById("liquidWeight").querySelector('span').innerText = liquidWeight.toFixed(2) + " kg"; document.getElementById("solidsToLiquidRatio").querySelector('span').innerText = solidsToLiquidRatio === Infinity ? "Infinite (No Liquid)" : (solidsToLiquidRatio === 0 ? "0 (No Solids)" : solidsToLiquidRatio.toFixed(2)); updateChart(solidsWeight, liquidWeight); updateTable(solidsWeight.toFixed(2), liquidWeight.toFixed(2), slurryWeight.toFixed(2)); } function updateChart(solidsWeight, liquidWeight) { var ctx = document.getElementById("slurryChart").getContext("2d"); var totalWeight = solidsWeight + liquidWeight; // Avoid division by zero or negative values for percentages var solidsPercent = totalWeight > 0 ? (solidsWeight / totalWeight) * 100 : 0; var liquidPercent = totalWeight > 0 ? (liquidWeight / totalWeight) * 100 : 0; // Ensure percentages don't exceed 100% due to floating point inaccuracies solidsPercent = Math.min(100, Math.max(0, solidsPercent)); liquidPercent = Math.min(100, Math.max(0, liquidPercent)); // Re-calculate to ensure sum is 100% if rounding occurred if (solidsPercent + liquidPercent !== 100) { liquidPercent = 100 – solidsPercent; } if (chartInstance) { chartInstance.destroy(); // Destroy previous chart instance } chartInstance = new Chart(ctx, { type: 'pie', data: { labels: ['Dry Solids', 'Liquid'], datasets: [{ label: 'Weight Percentage', data: [solidsPercent, liquidPercent], backgroundColor: [ 'rgba(0, 74, 153, 0.7)', // Primary color for solids 'rgba(40, 167, 69, 0.7)' // Success color for liquid ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(40, 167, 69, 1)' ], borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, // Allows custom height/width plugins: { legend: { position: 'bottom', }, title: { display: true, text: 'Slurry Composition by Weight (%)' }, tooltip: { callbacks: { label: function(context) { var label = context.label || "; if (label) { label += ': '; } if (context.parsed) { label += context.parsed.toFixed(2) + '%'; } return label; } } } } } }); } function updateTable(solidsWeight, liquidWeight, totalWeight) { document.getElementById("tableSolidsWeight").innerText = solidsWeight === "–" ? "–" : solidsWeight + " kg"; document.getElementById("tableLiquidWeight").innerText = liquidWeight === "–" ? "–" : liquidWeight + " kg"; document.getElementById("tableTotalWeight").innerText = totalWeight === "–" ? "–" : totalWeight + " kg"; var solidsPercent = "–"; var liquidPercent = "–"; if (totalWeight !== "–" && parseFloat(totalWeight) > 0) { solidsPercent = (parseFloat(solidsWeight) / parseFloat(totalWeight)) * 100; liquidPercent = (parseFloat(liquidWeight) / parseFloat(totalWeight)) * 100; document.getElementById("tableSolidsPercent").innerText = solidsPercent.toFixed(2) + "%"; document.getElementById("tableLiquidPercent").innerText = liquidPercent.toFixed(2) + "%"; } else { document.getElementById("tableSolidsPercent").innerText = "–"; document.getElementById("tableLiquidPercent").innerText = "–"; } } function resetCalculator() { document.getElementById("solidsWeight").value = "150"; document.getElementById("slurryWeight").value = "500"; // Reset errors document.getElementById("solidsWeightError").innerText = "; document.getElementById("solidsWeightError").classList.remove('visible'); document.getElementById("slurryWeightError").innerText = "; document.getElementById("slurryWeightError").classList.remove('visible'); calculateWeightPercentSolids(); // Recalculate with default values } function copyResults() { var mainResult = document.getElementById("mainResult").innerText; var weightPercentSolids = document.getElementById("weightPercentSolids").querySelector('span').innerText; var solidsToLiquidRatio = document.getElementById("solidsToLiquidRatio").querySelector('span').innerText; var liquidWeight = document.getElementById("liquidWeight").querySelector('span').innerText; var assumption1 = document.getElementById("assumption1").innerText; var assumption2 = document.getElementById("assumption2").innerText; var copyText = "— Slurry Weight Percent Solids Results —\n\n"; copyText += "Weight Percent Solids: " + mainResult + "\n"; copyText += "Weight % Solids Value: " + weightPercentSolids + "\n"; copyText += "Liquid Weight: " + liquidWeight + "\n"; copyText += "Solids to Liquid Ratio: " + solidsToLiquidRatio + "\n\n"; copyText += "— Key Assumptions —\n"; copyText += "- " + assumption1 + "\n"; copyText += "- " + assumption2 + "\n"; navigator.clipboard.writeText(copyText).then(function() { // Success feedback (optional) var tempAlert = document.createElement('div'); tempAlert.style.position = 'fixed'; tempAlert.style.top = '10px'; tempAlert.style.right = '10px'; tempAlert.style.backgroundColor = 'var(–success-color)'; tempAlert.style.color = 'white'; tempAlert.style.padding = '10px 20px'; tempAlert.style.borderRadius = '5px'; tempAlert.style.zIndex = '10000'; tempAlert.innerText = 'Results copied!'; document.body.appendChild(tempAlert); setTimeout(function() { tempAlert.remove(); }, 2000); }, function(err) { console.error('Failed to copy text: ', err); // Fallback for older browsers or permission issues alert('Failed to copy results. Please copy manually.'); }); } // Initial calculation on page load document.addEventListener('DOMContentLoaded', function() { // Dynamically set canvas height based on parent width for better aspect ratio var canvasContainer = document.querySelector('.chart-container'); var canvas = document.getElementById('slurryChart'); var chartHeight = canvasContainer.offsetWidth * 0.75; // Adjust multiplier for desired aspect ratio canvas.height = chartHeight; calculateWeightPercentSolids(); // Re-calculate on resize to adjust chart height window.addEventListener('resize', function() { var canvasContainer = document.querySelector('.chart-container'); var canvas = document.getElementById('slurryChart'); var chartHeight = canvasContainer.offsetWidth * 0.75; // Adjust multiplier canvas.height = chartHeight; if (chartInstance) { chartInstance.resize(); // Chart.js resize method } }); });

Leave a Comment