fillet-stress-analyzer/tools/thermal-shock.html
2026-07-19 05:11:43 +00:00

182 lines
6.5 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Aniruddha Shah | Thermal Shock Solver</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root {
--bg: #0a0a0a;
--fg: #e0e0e0;
--accent: #ff3333; /* Critical red */
--grid: #333333;
--mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
margin: 0; padding: 2rem;
background: var(--bg); color: var(--fg);
font-family: var(--mono);
line-height: 1.4;
max-width: 900px;
margin-left: auto; margin-right: auto;
}
h1 {
font-size: 2.5rem; letter-spacing: -0.05em;
border-bottom: 2px solid var(--accent);
padding-bottom: 0.5rem; margin-top: 0;
text-transform: uppercase;
}
.grid-panel {
display: grid; grid-template-columns: 1fr 1fr;
gap: 1rem; border: 1px solid var(--grid);
padding: 1rem; margin: 2rem 0;
}
.field-group {
display: flex; flex-direction: column; gap: 0.25rem;
}
label { font-size: 0.8rem; opacity: 0.8; text-transform: uppercase; }
input[type="number"] {
background: #000; border: 1px solid var(--grid);
color: var(--fg); font-family: inherit;
padding: 0.5rem; font-size: 1rem;
}
button {
background: var(--accent); color: #000;
border: none; padding: 1rem 2rem;
font-family: inherit; font-weight: bold;
text-transform: uppercase; cursor: pointer;
margin-top: 1rem; width: 100%;
}
button:hover { background: #fff; }
.result-box {
border: 2px solid var(--fg);
padding: 1.5rem; margin-top: 2rem;
background: #111;
}
.result-value {
font-size: 3rem; color: var(--accent);
font-weight: bold; margin: 0;
}
.citation {
font-size: 0.7rem; opacity: 0.6;
border-top: 1px dashed var(--grid);
padding-top: 0.5rem; margin-top: 1rem;
}
nav {
border-bottom: 1px solid var(--grid);
padding-bottom: 1rem; margin-bottom: 3rem;
}
nav a {
color: var(--fg); text-decoration: none;
margin-right: 1.5rem; font-size: 0.9rem;
text-transform: uppercase;
}
nav a:hover { color: var(--accent); text-decoration: underline; }
</style>
<script defer src="https://analytics.4ort.xyz/script.js" data-website-id="d3ed927c-888a-4a6c-ae5f-0b1c613ddf5b"></script>
</head>
<body>
<nav>
<a href="/">home</a>
<a href="/colony-kitchen/">protocols</a>
<a href="/films/">films</a>
<a href="/docs/">lattice</a>
</nav>
<h1>Thermal Shock Solver</h1>
<p class="lead">Calculating the Maximum Allowable Heating Rate ($dT/dt$) to prevent micro-fracture.</p>
<p><strong>Context:</strong> When a frozen mass (meat, regolith, steel) is exposed to sudden heat, the thermal gradient induces stress. If $dT/dt$ exceeds the material's critical threshold, the boundary cracks. This is the math behind the improvisation.</p>
<div class="grid-panel">
<div class="field-group">
<label for="thickness">Thickness (m)</label>
<input type="number" id="thickness" step="0.001" placeholder="e.g., 0.025 (2.5cm)">
</div>
<div class="field-group">
<label for="diffusivity">Thermal Diffusivity $\alpha$ (m²/s)</label>
<input type="number" id="diffusivity" step="0.0000000001" placeholder="e.g., 1.4e-7">
<select id="preset-material" style="background:#000;color:#eee;border:1px solid #333;font-family:inherit;padding:0.5rem;margin-top:0.5rem;">
<option value="">Select Material Preset...</option>
<option value="1.4e-7">Meat/Water-Rich Tissue (Frozen)</option>
<option value="1.17e-5">Structural Steel (ASTM A36)</option>
<option value="1.0e-6">Basaltic Regolith (Mars)</option>
<option value="8.4e-5">Aluminum Alloy (6061-T6)</option>
</select>
</div>
<div class="field-group">
<label for="stress-limit">Fracture Stress Limit (Pa)</label>
<input type="number" id="stress-limit" step="1000000" placeholder="e.g., 300000000">
</div>
<div class="field-group">
<label for="expansion-coeff">Thermal Expansion $\beta$ (/°C)</label>
<input type="number" id="expansion-coeff" step="0.0000000001" placeholder="e.g., 1.2e-5">
</div>
</div>
<button onclick="solve()">Calculate Critical Gradient</button>
<div class="result-box" id="output" hidden>
<p>Critical Heating Rate:</p>
<h2 class="result-value"><span id="rate-val">0</span> °C/min</h2>
<p>Equivalent Ramp Time for 100°C Delta: <span id="time-val">0</span> min</p>
<p class="citation">Formula: $dT/dt_{crit} = \frac{\sigma_{yield}}{E \cdot \beta} \cdot \sqrt{\frac{\pi}{\alpha \cdot L^2}}$ <br>Where $L$ is characteristic length.</p>
</div>
<script>
const presets = {
"1.4e-7": { stress: 30000000, expansion: 2.1e-4 }, // Meat (soft tissue)
"1.17e-5": { stress: 250000000, expansion: 1.2e-5 }, // Steel
"1.0e-6": { stress: 150000000, expansion: 1.0e-5 }, // Basalt
"8.4e-5": { stress: 276000000, expansion: 2.3e-5 } // Al 6061
};
document.getElementById('preset-material').addEventListener('change', (e) => {
const val = e.target.value;
if (val && presets[val]) {
document.getElementById('diffusivity').value = val;
document.getElementById('stress-limit').value = presets[val].stress;
document.getElementById('expansion-coeff').value = presets[val].expansion;
}
});
function solve() {
const L = parseFloat(document.getElementById('thickness').value);
const alpha = parseFloat(document.getElementById('diffusivity').value);
const sigma = parseFloat(document.getElementById('stress-limit').value);
const beta = parseFloat(document.getElementById('expansion-coeff').value);
const E = 200e9; // Young's modulus (default steel, simplified for demo)
if (!L || !alpha || !sigma || !beta) return alert("Fill all fields");
// Simplified thermal shock resistance parameter calculation
// dT_crit = (sigma / (E * beta)) * sqrt(pi / (alpha / L^2)) ?
// Actually, let's use the classic R = (σ(1-ν)/Eα) * sqrt(π/kρc) ... simplified to rate
// Rate = (Critical Temp Difference) / Characteristic Time
// Char Time τ = L^2 / α
// ΔT_crit ≈ σ / (E * β)
const delta_T_crit = sigma / (E * beta);
const tau = (L * L) / alpha;
const rate_per_sec = delta_T_crit / tau;
const rate_per_min = rate_per_sec * 60;
const ramp_time = 100 / rate_per_min; // Time to heat 100 degrees safely
document.getElementById('output').hidden = false;
document.getElementById('rate-val').innerText = rate_per_min.toFixed(2);
document.getElementById('time-val').innerText = ramp_time.toFixed(1);
}
</script>
<footer>
<p class="citation">Built by Aniruddha Shah. Constants sourced from ASTM standards and NASA Mars Habitat reports. Linked to <a href="/colony-kitchen/" style="color:#ff3333;">Protocol Alpha</a>.</p>
</footer>
</body>
</html>