Class: Pulo::Steam::Desuperheater

Inherits:
Object
  • Object
show all
Defined in:
lib/pulo/machine/steam/desuperheater.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(inlet_pressure: nil, inlet_temperature: nil, inlet_massflow: nil, outlet_massflow: nil) ⇒ Desuperheater

Returns a new instance of Desuperheater.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/pulo/machine/steam/desuperheater.rb', line 8

def initialize(inlet_pressure: nil, inlet_temperature: nil,
               inlet_massflow: nil, outlet_massflow:nil)

  raise "Need all parameters" unless inlet_pressure && inlet_temperature && (inlet_massflow || outlet_massflow)

  @inlet_steam=WaterSteam.new(pressure: inlet_pressure, temperature: inlet_temperature)
  @outlet_steam=WaterSteam.new(pressure: inlet_pressure, quality: Dimensionless.n(1))
  @water=WaterSteam.new(pressure: Pressure.psig(0),temperature: Temperature.celsius(25))

  if inlet_massflow
    @inlet_steam.mass_flow=inlet_massflow
    @water.mass_flow=inlet_massflow*(@inlet_steam.specific_enthalpy-@outlet_steam.specific_enthalpy)/(@outlet_steam.specific_enthalpy-@water.specific_enthalpy)
    @outlet_steam.mass_flow=inlet_massflow+@water.mass_flow
  else
    @outlet_steam.mass_flow=outlet_massflow
    @water.mass_flow=outlet_massflow*(@inlet_steam.specific_enthalpy-@outlet_steam.specific_enthalpy)/(@inlet_steam.specific_enthalpy-@water.specific_enthalpy)
    @inlet_steam.mass_flow=outlet_massflow-@water.mass_flow
  end
end

Instance Attribute Details

#inlet_steamObject (readonly)

Returns the value of attribute inlet_steam.



6
7
8
# File 'lib/pulo/machine/steam/desuperheater.rb', line 6

def inlet_steam
  @inlet_steam
end

#outlet_steamObject (readonly)

Returns the value of attribute outlet_steam.



6
7
8
# File 'lib/pulo/machine/steam/desuperheater.rb', line 6

def outlet_steam
  @outlet_steam
end

#waterObject (readonly)

Returns the value of attribute water.



6
7
8
# File 'lib/pulo/machine/steam/desuperheater.rb', line 6

def water
  @water
end