MULTIPHASE

All Functions

  • AdiabaticTurbine(; name, η = 1.0, setpressure = false, Pout = 0.1)
  • BasicSteamPin(; name, Pdef = 0.1)
  • ClosedFeedwaterHeater(; name)
  • ContinuityReservoir(; name)
  • ContinuityReservoir2(; name)
  • FixedHeatFlowPin(; name, Qin = 1e3)
  • HeatTransferPin(; name)
  • HeatTransferPort(; name)
  • IdealBoiler(; name, Tout = 350)
  • IdealCondensor(; name)
  • MixingChamber(; name)
  • MultiPhaseGnd(; name, P = 0.1)
  • OpenFeedwaterHeater(; name)
  • PassiveCondensor(; name)
  • ReliefElement(; name, pressurecontrol = false)
  • Reservoir(; name, P = 0.1)
  • SetPressure(; name, P = 0.1)
  • Splitter(; name)
  • SteamFlowSource(; name, ṁ = 1.0)
  • SteamFlowValve(; name)
  • SteamHeatTransfer(; name)
  • SuperHeatedReservoir(; name, P = 150, T = 600)
  • TunableSteamFlowValve(; name, ṁ = 1.0)
  • TunableSteamHeatTransfer(; name, Q̇in = 150e6)
  • TwoPortReservoir(; name, P = 0.1)
  • WorkPin(; name)
  • extenda(odevec::Vector{ODESystem})
  • hydro_basic_connect(n, p)
  • hydro_connect(pins...)
  • hydro_series_connect(comp; returnmode = :eq)
  • ioReservoir(; name, P = 0.1, fixboth = false)
  • throttle(; name)

COMPONENTS

AdiabaticPump(; name, η = 1.0, setpressure = false, Pout = 10, controlinlet = false)

  • DESCRIPTION:

    Adiabatic pump
    # work, multiply by 100 to get to kPa
    @named p = BasicSteamPin()
    @named n = BasicSteamPin()
    @named w = WorkPin()
    ps = @parameters η = η P = Pout

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - `η = 1.0`: Isentropic Effciency
    • - `setpressure = false`: Option to constrain outlet pressure
    • - `Pout = 10`: Pressure (bar)
    • - `controlinlet = false`: DESCRIPTION
  • EQUATIONS:

    \[ w.Ẇ = p.Φ + n.Φ \] \[ 0 = p.ṁ + n.ṁ\] \[ n.h = p.h + p.v * 1e5 * (n.P - p.P) / η \] \[ w.Ẇ = p.ṁ * (n.h - p.h)\] \[ \]

AdiabaticTurbine(; name, η = 1.0, setpressure = false, Pout = 0.1)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - `η = 1.0`: Isentropic Effciency
    • - `setpressure = false`: Option to constrain outlet pressure
    • - `Pout = 0.1`: DESCRIPTION
  • EQUATIONS:

    \[ Ẇ = p.Φ + n.Φ\] \[ w.Ẇ = Ẇ\] \[ 0 = p.ṁ + n.ṁ\] \[ n.h = p.h - (p.h - h(n.P, p.s)) * η\] \[ w.Ẇ = p.ṁ * (n.h - p.h)\] \[ \]

SIMOAdiabaticTurbine(; name, ηin = 1.0, setpressure = false, Pyin = 10, Pzin = 0.1)

  • DESCRIPTION:

    Single input multi output turbinbe
    EXTERNAL NODES FOR INTERFACING
    @named p = BasicSteamPin() # inlet node
    @named hp = AdiabaticTurbine(η = ηin, Pout = Pyin, setpressure = sp)
    @named lp = AdiabaticTurbine(η = ηin, Pout = Pzin, setpressure = sp)
    @named yn = BasicSteamPin()
    @named zn = BasicSteamPin()
    split_connect = hydro_connect(p, yn, zn) # mflow, p.ṁ => positive
    hp_connect = hydro_connect(yn, hp.p)
    lp_connect = hydro_connect(zn, lp.p)
    # yn(-) -------> y
    # IN --> p (+) --|
    # zn(-) -------> z

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - `ηin = 1.0`: DESCRIPTION
    • - `setpressure = false`: Option to constrain outlet pressure
    • - `Pyin = 10`: DESCRIPTION
    • - `Pzin = 0.1`: DESCRIPTION
  • EQUATIONS:

    \[ \] \[ \]

SteamHeatTransfer(; name)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
  • EQUATIONS:

    \[ 0 = p.ṁ + n.ṁ \] \[ q.Q̇ = p.Φ + n.Φ \] \[ C = p.ṁ * c_p(p.P, p.h) \] \[ 0 = q.Q̇ - Q̇\] \[ n.h = p.h + q.Q̇ / (p.ṁ)\] \[ n.P = p.P\] \[ \]

