Class: Pulo::Steam::Desuperheater
- Inherits:
-
Object
- Object
- Pulo::Steam::Desuperheater
- Defined in:
- lib/pulo/machine/steam/desuperheater.rb
Instance Attribute Summary collapse
-
#inlet_steam ⇒ Object
readonly
Returns the value of attribute inlet_steam.
-
#outlet_steam ⇒ Object
readonly
Returns the value of attribute outlet_steam.
-
#water ⇒ Object
readonly
Returns the value of attribute water.
Instance Method Summary collapse
-
#initialize(inlet_pressure: nil, inlet_temperature: nil, inlet_massflow: nil, outlet_massflow: nil) ⇒ Desuperheater
constructor
A new instance of Desuperheater.
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_steam ⇒ Object (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_steam ⇒ Object (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 |
#water ⇒ Object (readonly)
Returns the value of attribute water.
6 7 8 |
# File 'lib/pulo/machine/steam/desuperheater.rb', line 6 def water @water end |