Expansion Tank Size Calculator

Expansion Tank Size Calculator :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –card-background: #fff; –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: 20px 0; } .container { max-width: 960px; width: 100%; margin: 0 auto; background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; gap: 30px; } header { text-align: center; margin-bottom: 20px; } header h1 { color: var(–primary-color); margin-bottom: 10px; } .calculator-section { border: 1px solid var(–border-color); border-radius: 8px; padding: 25px; background-color: var(–card-background); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); } .calculator-section h2 { color: var(–primary-color); margin-top: 0; text-align: center; margin-bottom: 25px; } .loan-calc-container { display: flex; flex-direction: column; gap: 20px; } .input-group { display: flex; flex-direction: column; gap: 8px; } .input-group label { font-weight: bold; display: block; color: var(–primary-color); } .input-group input[type="number"], .input-group select { width: calc(100% – 20px); padding: 10px; border: 1px solid var(–border-color); border-radius: 5px; font-size: 1rem; box-sizing: border-box; } .input-group small { font-size: 0.85em; color: #6c757d; margin-top: 5px; display: block; } .error-message { color: var(–error-color); font-size: 0.85em; margin-top: 5px; min-height: 1.2em; /* Reserve space to prevent layout shift */ } .button-group { display: flex; justify-content: space-between; gap: 10px; margin-top: 25px; } .button-group button { padding: 12px 20px; border: none; border-radius: 5px; font-size: 1rem; cursor: pointer; transition: background-color 0.3s ease; flex-grow: 1; } .calculate-btn { background-color: var(–primary-color); color: white; } .calculate-btn:hover { background-color: #003366; } .reset-btn, .copy-btn { background-color: #6c757d; color: white; } .reset-btn:hover, .copy-btn:hover { background-color: #5a6268; } .results-container { margin-top: 25px; padding: 20px; border: 1px dashed var(–primary-color); border-radius: 5px; background-color: #eef7ff; text-align: center; display: flex; flex-direction: column; gap: 15px; } .results-container h3 { color: var(–primary-color); margin-top: 0; margin-bottom: 10px; } .main-result { font-size: 2.2em; font-weight: bold; color: var(–success-color); background-color: white; padding: 15px; border-radius: 5px; box-shadow: 0 2px 5px rgba(40, 167, 69, 0.2); } .intermediate-results div, .assumptions div { font-size: 1.1em; margin-bottom: 8px; } .intermediate-results strong, .assumptions strong { color: var(–primary-color); } .formula-explanation { font-size: 0.9em; color: #6c757d; margin-top: 15px; text-align: left; } table { width: 100%; border-collapse: collapse; margin-top: 20px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); } th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(–border-color); } thead { background-color: var(–primary-color); color: white; } tbody tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; caption-side: top; text-align: left; } canvas { display: block; margin: 20px auto; background-color: white; border-radius: 5px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); } .article-content { margin-top: 40px; padding: 25px; background-color: var(–card-background); border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); } .article-content h2, .article-content h3 { color: var(–primary-color); margin-top: 30px; margin-bottom: 15px; } .article-content h2 { border-bottom: 2px solid var(–primary-color); padding-bottom: 5px; } .article-content h3 { margin-top: 25px; } .article-content p, .article-content ul, .article-content ol { margin-bottom: 15px; } .article-content ul, .article-content ol { padding-left: 20px; } .article-content li { margin-bottom: 8px; } .faq-item { margin-bottom: 15px; } .faq-item strong { color: var(–primary-color); cursor: pointer; } .faq-item p { margin-top: 5px; display: none; /* Hidden by default */ padding-left: 15px; border-left: 2px solid var(–primary-color); } .faq-item p.show { display: block; } .related-links { margin-top: 25px; padding: 15px; background-color: #eef7ff; border-radius: 5px; } .related-links ul { list-style: none; padding: 0; } .related-links li { margin-bottom: 10px; } .related-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .related-links a:hover { text-decoration: underline; } .variable-table th, .variable-table td { border: 1px solid var(–border-color); } .variable-table tr:nth-child(even) { background-color: #f9f9f9; } .variable-table th { background-color: #eef7ff; color: var(–primary-color); } .highlight { background-color: var(–success-color); color: white; padding: 5px 10px; border-radius: 3px; font-weight: bold; }

Expansion Tank Size Calculator

Determine the optimal expansion tank size for your hydronic heating system.

Hydronic Expansion Tank Calculator

Enter the total amount of water in your hydronic system (gallons or liters).
The temperature of the water when the system is filled (Fahrenheit or Celsius).
The highest temperature the system will reach during operation (Fahrenheit or Celsius).
10-25 PSI 12-30 PSI 15-40 PSI The operating pressure range of your system.
Diaphragm/Bladder Plain Steel (Older Systems) Select the type of expansion tank.