TunableSteamHeatTransfer(; name, Q̇in = 1.5e8)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - `Q̇in = 1.5e8`: DESCRIPTION
  • EQUATIONS:

    \[ 0 = p.ṁ + n.ṁ \] \[ q.Q̇ = p.Φ + n.Φ \] \[ C = p.ṁ * c_p(p.P, p.h) \] \[ 0 = q.Q̇ - Q̇in\] \[ n.h = p.h + q.Q̇ / (p.ṁ)\] \[ n.P = p.P\] \[ \]

IdealBoiler(; name, Tout = 350)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - `Tout = 350`: DESCRIPTION
  • EQUATIONS:

    \[ q.Q̇ = p.Φ + n.Φ \] \[ 0 = p.ṁ + n.ṁ\] \[ n.P = p.P \] \[ n.h = h(p.P, T) \] \[ q.Q̇ = p.ṁ * (n.h - p.h)\] \[ \]

IdealCondensor(; name)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
  • EQUATIONS:

    \[ q.Q̇ = p.Φ + n.Φ \] \[ 0 = p.ṁ + n.ṁ\] \[ n.P = p.P \] \[ n.h = h_{sat}(p.P) \] \[ q.Q̇ = p.ṁ * (n.h - p.h)\] \[ q.Q̇ = Q̇\] \[ \]

PassiveCondensor(; name)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
  • EQUATIONS:

    \[ q.Q̇ = p.ṁ * (n.h - p.h)\] \[ 0 = p.ṁ + n.ṁ\] \[ q.Q̇ = Q̇\] \[ \]

ReliefElement(; name, pressurecontrol = false)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - `pressurecontrol = false`: DESCRIPTION
  • EQUATIONS:

    \[ n.ṁ + p.ṁ = 0 \] \[ q.Q̇ = p.Φ + n.Φ \] \[ \]

OpenFeedwaterHeater(; name)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
  • EQUATIONS:

    \[ [yfrac = 1] => [yfrac = 1]\] \[ [yfrac = 0] => [yfrac = 0.0]\] \[ n.P = p2.P\] \[ p1.P = n.P\] \[ n.h = h_{sat}(n.P) \] \[ 0 = n.h - (yfrac * p1.h + (1 - yfrac) * p2.h)\] \[ 0 = n.ṁ * yfrac + p1.ṁ\] \[ 0 = n.ṁ + p1.ṁ + p2.ṁ\] \[ 0 = n.Φ + (p1.Φ + p2.Φ)\] \[ \]

MixingChamber(; name)

  • DESCRIPTION:

    @named p1 = BasicSteamPin()
    @named p2 = BasicSteamPin()
    @named n = BasicSteamPin()

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
  • EQUATIONS:

    \[ n.P = p1.P\] \[ p1.P = p2.P\] \[ n.h = 1 / (p1.ṁ + p2.ṁ) * (p1.ṁ * p1.h + p2.ṁ * p2.h)\] \[ 0 = n.ṁ + p1.ṁ + p2.ṁ\] \[ 0 = n.Φ + p1.Φ + p2.Φ\] \[ \]

ClosedFeedwaterHeater(; name)

  • DESCRIPTION:

    Steam_OFW CLOSED FEEDWATER HEATER
    @named p1 = BasicSteamPin()
    @named n1 = BasicSteamPin()
    @named p2 = BasicSteamPin()
    @named n2 = BasicSteamPin()

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
  • EQUATIONS:

    \[ n1.P = p1.P \] \[ n2.P = p2.P\] \[ n2.h = n1.h \] \[ 0 = n1.ṁ + p1.ṁ\] \[ 0 = n2.ṁ + p2.ṁ\] \[ yfrac = (n2.h - p2.h) / ((p1.h - n1.h) + (n2.h - p2.h))\] \[ p1.ṁ = yfrac * (p1.ṁ + p2.ṁ)\] \[ p1.Φ = yfrac * (p1.Φ + p2.Φ)\] \[ 0 = n1.Φ + p1.Φ + p1.ṁ * p1.h + n1.ṁ * n1.h\] \[ 0 = n2.Φ + p2.Φ + p2.ṁ * p2.h + n2.ṁ * n2.h\] \[ \]

throttle(; name)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
  • EQUATIONS:

    \[ n.ṁ + p.ṁ = 0\] \[ p.h = n.h\] \[ ΔP = p.P - n.P\] \[ n.Φ = 0\] \[ \]

PINS

