<?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>공학설계 &#8211; MyEngNote</title>
	<atom:link href="https://myengnote.com/tag/%ea%b3%b5%ed%95%99%ec%84%a4%ea%b3%84/feed/" rel="self" type="application/rss+xml" />
	<link>https://myengnote.com</link>
	<description></description>
	<lastBuildDate>Wed, 08 Jul 2026 04:42:36 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>배관 마찰손실 계산기 &#038; 시뮬레이터</title>
		<link>https://myengnote.com/pipe-friction-pressure-drop-darcy-weisbach/</link>
					<comments>https://myengnote.com/pipe-friction-pressure-drop-darcy-weisbach/#respond</comments>
		
		<dc:creator><![CDATA[동동]]></dc:creator>
		<pubDate>Sun, 21 Jun 2026 23:25:42 +0000</pubDate>
				<category><![CDATA[공학계산기]]></category>
		<category><![CDATA[공학설계]]></category>
		<category><![CDATA[달시바이스바하]]></category>
		<category><![CDATA[마찰손실]]></category>
		<category><![CDATA[압력강하]]></category>
		<category><![CDATA[유체역학]]></category>
		<category><![CDATA[조도]]></category>
		<guid isPermaLink="false">https://myengnote.com/pipe-friction-pressure-drop-darcy-weisbach/</guid>

					<description><![CDATA[배관 구경, 배관 길이, 설계 유량 및 재질별 표면 조도(ε)를 대입하여 레이놀즈수(Re) 판정, Haaland 공식에 의한 Darcy 마찰계수(f), 배관 마찰 압력 손실을 실시간 해석하는 엔지니어링 계산기입니다. <a href="https://myengnote.com/pipe-friction-pressure-drop-darcy-weisbach/" style="text-decoration:none; color:#0073aa; font-weight:bold;">[본문 전체보기 >]</a>]]></description>
										<content:encoded><![CDATA[
<h2 style="font-size: 1.6em; font-weight: 800; color: #0c0e25; border-bottom: 2px solid #00f2fe; padding-bottom: 8px; margin-bottom: 20px;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 배관 마찰손실 계산기 &#038; 시뮬레이터</h2>


<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&#038;family=Outfit:wght@400;500;600;700;800&#038;display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* Scoped & Isolated Styles for pipe-friction-wrapper */
        /* Modern Reset and Design Tokens */
        .pipe-friction-wrapper *, .pipe-friction-wrapper *::before, .pipe-friction-wrapper *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        .pipe-friction-wrapper {
            --color-bg-dark: #f8f9fd;
            --color-bg-deep: #ffffff;
            --color-panel-bg: rgba(255, 255, 255, 0.85);
            --color-border: rgba(0, 0, 0, 0.06);
            --color-border-hover: rgba(0, 0, 0, 0.12);
            --color-text-main: #1e293b;
            --color-text-muted: #475569;
            --color-text-dark: #94a3b8;
            --color-cyan: #0284c7;
            --color-cyan-glow: rgba(2, 132, 199, 0.15);
            --color-magenta: #db2777;
            --color-magenta-glow: rgba(219, 39, 119, 0.15);
            --color-purple: #7c3aed;
            --color-purple-glow: rgba(124, 58, 237, 0.12);
            --color-success: #10b981;
            --color-warning: #f59e0b;
            --gradient-primary: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
            --gradient-accent: linear-gradient(135deg, var(--color-magenta) 0%, var(--color-purple) 100%);
            --gradient-panel: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.95) 100%);
            --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            --shadow-neon-cyan: 0 0 15px var(--color-cyan-glow);
            --shadow-neon-magenta: 0 0 15px var(--color-magenta-glow);
            --shadow-card: 0 8px 32px 0 rgba(15, 23, 42, 0.05);
            --blur-glass: blur(16px);
        }
        .pipe-friction-wrapper {
            background-color: var(--color-bg-dark);
            color: var(--color-text-main);
            font-family: var(--font-body);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            overflow-x: hidden;
            position: relative;
        }
        .app-background-glow {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            overflow: hidden;
            pointer-events: none;
        }
        .app-background-glow::before, 
        .app-background-glow::after {
            content: '';
            position: absolute;
            width: 600px;
            height: 600px;
            border-radius: 50%;
            filter: blur(140px);
            opacity: 0.15;
        }
        .app-background-glow::before {
            background: var(--color-cyan);
            top: -10%;
            right: -5%;
            animation: pulse-slow 15s infinite alternate;
        }
        .app-background-glow::after {
            background: var(--color-purple);
            bottom: -10%;
            left: -5%;
            animation: pulse-slow 20s infinite alternate-reverse;
        }
        @keyframes pulse-slow {
            0% { transform: scale(1) translate(0, 0); opacity: 0.12; }
            100% { transform: scale(1.2) translate(50px, 50px); opacity: 0.22; }
        }
        .app-container {
            width: 100%;
            max-width: 1440px;
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 24px;
        }
        .app-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            background: var(--color-panel-bg);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--color-border);
            border-radius: 16px;
            box-shadow: var(--shadow-card);
        }
        .logo-area {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        .logo-icon {
            font-size: 32px;
            background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .logo-area h1 {
            font-family: var(--font-heading);
            font-weight: 800;
            font-size: 24px;
            letter-spacing: 1px;
            background: linear-gradient(90deg, var(--color-text-main), var(--color-text-muted));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .logo-area .subtitle {
            font-size: 12px;
            color: var(--color-text-muted);
            font-weight: 500;
            letter-spacing: 0.5px;
        }
        .header-badge {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(16, 185, 129, 0.1);
            border: 1px solid rgba(16, 185, 129, 0.2);
            padding: 6px 14px;
            border-radius: 20px;
        }
        .pulse-dot {
            width: 8px;
            height: 8px;
            background-color: var(--color-success);
            border-radius: 50%;
            box-shadow: 0 0 10px var(--color-success);
            animation: pulse-dot-anim 1.5s infinite;
        }
        @keyframes pulse-dot-anim {
            0% { transform: scale(0.9); opacity: 0.6; }
            50% { transform: scale(1.2); opacity: 1; }
            100% { transform: scale(0.9); opacity: 0.6; }
        }
        .badge-text {
            font-size: 11px;
            font-weight: 600;
            color: var(--color-success);
            letter-spacing: 0.5px;
        }
        .app-main-grid {
            display: grid;
            grid-template-columns: 340px 1fr 340px;
            gap: 24px;
            align-items: start;
        }
        .panel {
            background: var(--gradient-panel);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--color-border);
            border-radius: 20px;
            padding: 24px;
            box-shadow: var(--shadow-card);
            display: flex;
            flex-direction: column;
            gap: 20px;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }
        .panel:hover {
            border-color: var(--color-border-hover);
        }
        .panel-header {
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid var(--color-border);
            padding-bottom: 14px;
        }
        .panel-header i {
            font-size: 18px;
        }
        .panel-header h2 {
            font-family: var(--font-heading);
            font-size: 18px;
            font-weight: 600;
            letter-spacing: 0.5px;
        }
        .text-cyan { color: var(--color-cyan); }
        .text-magenta { color: var(--color-magenta); }
        .text-purple { color: var(--color-purple); }
        .control-panel {
            grid-column: 1;
        }
        .input-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .input-label-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .input-label-row label {
            font-size: 13px;
            font-weight: 600;
            color: var(--color-text-main);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .helper-text {
            font-size: 10px;
            color: var(--color-text-muted);
            font-weight: 500;
        }
                .number-input-wrapper {
            display: flex;
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid var(--color-border);
            background: #ffffff;
            transition: all 0.2s ease;
        }
        .number-input-wrapper:focus-within {
            border-color: var(--color-cyan);
            box-shadow: 0 0 10px var(--color-cyan-glow);
        }
        .number-input-wrapper:focus-within {
            border-color: var(--color-cyan);
            box-shadow: 0 0 10px var(--color-cyan-glow);
        }
                .custom-number-input {
            flex: 1;
            width: 0;
            min-width: 0;
            background: #f8fafc !important;
            border: none !important;
            outline: none !important;
            color: #0f172a !important;
            padding: 10px 14px !important;
            font-family: var(--font-body) !important;
            font-size: 15px !important;
            font-weight: 700 !important;
            text-align: right !important;
            box-shadow: none !important;
            -webkit-appearance: none !important;
            -moz-appearance: textfield !important;
        }
        .custom-number-input::-webkit-outer-spin-button,
        .custom-number-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        .custom-number-input::-webkit-outer-spin-button,
        .custom-number-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
                .unit-badge {
            background: rgba(0, 0, 0, 0.03);
            color: var(--color-text-muted);
            font-size: 11px;
            font-weight: 700;
            padding: 0 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-left: 1px solid var(--color-border);
            pointer-events: none;
            flex-shrink: 0;
        }
        .unit-select-badge {
            background: rgba(0, 0, 0, 0.03);
            color: var(--color-text-muted);
            font-size: 11px;
            font-weight: 700;
            padding: 0 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            border-left: 1px solid var(--color-border);
            outline: none;
            cursor: pointer;
            flex-shrink: 0;
            font-family: var(--font-body);
            transition: all 0.2s ease;
        }
        .unit-select-badge:hover {
            background: rgba(0, 0, 0, 0.06);
            color: var(--color-text-main);
        }
        .custom-slider {
            -webkit-appearance: none;
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: rgba(0, 0, 0, 0.05);
            outline: none;
            margin: 8px 0;
            transition: background 0.2s ease;
        }
        .custom-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            cursor: pointer;
            transition: transform 0.1s ease, box-shadow 0.2s ease;
        }
        #slider-d::-webkit-slider-thumb {
            background: var(--color-cyan);
            box-shadow: 0 0 10px var(--color-cyan);
        }
        #slider-d::-webkit-slider-thumb:hover { transform: scale(1.2); }
        #slider-l::-webkit-slider-thumb {
            background: var(--color-purple);
            box-shadow: 0 0 10px var(--color-purple);
        }
        #slider-l::-webkit-slider-thumb:hover { transform: scale(1.2); }
        #slider-q::-webkit-slider-thumb {
            background: var(--color-success);
            box-shadow: 0 0 10px var(--color-success);
        }
        #slider-q::-webkit-slider-thumb:hover { transform: scale(1.2); }
        #slider-rough::-webkit-slider-thumb {
            background: var(--color-magenta);
            box-shadow: 0 0 10px var(--color-magenta);
        }
        #slider-rough::-webkit-slider-thumb:hover { transform: scale(1.2); }
        .presets-section {
            display: flex;
            flex-direction: column;
            gap: 12px;
            border-top: 1px solid var(--color-border);
            padding-top: 18px;
        }
        .presets-section h3 {
            font-size: 13px;
            font-weight: 700;
            color: var(--color-text-main);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .presets-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 8px;
        }
        .preset-btn {
            background: rgba(0, 0, 0, 0.015);
            border: 1px solid var(--color-border);
            border-radius: 10px;
            padding: 10px 12px;
            cursor: pointer;
            color: var(--color-text-main);
            display: flex;
            align-items: center;
            gap: 12px;
            text-align: left;
            transition: all 0.2s ease;
        }
        .preset-btn:hover {
            background: rgba(0, 0, 0, 0.04);
            transform: translateX(4px);
        }
        .preset-btn.active {
            background: linear-gradient(90deg, var(--color-cyan-glow), var(--color-purple-glow));
            border-color: var(--color-cyan);
            box-shadow: 0 0 10px var(--color-cyan-glow);
        }
        .preset-icon {
            width: 28px;
            height: 28px;
            background: rgba(0, 0, 0, 0.02);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            color: var(--color-cyan);
        }
        .preset-btn:hover .preset-icon, .preset-btn.active .preset-icon {
            background: var(--gradient-primary);
            color: #fff;
        }
        .preset-name {
            font-size: 12px;
            font-weight: 600;
        }
        .simulation-panel {
            grid-column: 2;
            align-self: start;
            justify-content: flex-start;
        }
        .simulation-panel .panel-header {
            justify-content: space-between;
        }
        .canvas-scale-indicator {
            font-size: 11px;
            color: var(--color-text-muted);
            background: rgba(0, 0, 0, 0.02);
            padding: 4px 10px;
            border-radius: 6px;
            border: 1px solid var(--color-border);
        }
        .canvas-wrapper {
            position: relative;
            width: 100%;
            background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
            border: 1px solid rgba(0, 0, 0, 0.06);
            border-radius: 16px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #physics-canvas {
            display: block;
            width: 100%;
            height: auto;
            aspect-ratio: 16 / 10;
        }
        .simulation-metrics-strip {
            display: flex;
            background: rgba(0, 0, 0, 0.01);
            border: 1px solid var(--color-border);
            border-radius: 12px;
            padding: 12px 20px;
            justify-content: space-around;
            align-items: center;
            gap: 10px;
            margin-top: 10px;
        }
        .mini-metric {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            text-align: center;
        }
        .mini-metric .label {
            font-size: 10px;
            font-weight: 600;
            color: var(--color-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .mini-metric .value {
            font-size: 14px;
            font-weight: 700;
            color: var(--color-text-main);
            font-family: var(--font-heading);
        }
        .mini-divider {
            width: 1px;
            height: 24px;
            background: rgba(0, 0, 0, 0.03);
        }
        .loss-readout-box {
            background: linear-gradient(135deg, rgba(219, 39, 119, 0.08) 0%, rgba(124, 58, 237, 0.04) 100%);
            border: 1px solid rgba(219, 39, 119, 0.25);
            border-radius: 16px;
            padding: 20px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            box-shadow: 0 0 15px rgba(219, 39, 119, 0.05);
        }
        .loss-title {
            font-size: 11px;
            font-weight: 700;
            color: var(--color-magenta);
            letter-spacing: 1px;
            text-transform: uppercase;
        }
        .loss-value {
            font-family: var(--font-heading);
            font-weight: 800;
            font-size: 26px;
            background: linear-gradient(90deg, var(--color-text-main), var(--color-magenta));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .loss-type {
            font-size: 11px;
            font-weight: 700;
            padding: 4px 12px;
            border-radius: 20px;
            color: #fff;
            background: var(--color-magenta);
        }
        .results-grid {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .result-card {
            background: rgba(255, 255, 255, 0.85);
            border: 1px solid var(--color-border);
            border-radius: 12px;
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 16px;
            transition: all 0.2s ease;
        }
        .result-card:hover {
            transform: translateY(-2px);
            border-color: rgba(2, 132, 199, 0.2);
            background: rgba(2, 132, 199, 0.03);
        }
        .card-icon {
            width: 38px;
            height: 38px;
            background: rgba(0, 0, 0, 0.015);
            border: 1px solid var(--color-border);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: var(--color-text-muted);
        }
        .card-content {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .card-unit {
            font-size: 11px;
            font-weight: 600;
            color: var(--color-text-muted);
        }
        .card-value {
            font-family: var(--font-heading);
            font-weight: 700;
            font-size: 17px;
            color: var(--color-text-main);
        }
        .formula-card {
            background: rgba(0, 0, 0, 0.01);
            border: 1px solid var(--color-border);
            border-radius: 12px;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            font-size: 12px;
        }
        .formula-card h4 {
            font-weight: 700;
            color: var(--color-text-main);
        }
        .formula-equation {
            font-family: monospace;
            color: var(--color-cyan);
            font-size: 13px;
            background: #f8fafc;
            padding: 8px 10px;
            border-radius: 6px;
            border: 1px solid var(--color-border);
            text-align: center;
        }
        /* Container Query */
        @container friction-container (max-width: 1100px) {
            .app-main-grid {
                grid-template-columns: 1fr 1fr;
                gap: 20px;
            }
            .control-panel {
                grid-column: 1;
            }
            .simulation-panel {
                grid-column: 2;
                align-self: start;
            }
            .results-panel {
                grid-column: 1 / span 2;
                display: grid;
                grid-template-columns: 1fr 1.2fr;
                gap: 20px;
            }
            .results-panel .panel-header {
                grid-column: 1 / span 2;
            }
            .loss-readout-box {
                grid-column: 1;
                grid-row: 2;
            }
            .results-grid {
                grid-column: 2;
                grid-row: 2;
            }
        }
        @container friction-container (max-width: 768px) {
            .app-main-grid {
                grid-template-columns: 1fr;
            }
            .control-panel, .simulation-panel, .results-panel {
                grid-column: 1;
            }
            .results-panel {
                display: flex;
                flex-direction: column;
                gap: 16px;
            }
            .loss-readout-box, .results-grid {
                grid-column: auto;
                grid-row: auto;
            }
            .panel-header h2 {
                white-space: normal !important;
                font-size: 15px !important;
            }
            .app-header {
                flex-direction: column;
                gap: 16px;
                text-align: center;
            }
            .logo-area {
                flex-direction: column;
                gap: 8px;
            }
        }
        .preset-details {
            display: flex;
            flex-direction: column;
            gap: 2px;
            align-items: flex-start;
            text-align: left;
        }
        .preset-spec {
            font-size: 11px;
            color: var(--color-text-muted);
            font-weight: 500;
        }
        .preset-name {
            font-size: 13px !important;
        }
/* ━━ WordPress 레이아웃 Override: 디자인 1 (2열 컴팩트 대칭 레이아웃) ━━ */
.pipe-friction-wrapper .app-main-grid,
.pipe-friction-wrapper .main-grid,
.pipe-friction-wrapper .sim-grid {
    display: grid !important;
    grid-template-columns: 340px 1fr !important;
    gap: 24px !important;
    align-items: start !important;
}
/* 3열 레이아웃을 2열 레이아웃으로 변경하는 특화 스타일 */
.pipe-friction-wrapper .right-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    min-width: 0 !important;
    grid-column: 2 !important;
}
.pipe-friction-wrapper .simulation-panel,
.pipe-friction-wrapper .canvas-panel,
.pipe-friction-wrapper .sim-panel {
    grid-column: auto !important;
    order: 1 !important;
    align-self: stretch !important;
}
.pipe-friction-wrapper .control-panel {
    grid-column: 1 !important;
}
/* 2열 통합 결과 분석 영역 레이아웃 */
.pipe-friction-wrapper .simulation-results-section {
    display: grid !important;
    grid-template-columns: 1.1fr 1.3fr !important;
    gap: 20px !important;
    border-top: 1px solid var(--color-border) !important;
    padding-top: 20px !important;
    margin-top: 10px !important;
    align-items: stretch !important;
}
/* Readout Box 스타일 */
.pipe-friction-wrapper .simulation-results-section .ratio-readout-box,
.pipe-friction-wrapper .simulation-results-section .re-readout-box,
.pipe-friction-wrapper .simulation-results-section .status-readout-box,
.pipe-friction-wrapper .simulation-results-section .flow-readout-box,
.pipe-friction-wrapper .simulation-results-section [class*="readout-box"],
.pipe-friction-wrapper .simulation-results-section .gauge-container {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}
.pipe-friction-wrapper .simulation-results-section .results-grid {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    justify-content: flex-start !important;
}
.pipe-friction-wrapper .simulation-results-section .results-grid .result-card {
    flex: none !important;
    display: flex !important;
    align-items: center !important;
    min-height: 72px !important;
    height: auto !important;
    padding: 12px 16px !important;
}
.pipe-friction-wrapper .simulation-results-section .formula-card {
    grid-column: 1 / span 2 !important;
    grid-row: 2 !important;
}
/* 모바일/반응형 (800px 이하) ── 항상 세로형(1열) 정렬 및 시뮬레이터 캔버스 최상단 배치 */
@media (max-width: 800px) {
    .pipe-friction-wrapper .app-main-grid,
    .pipe-friction-wrapper .main-grid,
    .pipe-friction-wrapper .sim-grid {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .pipe-friction-wrapper .control-panel {
        order: 2 !important;
        width: 100% !important;
    }
    .pipe-friction-wrapper .right-column {
        order: 1 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .pipe-friction-wrapper .simulation-panel,
    .pipe-friction-wrapper .canvas-panel,
    .pipe-friction-wrapper .sim-panel,
    .pipe-friction-wrapper .canvas-section {
        order: -1 !important;
    }
    .pipe-friction-wrapper .simulation-results-section {
        grid-template-columns: 1fr !important;
    }
    .pipe-friction-wrapper .simulation-results-section .ratio-readout-box,
    .pipe-friction-wrapper .simulation-results-section .re-readout-box,
    .pipe-friction-wrapper .simulation-results-section .status-readout-box,
    .pipe-friction-wrapper .simulation-results-section .flow-readout-box,
    .pipe-friction-wrapper .simulation-results-section [class*="readout-box"],
    .pipe-friction-wrapper .simulation-results-section .gauge-container {
        grid-column: 1 !important;
        grid-row: auto !important;
        height: auto !important;
    }
    .pipe-friction-wrapper .simulation-results-section .results-grid {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
    .pipe-friction-wrapper .simulation-results-section .formula-card {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}
.pipe-friction-wrapper .app-container,
.pipe-friction-wrapper .main-container {
    max-width: 100% !important;
    padding: 12px !important;
}
/* Premium Advice/Formula Card & Typography Overrides */
.pipe-friction-wrapper .simulation-results-section .formula-card,
.pipe-friction-wrapper .results-panel .formula-card {
    background: #ffffff !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: var(--shadow-card) !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 8px !important;
}
.pipe-friction-wrapper .simulation-results-section .formula-card h4,
.pipe-friction-wrapper .results-panel .formula-card h4 {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--color-text-main) !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    word-break: keep-all !important;
    line-height: 1.4 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.pipe-friction-wrapper .formula-equation {
    font-family: 'Outfit', 'Cambria Math', 'Times New Roman', monospace !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    word-break: keep-all !important;
    text-align: center !important;
}
.pipe-friction-wrapper #text-judgment {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--color-text-muted) !important;
    line-height: 1.6 !important;
    word-break: keep-all !important;
}
</style>
<div class="pipe-friction-wrapper" style="position: relative; width: 100%; box-sizing: border-box; overflow: hidden; margin: 30px auto; border-radius: 20px;">
    <div class="app-background-glow" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: hidden;"></div>
    <div style="position: relative; z-index: 2; width: 100%;">
    <div class="app-container">
        <header class="app-header">
            <div class="logo-area">
                <div class="logo-icon"><i class="fa-solid fa-water"></i></div>
                <div>
                    <h1>PIPE FRICTION LOSS</h1>
                    <div class="subtitle">배관 마찰 압력 손실 계산기 (Haaland &#038; Darcy)</div>
                </div>
            </div>
            <div class="header-badge">
                <div class="pulse-dot"></div>
                <span class="badge-text">DARCY-WEISBACH</span>
            </div>
        </header>
        <div class="app-main-grid">
            <!-- Controls -->
            <div class="panel control-panel">
                <div class="panel-header text-cyan">
                    <i class="fa-solid fa-sliders"></i>
                    <h2>배관 스펙 및 유동 입력</h2>
                </div>
                <!-- D Diameter -->
                <div class="input-group">
                    <div class="input-label-row">
                        <label for="input-d"><i class="fa-solid fa-circle-dot text-cyan"></i> 배관 내경 (D)</label>
                        <span class="helper-text">범위: 10 ~ 300 mm</span>
                    </div>
                    <div class="number-input-wrapper">
                        <input type="number" id="input-d" class="custom-number-input" min="10" max="300" value="80">
                        <span class="unit-badge">mm</span>
                    </div>
                    <input type="range" id="slider-d" class="custom-slider" min="10" max="300" value="80">
                </div>
                <!-- L Length -->
                <div class="input-group">
                    <div class="input-label-row">
                        <label for="input-l"><i class="fa-solid fa-ruler-horizontal text-purple"></i> 배관 길이 (L)</label>
                        <span class="helper-text">범위: 10 ~ 1000 m</span>
                    </div>
                    <div class="number-input-wrapper">
                        <input type="number" id="input-l" class="custom-number-input" min="10" max="1000" value="100">
                        <span class="unit-badge">m</span>
                    </div>
                    <input type="range" id="slider-l" class="custom-slider" min="10" max="1000" value="100">
                </div>
                <!-- Q Flow Rate -->
                <div class="input-group">
                    <div class="input-label-row">
                        <label for="input-q"><i class="fa-solid fa-gauge-high text-success"></i> 유동 유량 (Q)</label>
                        <span class="helper-text">범위: 0.5 ~ 500 m³/h</span>
                    </div>
                    <div class="number-input-wrapper">
                        <input type="number" id="input-q" class="custom-number-input" min="0.5" max="500" step="0.5" value="40.0">
                        <select id="select-q-unit" class="unit-select-badge">
                            <option value="m3h">m³/h</option>
                            <option value="LPM">LPM</option>
                            <option value="GPM">GPM</option>
                            <option value="m3s">m³/s</option>
                        </select>
                    </div>
                    <input type="range" id="slider-q" class="custom-slider" min="0.5" max="500" step="0.5" value="40">
                </div>
                <!-- ε Roughness -->
                <div class="input-group">
                    <div class="input-label-row">
                        <label for="input-rough"><i class="fa-solid fa-barcode text-magenta"></i> 표면 절대 조도 (&epsilon;)</label>
                        <span class="helper-text">범위: 0.001 ~ 0.500 mm</span>
                    </div>
                    <div class="number-input-wrapper">
                        <input type="number" id="input-rough" class="custom-number-input" min="0.001" max="0.500" step="0.001" value="0.045">
                        <span class="unit-badge">mm</span>
                    </div>
                    <input type="range" id="slider-rough" class="custom-slider" min="1" max="500" value="45">
                </div>
                <!-- Presets -->
                <div class="presets-section">
                    <h3><i class="fa-solid fa-cubes"></i> 산업용 배관 재질 프리셋</h3>
                    <div class="presets-grid">
                        <button class="preset-btn" data-preset="pvc">
                            <div class="preset-icon"><i class="fa-solid fa-shield-halved"></i></div>
                            <div class="preset-details"><span class="preset-name">PVC 플라스틱 배관</span><span class="preset-spec">&epsilon; = 0.0015 mm</span></div>
                        </button>
                        <button class="preset-btn" data-preset="steel">
                            <div class="preset-icon"><i class="fa-solid fa-industry"></i></div>
                            <div class="preset-details"><span class="preset-name">일반 탄소강 강관</span><span class="preset-spec">&epsilon; = 0.045 mm</span></div>
                        </button>
                        <button class="preset-btn" data-preset="castiron">
                            <div class="preset-icon"><i class="fa-solid fa-square"></i></div>
                            <div class="preset-details"><span class="preset-name">거친 녹슨 주철관</span><span class="preset-spec">&epsilon; = 0.26 mm</span></div>
                        </button>
                    </div>
                </div>
            </div>
            <!-- Auto Injected Right Column wrapper for Design 1 -->
            <div class="right-column">
                <div class="panel simulation-panel">
                                <div class="panel-header text-purple">
                                    <div style="display: flex; align-items: center; gap: 12px;">
                                        <i class="fa-solid fa-display"></i>
                                        <h2>실시간 관내 유동 상태 &#038; 압력 감쇄 시각화</h2>
                                    </div>
                                    <div class="canvas-scale-indicator" id="txt-canvas-scale">조도 레벨: 탄소강 강관</div>
                                </div>
                                <div class="canvas-wrapper">
                                    <canvas id="physics-canvas" width="640" height="400"></canvas>
                                </div>
                                <div class="simulation-metrics-strip">
                                    <div class="mini-metric">
                                        <span class="label">Darcy 마찰계수 (f)</span>
                                        <span class="value" id="mini-f">0.0215</span>
                                    </div>
                                    <div class="mini-divider"></div>
                                    <div class="mini-metric">
                                        <span class="label">평균 유속 (v)</span>
                                        <span class="value" id="mini-v">2.21 m/s</span>
                                    </div>
                                    <div class="mini-divider"></div>
                                    <div class="mini-metric">
                                        <span class="label">레이놀즈수 (Re)</span>
                                        <span class="value" id="mini-re">176,800</span>
                                    </div>
                                </div>
                            <div class="simulation-results-section">
                                <div class="loss-readout-box">
                                    <span class="loss-title">TOTAL PRESSURE DROP (&Delta;P)</span>
                                    <span class="loss-value" id="txt-p-loss">0.69 bar</span>
                                    <span class="loss-type" id="txt-loss-m">수두 손실: 7.02 m</span>
                                </div>
                                <div class="results-grid">
                                    <div class="result-card">
                                        <div class="card-icon text-cyan"><i class="fa-solid fa-glass-water-droplet"></i></div>
                                        <div class="card-content">
                                            <span class="card-unit">유동 상태 판독 (Flow Regime)</span>
                                            <span class="card-value" id="txt-flow-status">완전 난류 (Turbulent)</span>
                                        </div>
                                    </div>
                                    <div class="result-card">
                                        <div class="card-icon text-purple"><i class="fa-solid fa-chart-line-up"></i></div>
                                        <div class="card-content">
                                            <span class="card-unit">100m 당 압력 하락폭</span>
                                            <span class="card-value" id="txt-p-loss-100m">0.69 bar / 100m</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="formula-card">
                                        <h4><i class="fa-solid fa-circle-info text-cyan"></i> Haaland 마찰 보정 공식</h4>
                                        <div class="formula-equation">1/&radic;f &approx; -1.8log[(&epsilon;/3.7D)<sup>1.11</sup> + 6.9/Re]</div>
                                        <p>
                                            * 층류(Re&le;2300)에서는 f = 64/Re 식을 적용하며, 난류에서는 벽 거칠기를 가산합니다.
                                        </p>
                                    </div>
                            </div>
                </div>
            </div>
        </div>
        <!-- Disclaimer Footer -->
        <footer class="app-disclaimer" style="margin-top: 20px; padding: 12px 16px; background: rgba(0, 0, 0, 0.015); border: 1px solid var(--color-border); border-radius: 12px; font-size: 11px; color: var(--color-text-muted); line-height: 1.5; text-align: left; display: flex; gap: 10px; align-items: flex-start; clear: both;">
            <i class="fa-solid fa-circle-info" style="color: var(--color-cyan); font-size: 14px; margin-top: 2px; flex-shrink: 0;"></i>
            <span><strong>면책 조항 (Disclaimer):</strong> 본 시뮬레이터의 계산 결과는 교육 및 참고용으로만 제공되며, 실제 제품 설계나 제작 시에는 반드시 최신 공학 규격 및 공식 표준 설계 기준을 재확인하시기 바랍니다. 계산 값의 무결성을 보장하지 않으며, 이로 인해 발생하는 직접적/간접적 손해에 대해 제작자 및 본 블로그는 어떠한 책임을 지지 않습니다.</span>
        </footer>
</div>
    </div>
</div>
<script>
        (function() {
            // State
            const state = {
                d: 80,         // mm
                l: 100,        // m
                q: 40.0,       // m³/h (stored normalized in m3/h)
                qUnit: 'm3h',  // active input unit
                rough: 0.045,  // mm
                particles: [],
                splashes: [],
                lastTime: 0
            };
            // DOM Elements
            const inputD = document.getElementById('input-d');
            const sliderD = document.getElementById('slider-d');
            const inputL = document.getElementById('input-l');
            const sliderL = document.getElementById('slider-l');
            const inputQ = document.getElementById('input-q');
            const sliderQ = document.getElementById('slider-q');
            const selectQUnit = document.getElementById('select-q-unit');
            const inputRough = document.getElementById('input-rough');
            const sliderRough = document.getElementById('slider-rough');
            const txtPLoss = document.getElementById('txt-p-loss');
            const txtLossM = document.getElementById('txt-loss-m');
            const txtFlowStatus = document.getElementById('txt-flow-status');
            const txtPLoss100m = document.getElementById('txt-p-loss-100m');
            const miniF = document.getElementById('mini-f');
            const miniV = document.getElementById('mini-v');
            const miniRe = document.getElementById('mini-re');
            const presetButtons = document.querySelectorAll('.preset-btn');
            const canvas = document.getElementById('physics-canvas');
            const ctx = canvas.getContext('2d');
            // Initialize Particles
            const maxParticles = 90;
            for (let i = 0; i < maxParticles; i++) {
                state.particles.push({
                    x: 80 + Math.random() * 450,
                    yFrac: 0.15 + Math.random() * 0.7
                });
            }
            // Flow conversion helpers
            function convertQToUnit(valM3h, unit) {
                if (unit === 'm3h') return valM3h;
                if (unit === 'LPM') return valM3h * (1000 / 60);
                if (unit === 'GPM') return valM3h * (1000 / 60) * 0.264172;
                if (unit === 'm3s') return valM3h / 3600;
                return valM3h;
            }
            function convertQFromUnit(val, unit) {
                if (unit === 'm3h') return val;
                if (unit === 'LPM') return val / (1000 / 60);
                if (unit === 'GPM') return val / ((1000 / 60) * 0.264172);
                if (unit === 'm3s') return val * 3600;
                return val;
            }
            function updateQInputControls() {
                const unit = state.qUnit;
                let minVal, maxVal, stepVal;
                if (unit === 'm3h') {
                    minVal = 0.5; maxVal = 500; stepVal = 0.5;
                } else if (unit === 'LPM') {
                    minVal = 10; maxVal = 8000; stepVal = 10;
                } else if (unit === 'GPM') {
                    minVal = 3; maxVal = 2200; stepVal = 5;
                } else if (unit === 'm3s') {
                    minVal = 0.0001; maxVal = 0.1400; stepVal = 0.0001;
                }
                // Update number input attributes
                inputQ.min = minVal;
                inputQ.max = maxVal;
                inputQ.step = stepVal;
                // Update slider attributes
                sliderQ.min = minVal;
                sliderQ.max = maxVal;
                sliderQ.step = stepVal;
                // Update helper text range display
                const parentGroup = inputQ.closest('.input-group');
                if (parentGroup) {
                    const helper = parentGroup.querySelector('.helper-text');
                    if (helper) {
                        const unitSymbol = unit === 'm3h' ? 'm³/h' : (unit === 'm3s' ? 'm³/s' : unit);
                        helper.innerText = `범위: ${minVal} ~ ${maxVal} ${unitSymbol}`;
                    }
                }
            }
            // Sync
            function syncDFromSlider() {
                state.d = parseInt(sliderD.value);
                inputD.value = state.d;
                clearPresets();
                updateCalculations();
            }
            function syncDFromInput() {
                let val = parseInt(inputD.value);
                if (isNaN(val)) { val = 80; }
                if (val < 10) { val = 10; }
                if (val > 300) { val = 300; }
                state.d = val;
                inputD.value = val;
                sliderD.value = val;
                clearPresets();
                updateCalculations();
            }
            function syncLFromSlider() {
                state.l = parseInt(sliderL.value);
                inputL.value = state.l;
                clearPresets();
                updateCalculations();
            }
            function syncLFromInput() {
                let val = parseInt(inputL.value);
                if (isNaN(val)) { val = 100; }
                if (val < 10) { val = 10; }
                if (val > 1000) { val = 1000; }
                state.l = val;
                inputL.value = val;
                sliderL.value = val;
                clearPresets();
                updateCalculations();
            }
            function syncQFromSlider() {
                const val = parseFloat(sliderQ.value);
                inputQ.value = state.qUnit === 'm3s' ? val.toFixed(4) : (state.qUnit === 'm3h' ? val.toFixed(1) : val.toFixed(0));
                state.q = convertQFromUnit(val, state.qUnit);
                clearPresets();
                updateCalculations();
            }
            function syncQFromInput() {
                let val = parseFloat(inputQ.value);
                const minVal = parseFloat(inputQ.min);
                const maxVal = parseFloat(inputQ.max);
                if (isNaN(val)) { val = convertQToUnit(40.0, state.qUnit); }
                if (val < minVal) { val = minVal; }
                if (val > maxVal) { val = maxVal; }
                inputQ.value = state.qUnit === 'm3s' ? val.toFixed(4) : (state.qUnit === 'm3h' ? val.toFixed(1) : val.toFixed(0));
                sliderQ.value = val;
                state.q = convertQFromUnit(val, state.qUnit);
                clearPresets();
                updateCalculations();
            }
            function syncRoughFromSlider() {
                state.rough = parseFloat(sliderRough.value) / 1000;
                inputRough.value = state.rough.toFixed(3);
                clearPresets();
                updateCalculations();
            }
            function syncRoughFromInput() {
                let val = parseFloat(inputRough.value);
                if (isNaN(val)) { val = 0.045; }
                if (val < 0.001) { val = 0.001; }
                if (val > 0.500) { val = 0.500; }
                state.rough = val;
                inputRough.value = val.toFixed(3);
                sliderRough.value = Math.round(val * 1000);
                clearPresets();
                updateCalculations();
            }
            sliderD.addEventListener('input', syncDFromSlider);
            inputD.addEventListener('change', syncDFromInput);
            sliderL.addEventListener('input', syncLFromSlider);
            inputL.addEventListener('change', syncLFromInput);
            sliderQ.addEventListener('input', syncQFromSlider);
            inputQ.addEventListener('change', syncQFromInput);
            sliderRough.addEventListener('input', syncRoughFromSlider);
            inputRough.addEventListener('change', syncRoughFromInput);
            selectQUnit.addEventListener('change', function() {
                const oldUnit = state.qUnit;
                const newUnit = selectQUnit.value;
                state.qUnit = newUnit;
                const oldValInActiveUnit = convertQToUnit(state.q, oldUnit);
                const newValInActiveUnit = convertQToUnit(state.q, newUnit);
                updateQInputControls();
                inputQ.value = newUnit === 'm3s' ? newValInActiveUnit.toFixed(4) : (newUnit === 'm3h' ? newValInActiveUnit.toFixed(1) : newValInActiveUnit.toFixed(0));
                sliderQ.value = newValInActiveUnit;
                updateCalculations();
            });
            // Presets
            function loadPreset(presetKey) {
                clearPresets();
                presetButtons.forEach(function(btn) {
                    if (btn.dataset.preset === presetKey) {
                        btn.classList.add('active');
                    }
                });
                if (presetKey === 'pvc') {
                    state.d = 100;
                    state.l = 100;
                    state.q = 50.0;
                    state.rough = 0.0015;
                } else if (presetKey === 'steel') {
                    state.d = 80;
                    state.l = 100;
                    state.q = 40.0;
                    state.rough = 0.045;
                } else if (presetKey === 'castiron') {
                    state.d = 80;
                    state.l = 100;
                    state.q = 35.0;
                    state.rough = 0.26;
                }
                inputD.value = state.d;
                sliderD.value = state.d;
                inputL.value = state.l;
                sliderL.value = state.l;
                const qInActiveUnit = convertQToUnit(state.q, state.qUnit);
                inputQ.value = state.qUnit === 'm3s' ? qInActiveUnit.toFixed(4) : (state.qUnit === 'm3h' ? qInActiveUnit.toFixed(1) : qInActiveUnit.toFixed(0));
                sliderQ.value = qInActiveUnit;
                inputRough.value = state.rough.toFixed(4);
                sliderRough.value = Math.round(state.rough * 1000);
                updateCalculations();
            }
            function clearPresets() {
                presetButtons.forEach(function(btn) {
                    btn.classList.remove('active');
                });
            }
            presetButtons.forEach(function(btn) {
                btn.addEventListener('click', function() {
                    loadPreset(btn.dataset.preset);
                });
            });
            // Darcy Weisbach and Haaland solver
            function updateCalculations() {
                const g = 9.80665;
                const nu = 1.006e-6; // Kinematic viscosity of water at 20C
                const rho = 998.2;   // Density of water at 20C
                // Diameter m
                const D_m = state.d / 1000;
                const area = (Math.PI * Math.pow(D_m, 2)) / 4;
                // Velocity
                const v = state.q / (3600 * area);
                miniV.innerText = v.toFixed(2) + ' m/s';
                // Reynolds
                const re = (v * D_m) / nu;
                miniRe.innerText = Math.round(re).toLocaleString();
                let flowRegime = '완전 난류 (Turbulent)';
                if (re <= 2300) {
                    flowRegime = '안정적 층류 (Laminar)';
                } else if (re <= 4000) {
                    flowRegime = '천이 영역 (Transition)';
                }
                txtFlowStatus.innerText = flowRegime;
                // Friction factor f
                let f = 0.02;
                if (re <= 2300) {
                    // Laminar flow
                    if (re > 0) {
                        f = 64 / re;
                    } else {
                        f = 0;
                    }
                } else {
                    // Haaland approximation
                    const roughRatio = (state.rough / 1000) / D_m;
                    const logTerm = Math.log10(Math.pow(roughRatio / 3.7, 1.11) + 6.9 / re);
                    if (logTerm < 0) {
                        f = Math.pow(1 / (-1.8 * logTerm), 2);
                    }
                }
                miniF.innerText = f.toFixed(4);
                // Head loss h_f = f * (L/D) * (v^2 / 2g)
                const hf = f * (state.l / D_m) * (Math.pow(v, 2) / (2 * g));
                txtLossM.innerText = '수두 마찰 손실: ' + hf.toFixed(2) + ' m';
                // Pressure drop = rho * g * h_f / 100000 (bar)
                const deltaP = (rho * g * hf) / 100000;
                txtPLoss.innerText = deltaP.toFixed(2) + ' bar';
                // Loss per 100m
                const deltaP100m = (deltaP / state.l) * 100;
                txtPLoss100m.innerText = deltaP100m.toFixed(2) + ' bar / 100m';
                const txtCanvasScale = document.getElementById('txt-canvas-scale');
                if (txtCanvasScale) {
                    let textBadge = '탄소강 배관 사양';
                    if (state.rough <= 0.002) {
                        textBadge = 'PVC 매끄러운 배관';
                    } else if (state.rough >= 0.2) {
                        textBadge = '거친 주철 배관';
                    }
                    txtCanvasScale.innerText = `벽면 성격: ${textBadge}`;
                }
            }
            // Draw pipe flow with roughness and dynamic zooming
            function draw(currentTime) {
                requestAnimationFrame(draw);
                let dt = (currentTime - state.lastTime) / 1000;
                if (isNaN(dt)) { dt = 0.016; }
                if (dt < 0) { dt = 0.016; }
                if (dt > 0.1) { dt = 0.016; }
                state.lastTime = currentTime;
                const width = canvas.width;
                const height = canvas.height;
                ctx.clearRect(0, 0, width, height);
                // Grid (fixed background grid)
                ctx.save();
                ctx.strokeStyle = 'rgba(2, 132, 199, 0.04)';
                ctx.lineWidth = 1;
                for (let x = 0; x < width; x += 30) {
                    ctx.beginPath();
                    ctx.moveTo(x, 0);
                    ctx.lineTo(x, height);
                    ctx.stroke();
                }
                for (let y = 0; y < height; y += 30) {
                    ctx.beginPath();
                    ctx.moveTo(0, y);
                    ctx.lineTo(width, y);
                    ctx.stroke();
                }
                ctx.restore();
                // Dynamic Zoom computation (zooms in on short lengths, zooms out on long lengths)
                const zoom = 0.85 + 0.55 * Math.pow((1000 - state.l) / 990, 1.5);
                // Pipe geometry (visual pipe height scales with inner diameter d &#038; zoom)
                const basePipeHeight = 30 + ((state.d - 10) / 290) * 130;
                const pipeHeight = basePipeHeight * zoom;
                const cy = height / 2 + 10; // offset downwards to leave space for gauge
                const pipeTop = cy - pipeHeight / 2;
                const pipeBottom = cy + pipeHeight / 2;
                // Pipe visual boundaries with right-shifted pipeLeft to fit pump
                const pipeLeft = 80;
                const pipeRight = 240 + ((state.l - 10) / 990) * (width - 340);
                // Physical parameters for flow
                const D_m = state.d / 1000;
                const area = (Math.PI * Math.pow(D_m, 2)) / 4;
                const v = state.q / (3600 * area);
                const g = 9.80665;
                const nu = 1.006e-6;
                const rho = 998.2;
                const re = (v * D_m) / nu;
                let f = 0.02;
                if (re <= 2300) {
                    if (re > 0) { f = 64 / re; }
                } else {
                    const roughRatio = (state.rough / 1000) / D_m;
                    const logTerm = Math.log10(Math.pow(roughRatio / 3.7, 1.11) + 6.9 / re);
                    if (logTerm < 0) { f = Math.pow(1 / (-1.8 * logTerm), 2); }
                }
                const hf = f * (state.l / D_m) * (Math.pow(v, 2) / (2 * g));
                const deltaP = (rho * g * hf) / 100000; // bar
                const lossIntensity = Math.min(hf / 15, 1.0); // clamped visual limit
                // 1. Draw Centrifugal Pump on the left
                ctx.save();
                ctx.fillStyle = '#475569';
                ctx.strokeStyle = '#334155';
                ctx.lineWidth = 2 * zoom;
                const px = pipeLeft - 25 * zoom;
                const py = cy;
                const pr = 15 * zoom;
                // Pump suction inlet pipe (from far left)
                ctx.fillStyle = '#64748b';
                ctx.fillRect(0, py - 6 * zoom, px - pr, 12 * zoom);
                ctx.strokeRect(0, py - 6 * zoom, px - pr, 12 * zoom);
                // Discharge transition block (tangential outlet pipe)
                ctx.fillStyle = '#475569';
                ctx.fillRect(px, py - pipeHeight / 2, pipeLeft - 8 * zoom - px, pipeHeight);
                ctx.strokeRect(px, py - pipeHeight / 2, pipeLeft - 8 * zoom - px, pipeHeight);
                // Pump housing (scroll casing)
                ctx.fillStyle = '#475569';
                ctx.beginPath();
                ctx.arc(px, py, pr, 0, Math.PI * 2);
                ctx.fill();
                ctx.stroke();
                // Centrifugal impeller cover ring
                ctx.strokeStyle = '#cbd5e1';
                ctx.lineWidth = 1.5 * zoom;
                ctx.beginPath();
                ctx.arc(px, py, pr * 0.7, 0, Math.PI * 2);
                ctx.stroke();
                // Impeller central shaft cap
                ctx.fillStyle = '#1e293b';
                ctx.beginPath();
                ctx.arc(px, py, pr * 0.3, 0, Math.PI * 2);
                ctx.fill();
                ctx.stroke();
                ctx.restore();
                // 2. Draw interior pressure gradient shift (High pressure Cyan on left -> Low pressure Magenta on right)
                ctx.save();
                const interiorGrad = ctx.createLinearGradient(pipeLeft, pipeTop, pipeRight, pipeTop);
                interiorGrad.addColorStop(0, 'rgba(2, 132, 199, 0.25)');
                interiorGrad.addColorStop(1, 'rgba(219, 39, 119, ' + (0.1 + lossIntensity * 0.5) + ')');
                ctx.fillStyle = interiorGrad;
                ctx.fillRect(pipeLeft, pipeTop, pipeRight - pipeLeft, pipeHeight);
                ctx.restore();
                // 3. Draw wall roughness elements
                ctx.save();
                ctx.fillStyle = '#64748b';
                ctx.strokeStyle = '#475569';
                ctx.lineWidth = 4 * zoom;
                // Top Pipe Wall
                ctx.beginPath();
                ctx.moveTo(pipeLeft, pipeTop);
                ctx.lineTo(pipeRight, pipeTop);
                ctx.stroke();
                // Bottom Pipe Wall
                ctx.beginPath();
                ctx.moveTo(pipeLeft, pipeBottom);
                ctx.lineTo(pipeRight, pipeBottom);
                ctx.stroke();
                // If roughness is high, draw jagged texture on boundaries
                if (state.rough > 0.01) {
                    const bumpSize = Math.max(state.rough * 30, 2.5) * zoom; // scale bump height visually
                    const bumpFreq = Math.max(30 - state.rough * 30, 8) * zoom; // frequency of bumps
                    ctx.fillStyle = 'rgba(71, 85, 105, 0.8)';
                    for (let wx = pipeLeft + 5; wx < pipeRight - 5; wx += bumpFreq) {
                        // Top wall bumps
                        ctx.beginPath();
                        ctx.moveTo(wx, pipeTop);
                        ctx.lineTo(wx + bumpFreq/2, pipeTop + bumpSize);
                        ctx.lineTo(wx + bumpFreq, pipeTop);
                        ctx.closePath();
                        ctx.fill();
                        // Bottom wall bumps
                        ctx.beginPath();
                        ctx.moveTo(wx, pipeBottom);
                        ctx.lineTo(wx + bumpFreq/2, pipeBottom - bumpSize);
                        ctx.lineTo(wx + bumpFreq, pipeBottom);
                        ctx.closePath();
                        ctx.fill();
                    }
                }
                ctx.restore();
                // Draw Inlet Flange &#038; Outlet Flange
                ctx.save();
                ctx.fillStyle = '#64748b';
                ctx.strokeStyle = '#475569';
                ctx.lineWidth = 1.5 * zoom;
                // Left/Inlet Flange
                ctx.beginPath();
                ctx.rect(pipeLeft - 8 * zoom, pipeTop - 6 * zoom, 8 * zoom, pipeHeight + 12 * zoom);
                ctx.fill();
                ctx.stroke();
                // Right/Outlet Flange
                ctx.beginPath();
                ctx.rect(pipeRight, pipeTop - 6 * zoom, 8 * zoom, pipeHeight + 12 * zoom);
                ctx.fill();
                ctx.stroke();
                ctx.restore();
                // 4. Draw water jet discharging from outlet
                ctx.save();
                const streamGrad = ctx.createLinearGradient(pipeRight, pipeTop, pipeRight + 45 * zoom, cy + 80 * zoom);
                streamGrad.addColorStop(0, 'rgba(' + Math.floor(2 + lossIntensity * 217) + ', ' + Math.floor(132 - lossIntensity * 93) + ', ' + Math.floor(199 + lossIntensity * 56) + ', 0.6)');
                streamGrad.addColorStop(1, 'rgba(219, 39, 119, 0.05)');
                ctx.fillStyle = streamGrad;
                ctx.beginPath();
                ctx.moveTo(pipeRight + 8 * zoom, pipeTop);
                ctx.bezierCurveTo(pipeRight + 30 * zoom, pipeTop, pipeRight + 42 * zoom, cy + 50 * zoom, pipeRight + 42 * zoom, cy + 80 * zoom);
                ctx.lineTo(pipeRight + 26 * zoom, cy + 80 * zoom);
                ctx.bezierCurveTo(pipeRight + 26 * zoom, cy + 50 * zoom, pipeRight + 16 * zoom, pipeBottom, pipeRight + 8 * zoom, pipeBottom);
                ctx.closePath();
                ctx.fill();
                ctx.restore();
                // Spawning splashes at jet impact area
                if (Math.random() > 0.4) {
                    state.splashes.push({
                        x: pipeRight + 34 * zoom,
                        y: cy + 80 * zoom,
                        vx: (Math.random() - 0.2) * 50 * Math.max(0.5, v/3),
                        vy: -(0.5 + Math.random() * 0.8) * 45 * Math.max(0.5, v/3),
                        life: 1.0,
                        decay: 0.06 + Math.random() * 0.08,
                        size: 1 + Math.random() * 2
                     });
                }
                // Animate splashes
                ctx.save();
                ctx.fillStyle = 'rgba(2, 132, 199, 0.6)';
                state.splashes = state.splashes.filter(function(s) { return s.life > 0; });
                state.splashes.forEach(function(s) {
                    s.x += s.vx * dt;
                    s.y += s.vy * dt;
                    s.vy += 9.8 * 8 * dt; // gravity visual scale
                    s.life -= s.decay;
                    ctx.beginPath();
                    ctx.arc(s.x, s.y, s.size * zoom, 0, Math.PI * 2);
                    ctx.fill();
                });
                ctx.restore();
                // 5. Draw particles flowing inside pipe
                ctx.save();
                state.particles.forEach(function(p) {
                    const moveSpeed = v * 80;
                    let wobble = 0;
                    if (re > 4000) {
                        wobble = (Math.random() - 0.5) * (re / 150000) * 2;
                    }
                    p.x += moveSpeed * dt;
                    if (p.x > pipeRight - 5) {
                        p.x = pipeLeft + 5;
                        p.yFrac = 0.15 + Math.random() * 0.7;
                    }
                    const yCoord = pipeTop + p.yFrac * pipeHeight + wobble * zoom;
                    const progress = (p.x - pipeLeft) / (pipeRight - pipeLeft);
                    ctx.fillStyle = 'rgba(' + Math.floor(2 + progress * 217) + ', ' + Math.floor(132 - progress * 93) + ', ' + Math.floor(199 + progress * 56) + ', 0.7)';
                    ctx.beginPath();
                    ctx.arc(p.x, yCoord, 3 * zoom, 0, Math.PI * 2);
                    ctx.fill();
                });
                ctx.restore();
                // 6. Draw Inlet Pressure Gauge Dial
                ctx.save();
                const gx = pipeLeft + 25 * zoom;
                const gy = pipeTop - 35 * zoom;
                const gr = 20 * zoom;
                ctx.fillStyle = '#f8fafc';
                ctx.strokeStyle = '#64748b';
                ctx.lineWidth = 2.5 * zoom;
                ctx.beginPath();
                ctx.arc(gx, gy, gr, 0, Math.PI * 2);
                ctx.fill();
                ctx.stroke();
                ctx.strokeStyle = 'rgba(2, 132, 199, 0.15)';
                ctx.lineWidth = 1.5 * zoom;
                ctx.beginPath();
                ctx.arc(gx, gy, gr - 4 * zoom, 0, Math.PI * 2);
                ctx.stroke();
                const maxPScale = Math.max(2.0, Math.ceil(deltaP * 1.2));
                ctx.strokeStyle = '#94a3b8';
                ctx.lineWidth = 1 * zoom;
                for (let a = -Math.PI * 0.75; a <= Math.PI * 0.75; a += Math.PI * 0.375) {
                    ctx.beginPath();
                    ctx.moveTo(gx + Math.cos(a) * (gr - 4 * zoom), gy + Math.sin(a) * (gr - 4 * zoom));
                    ctx.lineTo(gx + Math.cos(a) * gr, gy + Math.sin(a) * gr);
                    ctx.stroke();
                }
                const needleAngle = -Math.PI * 0.75 + Math.min(1.0, deltaP / maxPScale) * Math.PI * 1.5;
                ctx.strokeStyle = '#db2777';
                ctx.lineWidth = 1.5 * zoom;
                ctx.beginPath();
                ctx.moveTo(gx, gy);
                ctx.lineTo(gx + Math.cos(needleAngle) * (gr - 3 * zoom), gy + Math.sin(needleAngle) * (gr - 3 * zoom));
                ctx.stroke();
                ctx.fillStyle = '#475569';
                ctx.beginPath();
                ctx.arc(gx, gy, 2 * zoom, 0, Math.PI * 2);
                ctx.fill();
                ctx.fillStyle = '#475569';
                ctx.font = '700 ' + Math.max(11, 8.5 * zoom) + 'px Inter, sans-serif';
                ctx.textAlign = 'center';
                ctx.fillText(deltaP.toFixed(2) + ' bar', gx, gy + gr + Math.max(9, 11 * zoom));
                ctx.font = '500 ' + Math.max(10, 7 * zoom) + 'px Inter, sans-serif';
                ctx.fillStyle = '#94a3b8';
                ctx.fillText('입구 압력', gx, gy - gr - Math.max(4, 4 * zoom));
                ctx.restore();
                // 7. CAD Style Dimension Line for Pipe Length (L)
                ctx.save();
                ctx.strokeStyle = '#7c3aed';
                ctx.fillStyle = '#7c3aed';
                ctx.lineWidth = 1.0;
                ctx.font = '500 ' + Math.max(12, 9 * zoom) + 'px Inter, sans-serif';
                const dimY = pipeBottom + 25 * zoom;
                ctx.beginPath();
                ctx.moveTo(pipeLeft, dimY - 4 * zoom);
                ctx.lineTo(pipeLeft, dimY + 4 * zoom);
                ctx.stroke();
                ctx.beginPath();
                ctx.moveTo(pipeRight, dimY - 4 * zoom);
                ctx.lineTo(pipeRight, dimY + 4 * zoom);
                ctx.stroke();
                ctx.beginPath();
                ctx.moveTo(pipeLeft, dimY);
                ctx.lineTo(pipeRight, dimY);
                ctx.stroke();
                ctx.beginPath();
                ctx.moveTo(pipeLeft, dimY);
                ctx.lineTo(pipeLeft + 6 * zoom, dimY - 3 * zoom);
                ctx.lineTo(pipeLeft + 6 * zoom, dimY + 3 * zoom);
                ctx.closePath();
                ctx.fill();
                ctx.beginPath();
                ctx.moveTo(pipeRight, dimY);
                ctx.lineTo(pipeRight - 6 * zoom, dimY - 3 * zoom);
                ctx.lineTo(pipeRight - 6 * zoom, dimY + 3 * zoom);
                ctx.closePath();
                ctx.fill();
                ctx.textAlign = 'center';
                ctx.fillStyle = '#7c3aed';
                ctx.fillText('L = ' + state.l + ' m', (pipeLeft + pipeRight) / 2, dimY - Math.max(6, 6 * zoom));
                ctx.restore();
            }
            // Copy &#038; right click block with nested if
            document.addEventListener('contextmenu', function(e) {
                e.preventDefault();
                alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                return false;
            }, { capture: true });
            document.addEventListener('selectstart', function(e) {
                e.preventDefault();
                return false;
            }, { capture: true });
            document.addEventListener('keydown', function(e) {
                if (e.key === 'F12') {
                    e.preventDefault();
                    alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                    return false;
                }
                if (e.ctrlKey) {
                    if (e.key === 'u' || e.key === 'c' || e.key === 's' || e.key === 'U' || e.key === 'C' || e.key === 'S') {
                        e.preventDefault();
                        alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                        return false;
                    }
                    if (e.shiftKey) {
                        if (['i','I','j','J','c','C'].includes(e.key)) {
                            e.preventDefault();
                            alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                            return false;
                        }
                    }
                }
            }, { capture: true });
            // Initialize
            updateQInputControls();
            loadPreset('steel');
            requestAnimationFrame(draw);
        })();
</script>


<div style="background: linear-gradient(135deg, rgba(0,242,254,0.03), rgba(138,43,226,0.03)); border: 1px solid rgba(0,242,254,0.15); border-radius: 12px; padding: 18px 24px; margin: 25px auto 35px auto; font-size: 0.95em; color: #4b5563; line-height: 1.7; font-family: sans-serif;">
    <strong style="color: #1f2937; font-size: 1.05em; display: flex; align-items: center; gap: 8px;">
        <span style="font-size: 1.2em;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span> 간편 사용 설명서
    </strong>
    <ol style="margin: 10px 0 0 0; padding-left: 20px;">
        <li style="margin-bottom: 6px;"><strong>배관 지형 설정: 배관의 순내경(D, mm)과 실제 직선 배관 구간 길이(L, m)를 조절합니다.</strong></li>
<li style="margin-bottom: 6px;">설계 유량 입력: 이송할 액체의 체적 유량(m³/h)을 설정하여 관 내 속도 수두를 형성합니다.</li>
<li style="margin-bottom: 6px;">관 재질 조도(Roughness) 설정: PVC(0.0015mm), 탄소강 강관(0.045mm), 주철관(0.25mm) 등 배관 내부 벽면 거칠기(조도)를 세팅합니다.</li>
<li style="margin-bottom: 6px;">마찰 계수 및 손실 평가: 계측 보드에서 레이놀즈수에 따른 층류/난류 영역 판정, Darcy 마찰계수(f) 및 수두 마찰 손실(h_f, m)과 마찰 압력 하락폭(bar)을 실시간 모니터링합니다.</li>
    </ol>
</div>


<details class="premium-seo-accordion" style="border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; background: #fbfbfc; padding: 0; margin: 30px auto; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.01); font-family: sans-serif;">
    <summary style="display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; font-size: 1.1em; font-weight: 700; color: #1f2937; cursor: pointer; user-select: none; outline: none; list-style: none;">
        <span><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4da.png" alt="📚" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Darcy-Weisbach 방정식 및 Haaland 마찰 계수 공학 공식 해설</span>
        <span class="accordion-arrow" style="font-size: 0.9em; color: #9ca3af; transition: transform 0.2s ease;">▼</span>
    </summary>
    <div style="padding: 0 24px 24px 24px; border-top: 1px solid rgba(0,0,0,0.04); background: #ffffff; border-radius: 0 0 12px 12px; font-size: 0.98em; color: #374151; line-height: 1.8;">
        <div style="margin-top: 20px;">
            <h3>1. 달시-바이스바하(Darcy-Weisbach) 수두 마찰 손실 기본 공식</h3>
<p>유체가 충만하게 흐르는 배관 내부에서 벽면 점성 마찰에 의해 발생하는 마찰 수두 손실(Head Loss, <code>h_f</code>)은 배관 유속의 제곱에 비례하고 배관 구경에 반비례하며, 다음과 같은 물리 정립 공식인 <strong>달시-바이스바하(Darcy-Weisbach) 방정식</strong>을 따릅니다.</p><p style="text-align: center; font-weight: bold; background: #e0f2fe; padding: 16px; border-radius: 8px; font-size: 1.05em; color: #0369a1;">h_f = f &times; (L / D) &times; (v&sup2; / 2g)</p><p>여기서 <code>h_f</code>는 마찰 손실 수두(m), <code>f</code>는 Darcy 마찰계수(Dimensionless Friction Factor), <code>L</code>은 배관 총길이(m), <code>D</code>는 배관 내부 직경(m), <code>v</code>는 평균 유속(m/s), <code>g</code>는 중력가속도(9.80665 m/s²)입니다. 이를 펌프 운전압 기준인 압력 강하 단위(<code>&Delta;P</code>)로 변환할 경우 다음 공식이 적용됩니다.</p><p style="text-align: center; font-weight: bold; background: #f3f4f6; padding: 12px; border-radius: 8px;">&Delta;P = &rho; &times; g &times; h_f / 100,000 &nbsp;[bar]</p>
<h3>2. Darcy 마찰계수(f)의 층류/난류 판정 및 Haaland / Colebrook 공식</h3>
<p>마찰 계수 <code>f</code>의 결정은 유체 유동이 <strong>층류(Laminar Flow)</strong> 상태인지 <strong>난류(Turbulent Flow)</strong> 상태인지에 따라 달라집니다. 유동 영역은 무차원 수인 <strong>레이놀즈수(Reynolds Number, Re = vD/&nu;)</strong>를 기준으로 판단합니다.</p><ul><li><strong>층류 유동 (Re &le; 2300):</strong> 관 벽면 조도의 영향을 받지 않고 오직 점성력에 의해서만 저항이 발생하며 다음 선형 공식으로 단순 수렴합니다.<br><code style="background:#f1f5f9; padding:2px 6px; border-radius:4px;">f = 64 / Re</code></li><li><strong>난류 유동 (Re &gt; 4000):</strong> 관 벽 거칠기인 절대조도(<code>&epsilon;</code>)와 관 내경의 상대비율(<code>&epsilon;/D</code>) 및 레이놀즈수의 복합 난해 함수가 됩니다. 실무에서는 명시적 양해함수 근사식인 <strong>Haaland 공식</strong>을 사용하여 Colebrook-White 음해공식을 높은 오차 정밀도로 대체합니다.</li></ul><p style="text-align: center; font-weight: bold; background: #f3f4f6; padding: 16px; border-radius: 8px;">1/&radic;f &approx; -1.8 &times; log₁₀ [ (&epsilon;/3.7D)<sup>1.11</sup> + 6.9/Re ]</p>
<h3>3. 산업 배관 재질에 따른 대표 조도(Roughness) 가이드라인</h3>
<p>대표 조도란 배관 내벽의 미세 돌기들의 평균 높이를 뜻하며, 재질별로 마찰 계수 격차를 발생시키는 핵심 척도입니다.</p><ul><li><strong>PVC / 플라스틱 파이프:</strong> <code>0.0015 mm</code> (극도로 매끄러워 마찰 저항이 가장 낮음)</li><li><strong>신품 탄소강 강관 (Commercial Steel):</strong> <code>0.045 mm</code> (산업 플랜트 가공 기본 표준 강관)</li><li><strong>아연도금철관 (Galvanized Iron):</strong> <code>0.15 mm</code> (도금 피막 거칠기 영향으로 강관보다 거침)</li><li><strong>주철관 (Cast Iron):</strong> <code>0.26 mm</code> (주조 공정상 벽면 돌기가 가장 크며 스케일 퇴적 우려가 높음)</li></ul>
        </div>
    </div>
</details>
<style>
details.premium-seo-accordion[open] summary .accordion-arrow { transform: rotate(180deg); color: #00f2fe; }
details.premium-seo-accordion summary::-webkit-details-marker { display: none; }
details.premium-seo-accordion:hover { border-color: rgba(0,242,254,0.3); }
</style>

]]></content:encoded>
					
					<wfw:commentRss>https://myengnote.com/pipe-friction-pressure-drop-darcy-weisbach/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>베르누이 계산기 &#038; 시뮬레이터</title>
		<link>https://myengnote.com/bernoulli-venturi-effect-calculator-simulator/</link>
					<comments>https://myengnote.com/bernoulli-venturi-effect-calculator-simulator/#respond</comments>
		
		<dc:creator><![CDATA[동동]]></dc:creator>
		<pubDate>Tue, 09 Jun 2026 03:21:10 +0000</pubDate>
				<category><![CDATA[공학계산기]]></category>
		<category><![CDATA[공학설계]]></category>
		<category><![CDATA[동압정압]]></category>
		<category><![CDATA[베르누이]]></category>
		<category><![CDATA[벤투리관]]></category>
		<category><![CDATA[유체역학]]></category>
		<category><![CDATA[진공발생]]></category>
		<guid isPermaLink="false">https://myengnote.com/bernoulli-venturi-effect-calculator-simulator/</guid>

					<description><![CDATA[벤투리 관(Venturi Tube)의 입구와 목(Throat) 직경, 유속, 정압을 입력하여 베르누이 정리(Bernoulli's Theorem)에 의한 속도 상승 및 정압 강하(Venturi Effect)를 실시간 해석하고 압력계를 시각화하는 2D 물리 시뮬레이터입니다.]]></description>
										<content:encoded><![CDATA[
<h2 style="font-size: 1.6em; font-weight: 800; color: #0c0e25; border-bottom: 2px solid #00f2fe; padding-bottom: 8px; margin-bottom: 20px;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 베르누이 계산기 &#038; 시뮬레이터</h2>


<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&#038;family=Outfit:wght@400;500;600;700;800&#038;display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* Scoped & Isolated Styles for bernoulli-venturi-wrapper */
        /* Modern Reset and Design Tokens */
        .bernoulli-venturi-wrapper *, .bernoulli-venturi-wrapper *::before, .bernoulli-venturi-wrapper *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        .bernoulli-venturi-wrapper {
            --color-bg-dark: #f8f9fd;
            --color-bg-deep: #ffffff;
            --color-panel-bg: rgba(255, 255, 255, 0.85);
            --color-border: rgba(0, 0, 0, 0.06);
            --color-border-hover: rgba(0, 0, 0, 0.12);
            --color-text-main: #1e293b;
            --color-text-muted: #475569;
            --color-text-dark: #94a3b8;
            --color-cyan: #0284c7;
            --color-cyan-glow: rgba(2, 132, 199, 0.15);
            --color-magenta: #db2777;
            --color-magenta-glow: rgba(219, 39, 119, 0.15);
            --color-purple: #7c3aed;
            --color-purple-glow: rgba(124, 58, 237, 0.12);
            --color-success: #10b981;
            --color-warning: #f59e0b;
            --gradient-primary: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
            --gradient-accent: linear-gradient(135deg, var(--color-magenta) 0%, var(--color-purple) 100%);
            --gradient-panel: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.95) 100%);
            --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            --shadow-neon-cyan: 0 0 15px var(--color-cyan-glow);
            --shadow-neon-magenta: 0 0 15px var(--color-magenta-glow);
            --shadow-card: 0 8px 32px 0 rgba(15, 23, 42, 0.05);
            --blur-glass: blur(16px);
        }
        .bernoulli-venturi-wrapper {
            background-color: var(--color-bg-dark);
            color: var(--color-text-main);
            font-family: var(--font-body);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            overflow-x: hidden;
            position: relative;
        }
        .app-background-glow {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            overflow: hidden;
            pointer-events: none;
        }
        .app-background-glow::before, 
        .app-background-glow::after {
            content: '';
            position: absolute;
            width: 600px;
            height: 600px;
            border-radius: 50%;
            filter: blur(140px);
            opacity: 0.15;
        }
        .app-background-glow::before {
            background: var(--color-cyan);
            top: -10%;
            right: -5%;
            animation: pulse-slow 15s infinite alternate;
        }
        .app-background-glow::after {
            background: var(--color-purple);
            bottom: -10%;
            left: -5%;
            animation: pulse-slow 20s infinite alternate-reverse;
        }
        @keyframes pulse-slow {
            0% { transform: scale(1) translate(0, 0); opacity: 0.12; }
            100% { transform: scale(1.2) translate(50px, 50px); opacity: 0.22; }
        }
        .app-container {
            width: 100%;
            max-width: 1440px;
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 24px;
        }
        .app-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            background: var(--color-panel-bg);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--color-border);
            border-radius: 16px;
            box-shadow: var(--shadow-card);
        }
        .logo-area {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        .logo-icon {
            font-size: 32px;
            background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .logo-area h1 {
            font-family: var(--font-heading);
            font-weight: 800;
            font-size: 24px;
            letter-spacing: 1px;
            background: linear-gradient(90deg, var(--color-text-main), var(--color-text-muted));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .logo-area .subtitle {
            font-size: 12px;
            color: var(--color-text-muted);
            font-weight: 500;
            letter-spacing: 0.5px;
        }
        .header-badge {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(16, 185, 129, 0.1);
            border: 1px solid rgba(16, 185, 129, 0.2);
            padding: 6px 14px;
            border-radius: 20px;
        }
        .pulse-dot {
            width: 8px;
            height: 8px;
            background-color: var(--color-success);
            border-radius: 50%;
            box-shadow: 0 0 10px var(--color-success);
            animation: pulse-dot-anim 1.5s infinite;
        }
        @keyframes pulse-dot-anim {
            0% { transform: scale(0.9); opacity: 0.6; }
            50% { transform: scale(1.2); opacity: 1; }
            100% { transform: scale(0.9); opacity: 0.6; }
        }
        .badge-text {
            font-size: 11px;
            font-weight: 600;
            color: var(--color-success);
            letter-spacing: 0.5px;
        }
        .app-main-grid {
            display: grid;
            grid-template-columns: 340px 1fr 340px;
            gap: 24px;
            align-items: start;
        }
        .panel {
            background: var(--gradient-panel);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--color-border);
            border-radius: 20px;
            padding: 24px;
            box-shadow: var(--shadow-card);
            display: flex;
            flex-direction: column;
            gap: 20px;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }
        .panel:hover {
            border-color: var(--color-border-hover);
        }
        .panel-header {
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid var(--color-border);
            padding-bottom: 14px;
        }
        .panel-header i {
            font-size: 18px;
        }
        .panel-header h2 {
            font-family: var(--font-heading);
            font-size: 18px;
            font-weight: 600;
            letter-spacing: 0.5px;
        }
        .text-cyan { color: var(--color-cyan); }
        .text-magenta { color: var(--color-magenta); }
        .text-purple { color: var(--color-purple); }
        .control-panel {
            grid-column: 1;
        }
        .input-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .input-label-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .input-label-row label {
            font-size: 13px;
            font-weight: 600;
            color: var(--color-text-main);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .helper-text {
            font-size: 10px;
            color: var(--color-text-muted);
            font-weight: 500;
        }
                .number-input-wrapper {
            display: flex;
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid var(--color-border);
            background: #ffffff;
            transition: all 0.2s ease;
        }
        .number-input-wrapper:focus-within {
            border-color: var(--color-cyan);
            box-shadow: 0 0 10px var(--color-cyan-glow);
        }
        .number-input-wrapper:focus-within {
            border-color: var(--color-cyan);
            box-shadow: 0 0 10px var(--color-cyan-glow);
        }
                .custom-number-input {
            flex: 1;
            width: 0;
            min-width: 0;
            background: #f8fafc !important;
            border: none !important;
            outline: none !important;
            color: #0f172a !important;
            padding: 10px 14px !important;
            font-family: var(--font-body) !important;
            font-size: 15px !important;
            font-weight: 700 !important;
            text-align: right !important;
            box-shadow: none !important;
            -webkit-appearance: none !important;
            -moz-appearance: textfield !important;
        }
        .custom-number-input::-webkit-outer-spin-button,
        .custom-number-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        .custom-number-input::-webkit-outer-spin-button,
        .custom-number-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
                .unit-badge {
            background: rgba(0, 0, 0, 0.03);
            color: var(--color-text-muted);
            font-size: 11px;
            font-weight: 700;
            padding: 0 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-left: 1px solid var(--color-border);
            pointer-events: none;
            flex-shrink: 0;
        }
        .custom-slider {
            -webkit-appearance: none;
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: rgba(0, 0, 0, 0.05);
            outline: none;
            margin: 8px 0;
            transition: background 0.2s ease;
        }
        .custom-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            cursor: pointer;
            transition: transform 0.1s ease, box-shadow 0.2s ease;
        }
        #slider-d1::-webkit-slider-thumb {
            background: var(--color-cyan);
            box-shadow: 0 0 10px var(--color-cyan);
        }
        #slider-d1::-webkit-slider-thumb:hover { transform: scale(1.2); }
        #slider-d2::-webkit-slider-thumb {
            background: var(--color-magenta);
            box-shadow: 0 0 10px var(--color-magenta);
        }
        #slider-d2::-webkit-slider-thumb:hover { transform: scale(1.2); }
        #slider-v1::-webkit-slider-thumb {
            background: var(--color-purple);
            box-shadow: 0 0 10px var(--color-purple);
        }
        #slider-v1::-webkit-slider-thumb:hover { transform: scale(1.2); }
        #slider-p1::-webkit-slider-thumb {
            background: var(--color-success);
            box-shadow: 0 0 10px var(--color-success);
        }
        #slider-p1::-webkit-slider-thumb:hover { transform: scale(1.2); }
        .presets-section {
            display: flex;
            flex-direction: column;
            gap: 12px;
            border-top: 1px solid var(--color-border);
            padding-top: 18px;
        }
        .presets-section h3 {
            font-size: 13px;
            font-weight: 700;
            color: var(--color-text-main);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .presets-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 8px;
        }
        .preset-btn {
            background: rgba(0, 0, 0, 0.015);
            border: 1px solid var(--color-border);
            border-radius: 10px;
            padding: 10px 12px;
            cursor: pointer;
            color: var(--color-text-main);
            display: flex;
            align-items: center;
            gap: 12px;
            text-align: left;
            transition: all 0.2s ease;
        }
        .preset-btn:hover {
            background: rgba(0, 0, 0, 0.04);
            transform: translateX(4px);
        }
        .preset-btn.active {
            background: linear-gradient(90deg, var(--color-cyan-glow), var(--color-purple-glow));
            border-color: var(--color-cyan);
            box-shadow: 0 0 10px var(--color-cyan-glow);
        }
        .preset-icon {
            width: 28px;
            height: 28px;
            background: rgba(0, 0, 0, 0.02);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            color: var(--color-cyan);
        }
        .preset-btn:hover .preset-icon, .preset-btn.active .preset-icon {
            background: var(--gradient-primary);
            color: #fff;
        }
        .preset-name {
            font-size: 12px;
            font-weight: 600;
        }
        .simulation-panel {
            grid-column: 2;
            align-self: start;
            justify-content: flex-start;
        }
        .simulation-panel .panel-header {
            justify-content: space-between;
        }
        .canvas-scale-indicator {
            font-size: 11px;
            color: var(--color-text-muted);
            background: rgba(0, 0, 0, 0.02);
            padding: 4px 10px;
            border-radius: 6px;
            border: 1px solid var(--color-border);
        }
        .canvas-wrapper {
            position: relative;
            width: 100%;
            background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
            border: 1px solid rgba(0, 0, 0, 0.06);
            border-radius: 16px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #physics-canvas {
            display: block;
            width: 100%;
            height: auto;
            aspect-ratio: 16 / 10;
        }
        .simulation-metrics-strip {
            display: flex;
            background: rgba(0, 0, 0, 0.01);
            border: 1px solid var(--color-border);
            border-radius: 12px;
            padding: 12px 20px;
            justify-content: space-around;
            align-items: center;
            gap: 10px;
            margin-top: 10px;
        }
        .mini-metric {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            text-align: center;
        }
        .mini-metric .label {
            font-size: 10px;
            font-weight: 600;
            color: var(--color-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .mini-metric .value {
            font-size: 14px;
            font-weight: 700;
            color: var(--color-text-main);
            font-family: var(--font-heading);
        }
        .mini-divider {
            width: 1px;
            height: 24px;
            background: rgba(0, 0, 0, 0.03);
        }
        .results-panel {
            grid-column: 3;
        }
        .press-readout-box {
            border-radius: 16px;
            padding: 20px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            transition: all 0.3s ease;
        }
        .press-readout-box.normal {
            background: rgba(2, 132, 199, 0.08);
            border: 1px solid rgba(2, 132, 199, 0.25);
            box-shadow: 0 0 15px rgba(2, 132, 199, 0.05);
        }
        .press-readout-box.vacuum {
            background: rgba(219, 39, 119, 0.08);
            border: 1px solid rgba(219, 39, 119, 0.25);
            box-shadow: 0 0 15px rgba(219, 39, 119, 0.1);
            animation: glow-pulse-vac 2s infinite alternate;
        }
        @keyframes glow-pulse-vac {
            0% { border-color: rgba(219, 39, 119, 0.25); box-shadow: 0 0 10px rgba(219, 39, 119, 0.05); }
            100% { border-color: rgba(219, 39, 119, 0.6); box-shadow: 0 0 20px rgba(219, 39, 119, 0.2); }
        }
        .press-title {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 1px;
            text-transform: uppercase;
        }
        .press-readout-box.normal .press-title { color: var(--color-cyan); }
        .press-readout-box.vacuum .press-title { color: var(--color-magenta); }
        .press-value {
            font-family: var(--font-heading);
            font-weight: 800;
            font-size: 26px;
            color: var(--color-text-main);
        }
        .press-type {
            font-size: 11px;
            font-weight: 700;
            padding: 4px 12px;
            border-radius: 20px;
            color: #fff;
        }
        .press-readout-box.normal .press-type { background: var(--color-cyan); }
        .press-readout-box.vacuum .press-type { background: var(--color-magenta); }
        .results-grid {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .result-card {
            background: rgba(255, 255, 255, 0.85);
            border: 1px solid var(--color-border);
            border-radius: 12px;
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 16px;
            transition: all 0.2s ease;
        }
        .result-card:hover {
            transform: translateY(-2px);
            border-color: rgba(2, 132, 199, 0.2);
            background: rgba(2, 132, 199, 0.03);
        }
        .card-icon {
            width: 38px;
            height: 38px;
            background: rgba(0, 0, 0, 0.015);
            border: 1px solid var(--color-border);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: var(--color-text-muted);
        }
        .card-content {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .card-unit {
            font-size: 11px;
            font-weight: 600;
            color: var(--color-text-muted);
        }
        .card-value {
            font-family: var(--font-heading);
            font-weight: 700;
            font-size: 17px;
            color: var(--color-text-main);
        }
        .formula-card {
            background: rgba(0, 0, 0, 0.01);
            border: 1px solid var(--color-border);
            border-radius: 12px;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            font-size: 12px;
        }
        .formula-card h4 {
            font-weight: 700;
            color: var(--color-text-main);
        }
        .formula-equation {
            font-family: monospace;
            color: var(--color-cyan);
            font-size: 13px;
            background: #f8fafc;
            padding: 8px 10px;
            border-radius: 6px;
            border: 1px solid var(--color-border);
            text-align: center;
        }
        /* Container Query */
        @container bernoulli-container (max-width: 1100px) {
            .app-main-grid {
                grid-template-columns: 1fr 1fr;
                gap: 20px;
            }
            .control-panel {
                grid-column: 1;
            }
            .simulation-panel {
                grid-column: 2;
                align-self: start;
            }
            .results-panel {
                grid-column: 1 / span 2;
                display: grid;
                grid-template-columns: 1fr 1.2fr;
                gap: 20px;
            }
            .results-panel .panel-header {
                grid-column: 1 / span 2;
            }
            .press-readout-box {
                grid-column: 1;
                grid-row: 2;
            }
            .results-grid {
                grid-column: 2;
                grid-row: 2;
            }
        }
        @container bernoulli-container (max-width: 768px) {
            .app-main-grid {
                grid-template-columns: 1fr;
            }
            .control-panel, .simulation-panel, .results-panel {
                grid-column: 1;
            }
            .results-panel {
                display: flex;
                flex-direction: column;
                gap: 16px;
            }
            .press-readout-box, .results-grid {
                grid-column: auto;
                grid-row: auto;
            }
            .panel-header h2 {
                white-space: normal !important;
                font-size: 15px !important;
            }
            .app-header {
                flex-direction: column;
                gap: 16px;
                text-align: center;
            }
            .logo-area {
                flex-direction: column;
                gap: 8px;
            }
        }
        .preset-details {
            display: flex;
            flex-direction: column;
            gap: 2px;
            align-items: flex-start;
            text-align: left;
        }
        .preset-spec {
            font-size: 11px;
            color: var(--color-text-muted);
            font-weight: 500;
        }
        .preset-name {
            font-size: 13px !important;
        }
/* ━━ WordPress 레이아웃 Override: 디자인 1 (2열 컴팩트 대칭 레이아웃) ━━ */
.bernoulli-venturi-wrapper .app-main-grid,
.bernoulli-venturi-wrapper .main-grid,
.bernoulli-venturi-wrapper .sim-grid {
    display: grid !important;
    grid-template-columns: 340px 1fr !important;
    gap: 24px !important;
    align-items: start !important;
}
/* 3열 레이아웃을 2열 레이아웃으로 변경하는 특화 스타일 */
.bernoulli-venturi-wrapper .right-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    min-width: 0 !important;
    grid-column: 2 !important;
}
.bernoulli-venturi-wrapper .simulation-panel,
.bernoulli-venturi-wrapper .canvas-panel,
.bernoulli-venturi-wrapper .sim-panel {
    grid-column: auto !important;
    order: 1 !important;
    align-self: stretch !important;
}
.bernoulli-venturi-wrapper .control-panel {
    grid-column: 1 !important;
}
/* 2열 통합 결과 분석 영역 레이아웃 */
.bernoulli-venturi-wrapper .simulation-results-section {
    display: grid !important;
    grid-template-columns: 1.1fr 1.3fr !important;
    gap: 20px !important;
    border-top: 1px solid var(--color-border) !important;
    padding-top: 20px !important;
    margin-top: 10px !important;
    align-items: stretch !important;
}
/* Readout Box 스타일 */
.bernoulli-venturi-wrapper .simulation-results-section .ratio-readout-box,
.bernoulli-venturi-wrapper .simulation-results-section .re-readout-box,
.bernoulli-venturi-wrapper .simulation-results-section .status-readout-box,
.bernoulli-venturi-wrapper .simulation-results-section .gauge-container {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}
.bernoulli-venturi-wrapper .simulation-results-section .results-grid {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    justify-content: flex-start !important;
}
.bernoulli-venturi-wrapper .simulation-results-section .results-grid .result-card {
    flex: none !important;
    display: flex !important;
    align-items: center !important;
    min-height: 72px !important;
    height: auto !important;
    padding: 12px 16px !important;
}
.bernoulli-venturi-wrapper .simulation-results-section .formula-card {
    grid-column: 1 !important;
    grid-row: 2 !important;
}
/* 모바일/반응형 (800px 이하) ── 항상 세로형(1열) 정렬 및 시뮬레이터 캔버스 최상단 배치 */
@media (max-width: 800px) {
    .bernoulli-venturi-wrapper .app-main-grid,
    .bernoulli-venturi-wrapper .main-grid,
    .bernoulli-venturi-wrapper .sim-grid {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .bernoulli-venturi-wrapper .control-panel {
        order: 2 !important;
        width: 100% !important;
    }
    .bernoulli-venturi-wrapper .right-column {
        order: 1 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .bernoulli-venturi-wrapper .simulation-panel,
    .bernoulli-venturi-wrapper .canvas-panel,
    .bernoulli-venturi-wrapper .sim-panel,
    .bernoulli-venturi-wrapper .canvas-section {
        order: -1 !important;
    }
    .bernoulli-venturi-wrapper .simulation-results-section {
        grid-template-columns: 1fr !important;
    }
    .bernoulli-venturi-wrapper .simulation-results-section .ratio-readout-box,
    .bernoulli-venturi-wrapper .simulation-results-section .re-readout-box,
    .bernoulli-venturi-wrapper .simulation-results-section .status-readout-box,
    .bernoulli-venturi-wrapper .simulation-results-section .gauge-container {
        grid-column: 1 !important;
        grid-row: auto !important;
        height: auto !important;
    }
    .bernoulli-venturi-wrapper .simulation-results-section .results-grid {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
    .bernoulli-venturi-wrapper .simulation-results-section .formula-card {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}
.bernoulli-venturi-wrapper .app-container,
.bernoulli-venturi-wrapper .main-container {
    max-width: 100% !important;
    padding: 12px !important;
}
/* Premium Advice/Formula Card & Typography Overrides */
.bernoulli-venturi-wrapper .simulation-results-section .formula-card,
.bernoulli-venturi-wrapper .results-panel .formula-card {
    background: #ffffff !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: var(--shadow-card) !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}
.bernoulli-venturi-wrapper .simulation-results-section .formula-card h4,
.bernoulli-venturi-wrapper .results-panel .formula-card h4 {
    font-weight: 700 !important;
    color: var(--color-text-main) !important;
}
.bernoulli-venturi-wrapper #text-judgment {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--color-text-muted) !important;
    line-height: 1.6 !important;
    word-break: keep-all !important;
}
</style>
<div class="bernoulli-venturi-wrapper" style="position: relative; width: 100%; box-sizing: border-box; overflow: hidden; margin: 30px auto; border-radius: 20px;">
    <div class="app-background-glow" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: hidden;"></div>
    <div style="position: relative; z-index: 2; width: 100%;">
    <div class="app-container">
        <header class="app-header">
            <div class="logo-area">
                <div class="logo-icon"><i class="fa-solid fa-arrows-split-up-and-left"></i></div>
                <div>
                    <h1>BERNOULLI VENTURI</h1>
                    <div class="subtitle">베르누이 정리 &#038; 벤투리 유동 수치 계산기</div>
                </div>
            </div>
            <div class="header-badge">
                <div class="pulse-dot"></div>
                <span class="badge-text">BERNOULLI LAW</span>
            </div>
        </header>
        <div class="app-main-grid">
            <!-- Controls -->
            <div class="panel control-panel">
                <div class="panel-header text-cyan">
                    <i class="fa-solid fa-sliders"></i>
                    <h2>유체 벤투리 물성 입력</h2>
                </div>
                <!-- D1 Inlet Diameter -->
                <div class="input-group">
                    <div class="input-label-row">
                        <label for="input-d1"><i class="fa-solid fa-circle text-cyan"></i> 입구 지름 (D₁)</label>
                        <span class="helper-text">범위: 50 ~ 250 mm</span>
                    </div>
                    <div class="number-input-wrapper">
                        <input type="number" id="input-d1" class="custom-number-input" min="50" max="250" value="150">
                        <span class="unit-badge">mm</span>
                    </div>
                    <input type="range" id="slider-d1" class="custom-slider" min="50" max="250" value="150">
                </div>
                <!-- D2 Throat Diameter -->
                <div class="input-group">
                    <div class="input-label-row">
                        <label for="input-d2"><i class="fa-solid fa-circle text-magenta"></i> 수축부 목 지름 (D₂)</label>
                        <span class="helper-text">범위: 20 ~ 140 mm</span>
                    </div>
                    <div class="number-input-wrapper">
                        <input type="number" id="input-d2" class="custom-number-input" min="20" max="140" value="60">
                        <span class="unit-badge">mm</span>
                    </div>
                    <input type="range" id="slider-d2" class="custom-slider" min="20" max="140" value="60">
                </div>
                <!-- v1 Inlet Velocity -->
                <div class="input-group">
                    <div class="input-label-row">
                        <label for="input-v1"><i class="fa-solid fa-gauge-high text-purple"></i> 입구 흐름 속도 (v₁)</label>
                        <span class="helper-text">범위: 0.1 ~ 5.0 m/s</span>
                    </div>
                    <div class="number-input-wrapper">
                        <input type="number" id="input-v1" class="custom-number-input" min="0.1" max="5.0" step="0.1" value="1.5">
                        <span class="unit-badge">m/s</span>
                    </div>
                    <input type="range" id="slider-v1" class="custom-slider" min="1" max="50" value="15">
                </div>
                <!-- P1 Inlet Pressure -->
                <div class="input-group">
                    <div class="input-label-row">
                        <label for="input-p1"><i class="fa-solid fa-compress text-success"></i> 입구 정적 압력 (P₁)</label>
                        <span class="helper-text">범위: 100 ~ 500 kPa</span>
                    </div>
                    <div class="number-input-wrapper">
                        <input type="number" id="input-p1" class="custom-number-input" min="100" max="500" value="250">
                        <span class="unit-badge">kPa</span>
                    </div>
                    <input type="range" id="slider-p1" class="custom-slider" min="100" max="500" value="250">
                </div>
                <!-- Presets -->
                <div class="presets-section">
                    <h3><i class="fa-solid fa-vial"></i> 벤투리 설계 프리셋</h3>
                    <div class="presets-grid">
                        <button class="preset-btn" data-preset="standard">
                            <div class="preset-icon"><i class="fa-solid fa-gauge-simple"></i></div>
                            <div class="preset-details"><span class="preset-name">표준 감압 설계</span><span class="preset-spec">150-60A, 1.5m/s</span></div>
                        </button>
                        <button class="preset-btn" data-preset="vacuumJet">
                            <div class="preset-icon"><i class="fa-solid fa-wind"></i></div>
                            <div class="preset-details"><span class="preset-name">이젝터 진공 흡입</span><span class="preset-spec">200-50A, 2.5m/s</span></div>
                        </button>
                        <button class="preset-btn" data-preset="lowDiff">
                            <div class="preset-icon"><i class="fa-solid fa-equals"></i></div>
                            <div class="preset-details"><span class="preset-name">미소 수축 유량계</span><span class="preset-spec">120-100A, 1.0m/s</span></div>
                        </button>
                    </div>
                </div>
            </div>
            <!-- Auto Injected Right Column wrapper for Design 1 -->
            <div class="right-column">
                <div class="panel simulation-panel">
                                <div class="panel-header text-purple">
                                    <div style="display: flex; align-items: center; gap: 12px;">
                                        <i class="fa-solid fa-display"></i>
                                        <h2>실시간 벤투리 액주계 압력 강하 시각화</h2>
                                    </div>
                                    <div class="canvas-scale-indicator" id="txt-canvas-scale">직경 수축비: 2.50배</div>
                                </div>
                                <div class="canvas-wrapper">
                                    <canvas id="physics-canvas" width="640" height="400"></canvas>
                                </div>
                                <div class="simulation-metrics-strip">
                                    <div class="mini-metric">
                                        <span class="label">차압 (&Delta;P)</span>
                                        <span class="value" id="mini-delta-p">120 kPa</span>
                                    </div>
                                    <div class="mini-divider"></div>
                                    <div class="mini-metric">
                                        <span class="label">입구 동압 (Pd1)</span>
                                        <span class="value" id="mini-pd1">1.13 kPa</span>
                                    </div>
                                    <div class="mini-divider"></div>
                                    <div class="mini-metric">
                                        <span class="label">목부 동압 (Pd2)</span>
                                        <span class="value" id="mini-pd2">44.1 kPa</span>
                                    </div>
                                </div>
                            <div class="simulation-results-section">
                                <div class="press-readout-box normal" id="press-box">
                                    <span class="press-title">THROAT STATIC PRESSURE (P₂)</span>
                                    <span class="press-value" id="txt-p2">156.2 kPa</span>
                                    <span class="press-type" id="txt-press-status">정압 안심 상태</span>
                                </div>
                                <div class="results-grid">
                                    <div class="result-card">
                                        <div class="card-icon text-cyan"><i class="fa-solid fa-bolt-lightning"></i></div>
                                        <div class="card-content">
                                            <span class="card-unit">수축 목부 유속 (v₂)</span>
                                            <span class="card-value" id="txt-v2">9.38 m/s</span>
                                        </div>
                                    </div>
                                    <div class="result-card">
                                        <div class="card-icon text-purple"><i class="fa-solid fa-ratio"></i></div>
                                        <div class="card-content">
                                            <span class="card-unit">유량 보존 체적 유량 (Q)</span>
                                            <span class="card-value" id="txt-q">95.4 m³/h</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="formula-card">
                                        <h4>베르누이 방정식 적용 공식</h4>
                                        <div class="formula-equation">P₂ = P₁ &#8211; &frac12;&rho;(v₂² &#8211; v₁²)</div>
                                        <p>
                                            * 유체 밀도는 1000 kg/m³(물 기준) 상수로 산정하여 수축 가속 유속에 의한 저압 발생치를 도출합니다.
                                        </p>
                                    </div>
                            </div>
                </div>
            </div>
        </div>
        <!-- Disclaimer Footer -->
        <footer class="app-disclaimer" style="margin-top: 20px; padding: 12px 16px; background: rgba(0, 0, 0, 0.015); border: 1px solid var(--color-border); border-radius: 12px; font-size: 11px; color: var(--color-text-muted); line-height: 1.5; text-align: left; display: flex; gap: 10px; align-items: flex-start; clear: both;">
            <i class="fa-solid fa-circle-info" style="color: var(--color-cyan); font-size: 14px; margin-top: 2px; flex-shrink: 0;"></i>
            <span><strong>면책 조항 (Disclaimer):</strong> 본 시뮬레이터의 계산 결과는 교육 및 참고용으로만 제공되며, 실제 제품 설계나 제작 시에는 반드시 최신 공학 규격 및 공식 표준 설계 기준을 재확인하시기 바랍니다. 계산 값의 무결성을 보장하지 않으며, 이로 인해 발생하는 직접적/간접적 손해에 대해 제작자 및 본 블로그는 어떠한 책임을 지지 않습니다.</span>
        </footer>
</div>
    </div>
</div>
<script>
        (function() {
            // State
            const state = {
                d1: 150,     // mm
                d2: 60,      // mm
                v1: 1.5,     // m/s
                p1: 250,     // kPa
                rho: 1000,   // kg/m³
                particles: [],
                lastTime: 0
            };
            // DOM Elements
            const inputD1 = document.getElementById('input-d1');
            const sliderD1 = document.getElementById('slider-d1');
            const inputD2 = document.getElementById('input-d2');
            const sliderD2 = document.getElementById('slider-d2');
            const inputV1 = document.getElementById('input-v1');
            const sliderV1 = document.getElementById('slider-v1');
            const inputP1 = document.getElementById('input-p1');
            const sliderP1 = document.getElementById('slider-p1');
            const txtP2 = document.getElementById('txt-p2');
            const txtPressStatus = document.getElementById('txt-press-status');
            const pressBox = document.getElementById('press-box');
            const txtV2 = document.getElementById('txt-v2');
            const txtQ = document.getElementById('txt-q');
            const miniDeltaP = document.getElementById('mini-delta-p');
            const miniPd1 = document.getElementById('mini-pd1');
            const miniPd2 = document.getElementById('mini-pd2');
            const presetButtons = document.querySelectorAll('.preset-btn');
            const canvas = document.getElementById('physics-canvas');
            const ctx = canvas.getContext('2d');
            function getDPR() {
                return window.devicePixelRatio || 1;
            }
            function initCanvas() {
                const dpr = getDPR();
                const rect = canvas.getBoundingClientRect();
                canvas.width = rect.width * dpr;
                canvas.height = rect.height * dpr;
                ctx.scale(dpr, dpr);
            }
            window.addEventListener('resize', initCanvas);
            initCanvas();
            setTimeout(initCanvas, 300);
            // Initialize Particles
            const maxParticles = 90;
            for (let i = 0; i < maxParticles; i++) {
                state.particles.push({
                    x: Math.random() * 640,
                    yFraction: 0.1 + Math.random() * 0.8
                });
            }
            // Clamping rules to prevent Throat Diameter >= Inlet Diameter
            function validateThroatDiameter() {
                const maxAllowedD2 = state.d1 - 10;
                if (state.d2 > maxAllowedD2) {
                    state.d2 = maxAllowedD2;
                    inputD2.value = state.d2;
                    sliderD2.value = state.d2;
                }
                sliderD2.max = maxAllowedD2;
            }
            // Sync Listeners
            function syncD1FromSlider() {
                state.d1 = parseInt(sliderD1.value);
                inputD1.value = state.d1;
                validateThroatDiameter();
                clearPresets();
                updateCalculations();
            }
            function syncD1FromInput() {
                let val = parseInt(inputD1.value);
                if (isNaN(val)) { val = 150; }
                if (val < 50) { val = 50; }
                if (val > 250) { val = 250; }
                state.d1 = val;
                inputD1.value = val;
                sliderD1.value = val;
                validateThroatDiameter();
                clearPresets();
                updateCalculations();
            }
            function syncD2FromSlider() {
                state.d2 = parseInt(sliderD2.value);
                inputD2.value = state.d2;
                validateThroatDiameter();
                clearPresets();
                updateCalculations();
            }
            function syncD2FromInput() {
                let val = parseInt(inputD2.value);
                if (isNaN(val)) { val = 60; }
                if (val < 20) { val = 20; }
                if (val > state.d1 - 10) { val = state.d1 - 10; }
                state.d2 = val;
                inputD2.value = val;
                sliderD2.value = val;
                validateThroatDiameter();
                clearPresets();
                updateCalculations();
            }
            function syncV1FromSlider() {
                state.v1 = parseFloat(sliderV1.value) / 10;
                inputV1.value = state.v1.toFixed(1);
                clearPresets();
                updateCalculations();
            }
            function syncV1FromInput() {
                let val = parseFloat(inputV1.value);
                if (isNaN(val)) { val = 1.5; }
                if (val < 0.1) { val = 0.1; }
                if (val > 5.0) { val = 5.0; }
                state.v1 = val;
                inputV1.value = val.toFixed(1);
                sliderV1.value = Math.round(val * 10);
                clearPresets();
                updateCalculations();
            }
            function syncP1FromSlider() {
                state.p1 = parseInt(sliderP1.value);
                inputP1.value = state.p1;
                clearPresets();
                updateCalculations();
            }
            function syncP1FromInput() {
                let val = parseInt(inputP1.value);
                if (isNaN(val)) { val = 250; }
                if (val < 100) { val = 100; }
                if (val > 500) { val = 500; }
                state.p1 = val;
                inputP1.value = val;
                sliderP1.value = val;
                clearPresets();
                updateCalculations();
            }
            sliderD1.addEventListener('input', syncD1FromSlider);
            inputD1.addEventListener('change', syncD1FromInput);
            sliderD2.addEventListener('input', syncD2FromSlider);
            inputD2.addEventListener('change', syncD2FromInput);
            sliderV1.addEventListener('input', syncV1FromSlider);
            inputV1.addEventListener('change', syncV1FromInput);
            sliderP1.addEventListener('input', syncP1FromSlider);
            inputP1.addEventListener('change', syncP1FromInput);
            // Presets
            function loadPreset(presetKey) {
                clearPresets();
                presetButtons.forEach(function(btn) {
                    if (btn.dataset.preset === presetKey) {
                        btn.classList.add('active');
                    }
                });
                if (presetKey === 'standard') {
                    state.d1 = 150;
                    state.d2 = 60;
                    state.v1 = 1.5;
                    state.p1 = 250;
                } else if (presetKey === 'vacuumJet') {
                    state.d1 = 200;
                    state.d2 = 45;
                    state.v1 = 2.5;
                    state.p1 = 150;
                } else if (presetKey === 'lowDiff') {
                    state.d1 = 120;
                    state.d2 = 100;
                    state.v1 = 1.0;
                    state.p1 = 300;
                }
                inputD1.value = state.d1;
                sliderD1.value = state.d1;
                inputD2.value = state.d2;
                sliderD2.value = state.d2;
                inputV1.value = state.v1.toFixed(1);
                sliderV1.value = Math.round(state.v1 * 10);
                inputP1.value = state.p1;
                sliderP1.value = state.p1;
                validateThroatDiameter();
                updateCalculations();
            }
            function clearPresets() {
                presetButtons.forEach(function(btn) {
                    btn.classList.remove('active');
                });
            }
            presetButtons.forEach(function(btn) {
                btn.addEventListener('click', function() {
                    loadPreset(btn.dataset.preset);
                });
            });
            // Physics Calcs
            function updateCalculations() {
                const ratio = state.d1 / state.d2;
                const areaRatio = Math.pow(ratio, 2);
                // Throat velocity v2
                const v2 = state.v1 * areaRatio;
                txtV2.innerText = v2.toFixed(2) + ' m/s';
                // Flow rate Q = A1 * v1 * 3600 (m³/h)
                const d1M = state.d1 / 1000;
                const area1 = (Math.PI * Math.pow(d1M, 2)) / 4;
                const qM3h = area1 * state.v1 * 3600;
                txtQ.innerText = qM3h.toFixed(1) + ' m³/h';
                // Pressures
                // Pd1 = 0.5 * rho * v1^2 / 1000 in kPa
                const pd1 = (0.5 * state.rho * Math.pow(state.v1, 2)) / 1000;
                // Pd2 = 0.5 * rho * v2^2 / 1000 in kPa
                const pd2 = (0.5 * state.rho * Math.pow(v2, 2)) / 1000;
                miniPd1.innerText = pd1.toFixed(2) + ' kPa';
                miniPd2.innerText = pd2.toFixed(1) + ' kPa';
                // P2 = P1 - (Pd2 - Pd1)
                const p2 = state.p1 - (pd2 - pd1);
                txtP2.innerText = p2.toFixed(1) + ' kPa';
                const deltaPVal = state.p1 - p2;
                miniDeltaP.innerText = deltaPVal.toFixed(1) + ' kPa';
                // Eval warning for vacuums/cavitations
                pressBox.className = 'press-readout-box';
                if (p2 < 0) {
                    pressBox.classList.add('vacuum');
                    txtPressStatus.innerText = '진공 흡착 유도 상태 (Vacuum Jet)';
                } else if (p2 < 15.0) {
                    // Water boiling cap is low at room temp (around 3 kPa absolute)
                    pressBox.classList.add('vacuum');
                    txtPressStatus.innerText = '공동현상(Cavitation) 극도 주의!';
                } else {
                    pressBox.classList.add('normal');
                    txtPressStatus.innerText = '안정적 압력 상태';
                }
                const txtCanvasScale = document.getElementById('txt-canvas-scale');
                if (txtCanvasScale) {
                    txtCanvasScale.innerText = `직경 비율: ${(state.d1 / state.d2).toFixed(2)}배 수축`;
                }
            }
            // Draw Venturi
            function draw(currentTime) {
                requestAnimationFrame(draw);
                let dt = (currentTime - state.lastTime) / 1000;
                if (isNaN(dt)) { dt = 0.016; }
                if (dt < 0) { dt = 0.016; }
                if (dt > 0.1) { dt = 0.016; }
                state.lastTime = currentTime;
                const dpr = getDPR();
                const width = canvas.width / dpr;
                const height = canvas.height / dpr;
                const scale = Math.min(width / 640, height / 400);
                ctx.clearRect(0, 0, width, height);
                // Grid
                ctx.save();
                ctx.strokeStyle = 'rgba(2, 132, 199, 0.04)';
                ctx.lineWidth = 1;
                for (let x = 0; x < width; x += 30 * scale) {
                    ctx.beginPath();
                    ctx.moveTo(x, 0);
                    ctx.lineTo(x, height);
                    ctx.stroke();
                }
                for (let y = 0; y < height; y += 30 * scale) {
                    ctx.beginPath();
                    ctx.moveTo(0, y);
                    ctx.lineTo(width, y);
                    ctx.stroke();
                }
                ctx.restore();
                // Venturi pipe coordinates mapping
                // Pipe sections along x: 
                // Left (straight, Inlet): x=0 to x=180
                // Constriction: x=180 to x=320 (Throat center at x=320)
                // Expansion: x=320 to x=460
                // Right (straight): x=460 to x=640
                // Mapped pixel heights
                const maxPixH = 150 * scale;
                const minPixH = 30 * scale;
                // Inlet height (D1) scaled
                const h1 = 60 * scale + ((state.d1 - 50) / 200) * (maxPixH - 60 * scale);
                // Throat height (D2) scaled
                const h2 = minPixH + ((state.d2 - 20) / 120) * (h1 - 20 * scale - minPixH);
                const cy = height / 2 + 30 * scale; // lower center to make room for glass columns on top
                // Helper to get pipe height at any given x
                function getPipeHalfHeightAt(x) {
                    const sx = x / scale;
                    if (sx < 180) {
                        return h1 / 2;
                    }
                    if (sx < 320) {
                        // linear interpolation or cosine easing for smooth transition
                        const ratio = (sx - 180) / 140;
                        const smoothRatio = (1 - Math.cos(ratio * Math.PI)) / 2;
                        return (h1 / 2) * (1 - smoothRatio) + (h2 / 2) * smoothRatio;
                    }
                    if (sx < 460) {
                        const ratio = (sx - 320) / 140;
                        const smoothRatio = (1 - Math.cos(ratio * Math.PI)) / 2;
                        return (h2 / 2) * (1 - smoothRatio) + (h1 / 2) * smoothRatio;
                    }
                    return h1 / 2;
                }
                // 1. Draw Venturi Glass contours
                ctx.save();
                ctx.fillStyle = 'rgba(2, 132, 199, 0.12)';
                ctx.beginPath();
                ctx.moveTo(0, cy - getPipeHalfHeightAt(0));
                for (let x = 0; x <= width; x += 5 * scale) {
                    ctx.lineTo(x, cy - getPipeHalfHeightAt(x));
                }
                ctx.lineTo(width, cy + getPipeHalfHeightAt(width));
                for (let x = width; x >= 0; x -= 5 * scale) {
                    ctx.lineTo(x, cy + getPipeHalfHeightAt(x));
                }
                ctx.closePath();
                ctx.fill();
                // Draw Pipe boundary lines
                ctx.strokeStyle = '#475569';
                ctx.lineWidth = 3.5 * scale;
                ctx.beginPath();
                ctx.moveTo(0, cy - getPipeHalfHeightAt(0));
                for (let x = 0; x <= width; x += 5 * scale) {
                    ctx.lineTo(x, cy - getPipeHalfHeightAt(x));
                }
                ctx.stroke();
                ctx.beginPath();
                ctx.moveTo(0, cy + getPipeHalfHeightAt(0));
                for (let x = 0; x <= width; x += 5 * scale) {
                    ctx.lineTo(x, cy + getPipeHalfHeightAt(x));
                }
                ctx.stroke();
                ctx.restore();
                // 2. Draw vertical manometer glass tubes
                // Tube 1 (Inlet, center at x = 90)
                // Tube 2 (Throat, center at x = 320)
                const tube1X = 90 * scale;
                const tube2X = 320 * scale;
                const tubeWidth = 14 * scale;
                // Mapped static water height: P1 [100 ~ 500] -> [40 ~ 160] pixels high
                const hFluid1 = (40 + ((state.p1 - 100) / 400) * 120) * scale;
                // Calculate P2
                const ratio = state.d1 / state.d2;
                const v2 = state.v1 * Math.pow(ratio, 2);
                const pd1 = (0.5 * state.rho * Math.pow(state.v1, 2)) / 1000;
                const pd2 = (0.5 * state.rho * Math.pow(v2, 2)) / 1000;
                const p2 = state.p1 - (pd2 - pd1);
                // Water column 2 height scaled
                let hFluid2 = (40 + ((p2 - 100) / 400) * 120) * scale;
                if (p2 < 0) { hFluid2 = 5 * scale; } // Vacuum drops to minimum visible line
                // Draw Glass columns
                ctx.save();
                ctx.fillStyle = 'rgba(255, 255, 255, 0.4)';
                ctx.strokeStyle = '#64748b';
                ctx.lineWidth = 2 * scale;
                // Column 1
                const colTopY1 = cy - getPipeHalfHeightAt(tube1X);
                ctx.fillRect(tube1X - tubeWidth / 2, colTopY1 - 180 * scale, tubeWidth, 180 * scale);
                ctx.beginPath();
                ctx.moveTo(tube1X - tubeWidth / 2, colTopY1 - 180 * scale);
                ctx.lineTo(tube1X - tubeWidth / 2, colTopY1);
                ctx.moveTo(tube1X + tubeWidth / 2, colTopY1 - 180 * scale);
                ctx.lineTo(tube1X + tubeWidth / 2, colTopY1);
                ctx.stroke();
                // Liquid in Column 1
                ctx.fillStyle = 'rgba(2, 132, 199, 0.6)';
                ctx.fillRect(tube1X - tubeWidth / 2 + 1, colTopY1 - hFluid1, tubeWidth - 2, hFluid1);
                // Column 2
                const colTopY2 = cy - getPipeHalfHeightAt(tube2X);
                ctx.fillStyle = 'rgba(255, 255, 255, 0.4)';
                ctx.fillRect(tube2X - tubeWidth / 2, colTopY2 - 180 * scale, tubeWidth, 180 * scale);
                ctx.beginPath();
                ctx.moveTo(tube2X - tubeWidth / 2, colTopY2 - 180 * scale);
                ctx.lineTo(tube2X - tubeWidth / 2, colTopY2);
                ctx.moveTo(tube2X + tubeWidth / 2, colTopY2 - 180 * scale);
                ctx.lineTo(tube2X + tubeWidth / 2, colTopY2);
                ctx.stroke();
                // Liquid in Column 2
                if (p2 < 0) {
                    // Show a blinking negative pressure indicator or vacuum bubbles
                    ctx.fillStyle = 'rgba(219, 39, 119, 0.7)';
                    ctx.fillRect(tube2X - tubeWidth / 2 + 1, colTopY2 - hFluid2, tubeWidth - 2, hFluid2);
                } else {
                    ctx.fillStyle = 'rgba(2, 132, 199, 0.6)';
                    ctx.fillRect(tube2X - tubeWidth / 2 + 1, colTopY2 - hFluid2, tubeWidth - 2, hFluid2);
                }
                ctx.restore();
                // 3. Animate Particles flowing through Venturi
                ctx.save();
                ctx.fillStyle = '#0284c7';
                state.particles.forEach(function(p) {
                    // Particle local velocity depends on coordinates
                    const halfH = getPipeHalfHeightAt(p.x);
                    const pipeMaxHalfH = h1 / 2;
                    // Continuity speed scaling
                    const areaScale = pipeMaxHalfH / halfH;
                    const speed = state.v1 * 120 * areaScale * scale;
                    p.x += speed * dt;
                    // Bound wrapping
                    if (p.x > width + 10 * scale) {
                        p.x = -10 * scale;
                        p.yFraction = 0.1 + Math.random() * 0.8;
                    }
                    // Compute vertical pixel position
                    const yPos = cy + (p.yFraction - 0.5) * 2 * halfH;
                    // Color shifts based on velocity
                    if (areaScale > 1.8) {
                        ctx.fillStyle = '#db2777';
                    } else if (areaScale > 1.2) {
                        ctx.fillStyle = '#7c3aed';
                    } else {
                        ctx.fillStyle = '#0284c7';
                    }
                    ctx.beginPath();
                    ctx.arc(p.x, yPos, 2.5 * scale, 0, Math.PI * 2);
                    ctx.fill();
                });
                ctx.restore();
            }
            // Right click/Copy block with nested if
            document.addEventListener('contextmenu', function(e) {
                e.preventDefault();
                alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                return false;
            }, { capture: true });
            document.addEventListener('selectstart', function(e) {
                e.preventDefault();
                return false;
            }, { capture: true });
            document.addEventListener('keydown', function(e) {
                if (e.key === 'F12') {
                    e.preventDefault();
                    alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                    return false;
                }
                if (e.ctrlKey) {
                    if (e.key === 'u' || e.key === 'c' || e.key === 's' || e.key === 'U' || e.key === 'C' || e.key === 'S') {
                        e.preventDefault();
                        alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                        return false;
                    }
                    if (e.shiftKey) {
                        if (['i','I','j','J','c','C'].includes(e.key)) {
                            e.preventDefault();
                            alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                            return false;
                        }
                    }
                }
            }, { capture: true });
            // Initialize
            loadPreset('standard');
            requestAnimationFrame(draw);
        })();
</script>


<div style="background: linear-gradient(135deg, rgba(0,242,254,0.03), rgba(138,43,226,0.03)); border: 1px solid rgba(0,242,254,0.15); border-radius: 12px; padding: 18px 24px; margin: 25px auto 35px auto; font-size: 0.95em; color: #4b5563; line-height: 1.7; font-family: sans-serif;">
    <strong style="color: #1f2937; font-size: 1.05em; display: flex; align-items: center; gap: 8px;">
        <span style="font-size: 1.2em;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span> 간편 사용 설명서
    </strong>
    <ol style="margin: 10px 0 0 0; padding-left: 20px;">
        <li style="margin-bottom: 6px;"><strong>배관 형상 입구(D1) 및 수축부 목(D2) 직경 설정: 슬라이더를 당겨 입구 구경과 가열 통로인 수축부(Throat) 구경을 지정합니다. (목 직경은 항상 입구 직경보다 작아야 합니다.)</strong></li>
<li style="margin-bottom: 6px;">입구 유속 및 정적 압력(P1) 설정: 유체가 벤투리 유입구로 들어올 때의 평균 유속(m/s)과 시작 정압(kPa)을 조절합니다.</li>
<li style="margin-bottom: 6px;">실시간 벤투리 감압 관찰: 수축부로 빨려 들어가는 파티클이 급격히 가속되고, 수축 지점에서 압력 게이지 액주계(Manometer) 높이가 크게 줄어드는 &#8216;벤투리 효과&#8217;를 목격합니다.</li>
<li style="margin-bottom: 6px;">정압/동압 분석 보고서 활용: 수축 단면에서의 최종 압력(P2)이 음압(진공) 상태에 진입하여 인젝터 흡입 구동력을 발생시킬 수 있는지 실시간 모듈에서 확인합니다.</li>
    </ol>
</div>


<details class="premium-seo-accordion" style="border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; background: #fbfbfc; padding: 0; margin: 30px auto; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.01); font-family: sans-serif;">
    <summary style="display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; font-size: 1.1em; font-weight: 700; color: #1f2937; cursor: pointer; user-select: none; outline: none; list-style: none;">
        <span><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4da.png" alt="📚" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 베르누이 방정식(Bernoulli&#8217;s Equation)과 벤투리 효과(Venturi Effect) 수학적 이론 유도</span>
        <span class="accordion-arrow" style="font-size: 0.9em; color: #9ca3af; transition: transform 0.2s ease;">▼</span>
    </summary>
    <div style="padding: 0 24px 24px 24px; border-top: 1px solid rgba(0,0,0,0.04); background: #ffffff; border-radius: 0 0 12px 12px; font-size: 0.98em; color: #374151; line-height: 1.8;">
        <div style="margin-top: 20px;">
            <h3>1. 베르누이 정리(Bernoulli&#8217;s Theorem)의 기본 원리 및 물리적 정의</h3>
<p>유체역학의 가장 기본이 되는 **베르누이 방정식(Bernoulli&#8217;s Equation)**은 흐르는 유체에 대한 **에너지 보존 법칙**의 다른 표현입니다. 마찰이 없고 압축되지 않는 완전유체(Ideal Fluid)가 일정한 유선을 따라 흐를 때, 흐름 안의 어느 점에서도 단위 체적당 유체가 가진 **정압(Static Pressure)**, **동압(Dynamic Pressure)**, **위치 수두 에너지(Potential Pressure)**의 합은 항상 일정하게 유지됩니다.</p><p style="text-align: center; font-weight: bold; background: #e0f2fe; padding: 16px; border-radius: 8px; font-size: 1.05em; color: #0369a1;">P + &frac12; &times; &rho; &times; v&sup2; + &rho; &times; g &times; z = Constant</p><p>여기서 <code>P</code>는 유체의 정압(Pa), <code>&rho;</code>는 유체 밀도(kg/m³), <code>v</code>는 흐름 속도(m/s), <code>g</code>는 중력가속도, <code>z</code>는 기준면으로부터의 높이(m)입니다. 수평으로 놓인 배관(<code>z1 = z2</code>)에서는 위치 에너지가 상쇄되므로, 유속이 빨라지면 반드시 정압이 하락하며 반대로 유속이 느려지면 정압이 상승하게 됩니다.</p>
<h3>2. 연속방정식과 연계한 벤투리 수축부 속도 및 압력 거동 계산</h3>
<p>유체가 단면적이 좁아지는 벤투리관 수축부를 지나갈 때, 통과 질량이 보존되어야 하므로 유동의 단면 속도는 관내 축소비율에 반비례하여 급상승합니다(연속방정식: <code>A1v1 = A2v2</code>).</p><p style="text-align: center; font-weight: bold; background: #f3f4f6; padding: 12px; border-radius: 8px;">v2 = v1 &times; (A1 / A2) = v1 &times; (D1 / D2)&sup2;</p><p>상승한 가속 유속 <code>v2</code>를 베르누이 방정식에 대입하면 수축부(Throat)에서의 정압 <code>P2</code>를 도출할 수 있습니다.</p><p style="text-align: center; font-weight: bold; background: #f3f4f6; padding: 12px; border-radius: 8px;">P2 = P1 &#8211; &frac12; &times; &rho; &times; (v2&sup2; &#8211; v1&sup2;)</p><p>만약 수축 비율이 극도로 커서 가속 유속이 한계치를 초과할 경우, 계산식 상의 <code>P2</code>가 대기압 이하로 감소하는 **진공 영역(Vacuum Pressure)**에 도달하게 됩니다. 이 저압 진공력에 의해 다른 부근의 액체나 가스를 스스로 빨아들이는 흡인 작용이 발생하며, 이는 스프레이 건, 기화기, 수류 이젝터 설계의 핵심 응용 물리로 활용됩니다.</p>
<h3>3. 실제 유체 해석(Loss and Cavitation)에서의 제한 요인</h3>
<p>이상 유체 계산식과 달리, 실제 점성 유체가 흐를 때는 내벽 마찰과 확산부에서의 와류 발생으로 인해 수축 단면 전후에 **마찰 압력 손실(Head Loss)**이 일어납니다. 또한 정압 <code>P2</code>가 이송 유체의 그 온도에 따른 **포화증기압(Vapor Pressure)** 이하로 떨어질 경우 유체가 관 내에서 비등 기화하여 **기포(Cavitation Bubble)**를 형성하는 공동현상이 일어날 수 있으며, 이는 배관 파손을 야기하므로 설계 시 임계 압력 이하로 떨어지지 않도록 철저히 차단 제어해야 합니다.</p>
        </div>
    </div>
</details>
<style>
details.premium-seo-accordion[open] summary .accordion-arrow { transform: rotate(180deg); color: #00f2fe; }
details.premium-seo-accordion summary::-webkit-details-marker { display: none; }
details.premium-seo-accordion:hover { border-color: rgba(0,242,254,0.3); }
</style>

]]></content:encoded>
					
					<wfw:commentRss>https://myengnote.com/bernoulli-venturi-effect-calculator-simulator/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>배관 유량 계산기 &#038; 시뮬레이터</title>
		<link>https://myengnote.com/pipe-flow-velocity-calculator-simulator/</link>
					<comments>https://myengnote.com/pipe-flow-velocity-calculator-simulator/#respond</comments>
		
		<dc:creator><![CDATA[동동]]></dc:creator>
		<pubDate>Sun, 07 Jun 2026 22:00:07 +0000</pubDate>
				<category><![CDATA[공학계산기]]></category>
		<category><![CDATA[공학설계]]></category>
		<category><![CDATA[배관경선정]]></category>
		<category><![CDATA[배관유량]]></category>
		<category><![CDATA[유속계산]]></category>
		<category><![CDATA[유체역학]]></category>
		<guid isPermaLink="false">https://myengnote.com/pipe-flow-velocity-calculator-simulator/</guid>

					<description><![CDATA[배관의 내경(D)과 설계 유량(Q)을 입력하여 단면 유속(v)을 실시간 산출하고, 배관 내 유속에 따른 권장 유속 조건 만족 여부 판정과 유체 흐름을 물리 엔진으로 시각화하는 고정밀 시뮬레이터입니다.]]></description>
										<content:encoded><![CDATA[
<h2 style="font-size: 1.6em; font-weight: 800; color: #0c0e25; border-bottom: 2px solid #00f2fe; padding-bottom: 8px; margin-bottom: 20px;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 배관 유량 계산기 &#038; 시뮬레이터</h2>


<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&#038;family=Outfit:wght@400;500;600;700;800&#038;display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* Scoped & Isolated Styles for pipe-flow-wrapper */
        /* Modern Reset and Design Tokens */
        .pipe-flow-wrapper *, .pipe-flow-wrapper *::before, .pipe-flow-wrapper *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        .pipe-flow-wrapper {
            --color-bg-dark: #f8f9fd;
            --color-bg-deep: #ffffff;
            --color-panel-bg: rgba(255, 255, 255, 0.85);
            --color-border: rgba(0, 0, 0, 0.06);
            --color-border-hover: rgba(0, 0, 0, 0.12);
            --color-text-main: #1e293b;
            --color-text-muted: #475569;
            --color-text-dark: #94a3b8;
            --color-cyan: #0284c7;
            --color-cyan-glow: rgba(2, 132, 199, 0.15);
            --color-magenta: #db2777;
            --color-magenta-glow: rgba(219, 39, 119, 0.15);
            --color-purple: #7c3aed;
            --color-purple-glow: rgba(124, 58, 237, 0.12);
            --color-success: #10b981;
            --color-warning: #f59e0b;
            --gradient-primary: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
            --gradient-accent: linear-gradient(135deg, var(--color-magenta) 0%, var(--color-purple) 100%);
            --gradient-panel: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.95) 100%);
            --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            --shadow-neon-cyan: 0 0 15px var(--color-cyan-glow);
            --shadow-neon-magenta: 0 0 15px var(--color-magenta-glow);
            --shadow-card: 0 8px 32px 0 rgba(15, 23, 42, 0.05);
            --blur-glass: blur(16px);
        }
        .pipe-flow-wrapper {
            background-color: var(--color-bg-dark);
            color: var(--color-text-main);
            font-family: var(--font-body);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            overflow-x: hidden;
            position: relative;
        }
        .app-background-glow {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            overflow: hidden;
            pointer-events: none;
        }
        .app-background-glow::before, 
        .app-background-glow::after {
            content: '';
            position: absolute;
            width: 600px;
            height: 600px;
            border-radius: 50%;
            filter: blur(140px);
            opacity: 0.15;
        }
        .app-background-glow::before {
            background: var(--color-cyan);
            top: -10%;
            right: -5%;
            animation: pulse-slow 15s infinite alternate;
        }
        .app-background-glow::after {
            background: var(--color-purple);
            bottom: -10%;
            left: -5%;
            animation: pulse-slow 20s infinite alternate-reverse;
        }
        @keyframes pulse-slow {
            0% { transform: scale(1) translate(0, 0); opacity: 0.12; }
            100% { transform: scale(1.2) translate(50px, 50px); opacity: 0.22; }
        }
        .app-container {
            width: 100%;
            max-width: 1440px;
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 24px;
        }
        .app-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 24px;
            background: var(--color-panel-bg);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--color-border);
            border-radius: 16px;
            box-shadow: var(--shadow-card);
        }
        .logo-area {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        .logo-icon {
            font-size: 32px;
            background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .logo-area h1 {
            font-family: var(--font-heading);
            font-weight: 800;
            font-size: 24px;
            letter-spacing: 1px;
            background: linear-gradient(90deg, var(--color-text-main), var(--color-text-muted));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .logo-area .subtitle {
            font-size: 12px;
            color: var(--color-text-muted);
            font-weight: 500;
            letter-spacing: 0.5px;
        }
        .header-badge {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(16, 185, 129, 0.1);
            border: 1px solid rgba(16, 185, 129, 0.2);
            padding: 6px 14px;
            border-radius: 20px;
        }
        .pulse-dot {
            width: 8px;
            height: 8px;
            background-color: var(--color-success);
            border-radius: 50%;
            box-shadow: 0 0 10px var(--color-success);
            animation: pulse-dot-anim 1.5s infinite;
        }
        @keyframes pulse-dot-anim {
            0% { transform: scale(0.9); opacity: 0.6; }
            50% { transform: scale(1.2); opacity: 1; }
            100% { transform: scale(0.9); opacity: 0.6; }
        }
        .badge-text {
            font-size: 11px;
            font-weight: 600;
            color: var(--color-success);
            letter-spacing: 0.5px;
        }
        .app-main-grid {
            display: grid;
            grid-template-columns: 340px 1fr 340px;
            gap: 24px;
            align-items: start;
        }
        .panel {
            background: var(--gradient-panel);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--color-border);
            border-radius: 20px;
            padding: 24px;
            box-shadow: var(--shadow-card);
            display: flex;
            flex-direction: column;
            gap: 20px;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }
        .panel:hover {
            border-color: var(--color-border-hover);
        }
        .panel-header {
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid var(--color-border);
            padding-bottom: 14px;
        }
        .panel-header i {
            font-size: 18px;
        }
        .panel-header h2 {
            font-family: var(--font-heading);
            font-size: 18px;
            font-weight: 600;
            letter-spacing: 0.5px;
        }
        .text-cyan { color: var(--color-cyan); }
        .text-magenta { color: var(--color-magenta); }
        .text-purple { color: var(--color-purple); }
        .control-panel {
            grid-column: 1;
        }
        .input-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .input-label-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .input-label-row label {
            font-size: 13px;
            font-weight: 600;
            color: var(--color-text-main);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .helper-text {
            font-size: 10px;
            color: var(--color-text-muted);
            font-weight: 500;
        }
        .number-input-wrapper {
            display: flex;
            position: relative;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid var(--color-border);
            background: #ffffff;
            transition: all 0.2s ease;
        }
        .number-input-wrapper:focus-within {
            border-color: var(--color-cyan);
            box-shadow: 0 0 10px var(--color-cyan-glow);
        }
        .custom-number-input {
            flex: 1;
            width: 0;
            min-width: 0;
            background: #f8fafc !important;
            border: none !important;
            outline: none !important;
            color: #0f172a !important;
            padding: 10px 14px !important;
            font-family: var(--font-body) !important;
            font-size: 15px !important;
            font-weight: 700 !important;
            text-align: right !important;
            box-shadow: none !important;
            -webkit-appearance: none !important;
            -moz-appearance: textfield !important;
        }
        .custom-number-input::-webkit-outer-spin-button,
        .custom-number-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        .unit-badge {
            background: rgba(0, 0, 0, 0.03);
            color: var(--color-text-muted);
            font-size: 11px;
            font-weight: 700;
            padding: 0 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-left: 1px solid var(--color-border);
            pointer-events: none;
            letter-spacing: 0.5px;
            flex-shrink: 0;
        }
        .unit-badge-select-wrapper {
            position: relative;
            background: rgba(0, 0, 0, 0.03);
            border-left: 1px solid var(--color-border);
            display: flex;
            align-items: center;
            flex-shrink: 0;
        }
        .unit-select {
            background: transparent;
            border: none;
            outline: none;
            color: var(--color-text-muted);
            font-size: 11px;
            font-weight: 700;
            padding: 10px 24px 10px 14px;
            cursor: pointer;
            letter-spacing: 0.5px;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            font-family: var(--font-body);
        }
        .unit-badge-select-wrapper::after {
            content: '\f0d7';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute;
            right: 10px;
            font-size: 9px;
            color: var(--color-text-muted);
            pointer-events: none;
        }
        .custom-slider {
            -webkit-appearance: none;
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: rgba(0, 0, 0, 0.05);
            outline: none;
            margin: 8px 0;
            transition: background 0.2s ease;
        }
        .custom-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            cursor: pointer;
            transition: transform 0.1s ease, box-shadow 0.2s ease;
        }
        #slider-d::-webkit-slider-thumb {
            background: var(--color-cyan);
            box-shadow: 0 0 10px var(--color-cyan);
        }
        #slider-d::-webkit-slider-thumb:hover { transform: scale(1.2); }
        #slider-q::-webkit-slider-thumb {
            background: var(--color-purple);
            box-shadow: 0 0 10px var(--color-purple);
        }
        #slider-q::-webkit-slider-thumb:hover { transform: scale(1.2); }
        .presets-section {
            display: flex;
            flex-direction: column;
            gap: 12px;
            border-top: 1px solid var(--color-border);
            padding-top: 18px;
        }
        .presets-section h3 {
            font-size: 13px;
            font-weight: 700;
            color: var(--color-text-main);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .presets-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 8px;
        }
        .preset-btn {
            background: rgba(0, 0, 0, 0.015) !important;
            border: 1px solid var(--color-border) !important;
            border-radius: 10px !important;
            padding: 10px 12px !important;
            cursor: pointer !important;
            color: var(--color-text-main) !important;
            display: flex !important;
            align-items: center !important;
            gap: 12px !important;
            text-align: left !important;
            transition: all 0.2s ease !important;
            box-shadow: none !important;
        }
        .preset-btn:hover {
            background: rgba(0, 0, 0, 0.04) !important;
            transform: translateX(4px) !important;
            color: var(--color-text-main) !important;
        }
        .preset-btn.active {
            background: linear-gradient(90deg, var(--color-cyan-glow), var(--color-purple-glow)) !important;
            border-color: var(--color-cyan) !important;
            box-shadow: 0 0 10px var(--color-cyan-glow) !important;
            color: var(--color-text-main) !important;
        }
        .preset-icon {
            width: 28px;
            height: 28px;
            background: rgba(0, 0, 0, 0.02);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            color: var(--color-cyan);
        }
        .preset-btn:hover .preset-icon, .preset-btn.active .preset-icon {
            background: var(--gradient-primary);
            color: #fff;
        }
        .preset-name {
            font-size: 12px;
            font-weight: 600;
        }
        .simulation-panel {
            grid-column: 2;
            align-self: start;
            justify-content: flex-start;
        }
        .simulation-panel .panel-header {
            justify-content: space-between;
        }
        .canvas-scale-indicator {
            font-size: 11px;
            color: var(--color-text-muted);
            background: rgba(0, 0, 0, 0.02);
            padding: 4px 10px;
            border-radius: 6px;
            border: 1px solid var(--color-border);
        }
        .canvas-wrapper {
            position: relative;
            width: 100%;
            background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
            border: 1px solid rgba(0, 0, 0, 0.06);
            border-radius: 16px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #physics-canvas {
            display: block;
            width: 100%;
            height: auto;
            aspect-ratio: 16 / 10;
        }
        .simulation-metrics-strip {
            display: flex;
            background: rgba(0, 0, 0, 0.01);
            border: 1px solid var(--color-border);
            border-radius: 12px;
            padding: 12px 20px;
            justify-content: space-around;
            align-items: center;
            gap: 10px;
            margin-top: 10px;
        }
        .mini-metric {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            text-align: center;
        }
        .mini-metric .label {
            font-size: 10px;
            font-weight: 600;
            color: var(--color-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .mini-metric .value {
            font-size: 14px;
            font-weight: 700;
            color: var(--color-text-main);
            font-family: var(--font-heading);
        }
        .mini-divider {
            width: 1px;
            height: 24px;
            background: rgba(0, 0, 0, 0.03);
        }
        .results-panel {
            grid-column: 3;
        }
        .status-readout-box {
            border-radius: 16px;
            padding: 20px;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            transition: all 0.3s ease;
        }
        .status-readout-box.optimal {
            background: rgba(16, 185, 129, 0.08);
            border: 1px solid rgba(16, 185, 129, 0.25);
            box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
        }
        .status-readout-box.warning {
            background: rgba(245, 158, 11, 0.08);
            border: 1px solid rgba(245, 158, 11, 0.25);
            box-shadow: 0 0 15px rgba(245, 158, 11, 0.05);
        }
        .status-readout-box.danger {
            background: rgba(219, 39, 119, 0.08);
            border: 1px solid rgba(219, 39, 119, 0.25);
            box-shadow: 0 0 15px rgba(219, 39, 119, 0.05);
        }
        .status-title {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 1px;
            text-transform: uppercase;
        }
        .status-readout-box.optimal .status-title { color: var(--color-success); }
        .status-readout-box.warning .status-title { color: var(--color-warning); }
        .status-readout-box.danger .status-title { color: var(--color-magenta); }
        .status-value {
            font-family: var(--font-heading);
            font-weight: 800;
            font-size: 26px;
            color: var(--color-text-main);
        }
        .status-badge {
            font-size: 12px;
            font-weight: 700;
            padding: 4px 12px;
            border-radius: 20px;
            color: #fff;
        }
        .status-readout-box.optimal .status-badge { background: var(--color-success); }
        .status-readout-box.warning .status-badge { background: var(--color-warning); }
        .status-readout-box.danger .status-badge { background: var(--color-magenta); }
        .results-grid {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .result-card {
            background: rgba(255, 255, 255, 0.85);
            border: 1px solid var(--color-border);
            border-radius: 12px;
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 16px;
            transition: all 0.2s ease;
        }
        .result-card:hover {
            transform: translateY(-2px);
            border-color: rgba(2, 132, 199, 0.2);
            background: rgba(2, 132, 199, 0.03);
        }
        .card-icon {
            width: 38px;
            height: 38px;
            background: rgba(0, 0, 0, 0.015);
            border: 1px solid var(--color-border);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            color: var(--color-text-muted);
        }
        .card-content {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .card-unit {
            font-size: 11px;
            font-weight: 600;
            color: var(--color-text-muted);
        }
        .card-value {
            font-family: var(--font-heading);
            font-weight: 700;
            font-size: 17px;
            color: var(--color-text-main);
        }
        .formula-card {
            background: rgba(0, 0, 0, 0.01);
            border: 1px solid var(--color-border);
            border-radius: 12px;
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            font-size: 12px;
        }
        .formula-card h4 {
            font-weight: 700;
            color: var(--color-text-main);
        }
        .formula-equation {
            font-family: monospace;
            color: var(--color-cyan);
            font-size: 13px;
            background: #f8fafc;
            padding: 8px 10px;
            border-radius: 6px;
            border: 1px solid var(--color-border);
            text-align: center;
        }
        .fluid-type-select {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 8px;
            border-top: 1px solid var(--color-border);
            padding-top: 14px;
        }
        .fluid-tab-btn {
            background: rgba(0, 0, 0, 0.03) !important;
            border: 1px solid rgba(0, 0, 0, 0.12) !important;
            padding: 6px 10px !important;
            border-radius: 8px !important;
            font-size: 11px !important;
            font-weight: 600 !important;
            cursor: pointer !important;
            text-align: center !important;
            transition: all 0.2s ease !important;
            color: var(--color-text-main) !important;
            box-shadow: none !important;
        }
        .fluid-tab-btn:hover {
            background: rgba(0, 0, 0, 0.06) !important;
            color: var(--color-text-main) !important;
        }
        .fluid-tab-btn.active {
            background: var(--color-cyan) !important;
            border-color: var(--color-cyan) !important;
            color: #fff !important;
        }
        /* Container Query */
        @container pipeflow-container (max-width: 1100px) {
            .app-main-grid {
                grid-template-columns: 1fr 1fr;
                gap: 20px;
            }
            .control-panel {
                grid-column: 1;
            }
            .simulation-panel {
                grid-column: 2;
                align-self: start;
            }
            .results-panel {
                grid-column: 1 / span 2;
                display: grid;
                grid-template-columns: 1fr 1.2fr;
                gap: 20px;
            }
            .results-panel .panel-header {
                grid-column: 1 / span 2;
            }
            .status-readout-box {
                grid-column: 1;
                grid-row: 2;
            }
            .results-grid {
                grid-column: 2;
                grid-row: 2;
            }
        }
        @container pipeflow-container (max-width: 768px) {
            .app-main-grid {
                grid-template-columns: 1fr;
            }
            .control-panel, .simulation-panel, .results-panel {
                grid-column: 1;
            }
            .results-panel {
                display: flex;
                flex-direction: column;
                gap: 16px;
            }
            .status-readout-box, .results-grid {
                grid-column: auto;
                grid-row: auto;
            }
            .panel-header h2 {
                white-space: normal !important;
                font-size: 15px !important;
            }
            .app-header {
                flex-direction: column;
                gap: 16px;
                text-align: center;
            }
            .logo-area {
                flex-direction: column;
                gap: 8px;
            }
        }
        .preset-details {
            display: flex;
            flex-direction: column;
            gap: 2px;
            align-items: flex-start;
            text-align: left;
        }
        .preset-spec {
            font-size: 11px;
            color: var(--color-text-muted);
            font-weight: 500;
        }
        .preset-name {
            font-size: 13px !important;
        }
/* ━━ WordPress 레이아웃 Override: 디자인 1 (2열 컴팩트 대칭 레이아웃) ━━ */
.pipe-flow-wrapper .app-main-grid,
.pipe-flow-wrapper .main-grid,
.pipe-flow-wrapper .sim-grid {
    display: grid !important;
    grid-template-columns: 340px 1fr !important;
    gap: 24px !important;
    align-items: start !important;
}
/* 3열 레이아웃을 2열 레이아웃으로 변경하는 특화 스타일 */
.pipe-flow-wrapper .right-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    min-width: 0 !important;
    grid-column: 2 !important;
}
.pipe-flow-wrapper .simulation-panel,
.pipe-flow-wrapper .canvas-panel,
.pipe-flow-wrapper .sim-panel {
    grid-column: auto !important;
    order: 1 !important;
    align-self: stretch !important;
}
.pipe-flow-wrapper .control-panel {
    grid-column: 1 !important;
}
/* 2열 통합 결과 분석 영역 레이아웃 */
.pipe-flow-wrapper .simulation-results-section {
    display: grid !important;
    grid-template-columns: 1.1fr 1.3fr !important;
    gap: 20px !important;
    border-top: 1px solid var(--color-border) !important;
    padding-top: 20px !important;
    margin-top: 10px !important;
    align-items: stretch !important;
}
/* Readout Box 스타일 */
.pipe-flow-wrapper .simulation-results-section .ratio-readout-box,
.pipe-flow-wrapper .simulation-results-section .re-readout-box,
.pipe-flow-wrapper .simulation-results-section .status-readout-box,
.pipe-flow-wrapper .simulation-results-section .gauge-container {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}
.pipe-flow-wrapper .simulation-results-section .results-grid {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    justify-content: flex-start !important;
}
.pipe-flow-wrapper .simulation-results-section .results-grid .result-card {
    flex: none !important;
    display: flex !important;
    align-items: center !important;
    min-height: 72px !important;
    height: auto !important;
    padding: 12px 16px !important;
}
.pipe-flow-wrapper .simulation-results-section .formula-card {
    grid-column: 1 !important;
    grid-row: 2 !important;
}
/* 모바일/반응형 (800px 이하) ── 항상 세로형(1열) 정렬 및 시뮬레이터 캔버스 최상단 배치 */
@media (max-width: 800px) {
    .pipe-flow-wrapper .app-main-grid,
    .pipe-flow-wrapper .main-grid,
    .pipe-flow-wrapper .sim-grid {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .pipe-flow-wrapper .control-panel {
        order: 2 !important;
        width: 100% !important;
    }
    .pipe-flow-wrapper .right-column {
        order: 1 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .pipe-flow-wrapper .simulation-panel,
    .pipe-flow-wrapper .canvas-panel,
    .pipe-flow-wrapper .sim-panel,
    .pipe-flow-wrapper .canvas-section {
        order: -1 !important;
    }
    .pipe-flow-wrapper .simulation-results-section {
        grid-template-columns: 1fr !important;
    }
    .pipe-flow-wrapper .simulation-results-section .ratio-readout-box,
    .pipe-flow-wrapper .simulation-results-section .re-readout-box,
    .pipe-flow-wrapper .simulation-results-section .status-readout-box,
    .pipe-flow-wrapper .simulation-results-section .gauge-container {
        grid-column: 1 !important;
        grid-row: auto !important;
        height: auto !important;
    }
    .pipe-flow-wrapper .simulation-results-section .results-grid {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
    .pipe-flow-wrapper .simulation-results-section .formula-card {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}
.pipe-flow-wrapper .app-container,
.pipe-flow-wrapper .main-container {
    max-width: 100% !important;
    padding: 12px !important;
}
/* Premium Advice/Formula Card & Typography Overrides */
.pipe-flow-wrapper .simulation-results-section .formula-card,
.pipe-flow-wrapper .results-panel .formula-card {
    background: #ffffff !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: var(--shadow-card) !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}
.pipe-flow-wrapper .simulation-results-section .formula-card h4,
.pipe-flow-wrapper .results-panel .formula-card h4 {
    font-weight: 700 !important;
    color: var(--color-text-main) !important;
}
.pipe-flow-wrapper #text-judgment {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--color-text-muted) !important;
    line-height: 1.6 !important;
    word-break: keep-all !important;
}
</style>
<div class="pipe-flow-wrapper" style="position: relative; width: 100%; box-sizing: border-box; overflow: hidden; margin: 30px auto; border-radius: 20px;">
    <div class="app-background-glow" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: hidden;"></div>
    <div style="position: relative; z-index: 2; width: 100%;">
    <div class="app-container">
        <header class="app-header">
            <div class="logo-area">
                <div class="logo-icon"><i class="fa-solid fa-arrows-left-right-to-line"></i></div>
                <div>
                    <h1>PIPE FLOW VELOCITY</h1>
                    <div class="subtitle">배관 유량 계산기 &#038; 유속 권장 설계 분석기</div>
                </div>
            </div>
            <div class="header-badge">
                <div class="pulse-dot"></div>
                <span class="badge-text">REALTIME MONITORING</span>
            </div>
        </header>
        <div class="app-main-grid">
            <!-- Controls -->
            <div class="panel control-panel">
                <div class="panel-header text-cyan">
                    <i class="fa-solid fa-sliders"></i>
                    <h2>배관 및 유동 입력</h2>
                </div>
                <!-- D Inner Diameter -->
                <div class="input-group">
                    <div class="input-label-row">
                        <label for="input-d"><i class="fa-solid fa-circle-dot text-cyan"></i> 배관 내경 (D)</label>
                        <span class="helper-text">범위: 10 ~ 1000 mm</span>
                    </div>
                    <div class="number-input-wrapper">
                        <input type="number" id="input-d" class="custom-number-input" min="10" max="1000" value="80">
                        <span class="unit-badge">mm</span>
                    </div>
                    <input type="range" id="slider-d" class="custom-slider" min="10" max="1000" value="80">
                </div>
                <!-- Q Flow Rate -->
                <div class="input-group">
                    <div class="input-label-row">
                        <label for="input-q"><i class="fa-solid fa-gauge text-purple"></i> 설계 유량 (Q)</label>
                        <span class="helper-text">범위: 0.1 ~ 3600.0 m³/h</span>
                    </div>
                    <div class="number-input-wrapper">
                        <input type="number" id="input-q" class="custom-number-input" min="0.1" max="3600" step="0.1" value="45.0">
                        <div class="unit-badge-select-wrapper">
                            <select id="unit-q" class="unit-select">
                                <option value="m3_h">m³/h</option>
                                <option value="m3_s">m³/s</option>
                                <option value="lpm">LPM</option>
                            </select>
                        </div>
                    </div>
                    <input type="range" id="slider-q" class="custom-slider" min="1" max="36000" value="450">
                </div>
                <!-- Fluid Type Selector -->
                <div class="input-group">
                    <div class="input-label-row">
                        <label><i class="fa-solid fa-droplet text-cyan"></i> 수송 유체 타입</label>
                    </div>
                    <div class="fluid-type-select">
                        <button class="fluid-tab-btn active" data-fluid="water">물<br>(Water)</button>
                        <button class="fluid-tab-btn" data-fluid="oil">오일<br>(Light Oil)</button>
                        <button class="fluid-tab-btn" data-fluid="air">공기<br>(Air/Gas)</button>
                    </div>
                </div>
                <!-- Presets -->
                <div class="presets-section">
                    <h3><i class="fa-solid fa-circle-nodes"></i> 실무 배관 프리셋</h3>
                    <div class="presets-grid">
                        <button class="preset-btn" data-preset="smallWater">
                            <div class="preset-icon"><i class="fa-solid fa-filter"></i></div>
                            <div class="preset-details"><span class="preset-name">소구경 물배관</span><span class="preset-spec">25A, 3 m³/h</span></div>
                        </button>
                        <button class="preset-btn" data-preset="midWater">
                            <div class="preset-icon"><i class="fa-solid fa-faucet-drip"></i></div>
                            <div class="preset-details"><span class="preset-name">중구경 메인관</span><span class="preset-spec">100A, 80 m³/h</span></div>
                        </button>
                        <button class="preset-btn" data-preset="hydraulic">
                            <div class="preset-icon"><i class="fa-solid fa-bolt"></i></div>
                            <div class="preset-details"><span class="preset-name">고압 유압배관</span><span class="preset-spec">20A, 250 LPM</span></div>
                        </button>
                    </div>
                </div>
            </div>
            <!-- Auto Injected Right Column wrapper for Design 1 -->
            <div class="right-column">
                <div class="panel simulation-panel">
                                <div class="panel-header text-purple">
                                    <div style="display: flex; align-items: center; gap: 12px;">
                                        <i class="fa-solid fa-display"></i>
                                        <h2>배관 내부 유속 분포 시뮬레이션</h2>
                                    </div>
                                    <div class="canvas-scale-indicator" id="txt-canvas-scale">배관 내경: 80 mm</div>
                                </div>
                                <div class="canvas-wrapper">
                                    <canvas id="physics-canvas" width="640" height="400"></canvas>
                                </div>
                                <div class="simulation-metrics-strip">
                                    <div class="mini-metric">
                                        <span class="label">배관 단면적 (A)</span>
                                        <span class="value" id="mini-area">50.27 cm²</span>
                                    </div>
                                    <div class="mini-divider"></div>
                                    <div class="mini-metric">
                                        <span class="label">설계 유량 (Q_lpm)</span>
                                        <span class="value" id="mini-q-lpm">750 LPM</span>
                                    </div>
                                    <div class="mini-divider"></div>
                                    <div class="mini-metric">
                                        <span class="label">동압 (Dynamic P)</span>
                                        <span class="value" id="mini-dp">1.25 kPa</span>
                                    </div>
                                </div>
                            <div class="simulation-results-section">
                                <div class="status-readout-box optimal" id="status-box">
                                    <span class="status-title">FLOW VELOCITY</span>
                                    <span class="status-value" id="txt-v">2.49 m/s</span>
                                    <span class="status-badge" id="txt-status-eval">적정 속도 (Optimal)</span>
                                </div>
                                <div class="results-grid">
                                    <div class="result-card">
                                        <div class="card-icon text-cyan"><i class="fa-solid fa-circle-check"></i></div>
                                        <div class="card-content">
                                            <span class="card-unit">흡입 배관 적합도 (Suction)</span>
                                            <span class="card-value" id="txt-suction-eval">유속 빠름 (Cavitation 우려)</span>
                                        </div>
                                    </div>
                                    <div class="result-card">
                                        <div class="card-icon text-purple"><i class="fa-solid fa-circle-check"></i></div>
                                        <div class="card-content">
                                            <span class="card-unit">송출 배관 적합도 (Delivery)</span>
                                            <span class="card-value" id="txt-delivery-eval">적정 유속 범위</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="formula-card">
                                        <h4>기본 설계 공식</h4>
                                        <div class="formula-equation">v = Q / A</div>
                                        <p>
                                            * 유량과 단면적 간의 단위 계수를 맞춰 자동으로 미터법 평균 유속을 도출합니다.
                                        </p>
                                    </div>
                            </div>
                </div>
            </div>
        </div>
        <!-- Disclaimer Footer -->
        <footer class="app-disclaimer" style="margin-top: 20px; padding: 12px 16px; background: rgba(0, 0, 0, 0.015); border: 1px solid var(--color-border); border-radius: 12px; font-size: 11px; color: var(--color-text-muted); line-height: 1.5; text-align: left; display: flex; gap: 10px; align-items: flex-start; clear: both;">
            <i class="fa-solid fa-circle-info" style="color: var(--color-cyan); font-size: 14px; margin-top: 2px; flex-shrink: 0;"></i>
            <span><strong>면책 조항 (Disclaimer):</strong> 본 시뮬레이터의 계산 결과는 교육 및 참고용으로만 제공되며, 실제 제품 설계나 제작 시에는 반드시 최신 공학 규격 및 공식 표준 설계 기준을 재확인하시기 바랍니다. 계산 값의 무결성을 보장하지 않으며, 이로 인해 발생하는 직접적/간접적 손해에 대해 제작자 및 본 블로그는 어떠한 책임을 지지 않습니다.</span>
        </footer>
</div>
    </div>
</div>
<script>
        (function() {
            // State
            const state = {
                d: 80,      // mm
                q: 45.0,    // Q value in selected unit
                qUnit: 'm3_h',
                fluid: 'water',
                particles: [],
                lastTime: 0
            };
            const qUnitConfigs = {
                m3_h: {
                    min: 0.1,
                    max: 3600.0,
                    step: 0.1,
                    helperText: "범위: 0.1 ~ 3600.0 m³/h",
                    format: (v) => v.toFixed(1),
                    toSlider: (v) => Math.round(v * 10),
                    fromSlider: (sv) => sv / 10,
                    sliderMin: 1,
                    sliderMax: 36000,
                    defaultVal: 45.0
                },
                m3_s: {
                    min: 0.0001,
                    max: 1.0000,
                    step: 0.0001,
                    helperText: "범위: 0.0001 ~ 1.0000 m³/s",
                    format: (v) => v.toFixed(4),
                    toSlider: (v) => Math.round(v * 10000),
                    fromSlider: (sv) => sv / 10000,
                    sliderMin: 1,
                    sliderMax: 10000,
                    defaultVal: 0.0125
                },
                lpm: {
                    min: 1,
                    max: 60000,
                    step: 1,
                    helperText: "범위: 1 ~ 60,000 LPM",
                    format: (v) => Math.round(v).toString(),
                    toSlider: (v) => Math.round(v),
                    fromSlider: (sv) => sv,
                    sliderMin: 1,
                    sliderMax: 60000,
                    defaultVal: 750
                }
            };
            function getQInM3h() {
                if (state.qUnit === 'm3_s') {
                    return state.q * 3600;
                }
                if (state.qUnit === 'lpm') {
                    return state.q * 0.06;
                }
                return state.q;
            }
            function convertQ(val, fromUnit, toUnit) {
                let valM3h = val;
                if (fromUnit === 'm3_s') {
                    valM3h = val * 3600;
                } else if (fromUnit === 'lpm') {
                    valM3h = val * 0.06;
                }
                let targetVal = valM3h;
                if (toUnit === 'm3_s') {
                    targetVal = valM3h / 3600;
                } else if (toUnit === 'lpm') {
                    targetVal = valM3h / 0.06;
                }
                const cfg = qUnitConfigs[toUnit];
                if (targetVal < cfg.min) { targetVal = cfg.min; }
                if (targetVal > cfg.max) { targetVal = cfg.max; }
                return targetVal;
            }
            function updateQUnitUI() {
                const cfg = qUnitConfigs[state.qUnit];
                const labelQ = document.querySelector('#input-q');
                if (labelQ) {
                    const group = labelQ.closest('.input-group');
                    if (group) {
                        const helper = group.querySelector('.helper-text');
                        if (helper) {
                            helper.innerText = cfg.helperText;
                        }
                    }
                }
                inputQ.min = cfg.min;
                inputQ.max = cfg.max;
                inputQ.step = cfg.step;
                sliderQ.min = cfg.sliderMin;
                sliderQ.max = cfg.sliderMax;
                const formatted = cfg.format(state.q);
                if (inputQ.value !== formatted) {
                    inputQ.value = formatted;
                }
                const sliderValStr = cfg.toSlider(state.q).toString();
                if (sliderQ.value !== sliderValStr) {
                    sliderQ.value = sliderValStr;
                }
            }
            // DOM Elements
            const inputD = document.getElementById('input-d');
            const sliderD = document.getElementById('slider-d');
            const inputQ = document.getElementById('input-q');
            const sliderQ = document.getElementById('slider-q');
            const txtV = document.getElementById('txt-v');
            const txtStatusEval = document.getElementById('txt-status-eval');
            const statusBox = document.getElementById('status-box');
            const txtSuctionEval = document.getElementById('txt-suction-eval');
            const txtDeliveryEval = document.getElementById('txt-delivery-eval');
            const miniArea = document.getElementById('mini-area');
            const miniQLpm = document.getElementById('mini-q-lpm');
            const miniDp = document.getElementById('mini-dp');
            const fluidTabButtons = document.querySelectorAll('.fluid-tab-btn');
            const presetButtons = document.querySelectorAll('.preset-btn');
            const canvas = document.getElementById('physics-canvas');
            const ctx = canvas.getContext('2d');
            // Spawn Particles
            const maxParticles = 120;
            for (let i = 0; i < maxParticles; i++) {
                state.particles.push({
                    x: Math.random() * 640,
                    y: 0.05 + Math.random() * 0.90, // vertical fraction
                    size: 1 + Math.random() * 3
                });
            }
            // Sync
            function syncDFromSlider() {
                const newD = parseInt(sliderD.value);
                state.d = newD;
                const newDStr = newD.toString();
                if (inputD.value !== newDStr) {
                    inputD.value = newDStr;
                }
                clearPresets();
                updateCalculations();
            }
            function syncDFromInput() {
                let val = parseInt(inputD.value);
                if (isNaN(val)) { val = 80; }
                if (val < 10) { val = 10; }
                if (val > 1000) { val = 1000; }
                state.d = val;
                const newDStr = val.toString();
                if (inputD.value !== newDStr) {
                    inputD.value = newDStr;
                }
                if (sliderD.value !== newDStr) {
                    sliderD.value = newDStr;
                }
                clearPresets();
                updateCalculations();
            }
            function syncQFromSlider() {
                const cfg = qUnitConfigs[state.qUnit];
                state.q = cfg.fromSlider(parseFloat(sliderQ.value));
                const formatted = cfg.format(state.q);
                if (inputQ.value !== formatted) {
                    inputQ.value = formatted;
                }
                clearPresets();
                updateCalculations();
            }
            function syncQFromInput() {
                const cfg = qUnitConfigs[state.qUnit];
                let val = parseFloat(inputQ.value);
                if (isNaN(val)) { val = cfg.defaultVal; }
                if (val < cfg.min) { val = cfg.min; }
                if (val > cfg.max) { val = cfg.max; }
                state.q = val;
                const formatted = cfg.format(val);
                if (inputQ.value !== formatted) {
                    inputQ.value = formatted;
                }
                const sliderValStr = cfg.toSlider(val).toString();
                if (sliderQ.value !== sliderValStr) {
                    sliderQ.value = sliderValStr;
                }
                clearPresets();
                updateCalculations();
            }
            sliderD.addEventListener('input', syncDFromSlider);
            inputD.addEventListener('change', syncDFromInput);
            sliderQ.addEventListener('input', syncQFromSlider);
            inputQ.addEventListener('change', syncQFromInput);
            const selectUnitQ = document.getElementById('unit-q');
            if (selectUnitQ) {
                selectUnitQ.addEventListener('change', function() {
                    const newUnit = selectUnitQ.value;
                    state.q = convertQ(state.q, state.qUnit, newUnit);
                    state.qUnit = newUnit;
                    updateQUnitUI();
                    updateCalculations();
                });
            }
            // Tabs
            fluidTabButtons.forEach(function(btn) {
                btn.addEventListener('click', function() {
                    fluidTabButtons.forEach(function(b) { b.classList.remove('active'); });
                    btn.classList.add('active');
                    state.fluid = btn.dataset.fluid;
                    updateCalculations();
                });
            });
            // Presets
            function loadPreset(presetKey) {
                clearPresets();
                presetButtons.forEach(function(btn) {
                    if (btn.dataset.preset === presetKey) {
                        btn.classList.add('active');
                    }
                });
                if (presetKey === 'smallWater') {
                    state.d = 25;
                    state.q = 3.0;
                    state.fluid = 'water';
                } else if (presetKey === 'midWater') {
                    state.d = 100;
                    state.q = 80.0;
                    state.fluid = 'water';
                } else if (presetKey === 'hydraulic') {
                    state.d = 20;
                    state.q = 15.0; // 250 LPM is 15 m3/h
                    state.fluid = 'oil';
                }
                // Sync Tab
                fluidTabButtons.forEach(function(btn) {
                    btn.classList.remove('active');
                    if (btn.dataset.fluid === state.fluid) {
                        btn.classList.add('active');
                    }
                });
                // Reset flow rate unit to m³/h for presets
                state.qUnit = 'm3_h';
                const unitQ = document.getElementById('unit-q');
                if (unitQ) {
                    unitQ.value = 'm3_h';
                }
                updateQUnitUI();
                // Sync Input Values
                inputD.value = state.d;
                sliderD.value = state.d;
                updateCalculations();
            }
            function clearPresets() {
                presetButtons.forEach(function(btn) {
                    btn.classList.remove('active');
                });
            }
            presetButtons.forEach(function(btn) {
                btn.addEventListener('click', function() {
                    loadPreset(btn.dataset.preset);
                });
            });
            // Core Calculations
            function updateCalculations() {
                const D_m = state.d / 1000;
                const area = (Math.PI * Math.pow(D_m, 2)) / 4; // m²
                const qM3h = getQInM3h();
                // v = Q / (3600 * A)
                const v = qM3h / (3600 * area); // m/s
                txtV.innerText = v.toFixed(2) + ' m/s';
                miniArea.innerText = (area * 10000).toFixed(2) + ' cm²';
                const qLpm = (qM3h * 1000) / 60;
                miniQLpm.innerText = Math.round(qLpm).toLocaleString() + ' LPM';
                // Density by fluid type
                let rho = 1000; // water
                if (state.fluid === 'oil') { rho = 850; }
                if (state.fluid === 'air') { rho = 1.2; }
                // Dynamic pressure = 0.5 * rho * v^2 in kPa
                const dpKpa = (0.5 * rho * Math.pow(v, 2)) / 1000;
                miniDp.innerText = dpKpa.toFixed(3) + ' kPa';
                // Evaluation
                statusBox.className = 'status-readout-box';
                // Set defaults
                let overallEval = '적정 유속 범위';
                let isOptimal = true;
                let isWarning = false;
                let isDanger = false;
                // Suction Pipe eval (0.5 ~ 1.5 m/s)
                if (v < 0.5) {
                    txtSuctionEval.innerText = '유속 낮음 (침전 위험)';
                    txtSuctionEval.style.color = '#f59e0b';
                } else if (v <= 1.5) {
                    txtSuctionEval.innerText = '아주 적정 (권장)';
                    txtSuctionEval.style.color = '#10b981';
                } else {
                    txtSuctionEval.innerText = '유속 빠름 (흡입 불리)';
                    txtSuctionEval.style.color = '#db2777';
                }
                // Delivery Pipe eval (1.5 ~ 3.0 m/s)
                if (v < 1.0) {
                    txtDeliveryEval.innerText = '유속 다소 낮음';
                    txtDeliveryEval.style.color = '#475569';
                } else if (v <= 3.0) {
                    txtDeliveryEval.innerText = '최적 유속 설계';
                    txtDeliveryEval.style.color = '#10b981';
                } else {
                    txtDeliveryEval.innerText = '유속 다소 높음 (손실 증대)';
                    txtDeliveryEval.style.color = '#f59e0b';
                }
                // Overall status categorization based on fluid type
                if (state.fluid === 'water' || state.fluid === 'oil') {
                    if (v > 4.5) {
                        overallEval = '유속 과다 (배관 마모 위험)';
                        isDanger = true;
                    } else if (v > 3.0) {
                        overallEval = '유속 높음 (압력손실 증가)';
                        isWarning = true;
                    } else if (v < 0.5) {
                        overallEval = '유속 과소 (침전 우려)';
                        isWarning = true;
                    } else {
                        overallEval = '적정 설계 범위';
                        isOptimal = true;
                    }
                } else {
                    // Gas/Air allows much higher velocity (up to 15-20 m/s)
                    if (v > 20.0) {
                        overallEval = '가스 속도 과다';
                        isDanger = true;
                    } else if (v > 15.0) {
                        overallEval = '유속 높음';
                        isWarning = true;
                    } else if (v < 2.0) {
                        overallEval = '유속 낮음';
                        isWarning = true;
                    } else {
                        overallEval = '적정 가스 배관 속도';
                        isOptimal = true;
                    }
                }
                if (isOptimal) {
                    statusBox.classList.add('optimal');
                    txtStatusEval.innerText = overallEval;
                } else if (isWarning) {
                    statusBox.classList.add('warning');
                    txtStatusEval.innerText = overallEval;
                } else if (isDanger) {
                    statusBox.classList.add('danger');
                    txtStatusEval.innerText = overallEval;
                }
                const txtCanvasScale = document.getElementById('txt-canvas-scale');
                if (txtCanvasScale) {
                    txtCanvasScale.innerText = `배관 직경: ${state.d} mm`;
                }
            }
            // Draw
            function draw(currentTime) {
                requestAnimationFrame(draw);
                let dt = (currentTime - state.lastTime) / 1000;
                if (isNaN(dt)) { dt = 0.016; }
                if (dt < 0) { dt = 0.016; }
                if (dt > 0.1) { dt = 0.016; }
                state.lastTime = currentTime;
                const width = canvas.width;
                const height = canvas.height;
                ctx.clearRect(0, 0, width, height);
                // Grid
                ctx.save();
                ctx.strokeStyle = 'rgba(2, 132, 199, 0.04)';
                ctx.lineWidth = 1;
                for (let x = 0; x < width; x += 30) {
                    ctx.beginPath();
                    ctx.moveTo(x, 0);
                    ctx.lineTo(x, height);
                    ctx.stroke();
                }
                for (let y = 0; y < height; y += 30) {
                    ctx.beginPath();
                    ctx.moveTo(0, y);
                    ctx.lineTo(width, y);
                    ctx.stroke();
                }
                ctx.restore();
                // Pipe mapping: 10 ~ 1000 mm mapped to 50 ~ 290 px
                const minScaleD = 10;
                const maxScaleD = 1000;
                const minPixH = 50;
                const maxPixH = 290;
                const pipeHeight = minPixH + ((state.d - minScaleD) / (maxScaleD - minScaleD)) * (maxPixH - minPixH);
                const pipeTop = (height - pipeHeight) / 2;
                const pipeBottom = pipeTop + pipeHeight;
                const pipeCenter = height / 2;
                // Flow physics variables
                const D_m = state.d / 1000;
                const area = (Math.PI * Math.pow(D_m, 2)) / 4;
                const qM3h = getQInM3h();
                const v = qM3h / (3600 * area);
                // Fluid properties for visual styling
                let particleColor = '#0284c7';
                let pipeFillColor = 'rgba(224, 242, 254, 0.3)';
                if (state.fluid === 'oil') {
                    particleColor = '#f59e0b';
                    pipeFillColor = 'rgba(254, 243, 199, 0.3)';
                }
                if (state.fluid === 'air') {
                    particleColor = '#94a3b8';
                    pipeFillColor = 'rgba(241, 245, 249, 0.3)';
                }
                // Draw Pipe Wall
                ctx.save();
                ctx.fillStyle = pipeFillColor;
                ctx.fillRect(0, pipeTop, width, pipeHeight);
                ctx.strokeStyle = '#64748b';
                ctx.lineWidth = 5;
                ctx.beginPath();
                ctx.moveTo(0, pipeTop);
                ctx.lineTo(width, pipeTop);
                ctx.moveTo(0, pipeBottom);
                ctx.lineTo(width, pipeBottom);
                ctx.stroke();
                ctx.restore();
                // Center dashed guideline
                ctx.save();
                ctx.strokeStyle = 'rgba(0,0,0,0.06)';
                ctx.lineWidth = 1.5;
                ctx.setLineDash([6, 6]);
                ctx.beginPath();
                ctx.moveTo(0, pipeCenter);
                ctx.lineTo(width, pipeCenter);
                ctx.stroke();
                ctx.restore();
                // Animate and draw particles
                ctx.save();
                ctx.fillStyle = particleColor;
                state.particles.forEach(function(p) {
                    const yReal = pipeTop + pipeHeight * p.y;
                    const rFrac = (p.y - 0.5) * 2; // range -1 to 1
                    // Parabolic velocity factor (high in center, low at walls)
                    let vProfile = 1.5 * (1 - rFrac * rFrac);
                    if (state.fluid === 'air') {
                        vProfile = 1.2 * Math.pow(1 - Math.abs(rFrac), 1/7); // flatter gas profile
                    }
                    // Move particles
                    const velocityFactor = 70; // visual scaling
                    const speed = v * velocityFactor * vProfile;
                    p.x += speed * dt;
                    // Boundaries
                    if (p.x > width + 10) {
                        p.x = -10;
                        p.y = 0.05 + Math.random() * 0.90;
                    }
                    // Clamp to make sure particles stay inside the pipe outlines (taking outline thickness into account)
                    const finalY = Math.max(pipeTop + 2.5 + p.size, Math.min(pipeBottom - 2.5 - p.size, yReal));
                    ctx.beginPath();
                    ctx.arc(p.x, finalY, p.size, 0, Math.PI * 2);
                    ctx.fill();
                });
                ctx.restore();
            }
            // Copy & right click block with nested if
            document.addEventListener('contextmenu', function(e) {
                e.preventDefault();
                alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                return false;
            }, { capture: true });
            document.addEventListener('selectstart', function(e) {
                e.preventDefault();
                return false;
            }, { capture: true });
            document.addEventListener('keydown', function(e) {
                if (e.key === 'F12') {
                    e.preventDefault();
                    alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                    return false;
                }
                if (e.ctrlKey) {
                    if (e.key === 'u' || e.key === 'c' || e.key === 's' || e.key === 'U' || e.key === 'C' || e.key === 'S') {
                        e.preventDefault();
                        alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                        return false;
                    }
                    if (e.shiftKey) {
                        if (['i','I','j','J','c','C'].includes(e.key)) {
                            e.preventDefault();
                            alert("이 콘텐츠는 저작권법의 보호를 받습니다. 무단 복제 및 우클릭을 금지합니다.");
                            return false;
                        }
                    }
                }
            }, { capture: true });
            // Initialize
            loadPreset('midWater');
            requestAnimationFrame(draw);
        })();
</script>


<div style="background: linear-gradient(135deg, rgba(0,242,254,0.03), rgba(138,43,226,0.03)); border: 1px solid rgba(0,242,254,0.15); border-radius: 12px; padding: 18px 24px; margin: 25px auto 35px auto; font-size: 0.95em; color: #4b5563; line-height: 1.7; font-family: sans-serif;">
    <strong style="color: #1f2937; font-size: 1.05em; display: flex; align-items: center; gap: 8px;">
        <span style="font-size: 1.2em;"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span> 간편 사용 설명서
    </strong>
    <ol style="margin: 10px 0 0 0; padding-left: 20px;">
        <li style="margin-bottom: 6px;"><strong>배관 지름(내경) 설정: 슬라이더나 직접 입력창을 통해 배관의 순수 내측 지름(mm)을 입력합니다.</strong></li>
<li style="margin-bottom: 6px;">설계 타겟 유량 설정: 단위 선택 기능과 함께 시간당 혹은 분당 요구되는 배관의 체적 유량을 입력합니다.</li>
<li style="margin-bottom: 6px;">용도별 권장 배관 속도 기준 확인: 계산된 유동 속도가 흡입관(Suction), 송출관(Delivery), 또는 고압 유압배관의 물리적 적정 속도 가이드라인(0.5 ~ 6 m/s)을 만족하는지 평가표를 확인합니다.</li>
<li style="margin-bottom: 6px;">실시간 흐름 시각화 및 피드백: 유속에 비례하여 부드럽게 흐르는 캔버스 내부 파티클의 이동 속도와 분포 프로파일을 직관적으로 확인합니다.</li>
    </ol>
</div>


<details class="premium-seo-accordion" style="border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; background: #fbfbfc; padding: 0; margin: 30px auto; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.01); font-family: sans-serif;">
    <summary style="display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; font-size: 1.1em; font-weight: 700; color: #1f2937; cursor: pointer; user-select: none; outline: none; list-style: none;">
        <span><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4da.png" alt="📚" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 배관 내경, 유량, 유속 간 연속방정식 공식 및 설계 가이드</span>
        <span class="accordion-arrow" style="font-size: 0.9em; color: #9ca3af; transition: transform 0.2s ease;">▼</span>
    </summary>
    <div style="padding: 0 24px 24px 24px; border-top: 1px solid rgba(0,0,0,0.04); background: #ffffff; border-radius: 0 0 12px 12px; font-size: 0.98em; color: #374151; line-height: 1.8;">
        <div style="margin-top: 20px;">
            <h3>1. 유체의 연속방정식(Continuity Equation)과 유동 계산 공식</h3>
<p>배관 시스템을 흐르는 유체의 유량(Flow Rate)과 유속(Velocity) 및 배관 단면적(Area) 사이에는 유도되는 물리법칙인 <strong>연속방정식(Continuity Equation)</strong>이 성립합니다. 비압축성 유체가 꽉 차서 흐르는 정상 유동에서 시간당 배관을 통과하는 유체의 체적 유량은 항상 일정하며 단면적과 속도의 곱으로 결정됩니다.</p><p style="text-align: center; font-weight: bold; background: #e0f2fe; padding: 16px; border-radius: 8px; font-size: 1.05em; color: #0369a1;">Q = A &times; v = (&pi; &times; D² / 4) &times; v</p><p>여기서 <code>Q</code>는 체적 유량(m³/s), <code>A</code>는 배관 내부 단면적(m²), <code>v</code>는 평균 흐름 유속(m/s), <code>D</code>는 배관 내경(m)입니다. 실무 공학 계산에서는 대개 구경 단위로 mm를, 유량 단위로 m³/h 또는 LPM(L/min)을 사용하므로 다음과 같은 유효 환산 공식이 적용됩니다.</p><p style="text-align: center; font-weight: bold; background: #f3f4f6; padding: 12px; border-radius: 8px;">v = (4 &times; Q_m³/h) / (&pi; &times; (D_mm / 1000)&sup2; &times; 3600) &approx; 353.68 &times; Q_m³/h / D_mm&sup2; &nbsp;[m/s]</p>
<h3>2. 엔지니어링 실무 배관 용도별 권장 설계 유속 기준 (Water/Oil)</h3>
<p>배관 설계 시 유속의 설정은 배관의 내구성 및 펌프 소요 에너지 효율에 직접적인 영향을 미칩니다. 유속이 너무 빠르면 마찰 손실이 기하급수적으로 늘어나고 <strong>공동현상(Cavitation)이나 배관 마모/부식(Erosion)</strong>을 야기할 수 있으며, 반대로 유속이 너무 느리면 동일 유량을 보내기 위해 지나치게 굵은 배관을 써야 하므로 설비 투자 단가가 늘어납니다.</p><ul><li><strong>펌프 흡입 배관 (Suction Line, Water):</strong> <code>0.5 ~ 1.5 m/s</code> (흡입 압력 손실 및 공동현상을 방지하기 위해 가장 느리게 설계함)</li><li><strong>펌프 송출 배관 (Delivery Line, Water):</strong> <code>1.5 ~ 3.0 m/s</code> (마찰 저항과 배관 경량화 사이의 경제적 최적 범위)</li><li><strong>유압 동력 전달 배관 (Hydraulic Pressure Line, Oil):</strong> <code>2.0 ~ 6.0 m/s</code> (고압 전달용 배관으로 상대적으로 속도 설계 허용 한계가 높음)</li></ul>
<h3>3. 경제적 배관 직경 선정 (Economic Pipe Diameter) 접근론</h3>
<p>배관 설계를 최종 결정할 때, 초기 설치 비용(배관 본체 및 피팅류 가격)과 운전 에너지 비용(마찰 압력 손실을 극복하기 위한 펌프 구동 전력비)을 모두 더한 <strong>총생애주기 비용(LCC)이 최소가 되는 지점</strong>이 바로 최적의 경제적 배관 직경입니다. 다양한 산업용 유속 기준치 계산 기능이 본 시뮬레이터에 실시간 모니터링 모듈로 내장되어 유동 구경 설계의 오차를 원천 차단해 줍니다.</p>
        </div>
    </div>
</details>
<style>
details.premium-seo-accordion[open] summary .accordion-arrow { transform: rotate(180deg); color: #00f2fe; }
details.premium-seo-accordion summary::-webkit-details-marker { display: none; }
details.premium-seo-accordion:hover { border-color: rgba(0,242,254,0.3); }
</style>

]]></content:encoded>
					
					<wfw:commentRss>https://myengnote.com/pipe-flow-velocity-calculator-simulator/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