Calculation Results

Required Expansion Volume:
Pressure Drop:
Acceptance Factor (V-e):

Key Assumptions:

System Water Volume:
Temperature Range:
Pressure Range:
Tank Type:

The calculation determines the minimum required expansion volume based on the system's water volume and the temperature change. The acceptance factor (V-e) is derived from the pressure range and tank type, indicating how much volume change the tank can accommodate within that pressure range. Formula: Vexpansion = Vsystem * ( (Tmax – Tfill) / (Tmax + 460 – Tfill) ) * 1.1 (for Diaphragm tanks, a slight safety factor is included). For plain steel tanks, the formula is similar but V-e calculation differs.

Expansion Tank Sizing Table

Typical Expansion Tank Sizes Based on System Volume
System Water Volume (Gal) Required Expansion Volume (Qt) Recommended Tank Size (Gal)

What is an Expansion Tank Size Calculator?

An expansion tank size calculator is a specialized tool designed to help homeowners, plumbers, and HVAC technicians determine the appropriate size for an expansion tank needed in a hydronic (water-based) heating or cooling system. Hydronic systems operate by circulating heated or cooled water through pipes to radiators, baseboard heaters, or radiant floor systems. As water heats up, it expands in volume. Without a properly sized expansion tank, this expansion can lead to dangerously high system pressures, potentially damaging pipes, fittings, boilers, and other components, or causing frequent pressure relief valve discharge. The calculator simplifies the complex calculations involved, making it easier to ensure system safety and efficiency. Many people often misunderstand that a simple guess is sufficient, but this can lead to either an undersized tank causing pressure issues or an oversized tank that may not function optimally. Therefore, using an accurate expansion tank size calculator is crucial for any hydronic system installation or maintenance.

This calculator is primarily used by:

  • Homeowners: Performing DIY maintenance or upgrades on their heating systems.
  • Plumbers and HVAC Technicians: Ensuring correct sizing during new installations or when replacing existing tanks.
  • System Designers: Verifying specifications for larger commercial or residential projects.

Common misconceptions about expansion tanks include believing that any tank will do, or that the size is solely dependent on boiler horsepower. In reality, system water volume, operating temperatures, and pressure ranges are the most critical factors. The expansion tank size calculator addresses these nuances directly.

Expansion Tank Size Calculator Formula and Mathematical Explanation

The fundamental principle behind calculating expansion tank size relies on understanding the thermal expansion of water and the pressure dynamics within a closed hydronic system. Water, like most substances, expands when heated and contracts when cooled. In a closed system, this change in volume must be accommodated without exceeding safe pressure limits.

The calculation involves determining the volume of water that will be added to the system due to the temperature increase, and then selecting an expansion tank capable of holding this additional volume while maintaining the desired operating pressure range.

Step-by-Step Derivation

  1. Calculate the Volume Change (ΔV): This is the amount of water volume added to the system as it heats up.
  2. Determine the Acceptance Factor (V-e): This factor represents the ratio of the volume change the tank can handle to the total system volume, based on pressure differentials.
  3. Calculate the Required Expansion Volume (Vexpansion): This is the minimum volume the expansion tank must be able to absorb.
  4. Select a Standard Tank Size: Expansion tanks come in standard sizes; you choose the smallest standard size that is greater than or equal to the calculated required expansion volume.

Variables and Formula

The primary formula for a diaphragm/bladder type expansion tank is:

Vexpansion = Vsystem * ( (Tmax – Tfill) / (Tmax + 460 – Tfill) )

A safety factor (often around 1.1 or 10%) is typically applied to ensure adequate capacity:

Vexpansion_safe = Vexpansion * 1.1

Variable Explanations

Variable Meaning Unit Typical Range
Vsystem Total Water Volume in the Hydronic System Gallons (US) or Liters 10 – 500+
Tfill Cold Fill Temperature °F or °C 40 – 70 °F (10 – 21 °C)
Tmax Maximum System Operating Temperature °F or °C 140 – 190 °F (60 – 88 °C)
Vexpansion Calculated Required Expansion Volume Gallons (US) or Liters Varies
Vexpansion_safe Safety-Adjusted Required Expansion Volume Gallons (US) or Liters Varies
Pmin Minimum System Pressure (at Tfill) PSI or Bar 10 – 25 PSI (0.7 – 1.7 Bar)
Pmax Maximum System Pressure (at Tmax) PSI or Bar 25 – 40 PSI (1.7 – 2.8 Bar)
V-e Acceptance Factor (Ratio of compressible volume to total system volume) Unitless 0.1 – 0.5 (approx.)
460 Absolute zero temperature in Fahrenheit (°R = °F + 460) °R Constant
273 Absolute zero temperature in Celsius (°K = °C + 273) °K Constant (Used if using Celsius, formula adjusts)

