{
  "version": 1,
  "topic": "TH12",
  "title": "Compositional flash teaching cases with component balances",
  "createdAt": "2026-10-24",
  "case": {
    "title": "Component allocation in one recorded flash",
    "premise": "Fixed PR case: 280 K, 2 MPa(a), total feed 100 mol, vapor mole fraction 0.657564115965. Component number selects methane through n-hexane.",
    "formula": "feed_i = 100zi; liquid_i = 100(1 − β)xi; vapor_i = 100βyi",
    "variables": "Rows 1–6 are C1, C2, C3, nC4, nC5 and nC6. The equilibrium state does not change with component selection.",
    "steps": [
      {
        "label": "Define the baseline",
        "calculation": "Component number (C1 to nC6) = 1",
        "explanation": "Fixed PR case: 280 K, 2 MPa(a), total feed 100 mol, vapor mole fraction 0.657564115965. Component number selects methane through n-hexane."
      },
      {
        "label": "Select the relation",
        "calculation": "feed_i = 100zi; liquid_i = 100(1 − β)xi; vapor_i = 100βyi",
        "explanation": "Rows 1–6 are C1, C2, C3, nC4, nC5 and nC6. The equilibrium state does not change with component selection."
      },
      {
        "label": "Substitute the values",
        "calculation": "Methane feed = 100 × 0.5 = 50 mol; liquid = 100 × (1 − 0.657564116) × 0.0971460404; vapor = 100 × 0.657564116 × 0.70979194; liquid + vapor = 50 mol",
        "explanation": "Retain intermediate precision. The displayed values are rounded only after evaluation."
      },
      {
        "label": "Read the result",
        "calculation": "Feed component (mol) = 50; Liquid component (mol) = 3.32662902; Vapor component (mol) = 46.673371",
        "explanation": "Phase composition and phase amount have different denominators. Every component must close independently."
      }
    ],
    "result": "Feed component (mol) = 50; Liquid component (mol) = 3.32662902; Vapor component (mol) = 46.673371",
    "interpretation": "Phase composition and phase amount have different denominators. Every component must close independently.",
    "control": "Component number (C1 to nC6)",
    "columns": [
      "Component number (C1 to nC6)",
      "Feed component (mol)",
      "Liquid component (mol)",
      "Vapor component (mol)"
    ],
    "rows": [
      [
        1,
        50,
        3.3266290227481337,
        46.67337097725187
      ],
      [
        2,
        15,
        4.264387791335624,
        10.735612208664373
      ],
      [
        3,
        15,
        8.743733591015284,
        6.256266408984715
      ],
      [
        4,
        10,
        8.296927839818707,
        1.7030721601812933
      ],
      [
        5,
        5,
        4.707415808959007,
        0.2925841910409919
      ],
      [
        6,
        5,
        4.904494349606927,
        0.09550565039307278
      ]
    ],
    "baseline": 0,
    "rowNotes": [
      "Component number (C1 to nC6) = 1. Feed component (mol): 50; Liquid component (mol): 3.32662902; Vapor component (mol): 46.673371.",
      "Component number (C1 to nC6) = 2. Feed component (mol): 15; Liquid component (mol): 4.26438779; Vapor component (mol): 10.7356122.",
      "Component number (C1 to nC6) = 3. Feed component (mol): 15; Liquid component (mol): 8.74373359; Vapor component (mol): 6.25626641.",
      "Component number (C1 to nC6) = 4. Feed component (mol): 10; Liquid component (mol): 8.29692784; Vapor component (mol): 1.70307216.",
      "Component number (C1 to nC6) = 5. Feed component (mol): 5; Liquid component (mol): 4.70741581; Vapor component (mol): 0.292584191.",
      "Component number (C1 to nC6) = 6. Feed component (mol): 5; Liquid component (mol): 4.90449435; Vapor component (mol): 0.0955056504."
    ],
    "provenance": "Fixed snapshot from the site's CoolProp 8 PR engine, independently compared with the thermo reference fixture. Selecting a row does not run a new flash.",
    "questions": [
      {
        "question": "Reproduce the baseline Feed component (mol) without rounding intermediate values.",
        "answer": "Methane feed = 100 × 0.5 = 50 mol; liquid = 100 × (1 − 0.657564116) × 0.0971460404; vapor = 100 × 0.657564116 × 0.70979194; liquid + vapor = 50 mol. Feed component (mol) = 50. Phase composition and phase amount have different denominators. Every component must close independently."
      },
      {
        "question": "Compare the first and last recorded scenarios. Which input changes?",
        "answer": "Component number (C1 to nC6) changes from 1 to 6. Other controls remain as stated in the premise. Feed component (mol) changes from 50 to 5."
      },
      {
        "question": "What would be needed to apply this example to a different physical system?",
        "answer": "Replace the synthetic controls with compatible documented inputs and check the relation's assumptions. Rows 1–6 are C1, C2, C3, nC4, nC5 and nC6. The equilibrium state does not change with component selection. Phase composition and phase amount have different denominators. Every component must close independently."
      }
    ]
  },
  "recorded": {
    "workflow": "peng-robinson-compositional-flash",
    "runtime": "CoolProp 8.0.0, Peng-Robinson, kij = 0",
    "inputs": {
      "T": 280,
      "p": 2,
      "z1": 0.5,
      "z2": 0.15,
      "z3": 0.15,
      "z4": 0.1,
      "z5": 0.05,
      "z6": 0.05
    },
    "beta": 0.6575641159651632,
    "massBeta": 0.4489132959587217,
    "liquidDensity": 591.9532946677658,
    "vaporDensity": 21.639978235090823,
    "componentBalanceError": 5.551115123125783e-17,
    "logFugacityMismatch": 1.8632706488830308e-10,
    "relativePressureResidual": 8.761880110341735e-12,
    "components": [
      {
        "name": "Methane",
        "short": "C1",
        "z": 0.5,
        "x": 0.09714604040766088,
        "y": 0.7097919403455489
      },
      {
        "name": "Ethane",
        "short": "C2",
        "z": 0.15,
        "x": 0.12453098492743819,
        "y": 0.16326335254634136
      },
      {
        "name": "Propane",
        "short": "C3",
        "z": 0.15,
        "x": 0.25533929119781623,
        "y": 0.09514306296659539
      },
      {
        "name": "n-Butane",
        "short": "nC4",
        "z": 0.1,
        "x": 0.24229142524603642,
        "y": 0.025899712572994473
      },
      {
        "name": "n-Pentane",
        "short": "nC5",
        "z": 0.05,
        "x": 0.1374685314369714,
        "y": 0.004449515780093034
      },
      {
        "name": "n-Hexane",
        "short": "nC6",
        "z": 0.05,
        "x": 0.14322372678407677,
        "y": 0.0014524157884268207
      }
    ]
  }
}
