<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>superheated steam Archives - Chemical Engineering Site</title>
	<atom:link href="https://chemicalengineeringsite.in/tag/superheated-steam/feed/" rel="self" type="application/rss+xml" />
	<link>https://chemicalengineeringsite.in/tag/superheated-steam/</link>
	<description>For Chemical Engineers</description>
	<lastBuildDate>Sun, 14 Sep 2025 05:32:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Superheated Steam Properties Calculator</title>
		<link>https://chemicalengineeringsite.in/superheated-steam-properties-calculator/</link>
		
		<dc:creator><![CDATA[chemicalengineeringsite]]></dc:creator>
		<pubDate>Sun, 14 Sep 2025 05:32:06 +0000</pubDate>
				<category><![CDATA[Calculators]]></category>
		<category><![CDATA[chemical engineering]]></category>
		<category><![CDATA[enthalpy]]></category>
		<category><![CDATA[entropy]]></category>
		<category><![CDATA[Process engineering]]></category>
		<category><![CDATA[specific volume]]></category>
		<category><![CDATA[steam properties calculator]]></category>
		<category><![CDATA[steam tables]]></category>
		<category><![CDATA[superheated steam]]></category>
		<category><![CDATA[thermodynamics]]></category>
		<guid isPermaLink="false">https://chemicalengineeringsite.in/?p=4060</guid>

					<description><![CDATA[<p>Superheated Steam Properties Calculator Enter Pressure with either Temperature or Degree of Superheat. Calculates v, ρ, h, s, u and heat capacities (Cp, Cv, k). Exports to Excel with live formulas. Input Mode Pressure + Temperature Pressure + Superheat (ΔT) Pressure bar(a)kPa(a)MPa(a) Valid: 0.06–221 bar(a) Temperature °CK ≥ Tsat at given P Degree of Superheat [&#8230;]</p>
<p>The post <a href="https://chemicalengineeringsite.in/superheated-steam-properties-calculator/">Superheated Steam Properties Calculator</a> appeared first on <a href="https://chemicalengineeringsite.in">Chemical Engineering Site</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<!-- Superheated Steam Properties Calculator + Excel Export (Pump theme, robust Excel Newton block with clamped T) -->
<div id="shsc" class="psc-card" role="region" aria-label="Superheated Steam Properties Calculator">
  <div class="psc-header">
    <h3 class="psc-title">Superheated Steam Properties Calculator</h3>
    <p class="psc-sub">Enter Pressure with either Temperature or Degree of Superheat. Calculates v, ρ, h, s, u and heat capacities (Cp, Cv, k). Exports to Excel with live formulas.</p>
  </div>

  <form class="psc-form" onsubmit="return false;">
    <fieldset class="psc-fieldset" style="border:1px dashed var(--b);border-radius:12px;padding:.6rem .7rem">
      <legend class="psc-sub">Input Mode</legend>
      <div class="psc-inline">
        <label class="psc-radio" style="display:flex;align-items:center;gap:.45rem;margin-right:1rem;color:var(--t)">
          <input type="radio" name="shsc-mode" value="PT" checked /> <span>Pressure + Temperature</span>
        </label>
        <label class="psc-radio" style="display:flex;align-items:center;gap:.45rem;margin-right:1rem;color:var(--t)">
          <input type="radio" name="shsc-mode" value="PSH" /> <span>Pressure + Superheat (ΔT)</span>
        </label>
      </div>
    </fieldset>

    <div class="psc-grid">
      <!-- Pressure -->
      <label class="psc-field">
        <span>Pressure</span>
        <div class="psc-inline">
          <input id="shsc-p" type="number" step="any" min="0" placeholder="e.g., 10" required />
          <select id="shsc-punit" aria-label="Pressure unit">
            <option value="bar" selected>bar(a)</option>
            <option value="kPa">kPa(a)</option>
            <option value="MPa">MPa(a)</option>
          </select>
        </div>
        <small class="psc-hint">Valid: 0.06–221 bar(a)</small>
      </label>

      <!-- Temperature (for PT) -->
      <label class="psc-field" id="shsc-Tbox">
        <span>Temperature</span>
        <div class="psc-inline">
          <input id="shsc-T" type="number" step="any" placeholder="e.g., 450" />
          <select id="shsc-Tunit" aria-label="Temperature unit">
            <option value="C" selected>°C</option>
            <option value="K">K</option>
          </select>
        </div>
        <small class="psc-hint">≥ T<sub>sat</sub> at given P</small>
      </label>

      <!-- Superheat (for PSH) -->
      <label class="psc-field" id="shsc-SHbox" style="display:none">
        <span>Degree of Superheat (ΔT)</span>
        <div class="psc-inline">
          <input id="shsc-SH" type="number" step="any" placeholder="e.g., 50" />
          <span class="psc-unit">°C</span>
        </div>
        <small class="psc-hint">ΔT ≥ 0 (final T = T<sub>sat</sub> + ΔT)</small>
      </label>
    </div>

    <div class="psc-actions">
      <button type="button" id="shsc-calc" class="psc-btn">Calculate</button>
      <button type="button" id="shsc-export" class="psc-btn psc-btn-ghost" title="Export Excel with formulas"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4ca.png" alt="📊" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Export Excel</button>
      <button type="button" id="shsc-reset" class="psc-btn psc-btn-ghost">Reset</button>
      <button type="button" id="shsc-copy" class="psc-btn psc-btn-ghost" title="Copy results">Copy</button>
    </div>
  </form>

  <div class="psc-results" aria-live="polite">
    <!-- Saturation + superheat -->
    <div class="psc-result"><div class="psc-result-label">Saturation Temperature at P (T<sub>sat</sub>)</div><div class="psc-result-value"><span id="shsc-Tsat">–</span></div></div>
    <div class="psc-result"><div class="psc-result-label">Actual Temperature (T)</div><div class="psc-result-value"><span id="shsc-Tact">–</span></div></div>
    <div class="psc-result"><div class="psc-result-label">Degree of Superheat (ΔT)</div><div class="psc-result-value"><span id="shsc-DTO">–</span></div></div>

    <!-- Properties -->
    <div class="psc-result"><div class="psc-result-label">Specific Volume v (m³/kg)</div><div class="psc-result-value"><span id="shsc-v">–</span></div></div>
    <div class="psc-result"><div class="psc-result-label">Density ρ (kg/m³)</div><div class="psc-result-value"><span id="shsc-rho">–</span></div></div>
    <div class="psc-result"><div class="psc-result-label">Enthalpy h (kJ/kg)</div><div class="psc-result-value"><span id="shsc-h">–</span></div></div>
    <div class="psc-result"><div class="psc-result-label">Entropy s (kJ/kg·K)</div><div class="psc-result-value"><span id="shsc-s">–</span></div></div>
    <div class="psc-result"><div class="psc-result-label">Internal Energy u (kJ/kg)</div><div class="psc-result-value"><span id="shsc-u">–</span></div></div>

    <div class="psc-result"><div class="psc-result-label">Isobaric Heat Capacity C<sub>p</sub> (kJ/kg·K)</div><div class="psc-result-value"><span id="shsc-cp">–</span></div></div>
    <div class="psc-result"><div class="psc-result-label">Isochoric Heat Capacity C<sub>v</sub> (kJ/kg·K)</div><div class="psc-result-value"><span id="shsc-cv">–</span></div></div>
    <div class="psc-result"><div class="psc-result-label">Heat Capacity Ratio k = C<sub>p</sub>/C<sub>v</sub></div><div class="psc-result-value"><span id="shsc-k">–</span></div></div>

    <div id="shsc-note" class="psc-note"></div>
  </div>

  <details class="psc-details">
    <summary>Formula &#038; correlation notes</summary>
    <ul>
      <li><strong>Saturation (for T<sub>sat</sub>):</strong> IAPWS Wagner-type p(T); for T from P use Newton with central derivative.</li>
      <li><strong>Ideal gas:</strong> v = R·T/P (with P in bar → ×100 to kPa); ρ = 1/v.</li>
      <li><strong>Enthalpy (superheated):</strong> h ≈ C<sub>p</sub>·T + h₀ with h(100 °C,sat)=2676 kJ/kg ⇒ h₀ = 2676 − C<sub>p</sub>·T<sub>ref</sub>.</li>
      <li><strong>Entropy (superheated):</strong> s ≈ s<sub>g,ref</sub> + C<sub>p</sub>·ln(T/T<sub>ref</sub>) − R·ln(P/P<sub>ref</sub>).</li>
      <li><strong>Internal energy:</strong> u = h − P·v (P in kPa, v in m³/kg → kJ/kg).</li>
      <li><strong>Heat capacities:</strong> C<sub>v</sub> = C<sub>p</sub> − R; k = C<sub>p</sub>/C<sub>v</sub>. (Single-average C<sub>p</sub> used.)</li>
    </ul>
  </details>

  <footer class="psc-footer">
    <small>Credit: <a href="https://chemicalengineeringsite.in/" target="_blank" rel="noopener">chemicalengineeringsite.in</a></small>
  </footer>
</div>

<style>
  /* Pump Specific Speed theme tokens */
  .psc-card{--b:#e6eef6;--t:#0f172a;--muted:#475569;--a:#2563eb;--bg:#ffffff;max-width:860px;margin:1.25rem auto;padding:1.25rem;border:1px solid var(--b);border-radius:16px;background:var(--bg);box-shadow:0 6px 20px rgba(2,6,23,.06)}
  .psc-title{margin:.25rem 0;font-size:1.25rem;color:var(--t)}
  .psc-sub{margin:0;color:var(--muted)}
  .psc-form{margin-top:.75rem}
  .psc-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
  @media (max-width:860px){.psc-grid{grid-template-columns:1fr}}
  .psc-field{display:flex;flex-direction:column;gap:6px}
  .psc-field span{font-weight:600;color:var(--t)}
  .psc-inline{display:flex;gap:8px;align-items:center}
  .psc-field input,.psc-field select{width:100%;padding:.6rem .7rem;border:1px solid var(--b);border-radius:10px;background:#fff;color:var(--t)}
  .psc-unit{color:var(--muted)}
  .psc-actions{display:flex;gap:10px;margin-top:.75rem;flex-wrap:wrap}
  .psc-btn{border:1px solid var(--a);background:var(--a);color:#fff;border-radius:999px;padding:.55rem .9rem;font-weight:600;cursor:pointer}
  .psc-btn-ghost{background:#fff;color:var(--a)}
  .psc-results{margin-top:1rem;border-top:1px dashed var(--b);padding-top:.9rem}
  .psc-result{display:flex;justify-content:space-between;align-items:center;margin:.35rem 0}
  .psc-result-label{color:var(--muted)}
  .psc-result-value{font-size:1.1rem;font-weight:700;color:var(--t)}
  .psc-note{margin-top:.4rem;color:#b45309}
  .psc-details{margin-top:.6rem}
  .psc-footer{margin-top:.6rem;color:var(--muted)}
</style>

<!-- SheetJS for Excel export -->
<script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>

<script>
(function(){
  const $ = id => document.getElementById(id);
  const EL = {
    mode:  () => document.querySelector('input[name="shsc-mode"]:checked')?.value || 'PT',
    p: $('shsc-p'), pUnit: $('shsc-punit'),
    T: $('shsc-T'), TUnit: $('shsc-Tunit'),
    SH: $('shsc-SH'),
    Tbox: $('shsc-Tbox'), SHbox: $('shsc-SHbox'),
    btnCalc: $('shsc-calc'), btnExport: $('shsc-export'),
    btnReset: $('shsc-reset'), btnCopy: $('shsc-copy'),
    Tsat: $('shsc-Tsat'), Tact: $('shsc-Tact'), DTO: $('shsc-DTO'),
    v: $('shsc-v'), rho: $('shsc-rho'), h: $('shsc-h'), s: $('shsc-s'), u: $('shsc-u'),
    cp: $('shsc-cp'), cv: $('shsc-cv'), k: $('shsc-k'),
    note: $('shsc-note')
  };

  // Thermo constants (consistent HTML & Excel)
  const Tc = 647.096, pc_bar = 220.64;
  const R = 0.461526;          // kJ/(kg·K)
  const cp = 2.08;             // kJ/(kg·K) average superheated Cp
  const Tref = 373.15, pref_bar = 1.01325, hg_ref = 2676.0, sg_ref = 7.354;
  const h0 = hg_ref - cp*Tref; // calibration so h=2676 at 100 °C
  const a = [-7.85951783, 1.84408259, -11.7866497, 22.6807411, -15.9618719, 1.80122502];

  const round = (v,dp=3)=>Number.isFinite(v)?(Math.round(v*10**dp)/10**dp).toFixed(dp):'–';
  const C2K = C=>C+273.15, K2C = K=>K-273.15;

  function p_sat_from_T(T_K){
    const tau = 1 - (T_K/Tc);
    const ln_pr = (Tc/T_K) * (a[0]*tau + a[1]*tau**1.5 + a[2]*tau**3 + a[3]*tau**3.5 + a[4]*tau**4 + a[5]*tau**7.5);
    return Math.exp(ln_pr)*pc_bar;
  }
  function T_sat_from_p(p_bar){
    let T = Math.min(Math.max(273.15 + 100*(p_bar/pref_bar)**0.25, 273.15), Tc-0.01);
    for(let i=0;i<30;i++){
      const dT=0.005, f=p_sat_from_T(T)-p_bar;
      const dp=(p_sat_from_T(T+dT)-p_sat_from_T(T-dT))/(2*dT);
      if(!isFinite(dp)||Math.abs(dp)<1e-7) break;
      const step=f/dp; T = Math.min(Math.max(T - step, 273.15), Tc-1e-6);
      if(Math.abs(step)<1e-6) break;
    }
    return T;
  }

  function to_bar(p, unit){ if(unit==='bar') return p; if(unit==='kPa') return p/100; if(unit==='MPa') return p*10; return NaN; }
  function T_from_input(val, unit){ return unit==='K' ? val : val+273.15; }

  function calculate(){
    const mode = EL.mode();
    const p_in = Number(EL.p.value);
    if(!isFinite(p_in) || p_in<=0){ EL.note.textContent='Enter a valid positive Pressure.'; return; }
    const Pbar = to_bar(p_in, EL.pUnit.value);
    if(!(Pbar>0) || Pbar<0.06 || Pbar>221){ EL.note.textContent='Pressure must be between 0.06 and 221 bar(a).'; return; }

    const TsatK = T_sat_from_p(Pbar);

    let T_K;
    if(mode==='PT'){
      const Tin = Number(EL.T.value);
      if(!isFinite(Tin)){ EL.note.textContent='Enter a valid Temperature.'; return; }
      T_K = T_from_input(Tin, EL.TUnit.value);
      if(T_K < TsatK){ EL.note.textContent='Superheated requires T ≥ T_sat at given P.'; return; }
    }else{
      const dT = Number(EL.SH.value);
      if(!isFinite(dT) || dT<0){ EL.note.textContent='Enter ΔT ≥ 0.'; return; }
      T_K = TsatK + dT; // ΔT in °C equals K difference
    }

    // Properties (ideal-gas superheated)
    const v = (R*T_K)/(Pbar*100);      // m³/kg (bar→kPa)
    const rho = 1/v;
    const h = cp*T_K + h0;             // kJ/kg
    const s = sg_ref + cp*Math.log(T_K/Tref) - R*Math.log(Pbar/pref_bar);
    const u = h - (Pbar*100)*v;        // kJ/kg (kPa·m³/kg)
    const cv = cp - R;
    const k = cp / cv;

    // Outputs
    EL.Tsat.textContent = `${round(K2C(TsatK),3)} °C`;
    EL.Tact.textContent = `${round(K2C(T_K),3)} °C`;
    EL.DTO.textContent  = `${round(T_K - TsatK,3)} °C`;
    EL.v.textContent    = round(v,6);
    EL.rho.textContent  = round(rho,5);
    EL.h.textContent    = round(h,2);
    EL.s.textContent    = round(s,4);
    EL.u.textContent    = round(u,2);
    EL.cp.textContent   = round(cp,4);
    EL.cv.textContent   = round(cv,4);
    EL.k.textContent    = round(k,4);
    EL.note.textContent = '';

    window.__shsc_state = { mode, Pbar, TsatK, TK:T_K, cp };
  }

  function reset(){
    EL.p.value=''; EL.pUnit.value='bar';
    EL.T.value=''; EL.TUnit.value='C';
    EL.SH.value='';
    ['Tsat','Tact','DTO','v','rho','h','s','u','cp','cv','k'].forEach(k=>EL[k].textContent='–');
    EL.note.textContent='';
    window.__shsc_state = null;
  }

  function copyResults(){
    const txt = `Superheated Steam Properties
-----------------------------
T_sat (°C): ${EL.Tsat.textContent}
T (°C): ${EL.Tact.textContent}
ΔT (°C): ${EL.DTO.textContent}
v (m³/kg): ${EL.v.textContent}
ρ (kg/m³): ${EL.rho.textContent}
h (kJ/kg): ${EL.h.textContent}
s (kJ/kg·K): ${EL.s.textContent}
u (kJ/kg): ${EL.u.textContent}
Cp (kJ/kg·K): ${EL.cp.textContent}
Cv (kJ/kg·K): ${EL.cv.textContent}
k = Cp/Cv: ${EL.k.textContent}`;
    navigator.clipboard?.writeText(txt).then(()=>{
      EL.note.style.color='#16a34a'; EL.note.textContent='Results copied.'; setTimeout(()=>{EL.note.textContent=''; EL.note.style.color='';},1400);
    }).catch(()=>{
      EL.note.style.color='#b45309'; EL.note.textContent='Copy failed. Select and copy manually.';
    });
  }

  // Excel export (label-safe + clamped central difference so no #NUM! near Tc)
  function exportExcel(){
    const s = window.__shsc_state;
    if(!s){ EL.note.style.color='#b45309'; EL.note.textContent='Calculate first.'; return; }

    const modeStr = s.mode;
    const A = [
      ['Superheated Steam Properties (dynamic Excel)','','',''],
      ['','','',''],
      ['Mode ("PT" or "PSH")', modeStr,'',''],
      ['Pressure Input (bar a)', s.Pbar, 'bar',''],
      ['Temperature Input (°C)', modeStr==='PT' ? +(s.TK-273.15).toFixed(6) : '', '°C','Only used in PT mode'],
      ['Degree of Superheat ΔT (°C)', modeStr==='PSH' ? +(s.TK - s.TsatK).toFixed(6) : '', '°C','Only used in PSH mode'],
      ['','','',''],

      // Constants
      ['Constants','Value','Units',''],
      ['Critical Temperature (Tc)', 647.096, 'K',''],
      ['Critical Pressure (pc)', 220.64, 'bar',''],
      ['Gas Constant (steam, R)', 0.461526, 'kJ/(kg·K)',''],
      ['Superheated Cp (Cp)', s.cp ?? 2.08, 'kJ/(kg·K)',''],
      ['Reference Temperature (T_ref)', 373.15, 'K',''],
      ['Reference Pressure (p_ref)', 1.01325, 'bar',''],
      ['Reference h_g at 100°C', 2676, 'kJ/kg',''],
      ['Reference s_g at 100°C', 7.354, 'kJ/(kg·K)',''],
      ['h0 = h_g,ref - Cp*T_ref', {t:'n', f:'B14 - B12*B13'}, 'kJ/kg',''],
      ['','','',''],

      // Saturation at P: T_from_P via Newton
      ['ΔT_derive (K)', 0.005, 'K',''],
      ['P_in (bar)', {t:'n', f:'B4'}, 'bar',''],
      ['T0 (K) seed', '', 'K','MAX(273.15, MIN(B9-0.01, 273.15 + 100*POWER(B17/B15,0.25)))'],
      ['p(T0) (bar)', '', 'bar',''],
      ['dp/dT @T0', '', 'bar/K',''],
      ['T1 (K)', '', 'K',''],
      ['p(T1) (bar)', '', 'bar',''],
      ['dp/dT @T1', '', 'bar/K',''],
      ['T2 (K)', '', 'K',''],
      ['p(T2) (bar)', '', 'bar',''],
      ['dp/dT @T2', '', 'bar/K',''],
      ['T3 (K)', '', 'K',''],
      ['p(T3) (bar)', '', 'bar',''],
      ['dp/dT @T3', '', 'bar/K',''],
      ['T4 (K)', '', 'K',''],
      ['p(T4) (bar)', '', 'bar',''],
      ['dp/dT @T4', '', 'bar/K',''],
      ['T_sat at P (K)', '', 'K','Newton result'],
      ['T_sat (°C)', '', '°C','T_satK-273.15'],
      ['','','',''],

      // Effective T & P by Mode
      ['T_mode (K)', '', 'K','IF(Mode="PT", T_in_C+273.15, T_satK + dT_input)'],
      ['P_mode (bar)', '', 'bar','=P_in'],
      ['Degree of Superheat (°C)', '', '°C','T_modeK - T_satK'],
      ['','','',''],

      // RESULTS
      ['Property','Value','Units','Formula'],
      ['Saturation Temperature (°C)', '', '°C', 'T_satK-273.15'],
      ['Actual Temperature (°C)', '', '°C', 'T_modeK-273.15'],
      ['Degree of Superheat (°C)', '', '°C', 'T_modeK - T_satK'],
      ['Specific Volume v', '', 'm³/kg', 'R*T_modeK/(P_mode*100)'],
      ['Density ρ', '', 'kg/m³', '1/v'],
      ['Enthalpy h', '', 'kJ/kg', 'Cp*T_modeK + h0'],
      ['Entropy s', '', 'kJ/kg·K', 's_g,ref + Cp*ln(T_modeK/T_ref) - R*ln(P_mode/p_ref)'],
      ['Internal Energy u', '', 'kJ/kg', 'h - (P_mode*100)*v'],
      ['Cp', '', 'kJ/kg·K', 'constant'],
      ['Cv', '', 'kJ/kg·K', 'Cp - R'],
      ['k = Cp/Cv', '', '-', 'Cp/Cv'],
      ['','','',''],
      ['Source: chemicalengineeringsite.in','','','']
    ];

    const ws = XLSX.utils.aoa_to_sheet(A);
    ws['!cols'] = [{wch:44},{wch:22},{wch:14},{wch:46}];
    ws['!freeze'] = { xSplit: 1, ySplit: 7 };

    // Find a row by label (Col A)
    function rowOf(label){
      for(const addr in ws){
        if(!/^[A-Z]+\d+$/.test(addr)) continue;
        if(addr.startsWith('A') && ws[addr] && ws[addr].v === label) return parseInt(addr.replace(/^[A-Z]+/,''),10);
      }
      return null;
    }
    const setB = (r,f)=>{ ws['B'+r] = {t:'n', f}; };

    // Constants rows
    const rTc=rowOf('Critical Temperature (Tc)'),
          rpc=rowOf('Critical Pressure (pc)'),
          rR =rowOf('Gas Constant (steam, R)'),
          rCp=rowOf('Superheated Cp (Cp)'),
          rTref=rowOf('Reference Temperature (T_ref)'),
          rPref=rowOf('Reference Pressure (p_ref)'),
          rhgref=rowOf('Reference h_g at 100°C'),
          rsgref=rowOf('Reference s_g at 100°C'),
          rh0=rowOf('h0 = h_g,ref - Cp*T_ref');

    // Newton rows
    const rDelta=rowOf('ΔT_derive (K)'),
          rPin=rowOf('P_in (bar)'),
          rT0=rowOf('T0 (K) seed'),
          rPT0=rowOf('p(T0) (bar)'),
          rdp0=rowOf('dp/dT @T0'),
          rT1=rowOf('T1 (K)'),
          rPT1=rowOf('p(T1) (bar)'),
          rdp1=rowOf('dp/dT @T1'),
          rT2=rowOf('T2 (K)'),
          rPT2=rowOf('p(T2) (bar)'),
          rdp2=rowOf('dp/dT @T2'),
          rT3=rowOf('T3 (K)'),
          rPT3=rowOf('p(T3) (bar)'),
          rdp3=rowOf('dp/dT @T3'),
          rT4=rowOf('T4 (K)'),
          rPT4=rowOf('p(T4) (bar)'),
          rdp4=rowOf('dp/dT @T4'),
          rTsatK=rowOf('T_sat at P (K)'),
          rTsatC=rowOf('T_sat (°C)');

    // Mode rows
    const rMode=rowOf('Mode ("PT" or "PSH")'),
          rTinC=rowOf('Temperature Input (°C)'),
          rdTin=rowOf('Degree of Superheat ΔT (°C)'),
          rTmode=rowOf('T_mode (K)'),
          rPmode=rowOf('P_mode (bar)'),
          rSH=rowOf('Degree of Superheat (°C)');

    // Results rows
    const rRes_TsatC=rowOf('Saturation Temperature (°C)'),
          rRes_TactC=rowOf('Actual Temperature (°C)'),
          rRes_dT=rowOf('Degree of Superheat (°C)'),
          rRes_v=rowOf('Specific Volume v'),
          rRes_rho=rowOf('Density ρ'),
          rRes_h=rowOf('Enthalpy h'),
          rRes_s=rowOf('Entropy s'),
          rRes_u=rowOf('Internal Energy u'),
          rRes_Cp=rowOf('Cp'),
          rRes_Cv=rowOf('Cv'),
          rRes_k=rowOf('k = Cp/Cv');

    // Wagner p(T) helper that clamps temperature inside Excel to [273.15, Tc-1E-6]
    function p_of_expr(Texpr){
      const Tclip = `MAX(273.15, MIN(${Texpr}, B${rTc}-1E-6))`;
      return `EXP((B${rTc}/${Tclip})*( -7.85951783*(1-${Tclip}/B${rTc}) + 1.84408259*POWER(1-${Tclip}/B${rTc},1.5) -11.7866497*POWER(1-${Tclip}/B${rTc},3) +22.6807411*POWER(1-${Tclip}/B${rTc},3.5) -15.9618719*POWER(1-${Tclip}/B${rTc},4) +1.80122502*POWER(1-${Tclip}/B${rTc},7.5) ))*B${rpc}`;
    }
    const dpdt = (Trow) => `( ${p_of_expr(`(B${Trow}+B${rDelta})`)} - ${p_of_expr(`(B${Trow}-B${rDelta})`)} )/(2*B${rDelta})`;

    // Newton iterations (all guarded by clamp inside p_of_expr)
    setB(rT0,  `MAX(273.15, MIN(B${rTc}-0.01, 273.15 + 100*POWER(B${rPin}/B${rPref},0.25)))`);
    setB(rPT0, p_of_expr(`B${rT0}`));
    setB(rdp0, dpdt(rT0));
    setB(rT1,  `MAX(273.15, MIN(B${rTc}-1E-6, B${rT0} - (B${rPT0}-B${rPin})/B${rdp0}))`);
    setB(rPT1, p_of_expr(`B${rT1}`));
    setB(rdp1, dpdt(rT1));
    setB(rT2,  `MAX(273.15, MIN(B${rTc}-1E-6, B${rT1} - (B${rPT1}-B${rPin})/B${rdp1}))`);
    setB(rPT2, p_of_expr(`B${rT2}`));
    setB(rdp2, dpdt(rT2));
    setB(rT3,  `MAX(273.15, MIN(B${rTc}-1E-6, B${rT2} - (B${rPT2}-B${rPin})/B${rdp2}))`);
    setB(rPT3, p_of_expr(`B${rT3}`));
    setB(rdp3, dpdt(rT3));
    setB(rT4,  `MAX(273.15, MIN(B${rTc}-1E-6, B${rT3} - (B${rPT3}-B${rPin})/B${rdp3}))`);
    setB(rPT4, p_of_expr(`B${rT4}`));
    setB(rdp4, dpdt(rT4));
    setB(rTsatK, `MAX(273.15, MIN(B${rTc}-1E-6, B${rT4} - (B${rPT4}-B${rPin})/B${rdp4}))`);
    setB(rTsatC, `B${rTsatK}-273.15`);

    // Effective T & P
    setB(rTmode, `IF(B${rMode}="PT", B${rTinC}+273.15, B${rTsatK} + B${rdTin})`);
    setB(rPmode, `B${rPin}`);
    setB(rSH,    `B${rTmode} - B${rTsatK}`);

    // Results
    setB(rRes_TsatC, `B${rTsatK}-273.15`);
    setB(rRes_TactC, `B${rTmode}-273.15`);
    setB(rRes_dT,    `B${rTmode}-B${rTsatK}`);
    setB(rRes_v,     `B${rR}*B${rTmode}/(B${rPmode}*100)`);
    setB(rRes_rho,   `1/B${rRes_v}`);
    setB(rRes_h,     `B${rCp}*B${rTmode} + B${rh0}`);
    setB(rRes_s,     `B${rsgref} + B${rCp}*LN(B${rTmode}/B${rTref}) - B${rR}*LN(B${rPmode}/B${rPref})`);
    setB(rRes_u,     `B${rRes_h} - (B${rPmode}*100)*B${rRes_v}`);
    setB(rRes_Cp,    `B${rCp}`);
    setB(rRes_Cv,    `B${rCp} - B${rR}`);
    setB(rRes_k,     `B${rRes_Cp}/B${rRes_Cv}`);

    // Clickable source
    const lastRow = Math.max(...Object.keys(ws).filter(k=>/^[A-Z]+\d+$/.test(k)).map(k=>+k.replace(/^[A-Z]+/,'')));
    ws['A'+lastRow] = { t:'s', v:'Source: chemicalengineeringsite.in', l:{ Target:'https://chemicalengineeringsite.in/' } };

    const wb = XLSX.utils.book_new();
    XLSX.utils.book_append_sheet(wb, ws, 'Superheated');
    const ts = new Date().toISOString().slice(0,19).replace(/[:T]/g,'-');
    XLSX.writeFile(wb, `superheated_steam_dynamic_${ts}.xlsx`);
  }

  // Wire up
  EL.btnCalc.addEventListener('click', calculate);
  EL.btnReset.addEventListener('click', reset);
  EL.btnCopy.addEventListener('click', copyResults);
  EL.btnExport.addEventListener('click', exportExcel);

  // Toggle input boxes by mode
  Array.from(document.querySelectorAll('input[name="shsc-mode"]')).forEach(r=>{
    r.addEventListener('change', ()=>{
      const m = EL.mode();
      if(m==='PT'){ EL.Tbox.style.display='block'; EL.SHbox.style.display='none'; }
      else{ EL.Tbox.style.display='none'; EL.SHbox.style.display='block'; }
      reset();
    });
  });

  // Enter to calculate
  ['shsc-p','shsc-T','shsc-SH'].forEach(id=>{
    const node=$(id); if(!node) return;
    node.addEventListener('keydown', e=>{ if(e.key==='Enter'){ e.preventDefault(); calculate(); } });
  });
})();
</script>

<p>The post <a href="https://chemicalengineeringsite.in/superheated-steam-properties-calculator/">Superheated Steam Properties Calculator</a> appeared first on <a href="https://chemicalengineeringsite.in">Chemical Engineering Site</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