Note on Units:

Ensure consistency in units. If using Fahrenheit, use 460. If using Celsius, use 273 (the formula adapts slightly).

Calculation for Plain Steel Tanks:

For older plain steel tanks, the calculation is similar, but the acceptance factor (V-e) is generally higher (e.g., 0.5 or more) because they rely on air compression, which is less efficient than a bladder/diaphragm. The formula becomes:

Vexpansion = Vsystem * ( (Pmax – Pmin) / (Pmax + 14.7 + Pmin) )

Note: 14.7 PSI is atmospheric pressure. The formula using pressure is often preferred for plain steel tanks.

Practical Examples (Real-World Use Cases)

Understanding the expansion tank size calculator is best done through practical examples. Let's consider two common scenarios:

Example 1: Standard Residential Boiler System

Scenario: A typical single-family home with a hot water boiler system.

  • System Water Volume (Vsystem): 50 gallons
  • Cold Fill Temperature (Tfill): 50 °F
  • Maximum System Temperature (Tmax): 180 °F
  • System Pressure Range: 12 PSI (cold) to 30 PSI (hot)
  • Tank Type: Diaphragm/Bladder

Calculation Steps:

  1. Calculate Temperature Factor: (180 – 50) / (180 + 460 – 50) = 130 / 590 ≈ 0.2203
  2. Calculate Required Expansion Volume (Vexpansion): 50 gallons * 0.2203 ≈ 11.01 gallons
  3. Apply Safety Factor: 11.01 gallons * 1.1 ≈ 12.11 gallons

Result Interpretation: The system requires an expansion volume of at least 12.11 gallons to safely accommodate the thermal expansion of water. Consulting a standard tank size chart, a 15-gallon or 20-gallon expansion tank would be recommended to ensure sufficient capacity and longevity.

Example 2: Older System with Plain Steel Tank

Scenario: An older home where the original plain steel expansion tank needs to be replaced or sized.

  • System Water Volume (Vsystem): 35 gallons
  • Cold Fill Pressure (Pmin): 10 PSI
  • Maximum System Pressure (Pmax): 25 PSI
  • Tank Type: Plain Steel

Calculation Steps (using pressure method for plain steel):

  1. Calculate Pressure Change Factor: (25 – 10) / (25 + 14.7 + 10) = 15 / 49.7 ≈ 0.3018
  2. Calculate Required Expansion Volume (Vexpansion): 35 gallons * 0.3018 ≈ 10.56 gallons

Result Interpretation: For this plain steel tank system, approximately 10.56 gallons of expansion volume is needed. Since plain steel tanks are less efficient, installers might still recommend a slightly larger tank than the calculated value, or at least ensure the air charge is precisely set to match Pmin. A 12-gallon or 15-gallon tank might be suitable, depending on manufacturer recommendations and reserve capacity needs.

How to Use This Expansion Tank Size Calculator

Using the expansion tank size calculator is straightforward. Follow these steps to get an accurate size recommendation for your hydronic system:

  1. Gather System Information: Before using the calculator, collect the following details about your hydronic system:
    • Total Water Volume: This is the total amount of water in your entire system (boiler, pipes, radiators, etc.). If unknown, you can estimate based on boiler size and system type. A common estimate for residential systems is 2 gallons per gallon of boiler capacity, plus an allowance for piping and radiation.
    • Cold Fill Temperature: The temperature of the water when the system is initially filled or after draining.
    • Maximum System Temperature: The highest temperature your system reaches during normal operation. Check your boiler's thermostat settings or operating manual.
    • System Pressure Range: The pressure indicated on your system's gauge when the water is cold (fill pressure) and when it is hot (maximum operating pressure). This is crucial for determining the tank's acceptance factor.
    • Expansion Tank Type: Identify whether you have a modern diaphragm/bladder tank or an older plain steel tank.
  2. Input Values: Enter each piece of information into the corresponding field on the calculator. Ensure you use consistent units (e.g., all Fahrenheit or all Celsius; all Gallons or all Liters). The calculator is designed to handle common US units (Gallons, PSI, Fahrenheit) but the underlying principle applies universally.
  3. Select Options: Choose the correct pressure range and tank type from the dropdown menus.
  4. Calculate: Click the "Calculate Size" button.
  5. Review Results: The calculator will display:
    • The main highlighted result: The recommended minimum expansion tank size in gallons.
    • Intermediate values: The calculated required expansion volume, pressure drop, and acceptance factor (V-e), which provide insight into the system's thermal behavior.
    • Key assumptions: A summary of the inputs you used, allowing you to double-check your entries.
    • A brief formula explanation for your reference.
  6. Interpret and Select: Compare the recommended tank size to standard commercially available expansion tank sizes. Always choose a tank size that is equal to or larger than the calculated requirement. It's generally better to slightly oversize than to undersize an expansion tank.
  7. Use Additional Features:
    • Reset Button: Use this to clear all fields and start over if you made a mistake or want to run a new calculation.
    • Copy Results Button: This useful feature copies all calculated results and key assumptions, allowing you to easily paste them into a document, email, or invoice.

