<?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>Ammonia Equilibrium Curve Archives - Chemical Engineering Site</title>
	<atom:link href="https://chemicalengineeringsite.in/tag/ammonia-equilibrium-curve/feed/" rel="self" type="application/rss+xml" />
	<link>https://chemicalengineeringsite.in/tag/ammonia-equilibrium-curve/</link>
	<description>For Chemical Engineers</description>
	<lastBuildDate>Sun, 31 Aug 2025 15:27:17 +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>Ammonia &#8211; Equilibrium Vapour Pressure and Temperature Calculator</title>
		<link>https://chemicalengineeringsite.in/ammonia-equilibrium-vapour-pressure-and-temperature-calculator/</link>
					<comments>https://chemicalengineeringsite.in/ammonia-equilibrium-vapour-pressure-and-temperature-calculator/#respond</comments>
		
		<dc:creator><![CDATA[chemicalengineeringsite]]></dc:creator>
		<pubDate>Sat, 30 Aug 2025 12:00:00 +0000</pubDate>
				<category><![CDATA[Calculators]]></category>
		<category><![CDATA[Ammonia Equilibrium Curve]]></category>
		<category><![CDATA[Ammonia Saturation Pressure Calculator]]></category>
		<category><![CDATA[Ammonia Saturation Temperature Calculator]]></category>
		<guid isPermaLink="false">https://chemicalengineeringsite.in/?p=3882</guid>

					<description><![CDATA[<p>NH₃ Vapor Pressure ⇆ Saturation Temperature Enter either Temperature or Pressure. Choose pressure basis (Absolute or Gauge). Excel export includes live formulas. Temperature Unit °CK°F Pressure Unit barkPaMPakg/cm²psi Pressure Basis AbsoluteGauge Temperature (input if T→P) Pressure (input if P→T) Calculate &#x1f4ca; Export Excel Reset Copy Result Temperature– Result Pressure– Method (Antoine, NH₃) Form: log10(P_bar_abs) = [&#8230;]</p>
<p>The post <a href="https://chemicalengineeringsite.in/ammonia-equilibrium-vapour-pressure-and-temperature-calculator/">Ammonia &#8211; Equilibrium Vapour Pressure and Temperature Calculator</a> appeared first on <a href="https://chemicalengineeringsite.in">Chemical Engineering Site</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<!-- NH3 Vapor Pressure ⇆ Saturation Temperature — P&#x2194;T with Abs/Gauge & Excel | chemicalengineeringsite.in -->
<div class="card" id="nh3pt">
  <h3>NH₃ Vapor Pressure ⇆ Saturation Temperature</h3>
  <p class="sub">
    Enter either <b>Temperature</b> <em>or</em> <b>Pressure</b>. Choose pressure basis (Absolute or Gauge). Excel export includes live formulas.
  </p>

  <form onsubmit="return false;">
    <div class="grid">
      <label><span>Temperature Unit</span>
        <select id="uT">
          <option value="C" selected>°C</option>
          <option value="K">K</option>
          <option value="F">°F</option>
        </select>
      </label>

      <label><span>Pressure Unit</span>
        <select id="uP">
          <option value="bar" selected>bar</option>
          <option value="kPa">kPa</option>
          <option value="MPa">MPa</option>
          <option value="kgcm2">kg/cm²</option>
          <option value="psi">psi</option>
        </select>
      </label>

      <label><span>Pressure Basis</span>
        <select id="pBasis">
          <option value="abs" selected>Absolute</option>
          <option value="gauge">Gauge</option>
        </select>
      </label>

      <span></span>

      <label><span>Temperature (input if T→P)</span>
        <input id="Tin" type="number" step="any" placeholder="e.g., 25">
      </label>
      <label><span>Pressure (input if P→T)</span>
        <input id="Pin" type="number" step="any" placeholder="e.g., 10">
      </label>

      <button id="calc" type="button" class="btn">Calculate</button>
      <div class="actions-right">
        <button id="xlsx" type="button" class="btn ghost" title="Export Excel with live 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 id="reset" type="button" class="btn ghost">Reset</button>
        <button id="copy"  type="button" class="btn ghost">Copy</button>
      </div>
    </div>
  </form>

  <div id="badges" class="badges"></div>

  <div class="results" aria-live="polite">
    <div class="row"><span>Result Temperature</span><strong id="Tout">–</strong></div>
    <div class="row"><span>Result Pressure</span><strong id="Pout">–</strong></div>
  </div>

  <details class="notes">
    <summary>Method (Antoine, NH₃)</summary>
    <ul>
      <li>Form: <code>log10(P_bar_abs) = A − B/(T_K + C)</code></li>
      <li>Ranges:
        <ul>
          <li>164.0–239.6 K: A=3.18757, B=506.713, C=−80.78</li>
          <li>239.6–371.5 K: A=4.86886, B=1113.928, C=−10.409</li>
        </ul>
      </li>
      <li>Invert: <code>T_K = B/(A − log10(P_bar_abs)) − C</code></li>
      <li>Atmospheric pressure (gauge<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2194.png" alt="↔" class="wp-smiley" style="height: 1em; max-height: 1em;" />absolute): <b>1.01325 bar</b>.</li>
    </ul>
  </details>

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

<style>
  .card{--b:#e6eef6;--t:#0f172a;--a:#2563eb;--muted:#475569;max-width:900px;margin:1rem auto;padding:1rem;border:1px solid var(--b);border-radius:14px;background:#fff;box-shadow:0 6px 20px rgba(2,6,23,.06)}
  h3{margin:.2rem 0}.sub{color:var(--muted);margin:.25rem 0}
  .grid{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;gap:12px;align-items:end}
  @media(max-width:900px){.grid{grid-template-columns:1fr 1fr}}
  label{display:flex;flex-direction:column;gap:6px}
  input,select{padding:.55rem .7rem;border:1px solid var(--b);border-radius:10px}
  .actions-right{display:flex;gap:10px;justify-content:flex-end;grid-column:span 2}
  .btn{background:var(--a);color:#fff;border:1px solid var(--a);border-radius:999px;padding:.55rem .9rem;font-weight:700;cursor:pointer}
  .ghost{background:#fff;color:var(--a)}
  .badges{display:flex;gap:8px;flex-wrap:wrap;margin:.6rem 0}
  .badge{border-radius:999px;padding:.2rem .6rem;font-weight:700}
  .err{background:#fee2e2;color:#b91c1c;border:1px solid #fecaca}
  .warn{background:#ffedd5;color:#9a3412;border:1px solid #fed7aa}
  .results{margin-top:.5rem;border-top:1px dashed #e6eef6;padding-top:.6rem}
  .row{display:flex;justify-content:space-between;margin:.25rem 0}
  .notes{margin-top:.6rem}
  footer{margin-top:.7rem;color:#475569}
</style>

<!-- Load SheetJS BEFORE our logic -->
<script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>

<script>
/* ===== Robust WP dispatcher: event delegation & safe timing ===== */
document.addEventListener('DOMContentLoaded', function () {
  const root = document.getElementById('nh3pt');
  if (!root) return;

  // Ensure all buttons are non-submit
  root.querySelectorAll('button').forEach(btn=>{
    if(!btn.hasAttribute('type')) btn.setAttribute('type','button');
  });

  // Route all button clicks via delegation
  root.addEventListener('click', function(e){
    const t = e.target.closest('button');
    if(!t || !root.contains(t)) return;
    e.preventDefault();

    const id = t.id;
    try{
      if(id==='calc')  { window.__nh3pt_compute && window.__nh3pt_compute(root); }
      if(id==='reset') { window.__nh3pt_reset   && window.__nh3pt_reset(root); }
      if(id==='copy')  { window.__nh3pt_copy    && window.__nh3pt_copy(root); }
      if(id==='xlsx')  { window.__nh3pt_export  && window.__nh3pt_export(root); }
    }catch(err){ console.error(err); }
  });
});
</script>

<script>
/* ===== Main logic (scoped; functions exposed for dispatcher) ===== */
document.addEventListener('DOMContentLoaded', function () {
  const PATM_BAR = 1.01325; // atm for gauge <-> absolute

  // Antoine ranges (P in bar abs, T in K)
  const RANGES = [
    { Tmin:164.0, Tmax:239.6, A:3.18757, B:506.713, C:-80.78 },
    { Tmin:239.6, Tmax:371.5, A:4.86886, B:1113.928, C:-10.409 }
  ];

  // Unit helpers
  const toK = (v,u) => u==='K'? v : u==='C'? v+273.15 : (v-32)*5/9 + 273.15;
  const fromK = (K,u) => u==='K'? K : u==='C'? K-273.15 : (K-273.15)*9/5+32;

  // pressure <-> bar (same basis)
  const toBar = (v,u) => {
    switch(u){
      case 'bar': return v;
      case 'kPa': return v/100;
      case 'MPa': return v*10;
      case 'kgcm2': return v*0.980665;
      case 'psi': return v*0.0689476;
      default: return NaN;
    }
  };
  const fromBar = (bar,u) => {
    switch(u){
      case 'bar': return bar;
      case 'kPa': return bar*100;
      case 'MPa': return bar/10;
      case 'kgcm2': return bar/0.980665;
      case 'psi': return bar/0.0689476;
      default: return NaN;
    }
  };

  const round=(v,d=6)=> Number.isFinite(v)?(Math.round(v*10**d)/10**d).toFixed(d):'–';

  function Psat_bar_abs_from_TK(TK){
    let r = RANGES.find(x=>TK>=x.Tmin && TK<=x.Tmax) || (TK<RANGES[0].Tmin?RANGES[0]:RANGES[RANGES.length-1]);
    return Math.pow(10, r.A - r.B/(TK + r.C));
  }
  function TK_from_Psat_bar_abs(Pbar){
    const cand = RANGES.map(r => {
      const TK = r.B/(r.A - Math.log10(Pbar)) - r.C;
      return {TK, in:(TK>=r.Tmin && TK<=r.Tmax), r};
    });
    const hit = cand.find(c=>c.in);
    if (hit) return hit.TK;
    // Choose closest outside-range
    return cand.reduce((best,c)=>{
      const d = c.TK<c.r.Tmin? (c.r.Tmin-c.TK) : (c.TK-c.r.Tmax);
      return !best || d<best.d ? {v:c.TK,d} : best;
    }, null).v;
  }

  // Expose actions
  window.__nh3pt_compute = function(root){
    const $ = sel => root.querySelector(sel);
    const B = root.querySelector('#badges'); B.innerHTML='';
    const badge = (cls,txt)=>{ const s=document.createElement('span'); s.className='badge '+cls; s.textContent=txt; B.appendChild(s); };

    const uT=$('#uT').value, uP=$('#uP').value, basis=$('#pBasis').value;
    const Tin=parseFloat($('#Tin').value), Pin=parseFloat($('#Pin').value);
    const hasT=Number.isFinite(Tin), hasP=Number.isFinite(Pin);

    if(hasT && hasP) badge('warn','Provide either Temperature OR Pressure (not both). Using Temperature.');
    if(!hasT && !hasP){ badge('err','Enter Temperature or Pressure.'); return; }

    let TK, Pbar_abs;

    if(hasT){
      TK = toK(Tin,uT);
      if(!Number.isFinite(TK)){ badge('err','Invalid temperature'); return; }
      if(TK < 164 || TK > 371.5) badge('warn','Temperature outside correlation range (164–371.5 K). Extrapolated.');
      Pbar_abs = Psat_bar_abs_from_TK(TK);
    } else {
      let Pbar_in = toBar(Pin,uP);
      if(!Number.isFinite(Pbar_in) || Pbar_in<0){ badge('err','Invalid pressure'); return; }
      Pbar_abs = (basis==='gauge') ? (Pbar_in + PATM_BAR) : Pbar_in;

      const Pmin = Psat_bar_abs_from_TK(164), Pmax = Psat_bar_abs_from_TK(371.5);
      if(Pbar_abs < Pmin || Pbar_abs > Pmax) badge('warn','Pressure outside correlation range (~0.41–62.6 bar abs). Extrapolated.');

      TK = TK_from_Psat_bar_abs(Pbar_abs);
      if(basis==='gauge' && Pbar_in===0) badge('warn','0 gauge equals atmospheric absolute pressure.');
    }

    const Tout = fromK(TK, uT);
    let Pout_bar = (basis==='gauge') ? (Pbar_abs - PATM_BAR) : Pbar_abs;
    if(basis==='gauge' && Pout_bar<0) badge('warn','Gauge result is sub-atmospheric (negative).');

    $('#Tout').textContent = `${round(Tout,3)} ${$('#uT').selectedOptions[0].text}`;
    $('#Pout').textContent = `${round(fromBar(Pout_bar,uP),4)} ${$('#uP').selectedOptions[0].text} ${basis==='gauge'?'(g)':'(abs)'}`;
  };

  window.__nh3pt_reset = function(root){
    const $ = sel => root.querySelector(sel);
    ['Tin','Pin'].forEach(id=>$( '#'+id ).value='');
    $('#uT').value='C'; $('#uP').value='bar'; $('#pBasis').value='abs';
    root.querySelector('#badges').innerHTML='';
    ['#Tout','#Pout'].forEach(id=>root.querySelector(id).textContent='–');
  };

  window.__nh3pt_copy = function(root){
    const B = root.querySelector('#badges');
    const badge = (cls,txt)=>{ const s=document.createElement('span'); s.className='badge '+cls; s.textContent=txt; B.appendChild(s); };
    const t = `NH3 P&#x2194;T
Temperature: ${root.querySelector('#Tout').textContent}
Pressure: ${root.querySelector('#Pout').textContent}`;
    navigator.clipboard?.writeText(t);
    badge('warn','Results copied to clipboard');
    setTimeout(()=>B.innerHTML='',1200);
  };

  window.__nh3pt_export = function(root){
    if(typeof XLSX==='undefined'){ alert('Excel library not loaded.'); return; }

    // Gather UI selections to seed the sheet
    const uT = root.querySelector('#uT').value;
    const uP = root.querySelector('#uP').value;
    const pB = root.querySelector('#pBasis').value;
    const Tin = root.querySelector('#Tin').value || '';
    const Pin = root.querySelector('#Pin').value || '';

    // Build the sheet (same logic as UI, but with live formulas)
    const data = [
      ['NH3 Vapor Pressure ⇆ Saturation Temperature — P&#x2194;T (Abs/Gauge with Units)','', '', '', ''],
      ['Temp Unit', uT, '', 'Press Unit', uP],
      ['Press Basis', pB, '', 'Patm (bar)', 1.01325],
      ['Tin (entered)', Tin, '', 'Pin (entered)', Pin],

      ['','', '', '', ''],
      ['=== Conversions to base (K & bar abs) ===','','','',''],
      // T_K
      ['T_K', {t:'n',
        f:'IF(B2="K", B4, IF(B2="C", B4+273.15, (B4-32)*5/9+273.15))'
      }, '', '', ''],
      // P_in (bar)
      ['P_in_bar', {t:'n',
        f:'IF(E2="bar", E4, IF(E2="kPa", E4/100, IF(E2="MPa", E4*10, IF(E2="kgcm2", E4*0.980665, IF(E2="psi", E4*0.0689476, "")))))'
      }, '', '', ''],
      // P_abs_bar
      ['P_abs_bar', {t:'n',
        f:'IF(B3="gauge", B8 + E3, B8)'
      }, '', '', ''],

      ['','', '', '', ''],
      ['=== Antoine coefficients (NH3) ===','','','',''],
      ['Range1 Tmin',164.0,'Tmax',239.6,'A1',3.18757],
      ['B1',506.713,'C1',-80.78,'',''],
      ['Range2 Tmin',239.6,'Tmax',371.5,'A2',4.86886],
      ['B2',1113.928,'C2',-10.409,'',''],

      ['','', '', '', ''],
      ['=== Forward (T→P) ===','','','',''],
      // choose range by T_K
      ['P_bar_from_T', {t:'n',
        f:'IF(AND(B6>=B12,B6<=D12), 10^(E12 - B13/(B6 + D13)), IF(AND(B6>=B14,B6<=D14), 10^(E14 - B15/(B6 + D15)), 10^(E14 - B15/(B6 + D15))))'
      }, '', '', ''],

      ['','', '', '', ''],
      ['=== Inverse (P→T) ===','','','',''],
      // try both ranges and pick in-range; else range2
      ['T_K_from_P', {t:'n',
        f:'IF(AND(B9>= 10^(E12 - B13/(B12 + D13)), B9<= 10^(E12 - B13/(D12 + D13))), B13/(E12 - LOG10(B9)) - D13, IF(AND(B9>= 10^(E14 - B15/(B14 + D15)), B9<= 10^(E14 - B15/(D14 + D15))), B15/(E14 - LOG10(B9)) - D15, B15/(E14 - LOG10(B9)) - D15))'
      }, '', '', ''],

      ['','', '', '', ''],
      ['=== Outputs in selected units/basis ===','','','',''],
      // Display Temperature: if Tin was provided, use T→P branch; else P→T
      ['T_out', {t:'n',
        f:'IF(NOT(ISBLANK(B4)), IF(B2="K", B18, IF(B2="C", B18-273.15, (B18-273.15)*9/5+32)), IF(B2="K", B22, IF(B2="C", B22-273.15, (B22-273.15)*9/5+32)))'
      }, '', '', ''],

      // Display Pressure (abs/gauge as chosen): P from T if Tin present, else P_abs from input
      ['P_out_bar_abs', {t:'n',
        f:'IF(NOT(ISBLANK(B4)), B18, B9)'
      }, '', '', ''],

      ['P_out_bar_basis', {t:'n',
        f:'IF(B3="gauge", B25 - E3, B25)'
      }, '', '', ''],

      ['P_out', {t:'n',
        f:'IF(E2="bar", B26, IF(E2="kPa", B26*100, IF(E2="MPa", B26/10, IF(E2="kgcm2", B26/0.980665, IF(E2="psi", B26/0.0689476, "")))))'
      }, '', '', ''],

      ['','', '', '', ''],
      ['Source: chemicalengineeringsite.in','','','',''],
    ];

    const ws = XLSX.utils.aoa_to_sheet(data);
    ws['!cols'] = [{wch:56},{wch:24},{wch:18},{wch:24},{wch:24}];
    const last = data.length;
    // Make "Source" clickable
    ws[`A${last}`] = { t:'s', v:'Source: chemicalengineeringsite.in', l:{ Target:'https://chemicalengineeringsite.in/' } };
    ws['!freeze'] = { xSplit: 1, ySplit: 6 };

    const wb = XLSX.utils.book_new();
    XLSX.utils.book_append_sheet(wb, ws, 'NH3 P-T');

    const ts = new Date().toISOString().slice(0,19).replace(/[:T]/g,'-');
    XLSX.writeFile(wb, `NH3_P_T_abs_gauge_${ts}.xlsx`);
  };
});
</script>

<p>The post <a href="https://chemicalengineeringsite.in/ammonia-equilibrium-vapour-pressure-and-temperature-calculator/">Ammonia &#8211; Equilibrium Vapour Pressure and Temperature Calculator</a> appeared first on <a href="https://chemicalengineeringsite.in">Chemical Engineering Site</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chemicalengineeringsite.in/ammonia-equilibrium-vapour-pressure-and-temperature-calculator/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
