Class: Pulo::Steam::Boiler

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(feedwater_pressure: nil, blowdown_rate: nil, combustion_efficiency: nil, steam_pressure: nil, steam_temperature: nil, fuel_power: nil, steam_massflow: nil, feedwater_massflow: nil) ⇒ Boiler

Returns a new instance of Boiler.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/pulo/machine/steam/boiler.rb', line 10

def initialize(feedwater_pressure: nil,blowdown_rate: nil,combustion_efficiency:nil,steam_pressure: nil,
               steam_temperature: nil,fuel_power: nil,
               steam_massflow: nil,feedwater_massflow: nil)

  raise "Need all parameters" unless
      feedwater_pressure && blowdown_rate &&
      combustion_efficiency && steam_pressure &&
      (steam_temperature || fuel_power) &&
      (steam_massflow || feedwater_massflow)

  #steam_massflow=steam_massflow
  @blowdown_rate=blowdown_rate
  @combustion_efficiency=combustion_efficiency
  @steam_temperature=steam_temperature
  @feedwater_pressure=feedwater_pressure
  @steam_pressure=steam_pressure
  @fuel_power=fuel_power
  #feedwater_massflow=feedwater_massflow

  @blowdown=WaterSteam.new(pressure: @steam_pressure, quality: Dimensionless.new(0))
  if steam_massflow
    feedwater_massflow=steam_massflow/(1-@blowdown_rate)
  else
    steam_massflow=feedwater_massflow*(1-@blowdown_rate)
  end

  @blowdown.mass_flow=feedwater_massflow*@blowdown_rate
  #@[email protected]_enthalpy*@blowdown_massflow

  @feedwater=WaterSteam.new(pressure: @feedwater_pressure, quality: Dimensionless.new(0))
  @feedwater.mass_flow=feedwater_massflow
  #@[email protected]_enthalpy*@feedwater_massflow


  if @steam_temperature
    @steam=WaterSteam.new(pressure: @steam_pressure, temperature: @steam_temperature)
    @steam.mass_flow=steam_massflow
    #@[email protected]_enthalpy*@steam_massflow
    @boiler_power=@steam.energy_flow + @blowdown.energy_flow - @feedwater.energy_flow
    @fuel_power=@boiler_power/@combustion_efficiency
  else
    @boiler_power=@fuel_power*@combustion_efficiency
    steam_power=@boiler_power-@blowdown.energy_flow+@feedwater.energy_flow
    specific_enthalpy=steam_power/steam_massflow
    @steam=WaterSteam.new(pressure: @steam_pressure, specific_enthalpy: specific_enthalpy)
    @steam.mass_flow=steam_massflow
    raise "Boiler not boiling!" if @steam.if97_region=="1"
  end
end

Instance Attribute Details

#blowdownObject (readonly)

Returns the value of attribute blowdown.



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

def blowdown
  @blowdown
end

#blowdown_rateObject (readonly)

Returns the value of attribute blowdown_rate.



7
8
9
# File 'lib/pulo/machine/steam/boiler.rb', line 7

def blowdown_rate
  @blowdown_rate
end

#boiler_powerObject (readonly)

Returns the value of attribute boiler_power.



8
9
10
# File 'lib/pulo/machine/steam/boiler.rb', line 8

def boiler_power
  @boiler_power
end

#combustion_efficiencyObject (readonly)

Returns the value of attribute combustion_efficiency.



7
8
9
# File 'lib/pulo/machine/steam/boiler.rb', line 7

def combustion_efficiency
  @combustion_efficiency
end

#feedwaterObject (readonly)

Returns the value of attribute feedwater.



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

def feedwater
  @feedwater
end

#fuel_powerObject (readonly)

Returns the value of attribute fuel_power.



8
9
10
# File 'lib/pulo/machine/steam/boiler.rb', line 8

def fuel_power
  @fuel_power
end

#steamObject (readonly)

Returns the value of attribute steam.



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

def steam
  @steam
end