By following these steps, you can confidently determine the correct expansion tank size, ensuring your hydronic system operates safely and efficiently, preventing costly damage and maintaining consistent comfort levels. Proper expansion tank sizing is fundamental.

Key Factors That Affect Expansion Tank Size Results

Several interconnected factors significantly influence the required size of an expansion tank. Understanding these factors is key to accurate sizing and optimal system performance. The expansion tank size calculator takes the most critical ones into account:

  1. Total System Water Volume (Vsystem):

    This is arguably the most critical input. A larger system holds more water, meaning a greater absolute volume of water will expand when heated. Therefore, systems with higher water volumes inherently require larger expansion tanks to manage the increased thermal expansion.

  2. Temperature Range (Tfill to Tmax):

    The greater the difference between the cold fill temperature and the maximum operating temperature, the more the water will expand. A system that operates at very high temperatures (e.g., steam systems, though this calculator is for hydronic) or is filled at very low temperatures will experience a larger volume change and thus need a larger expansion tank. The formula directly incorporates this difference.

  3. System Pressure Range (Pmin to Pmax):

    The acceptable pressure swing in the system dictates how much volume change the tank needs to accommodate. A wider pressure range (e.g., 10 PSI to 30 PSI vs. 12 PSI to 25 PSI) implies a larger potential volume change that the tank must handle. For plain steel tanks, this is a direct input to the calculation; for diaphragm tanks, it influences the selection of the tank's pre-charge pressure, which is implicitly handled by selecting a common range in the calculator.

  4. Type of Expansion Tank:

    Diaphragm or bladder tanks are generally more efficient and require smaller sizes for the same job compared to older plain steel tanks. Plain steel tanks rely solely on compressing a fixed volume of air, which is less predictable and requires a larger air cushion (hence a larger V-e factor). The calculator differentiates between these types.

  5. System Design and Operating Pressures:

    The intended operating pressure of the system is set by the fill pressure (Pmin) and the pressure relief valve setting (which indirectly determines Pmax). Incorrectly setting these pressures, especially the fill pressure, can lead to the expansion tank being ineffective or the system operating unsafely. The pre-charge pressure of the expansion tank should ideally match the minimum system pressure (for diaphragm tanks).

  6. Boiler Horsepower/Btuh Rating:

    While not directly used in the core formula (which focuses on water volume), the boiler's heating capacity is often a proxy for estimating total system water volume, especially in older systems where precise water volume might be unknown. Larger boilers typically serve larger systems.

  7. Location and Installation:

    While not mathematical inputs, factors like the system's elevation (affecting static pressure) and ensuring the tank is installed correctly (e.g., vertically for bladder tanks) are crucial for performance. An improperly installed tank may not function as intended, even if correctly sized.

Accurate input of these factors into an expansion tank calculator ensures reliable system operation and longevity.

Frequently Asked Questions (FAQ)

Q1: How do I find the total water volume of my heating system?

A1: If not specified by the manufacturer, you can estimate it. A common rule of thumb is 1.5 to 2 gallons of water volume per boiler horsepower (or per 50,000 Btuh). Add to this the volume of water in your piping, radiators, or baseboard heaters. For smaller systems, a 50-gallon estimate is often a good starting point. Using the calculator's estimate feature or consulting your HVAC professional is recommended.

Q2: Can I use a larger expansion tank than calculated?

A2: Yes, it is generally safe and often recommended to use an expansion tank that is slightly larger than the calculated minimum requirement. An oversized tank provides a greater safety margin and may extend the tank's lifespan. However, an excessively large tank is usually unnecessary and might offer diminishing returns.

Q3: What happens if my expansion tank is too small?

A3: If an expansion tank is undersized, it cannot accommodate the expanded volume of water as the system heats up. This leads to excessive pressure build-up, which can cause the pressure relief valve to discharge water frequently, potentially leading to water hammer, damage to system components (like the boiler or pumps), and even leaks.

Q4: What is the difference between a diaphragm and a plain steel expansion tank?

A4: Diaphragm/bladder tanks use a flexible rubber membrane to separate the system water from an air cushion, providing better performance and requiring less maintenance. Plain steel tanks have a simple air pocket or baffle within a steel tank; they are older technology, less efficient, and require periodic checking and adjustment of the air charge. Diaphragm tanks are the standard for modern systems.