BasicSteamPin(; name, Pdef = 0.1)

  • DESCRIPTION:

    Basic Steam Pin
    Self computes T,s,x,V
    Must have methods for ṁ,Φ,P,h
    across_var =
    @variables P(t) = Pdef T(t) = 300 s(t) = 0.0 h(t) = 191e3 x(t) = 0.0 v(t) = 0.001
    thru_var = @variables ṁ(t) = 0.0 Φ(t) = 0.0 # mass flow and energy flow

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - Pdef = 0.1: DESCRIPTION
  • EQUATIONS:

    \[ T = T(P, h)\] \[ s = s(P, h)\] \[ x = x(P, h)\] \[ v = v(P, h)\] \[ \]

SOURCES

SetPressure(; name, P = 0.1)

  • DESCRIPTION:

    Ideal pressure source

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - P = 0.1: DESCRIPTION
  • EQUATIONS:

    \[ p.P = P\] \[ n.P = p.P\] \[ n.h = p.h\] \[ 0 = p.Φ + n.Φ \] \[ 0 = p.ṁ + n.ṁ\] \[ \]

SteamFlowSource(; name, ṁ = 1.0)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - `ṁ = 1.0`: Mass flow rate (kg/s)
  • EQUATIONS:

    \[ 0 = p.Φ + n.Φ \] \[ 0 = p.ṁ + n.ṁ\] \[ p.ṁ = Ṁ\] \[ p.h = n.h\] \[ n.P = p.P\] \[ \]

UTILITYS

Reservoir(; name, P = 0.1)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - = 0.1`: DESCRIPTION
  • EQUATIONS:

    \[ n.P = P\] \[ n.h = h_{sat}(P)\] \[ n.Φ = 0\] \[ \]

MultiPhaseGnd(; name, P = 0.1)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - = 0.1`: DESCRIPTION
  • EQUATIONS:

    \[ n.P = P\] \[ n.Φ = 0\] \[ \]

SuperHeatedReservoir(; name, P = 150, T = 600)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - `P = 150`: DESCRIPTION
    • - `T = 600`: DESCRIPTION
  • EQUATIONS:

    \[ n.P = P\] \[ 0 = h(P, T) + n.h\] \[ n.Φ = -n.ṁ * n.h\] \[ \]

ioReservoir(; name, P = 0.1, fixboth = false)

  • DESCRIPTION:

    Fluid reference element with the option to set both the inlet and outlet pressures

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - P = 0.1: Pressure (bar)
    • - `fixboth = false`: Option to fix both the inlet an d the outlet
  • EQUATIONS:

    \[ n.P = P\] \[ n.h = h_{sat}(P)\] \[ n.Φ = 0\] \[ 0 = n.ṁ + p.ṁ\] \[ \]

TwoPortReservoir(; name, P = 0.1)

  • DESCRIPTION:

    Basic

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - P = 0.1: Pressure for both the p and n ports
  • EQUATIONS:

    \[ n.P = P\] \[ p.P = P\] \[ n.h = h_{sat}(P)\] \[ p.h = n.h\] \[ p.Φ = 0 \] \[ 0 = n.ṁ + p.ṁ \] \[ 0 = n.Φ + p.Φ\] \[ \]

ContinuityReservoir2(; name)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
  • EQUATIONS:

    \[ n.P = p.P\] \[ n.h = p.h\] \[ p.Φ = 0\] \[ 0 = n.Φ + p.Φ\] \[ 0 = n.ṁ + p.ṁ\] \[ \]

ContinuityReservoir(; name)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
  • EQUATIONS:

    \[ n.P = p.P\] \[ n.h = p.h\] \[ n.Φ = 0\] \[ ΔΦ = p.Φ\] \[ 0 = n.ṁ + p.ṁ\] \[ \]

SteamFlowValve(; name)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
  • EQUATIONS:

    \[ 0 = p.Φ + n.Φ \] \[ 0 = p.ṁ + n.ṁ\] \[ p.ṁ = Ṁ\] \[ p.h = n.h\] \[ n.P = p.P\] \[ \]

TunableSteamFlowValve(; name, ṁ = 1.0)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
    • - `ṁ = 1.0`: Mass flow rate (kg/s)
  • EQUATIONS:

    \[ 0 = p.Φ + n.Φ \] \[ 0 = p.ṁ + n.ṁ\] \[ p.ṁ = ṁ\] \[ p.h = n.h\] \[ n.P = p.P\] \[ \]

Splitter(; name)

  • DESCRIPTION:

  • INPUTS:
    • - name: Name of the system, symbol. Or use the @named macro when initializing.
  • EQUATIONS:

    \[ \] \[ \]