Q5: How do I determine the pre-charge pressure for a new expansion tank?

A5: For diaphragm/bladder tanks, the pre-charge pressure should typically match the system's minimum cold fill pressure (Pmin). For example, if your system is filled to 12 PSI, the tank should be pre-charged to 12 PSI. Always check the tank manufacturer's specific recommendations. This ensures the tank is properly balanced with the system pressure.

Q6: My system uses Celsius and Bar. Can I use this calculator?

A6: The calculator is primarily set up for US customary units (Gallons, PSI, Fahrenheit). However, the underlying formulas are provided. If you are comfortable with unit conversions, you can convert your Celsius and Bar values to Fahrenheit and PSI before inputting them, or adapt the formulas directly using the absolute zero constants (460 for °F, 273 for °C).

Q7: How often should I check my expansion tank?

A7: For diaphragm/bladder tanks, it's recommended to check the pre-charge pressure annually or whenever the system is serviced. For older plain steel tanks, checking the air pressure might be needed more frequently, perhaps every 6-12 months, as air can be absorbed by the water over time.

Q8: Does the expansion tank size depend on the boiler's BTU output?

A8: Indirectly. The BTU output often correlates with the total water volume of the system. A higher BTU output usually means a larger system with more water, which requires a larger expansion tank. However, the direct calculation uses the total water volume, which is a more precise factor than BTU alone.

© 2023 Your Company Name. All rights reserved.

var systemVolumeInput = document.getElementById('systemVolume'); var coldFillTempInput = document.getElementById('coldFillTemp'); var maxTempInput = document.getElementById('maxTemp'); var pressureRangeSelect = document.getElementById('pressureRange'); var tankTypeSelect = document.getElementById('tankType'); var resultsContainer = document.getElementById('resultsContainer'); var mainResultDiv = document.getElementById('mainResult'); var expansionVolumeDiv = document.getElementById('expansionVolume'); var pressureDropDiv = document.getElementById('pressureDrop'); var acceptanceFactorDiv = document.getElementById('acceptanceFactor'); var assumption1Div = document.getElementById('assumption1'); var assumption2Div = document.getElementById('assumption2'); var assumption3Div = document.getElementById('assumption3'); var assumption4Div = document.getElementById('assumption4'); var tbody = document.querySelector('#sizingTable tbody'); var ctx = document.getElementById('expansionChart').getContext('2d'); var expansionChart = null; // To hold the chart instance // Default values var defaultSystemVolume = 50; var defaultColdFillTemp = 50; var defaultMaxTemp = 180; // Initialize calculator with defaults function initializeCalculator() { systemVolumeInput.value = defaultSystemVolume; coldFillTempInput.value = defaultColdFillTemp; maxTempInput.value = defaultMaxTemp; pressureRangeSelect.value = "12-30"; tankTypeSelect.value = "diaphragm"; populateSizingTable(); updateChart(); } // Function to validate input function validateInput(inputId, errorId, minValue, maxValue) { var input = document.getElementById(inputId); var errorDiv = document.getElementById(errorId); var value = parseFloat(input.value); errorDiv.textContent = "; // Clear previous error if (isNaN(value)) { errorDiv.textContent = 'Please enter a valid number.'; return false; } if (value <= 0) { errorDiv.textContent = 'Value must be positive.'; return false; } if (minValue !== undefined && value maxValue) { errorDiv.textContent = 'Value is too high.'; return false; } return true; } // Function to get pressure range values function getPressureValues() { var rangeStr = pressureRangeSelect.value; var parts = rangeStr.split('-'); return { min: parseFloat(parts[0]), max: parseFloat(parts[1]) }; } // Function to calculate expansion tank size function calculateExpansionTankSize() { var isValid = true; // Clear previous errors document.getElementById('systemVolumeError').textContent = "; document.getElementById('coldFillTempError').textContent = "; document.getElementById('maxTempError').textContent = "; // Validate inputs if (!validateInput('systemVolume', 'systemVolumeError')) isValid = false; if (!validateInput('coldFillTemp', 'coldFillTempError')) isValid = false; if (!validateInput('maxTemp', 'maxTempError')) isValid = false; if (!isValid) { resultsContainer.style.display = 'none'; return; } var systemVolume = parseFloat(systemVolumeInput.value); var coldFillTemp = parseFloat(coldFillTempInput.value); var maxTemp = parseFloat(maxTempInput.value); var tankType = tankTypeSelect.value; var pressureValues = getPressureValues(); var pMin = pressureValues.min; var pMax = pressureValues.max; var expansionVolume = 0; var acceptanceFactor = 0; var formulaUsed = ""; if (tankType === 'diaphragm') { // Formula for Diaphragm/Bladder Tank (using Fahrenheit constant 460) var tempFactor = (maxTemp – coldFillTemp) / (maxTemp + 460 – coldFillTemp); expansionVolume = systemVolume * tempFactor; // Acceptance factor calculation based on pressure range for diaphragm tanks // V-e = (Pmax – Pmin) / (Pmax + Patm) // Simplified calculation often used in practice: acceptanceFactor = (pMax – pMin) / (pMax + 14.7); // Assuming atmospheric pressure ~14.7 PSI formulaUsed = "Vexpansion = Vsystem * ((Tmax – Tfill) / (Tmax + 460 – Tfill)) * 1.1 (for Diaphragm)"; } else { // Plain Steel Tank // Formula for Plain Steel Tank (using pressure) // V-e = (Pmax – Pmin) / (Pmax + Patm) acceptanceFactor = (pMax – pMin) / (pMax + 14.7); expansionVolume = systemVolume * acceptanceFactor; formulaUsed = "Vexpansion = Vsystem * ((Pmax – Pmin) / (Pmax + 14.7)) (for Plain Steel)"; } // Apply safety factor (10%) var safeExpansionVolume = expansionVolume * 1.1; // Determine standard tank sizes (US Gallons) var recommendedTankSize = 0; if (safeExpansionVolume <= 0.5) recommendedTankSize = 2; else if (safeExpansionVolume <= 0.75) recommendedTankSize = 2; // Some systems might use 0.75 gal minimum else if (safeExpansionVolume <= 1) recommendedTankSize = 2; else if (safeExpansionVolume <= 1.5) recommendedTankSize = 2; else if (safeExpansionVolume <= 2) recommendedTankSize = 2; else if (safeExpansionVolume <= 3) recommendedTankSize = 3; else if (safeExpansionVolume <= 4) recommendedTankSize = 4; else if (safeExpansionVolume <= 5) recommendedTankSize = 5; else if (safeExpansionVolume <= 7) recommendedTankSize = 7; else if (safeExpansionVolume <= 10) recommendedTankSize = 11; // Often 11 gal is next std size else if (safeExpansionVolume <= 15) recommendedTankSize = 15; else if (safeExpansionVolume <= 20) recommendedTankSize = 20; else if (safeExpansionVolume <= 25) recommendedTankSize = 25; else if (safeExpansionVolume <= 30) recommendedTankSize = 30; else recommendedTankSize = Math.ceil(safeExpansionVolume / 5) * 5; // Round up to nearest 5 gal for larger sizes // Update results display mainResultDiv.textContent = recommendedTankSize + " Gallons"; expansionVolumeDiv.innerHTML = "Required Expansion Volume: " + safeExpansionVolume.toFixed(2) + " Gallons"; pressureDropDiv.innerHTML = "Pressure Drop: " + (pMax – pMin).toFixed(1) + " PSI"; acceptanceFactorDiv.innerHTML = "Acceptance Factor (V-e): " + acceptanceFactor.toFixed(3); // Update assumptions assumption1Div.innerHTML = "System Water Volume: " + systemVolume + " Gallons"; assumption2Div.innerHTML = "Temperature Range: " + coldFillTemp + "°F to " + maxTemp + "°F"; assumption3Div.innerHTML = "Pressure Range: " + pMin + " PSI to " + pMax + " PSI"; assumption4Div.innerHTML = "Tank Type: " + (tankType === 'diaphragm' ? 'Diaphragm/Bladder' : 'Plain Steel'); // Update formula explanation dynamically document.querySelector('.formula-explanation').innerHTML = "The calculation determines the minimum required expansion volume based on the system' s water volume and the temperature change (or pressure change for steel tanks). The acceptance factor (V-e) is derived from the pressure range and tank type. Formula Used: " + formulaUsed + ". A 10% safety factor is applied."; resultsContainer.style.display = 'flex'; populateSizingTable(); updateChart(); } // Function to populate the sizing table function populateSizingTable() { tbody.innerHTML = "; // Clear existing rows var tableData = [ { volume: 20, reqVolUnit: 1.0, recTank: 2 }, // Example values, actual reqVolUnit depends on temp/pressure { volume: 30, reqVolUnit: 1.5, recTank: 2 }, { volume: 40, reqVolUnit: 2.0, recTank: 2 }, { volume: 50, reqVolUnit: 2.5, recTank: 3 }, { volume: 60, reqVolUnit: 3.0, recTank: 3 }, { volume: 80, reqVolUnit: 4.0, recTank: 4 }, { volume: 100, reqVolUnit: 5.0, recTank: 5 }, { volume: 150, reqVolUnit: 7.5, recTank: 7 }, { volume: 200, reqVolUnit: 10.0, recTank: 11 }, { volume: 300, reqVolUnit: 15.0, recTank: 15 }, { volume: 400, reqVolUnit: 20.0, recTank: 20 }, { volume: 500, reqVolUnit: 25.0, recTank: 25 } ]; // Simplified table population based on common system volumes and typical required expansion // A truly dynamic table would recalculate based on current input parameters, // but this provides a general reference. var systemVolume = parseFloat(systemVolumeInput.value); var coldFillTemp = parseFloat(coldFillTempInput.value); var maxTemp = parseFloat(maxTempInput.value); var tankType = tankTypeSelect.value; var pressureValues = getPressureValues(); var pMin = pressureValues.min; var pMax = pressureValues.max; var standardVolumes = [20, 50, 100, 150, 200, 300, 400, 500]; standardVolumes.forEach(function(vol) { var calculatedExpVol = 0; var safetyFactor = 1.1; if (tankType === 'diaphragm') { var tempFactor = (maxTemp – coldFillTemp) / (maxTemp + 460 – coldFillTemp); calculatedExpVol = vol * tempFactor * safetyFactor; } else { var pressureFactor = (pMax – pMin) / (pMax + 14.7); calculatedExpVol = vol * pressureFactor * safetyFactor; } var recommendedTank = 0; if (calculatedExpVol <= 0.5) recommendedTank = 2; else if (calculatedExpVol <= 0.75) recommendedTank = 2; else if (calculatedExpVol <= 1) recommendedTank = 2; else if (calculatedExpVol <= 1.5) recommendedTank = 2; else if (calculatedExpVol <= 2) recommendedTank = 2; else if (calculatedExpVol <= 3) recommendedTank = 3; else if (calculatedExpVol <= 4) recommendedTank = 4; else if (calculatedExpVol <= 5) recommendedTank = 5; else if (calculatedExpVol <= 7) recommendedTank = 7; else if (calculatedExpVol <= 10) recommendedTank = 11; else if (calculatedExpVol <= 15) recommendedTank = 15; else if (calculatedExpVol <= 20) recommendedTank = 20; else if (calculatedExpVol <= 25) recommendedTank = 25; else if (calculatedExpVol <= 30) recommendedTank = 30; else recommendedTank = Math.ceil(calculatedExpVol / 5) * 5; var row = tbody.insertRow(); var cell1 = row.insertCell(0); var cell2 = row.insertCell(1); var cell3 = row.insertCell(2); cell1.textContent = vol; cell2.textContent = calculatedExpVol.toFixed(2); cell3.textContent = recommendedTank; }); } // Function to update the chart function updateChart() { var systemVolume = parseFloat(systemVolumeInput.value); var coldFillTemp = parseFloat(coldFillTempInput.value); var maxTemp = parseFloat(maxTempInput.value); var tankType = tankTypeSelect.value; var pressureValues = getPressureValues(); var pMin = pressureValues.min; var pMax = pressureValues.max; var volumes = [20, 50, 100, 150, 200, 300, 400, 500]; var requiredVolumesDiaphragm = []; var requiredVolumesSteel = []; var safetyFactor = 1.1; volumes.forEach(function(vol) { // Diaphragm calculation var tempFactor = (maxTemp – coldFillTemp) / (maxTemp + 460 – coldFillTemp); requiredVolumesDiaphragm.push(vol * tempFactor * safetyFactor); // Steel calculation var pressureFactor = (pMax – pMin) / (pMax + 14.7); requiredVolumesSteel.push(vol * pressureFactor * safetyFactor); }); if (expansionChart) { expansionChart.destroy(); } expansionChart = new Chart(ctx, { type: 'line', data: { labels: volumes.map(String), // Volume labels datasets: [{ label: 'Required Volume (Diaphragm Tank)', data: requiredVolumesDiaphragm, borderColor: 'rgb(75, 192, 192)', tension: 0.1, fill: false, pointRadius: 3 }, { label: 'Required Volume (Steel Tank)', data: requiredVolumesSteel, borderColor: 'rgb(255, 99, 132)', tension: 0.1, fill: false, pointRadius: 3 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { title: { display: true, text: 'Required Expansion Volume vs. System Water Volume' }, legend: { position: 'top' } }, scales: { x: { title: { display: true, text: 'System Water Volume (Gallons)' } }, y: { title: { display: true, text: 'Required Expansion Volume (Gallons)' } } } } }); } // Function to reset calculator to default values function resetCalculator() { systemVolumeInput.value = defaultSystemVolume; coldFillTempInput.value = defaultColdFillTemp; maxTempInput.value = defaultMaxTemp; pressureRangeSelect.value = "12-30"; tankTypeSelect.value = "diaphragm"; document.getElementById('systemVolumeError').textContent = ''; document.getElementById('coldFillTempError').textContent = ''; document.getElementById('maxTempError').textContent = ''; resultsContainer.style.display = 'none'; populateSizingTable(); updateChart(); } // Function to copy results function copyResults() { var mainResult = mainResultDiv.textContent; var expVolume = expansionVolumeDiv.textContent.replace('Required Expansion Volume: ', ''); var pressureDrop = pressureDropDiv.textContent.replace('Pressure Drop: ', ''); var acceptanceFactor = acceptanceFactorDiv.textContent.replace('Acceptance Factor (V-e): ', ''); var assumption1 = assumption1Div.textContent; var assumption2 = assumption2Div.textContent; var assumption3 = assumption3Div.textContent; var assumption4 = assumption4Div.textContent; var formulaText = document.querySelector('.formula-explanation').textContent; var copyText = "— Expansion Tank Size Calculation Results —\n\n"; copyText += "Recommended Tank Size: " + mainResult + "\n"; copyText += expVolume + "\n"; copyText += pressureDrop + "\n"; copyText += acceptanceFactor + "\n\n"; copyText += "Key Assumptions:\n"; copyText += assumption1 + "\n"; copyText += assumption2 + "\n"; copyText += assumption3 + "\n"; copyText += assumption4 + "\n\n"; copyText += "Formula Used:\n" + formulaText; // Use navigator.clipboard for modern browsers, fallback to textarea for older ones if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(copyText).then(function() { alert('Results copied to clipboard!'); }).catch(function(err) { console.error('Could not copy text: ', err); fallbackCopyTextToClipboard(copyText); }); } else { fallbackCopyTextToClipboard(copyText); } } function fallbackCopyTextToClipboard(text) { var textArea = document.createElement("textarea"); textArea.value = text; textArea.style.position = "fixed"; // Avoid scrolling to bottom textArea.style.left = "-9999px"; textArea.style.top = "-9999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'successful' : 'unsuccessful'; alert('Results copied to clipboard! (' + msg + ')'); } catch (err) { console.error('Fallback: Oops, unable to copy', err); alert('Failed to copy results.'); } document.body.removeChild(textArea); } // FAQ toggle function function toggleFaq(element) { var p = element.nextElementSibling; p.classList.toggle('show'); } // Initial calculations and chart rendering on page load window.onload = function() { initializeCalculator(); // Initial chart rendering with default values var currentSystemVolume = parseFloat(systemVolumeInput.value); var currentColdFillTemp = parseFloat(coldFillTempInput.value); var currentMaxTemp = parseFloat(maxTempInput.value); var currentTankType = tankTypeSelect.value; var currentPressureValues = getPressureValues(); var currentPMin = currentPressureValues.min; var currentPMax = currentPressureValues.max; var volumes = [20, 50, 100, 150, 200, 300, 400, 500]; var requiredVolumesDiaphragm = []; var requiredVolumesSteel = []; var safetyFactor = 1.1; volumes.forEach(function(vol) { var tempFactor = (currentMaxTemp – currentColdFillTemp) / (currentMaxTemp + 460 – currentColdFillTemp); requiredVolumesDiaphragm.push(vol * tempFactor * safetyFactor); var pressureFactor = (currentPMax – currentPMin) / (currentPMax + 14.7); requiredVolumesSteel.push(vol * pressureFactor * safetyFactor); }); ctx.canvas.parentNode.style.height = '300px'; // Set height for canvas container expansionChart = new Chart(ctx, { type: 'line', data: { labels: volumes.map(String), datasets: [{ label: 'Required Volume (Diaphragm Tank)', data: requiredVolumesDiaphragm, borderColor: 'rgb(75, 192, 192)', tension: 0.1, fill: false, pointRadius: 3 }, { label: 'Required Volume (Steel Tank)', data: requiredVolumesSteel, borderColor: 'rgb(255, 99, 132)', tension: 0.1, fill: false, pointRadius: 3 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { title: { display: true, text: 'Required Expansion Volume vs. System Water Volume' }, legend: { position: 'top' } }, scales: { x: { title: { display: true, text: 'System Water Volume (Gallons)' } }, y: { title: { display: true, text: 'Required Expansion Volume (Gallons)' } } } } }); }; // Add event listeners for real-time updates systemVolumeInput.addEventListener('input', calculateExpansionTankSize); coldFillTempInput.addEventListener('input', calculateExpansionTankSize); maxTempInput.addEventListener('input', calculateExpansionTankSize); pressureRangeSelect.addEventListener('change', calculateExpansionTankSize); tankTypeSelect.addEventListener('change', calculateExpansionTankSize);

Leave a Comment