Exemple #1
0
 def __init__(self, temporary, number):
     heat_stor = 0
     ele_stor = 0
     ice = InternalCombustionEngine(number, temporary)
     chp = CHPInternalCombustionEngine(temporary, number)
     heatstorage = HeatStorage(temporary)
     elestorage = EleStorage(temporary)
     gas_boiler = GasBoiler(temporary)
     demand = DemandData()
     time = demand.E_sheetnrows - 1
     ele_bought = []
     fuel = []
     ele_ice = []
     steam_boiler = []
     for t in range(0, time, Parameters.delttime):
         if ((demand.H_steam[t] >
              chp.heat_steam_out_max + gas_boiler.nominal)
                 | (demand.H[t] + demand.H_steam[t] >
                    heatstorage.get_H_out_max(heat_stor) +
                    chp.heat_out_max + gas_boiler.nominal)):
             self.judge = 0
             break
         else:
             self.judge = 1
             heat_steam_drive = HeatSteamDrive(t, temporary, number)
             self.steam = heat_steam_drive.steam
             self.gas_boiler_out_for_steam = heat_steam_drive.gas_boiler_out_for_steam
             pl = ice.get_pl_through_exhaust_gas(
                 heat_steam_drive.exhaust_gas)
             self.ele = pl * ice.nominal
             self.heat = ice.get_jacket_water_pl(pl)
             heat_follow = HeatFollow(t, temporary, heat_stor, self.heat)
             heat_stor = heat_follow.heat_stor
             self.gas_boiler_out_for_other = heat_follow.gas_boiler_out
             ele_follow = EleFollow(t, temporary, ele_stor, self.ele)
             ele_stor = ele_follow.ele_stor
             ele_bought.append(ele_follow.ele_bought)
             self.fuel_ice = ice.get_fuel(pl)
             self.fuel_gas_boiler = gas_boiler.get_Fuel_in(
                 self.gas_boiler_out_for_steam +
                 self.gas_boiler_out_for_other)
             fuel.append(self.fuel_ice + self.fuel_gas_boiler)
         steam_boiler.append(self.steam + self.gas_boiler_out_for_steam +
                             self.gas_boiler_out_for_other)
         ele_ice.append(self.ele)
         if heat_stor > heatstorage.nominal:
             heat_stor = heatstorage.nominal
         if ele_stor > elestorage.nominal:
             ele_stor = elestorage.nominal
     self.fuel = sum(fuel)
     self.ele_bought = sum(ele_bought)
     self.emission_calculate_ice = sum(ele_ice)
     self.emission_calculate_boiler = sum(steam_boiler)
     self.emission_calculate_absorption_chiller = 0
     self.emission_calculate_grid = self.ele_bought
Exemple #2
0
    def __init__(self, temporary, number):
        self.internal_combustion_engine = InternalCombustionEngine(
            number, temporary)
        self.boiler = Boiler(temporary)
        self.absorption_chiller = DoubleEffectAbsorptionChiller(temporary)
        self.number = number
        self.temporary = temporary
        self.ele_out_max = self.internal_combustion_engine.nominal
        # chp.heat_steam_out_max是exhaust gas全部进入锅炉的蒸汽
        # chp.heat_out_max 是exhaust gas全部进入锅炉的蒸汽 + 缸套水热
        # chp.heat_space_water_max 是exhaust gas全部进入制冷机制热 + 缸套水热
        # chp.cold_out_max 是exhaust gas和jacket water全部进入制冷剂的情况
        # chp.cold_out_max_exhaust_gas 是exhaust gas全进入制冷机的情况
        if self.internal_combustion_engine.get_exhaust_gas_pl(
                1) * self.boiler.effi >= self.boiler.nominal:
            self.heat_steam_out_max = self.boiler.nominal
        else:
            self.heat_steam_out_max = self.internal_combustion_engine.get_exhaust_gas_pl(
                1) * self.boiler.effi
        self.heat_out_max = self.heat_steam_out_max + self.internal_combustion_engine.get_jacket_water_pl(
            1)

        if (self.internal_combustion_engine.get_exhaust_gas_pl(1) *
                self.absorption_chiller.COP_heat >=
                self.absorption_chiller.heat_nominal):
            self.heat_space_water_max = (
                self.absorption_chiller.heat_nominal +
                self.internal_combustion_engine.get_jacket_water_pl(1))
        else:
            self.heat_space_water_max = (
                self.internal_combustion_engine.get_exhaust_gas_pl(1) *
                self.absorption_chiller.COP_heat +
                self.internal_combustion_engine.get_jacket_water_pl(1))

        cold = (self.internal_combustion_engine.get_exhaust_gas_pl(1) *
                self.absorption_chiller.COP_double +
                self.internal_combustion_engine.get_jacket_water_pl(1) *
                self.absorption_chiller.COP_single)
        if cold >= self.absorption_chiller.nominal:
            self.cold_out_max = self.absorption_chiller.nominal
        else:
            self.cold_out_max = cold

        if (self.internal_combustion_engine.get_exhaust_gas_pl(1) *
                self.absorption_chiller.COP_double >=
                self.absorption_chiller.nominal):
            self.cold_out_max_exhaust_gas = self.absorption_chiller.nominal
        else:
            self.cold_out_max_exhaust_gas = (
                self.internal_combustion_engine.get_exhaust_gas_pl(1) *
                self.absorption_chiller.COP_double)
Exemple #3
0
 def __init__(self, temporary, number):
     chp = CHPInternalCombustionEngine(temporary, number)
     ice = InternalCombustionEngine(number, temporary)
     absorption_chiller = DoubleEffectAbsorptionChiller(temporary)
     gas_boiler = GasBoiler(temporary)
     elestorage = EleStorage(temporary)
     heatstorage = HeatStorage(temporary)
     demand = DemandData()
     time = demand.E_sheetnrows - 1
     heat_stor = 0
     ele_stor = 0
     fuel = []
     ele_bought = []
     ele_ice = []
     heat_gas_boiler = []
     heat_absorption_chiller = []
     for t in range(0, time, Parameters.delttime):
         ele = min(demand.E[t] - elestorage.get_E_out_max(ele_stor), ice.nominal)
         judge_heat = chp.get_heat_through_ele(ele)
         if demand.H[t] > heatstorage.get_H_out_max(heat_stor) + judge_heat + gas_boiler.nominal:
             self.judge = 0
             break
         else:
             self.judge = 1
             ele_drive = EleDrive(t, temporary, number, ele_stor)
             if ele_drive.ele == 0:
                 heat_drive = HeatDriveChiller(t, temporary, number, heat_stor)
                 self.heat = heat_drive.heat
                 self.heat_gas_boiler = heat_drive.gas_boiler_out
                 self.ele = ice.get_ele_out_through_heat_mode(self.heat)
                 pl = self.ele / ice.nominal
                 self.heat_absorption_chiller = ice.get_exhaust_gas_pl(pl) * absorption_chiller.COP_heat
                 heat_stor = heat_drive.heat_stor
                 ele_stor = elestorage.get_S(ele_stor, self.ele, ele_drive.elestorage_out)
                 fuel.append(ice.get_fuel(pl) + gas_boiler.get_Fuel_in(heat_drive.gas_boiler_out))
                 ele_bought.append(0)
             else:
                 self.ele = ele_drive.ele
                 pl = self.ele / ice.nominal
                 self.heat_absorption_chiller = ice.get_exhaust_gas_pl(pl) * absorption_chiller.COP_heat
                 self.heat = self.heat_absorption_chiller + ice.get_jacket_water_pl(pl)
                 heat_follow = HeatFollow(t, temporary, heat_stor, self.heat)
                 heat_stor = heat_follow.heat_stor
                 self.heat_gas_boiler = heat_follow.gas_boiler_out
                 self.fuel = ice.get_fuel(pl) + gas_boiler.get_Fuel_in(heat_follow.gas_boiler_out)
                 fuel.append(ice.get_fuel(pl) + gas_boiler.get_Fuel_in(heat_follow.gas_boiler_out))
                 ele_bought.append(ele_drive.ele_bought)
             ele_ice.append(self.ele)
             heat_gas_boiler.append(self.heat_gas_boiler)
             heat_absorption_chiller.append(self.heat_absorption_chiller)
             if heat_stor > heatstorage.nominal:
                 heat_stor = heatstorage.nominal
             if ele_stor > elestorage.nominal:
                 ele_stor = elestorage.nominal
     self.fuel = sum(fuel)
     self.ele_bought = sum(ele_bought)
     self.emission_calculate_ice = sum(ele_ice)
     self.emission_calculate_boiler = sum(heat_gas_boiler)
     self.emission_calculate_absorption_chiller = sum(self.heat_absorption_chiller)
     self.emission_calculate_grid = self.ele_bought
Exemple #4
0
 def __init__(self, t, temporary, number, ele_stor):
     ice = InternalCombustionEngine(number, temporary)
     demand = DemandData()
     elestorage = EleStorage(temporary)
     self.elestorage_in = 0
     if demand.E[t] <= elestorage.get_E_out_max(ele_stor):
         self.status = 0
         self.elestorage_out = demand.E[t]
         self.ele = 0
         self.ele_bought = 0
     elif (
         (demand.E[t] > elestorage.get_E_out_max(ele_stor))
             &
         (demand.E[t] <= elestorage.get_E_out_max(ele_stor) + ice.nominal)):
         self.status = 1
         self.elestorage_out = elestorage.get_E_out_max(ele_stor)
         self.ele = demand.E[t] - self.elestorage_out
         self.ele_bought = 0
     else:
         self.status = 1
         self.elestorage_out = elestorage.get_E_out_max(ele_stor)
         self.ele = ice.nominal
         self.ele_bought = demand.E[t] - self.elestorage_out - self.ele
     self.ele_stor = elestorage.get_S(ele_stor, self.elestorage_in,
                                      self.elestorage_out)
Exemple #5
0
 def __init__(self, temporary, number):
     ele_stor = 0
     elestorage = EleStorage(temporary)
     ice = InternalCombustionEngine(number, temporary)
     demand = DemandData()
     self.judge = 1
     self.ele_bought = []
     self.fuel = []
     self.ele_ice = []
     self.ele_waste = []
     for t in range(6, 22, Parameters.delttime):
         ele = ice.nominal
         if demand.transition_E[t] <= ele:
             elestorage_ele_out = 0
             elestorage_ele_in = ele - demand.transition_E[t]
             ele_bought = 0
         elif (demand.transition_E[t] >
               ele) & (demand.transition_E[t] <=
                       ele + elestorage.get_E_out_max(ele_stor)):
             elestorage_ele_out = demand.transition_E[t] - ele
             elestorage_ele_in = 0
             ele_bought = 0
         else:
             elestorage_ele_out = elestorage.get_E_out_max(ele_stor)
             elestorage_ele_in = 0
             ele_bought = demand.transition_E[t] - ele - elestorage_ele_out
         ele_stor = elestorage.get_S(ele_stor, elestorage_ele_in,
                                     elestorage_ele_out)
         if ele_stor > elestorage.nominal:
             self.ele_waste.append(ele_stor - elestorage.nominal)
             ele_stor = elestorage.nominal
         else:
             self.ele_waste.append(0)
         self.ele_ice.append(ele)
         self.fuel.append(ice.get_fuel(1))
         self.ele_bought.append(ele_bought)
     for t in range(22, 24, Parameters.delttime):
         ele_during_shut_down = EleDuringShutDown(temporary, t, ele_stor, 2)
         ele_stor = ele_during_shut_down.ele_stor
         self.ele_bought.append(ele_during_shut_down.ele_bought_for_ele)
     for t in range(0, 6, Parameters.delttime):
         ele_during_shut_down = EleDuringShutDown(temporary, t, ele_stor, 2)
         ele_stor = ele_during_shut_down.ele_stor
         self.ele_bought.append(ele_during_shut_down.ele_bought_for_ele)
Exemple #6
0
 def __init__(self, temporary, number):
     cold_stor = 0
     ele_stor = 0
     chp = CHPInternalCombustionEngine(temporary, number)
     heat_pump = HeatPump(temporary)
     absorption_chiller = DoubleEffectAbsorptionChiller(temporary)
     coldstorage = ColdStorage(temporary)
     elestorage = EleStorage(temporary)
     ice = InternalCombustionEngine(number, temporary)
     demand = DemandData()
     time = demand.E_sheetnrows - 1
     ele_bought = []
     fuel = []
     ele_ice = []
     cold_absorption_chiller = []
     for t in range(0, time, Parameters.delttime):
         if demand.C[t] > coldstorage.get_C_out_max(
                 cold_stor) + chp.cold_out_max + heat_pump.nominal:
             self.judge = 0
             break
         else:
             self.judge = 1
             cold_drive = ColdDrive(t, temporary, number, cold_stor)
             if cold_drive.cold == 0:
                 ele_drive = EleDrive(t, temporary, number, ele_stor)
                 ele_stor = ele_drive.ele_stor
                 self.ele = ele_drive.ele
                 pl = self.ele / ice.nominal
                 exhaust_gas = ice.get_exhaust_gas_pl(pl)
                 jacket_water = ice.get_jacket_water_pl(pl)
                 self.cold = absorption_chiller.get_cold_out(
                     exhaust_gas, jacket_water)
                 cold_stor = coldstorage.get_S(cold_stor, self.cold,
                                               cold_drive.coldstorage_out)
                 ele_bought.append(ele_drive.ele_bought)
                 fuel.append(ice.get_fuel(ele_drive.ele / ice.nominal))
             else:
                 self.cold = cold_drive.cold
                 cold_stor = cold_drive.cold_stor
                 self.ele = ice.get_ele_out_through_cold(cold_drive.cold)
                 ele_follow = EleFollow(t, temporary, ele_stor, self.ele)
                 ele_stor = ele_follow.ele_stor
                 ele_bought.append(
                     heat_pump.get_E_in(cold_drive.heat_pump_out) +
                     ele_follow.ele_bought)
                 fuel.append(ice.get_fuel(self.ele / ice.nominal))
             ele_ice.append(self.ele)
             cold_absorption_chiller.append(self.cold)
             if cold_stor > coldstorage.nominal:
                 cold_stor = coldstorage.nominal
             if ele_stor > elestorage.nominal:
                 ele_stor = elestorage.nominal
     self.fuel = sum(fuel)
     self.ele_bought = sum(ele_bought)
     self.emission_calculate_ice = sum(ele_ice)
     self.emission_calculate_boiler = 0
     self.emission_calculate_absorption_chiller = sum(
         cold_absorption_chiller)
     self.emission_calculate_grid = self.ele_bought
Exemple #7
0
 def __init__(self, temporary, number):
     ele_stor = 0
     elestorage = EleStorage(temporary)
     ice = InternalCombustionEngine(number, temporary)
     demand = DemandData()
     time = demand.E_sheetnrows - 1
     ele_bought = []
     fuel = []
     ele_ice = []
     for t in range(0, time, Parameters.delttime):
         ele_drive = EleDrive(t, temporary, number, ele_stor)
         self.ele = ele_drive.ele
         ele_ice.append(self.ele)
         pl = self.ele / ice.nominal
         fuel.append(ice.get_fuel(pl))
         ele_stor = elestorage.get_S(ele_stor, 0, ele_drive.elestorage_out)
         ele_bought.append(ele_drive.ele_bought)
         if ele_stor > elestorage.nominal:
             ele_stor = elestorage.nominal
     self.fuel = sum(fuel)
     self.ele_bought = sum(ele_bought)
Exemple #8
0
 def __init__(self, t, temporary, number, heat_stor):
     demand = DemandData()
     heatstorage = HeatStorage(temporary)
     ice = InternalCombustionEngine(number, temporary)
     self.heatstorage_in = 0
     if demand.H[t] <= heatstorage.get_H_out_max(heat_stor):
         self.heatstorage_out = demand.H[t]
         self.heat = 0
         self.gas_boiler_out = 0
     elif ((demand.H[t] > heatstorage.get_H_out_max(heat_stor))
           & (demand.H[t] <= heatstorage.get_H_out_max(heat_stor) +
              ice.get_jacket_water_pl(1))):
         self.heatstorage_out = heatstorage.get_H_out_max(heat_stor)
         self.heat = demand.H[t] - self.heatstorage_out
         self.gas_boiler_out = 0
     else:
         self.heatstorage_out = heatstorage.get_H_out_max(heat_stor)
         self.heat = ice.get_jacket_water_pl(1)
         self.gas_boiler_out = demand.H[t] - self.heatstorage_out - self.heat
     self.heat_stor = heatstorage.get_S(heat_stor, self.heatstorage_in,
                                        self.heatstorage_out)
 def __init__(self, temporary, number):
     internal_combustion_engine = InternalCombustionEngine(
         number, temporary)
     boiler = Boiler(temporary)
     absorption_chiller = DoubleEffectAbsorptionChiller(temporary)
     self.ele_out_max = internal_combustion_engine.nominal
     if internal_combustion_engine.get_exhaust_gas_pl(
             1) * boiler.effi >= boiler.nominal:
         self.heat_out_max = boiler.nominal
     else:
         self.heat_out_max = internal_combustion_engine.get_exhaust_gas_pl(
             1) * boiler.effi
     cold = (internal_combustion_engine.get_exhaust_gas_pl(1) *
             absorption_chiller.COP_double +
             internal_combustion_engine.get_jacket_water_pl(1) *
             absorption_chiller.COP_single)
     if cold >= absorption_chiller.nominal:
         self.cold_out_max = absorption_chiller.nominal
     else:
         self.cold_out_max = cold
Exemple #10
0
    def __init__(self, temporary, number):
        demand = DemandData()
        heatstorage = HeatStorage(temporary)
        coldstorage = ColdStorage(temporary)
        elestorage = EleStorage(temporary)
        gas_boiler = GasBoiler(temporary)
        heat_pump = HeatPump(temporary)
        ice = InternalCombustionEngine(number, temporary)
        chp = CHPInternalCombustionEngine(temporary, number)
        heat_stor = 0
        ele_stor = 0
        cold_stor = 0
        self.fuel = []
        self.ele_bought = []
        self.ele_ice = []
        self.heat_jacket_water = []
        self.heat_gas_boiler = []
        self.cold_absorption_chiller = []
        self.cold_heat_pump = []
        self.cold_waste = []
        self.heat_waste = []
        self.ele_waste = []
        for t in range(7, 23, Parameters.delttime):
            if ((demand.C[t] > chp.cold_out_max_exhaust_gas +
                 coldstorage.get_C_out_max(cold_stor) + heat_pump.nominal)
                    |
                (demand.H[t] >
                 (ice.get_jacket_water_pl(1) +
                  heatstorage.get_H_out_max(heat_stor) + gas_boiler.nominal))):
                self.judge = 0
                break
            else:
                self.judge = 1
                ele = ice.nominal
                heat = ice.get_jacket_water_pl(1)
                cold = chp.cold_out_max_exhaust_gas
                if demand.C[t] <= cold:
                    coldstorage_cold_in = cold - demand.C[t]
                    coldstorage_cold_out = 0
                    cold_heat_pump = 0
                    ele_needed_for_heat_pump = 0
                elif (demand.C[t] >
                      cold) & (demand.C[t] <=
                               cold + coldstorage.get_C_out_max(cold_stor)):
                    coldstorage_cold_out = coldstorage.get_C_out_max(
                        cold_stor) + cold - demand.C[t]
                    coldstorage_cold_in = 0
                    cold_heat_pump = 0
                    ele_needed_for_heat_pump = 0
                else:
                    coldstorage_cold_out = coldstorage.get_C_out_max(cold_stor)
                    coldstorage_cold_in = 0
                    cold_heat_pump = demand.C[t] - coldstorage_cold_out - cold
                    ele_needed_for_heat_pump = heat_pump.get_E_in(
                        cold_heat_pump)
                cold_stor = coldstorage.get_S(cold_stor, coldstorage_cold_in,
                                              coldstorage_cold_out)
                if demand.transition_E <= ele:
                    ele_bought_for_ele = 0
                    if ele_needed_for_heat_pump > 0:
                        if ele - demand.transition_E[
                                t] >= ele_needed_for_heat_pump:
                            elestorage_ele_in = ele - demand.transition_E[
                                t] - ele_needed_for_heat_pump
                            elestorage_ele_out = 0
                            ele_bought_for_heat_pump = 0
                        else:
                            elestorage_ele_in = 0
                            elestorage_ele_out = 0
                            ele_bought_for_heat_pump = ele_needed_for_heat_pump - (
                                ele - demand.transition_E[t])
                    else:
                        ele_bought_for_heat_pump = 0
                        elestorage_ele_out = 0
                        elestorage_ele_in = ele - demand.transition_E[t]
                elif(demand.transition_E[t] > ele) \
                        & (demand.transition_E[t] < ele + elestorage.get_E_out_max(ele_stor)):
                    ele_bought_for_ele = 0
                    elestorage_ele_out = demand.transition_E[t] - ele
                    elestorage_ele_in = 0
                    ele_bought_for_heat_pump = ele_needed_for_heat_pump
                else:
                    ele_bought_for_ele = demand.transition_E[
                        t] - ele - elestorage.get_E_out_max(ele_stor)
                    elestorage_ele_out = elestorage.get_E_out_max(ele_stor)
                    elestorage_ele_in = 0
                    ele_bought_for_heat_pump = ele_needed_for_heat_pump
                ele_stor = elestorage.get_S(ele_stor, elestorage_ele_in,
                                            elestorage_ele_out)
                ele_bought = ele_bought_for_heat_pump + ele_bought_for_ele

                if demand.H[t] <= heat:
                    heatstorage_heat_out = 0
                    heatstorage_heat_in = heat - demand.H[t]
                    heat_gas_boiler = 0
                elif (demand.H[t] >
                      heat) & (demand.H[t] <=
                               heat + heatstorage.get_H_out_max(heat_stor)):
                    heatstorage_heat_out = demand.H[t] - heat
                    heatstorage_heat_in = 0
                    heat_gas_boiler = 0
                else:
                    heatstorage_heat_out = heatstorage.get_H_out_max(heat_stor)
                    heatstorage_heat_in = 0
                    heat_gas_boiler = demand.H[
                        t] - heat - heatstorage.get_H_out_max(heat_stor)
                heat_stor = heatstorage.get_S(heat_stor, heatstorage_heat_in,
                                              heatstorage_heat_out)
                if cold_stor > coldstorage.nominal:
                    self.cold_waste.append(cold_stor - coldstorage.nominal)
                    cold_stor = coldstorage.nominal
                else:
                    self.cold_waste.append(0)
                if heat_stor > heatstorage.nominal:
                    self.heat_waste.append(heat_stor - heatstorage.nominal)
                    heat_stor = heatstorage.nominal
                else:
                    self.heat_waste.append(0)
                if ele_stor > elestorage.nominal:
                    self.ele_waste.append(ele_stor - elestorage.nominal)
                    ele_stor = elestorage.nominal
                else:
                    self.ele_waste.append(0)
                self.ele_ice.append(ele)
                self.heat_jacket_water.append(heat)
                self.cold_absorption_chiller.append(cold)
                self.cold_heat_pump.append(cold_heat_pump)
                self.heat_gas_boiler.append(heat_gas_boiler)
                self.ele_bought.append(ele_bought)
                self.fuel.append(
                    ice.get_fuel(1) + gas_boiler.get_Fuel_in(heat_gas_boiler))
        if self.judge == 1:
            for t in range(23, 24, Parameters.delttime):
                cold_during_shut_down = ColdDuringShutDown(
                    temporary, t, cold_stor)
                heat_during_sut_down = HeatDuringShutDown(
                    temporary, t, heat_stor)
                ele_during_shut_down = EleDuringShutDown(
                    temporary, t, ele_stor, 2)
                cold_stor = cold_during_shut_down.cold_stor
                heat_stor = heat_during_sut_down.heat_stor
                ele_stor = ele_during_shut_down.ele_stor
                self.cold_heat_pump.append(
                    cold_during_shut_down.cold_heat_pump)
                self.heat_gas_boiler.append(
                    heat_during_sut_down.heat_gas_boiler)
                self.fuel.append(heat_during_sut_down.fuel)
                self.ele_bought.append(
                    cold_during_shut_down.ele_bought_for_heat_pump +
                    ele_during_shut_down.ele_bought_for_ele)
            for t in range(0, 7, Parameters.delttime):
                cold_during_shut_down = ColdDuringShutDown(
                    temporary, t, cold_stor)
                heat_during_sut_down = HeatDuringShutDown(
                    temporary, t, heat_stor)
                ele_during_shut_down = EleDuringShutDown(
                    temporary, t, ele_stor, 2)
                cold_stor = cold_during_shut_down.cold_stor
                heat_stor = heat_during_sut_down.heat_stor
                ele_stor = ele_during_shut_down.ele_stor
                self.cold_heat_pump.append(
                    cold_during_shut_down.cold_heat_pump)
                self.heat_gas_boiler.append(
                    heat_during_sut_down.heat_gas_boiler)
                self.fuel.append(heat_during_sut_down.fuel)
                self.ele_bought.append(
                    cold_during_shut_down.ele_bought_for_heat_pump +
                    ele_during_shut_down.ele_bought_for_ele)
Exemple #11
0
    def __init__(self, temporary, number):
        chp = CHPInternalCombustionEngine(temporary, number)
        ice = InternalCombustionEngine(number, temporary)
        gas_boiler = GasBoiler(temporary)
        elestorage = EleStorage(temporary)
        heatstorage = HeatStorage(temporary)
        demand = DemandData()
        heat_stor = 0
        ele_stor = 0
        self.fuel = []
        self.ele_bought = []
        self.ele_ice = []
        self.heat_gas_boiler = []
        self.heat_waste = []
        self.ele_waste = []
        for t in range(7, 23, Parameters.delttime):
            if demand.H[t] > chp.heat_out_max + heatstorage.get_H_out_max(
                    heat_stor) + gas_boiler.nominal:
                self.judge = 0
                break
            else:
                self.judge = 1
                ele = ice.nominal
                heat = chp.heat_out_max
                if demand.H[t] <= heat:
                    heatstorage_heat_in = heat - demand.H[t]
                    heatstorage_heat_out = 0
                    heat_gas_boiler = 0
                elif (demand.H[t] >
                      heat) & (demand.H[t] <=
                               heat + heatstorage.get_H_out_max(heat_stor)):
                    heatstorage_heat_in = 0
                    heatstorage_heat_out = heatstorage.get_H_out_max(
                        heat_stor) + heat - demand.H[t]
                    heat_gas_boiler = 0
                else:
                    heatstorage_heat_in = 0
                    heatstorage_heat_out = heatstorage.get_H_out_max(heat_stor)
                    heat_gas_boiler = demand.H[
                        t] - heat - heatstorage.get_H_out_max(heat_stor)
                heat_stor = heatstorage.get_S(heat_stor, heatstorage_heat_in,
                                              heatstorage_heat_out)
                if demand.heat_E[t] <= ele:
                    elestorage_ele_in = ele - demand.heat_E[t]
                    elestorage_ele_out = 0
                    ele_bought = 0
                elif (demand.heat_E[t] >
                      ele) & (demand.heat_E[t] <=
                              ele + elestorage.get_E_out_max(ele_stor)):
                    elestorage_ele_in = 0
                    elestorage_ele_out = elestorage.get_E_out_max(
                        ele_stor + ele - demand.heat_E[t])
                    ele_bought = 0
                else:
                    elestorage_ele_in = 0
                    elestorage_ele_out = elestorage.get_E_out_max(ele_stor)
                    ele_bought = demand.heat_E[
                        t] - ele - elestorage.get_E_out_max(ele_stor)
                ele_stor = elestorage.get_S(ele_stor, elestorage_ele_in,
                                            elestorage_ele_out)
                if heat_stor > heatstorage.nominal:
                    self.heat_waste.append(heat_stor - heatstorage.nominal)
                    heat_stor = heatstorage.nominal
                else:
                    self.heat_waste.append(0)
                if ele_stor > elestorage.nominal:
                    self.ele_waste.append(ele_stor - elestorage.nominal)
                    ele_stor = elestorage.nominal
                else:
                    self.ele_waste.append(0)
                self.ele_ice.append(ele)
                self.heat_gas_boiler.append(heat_gas_boiler)
                self.ele_bought.append(ele_bought)
                self.fuel.append(
                    ice.get_fuel(1) + gas_boiler.get_Fuel_in(heat_gas_boiler))

        if self.judge == 1:
            for t in range(23, 24):
                heat_during_shut_down = HeatDuringShutDown(
                    temporary, t, heat_stor)
                ele_during_shut_down = EleDuringShutDown(
                    temporary, t, ele_stor, 1)
                heat_stor = heat_during_shut_down.heat_stor
                ele_stor = ele_during_shut_down.ele_stor
                self.heat_gas_boiler.append(
                    heat_during_shut_down.heat_gas_boiler)
                self.fuel.append(heat_during_shut_down.fuel)
                self.ele_bought.append(ele_during_shut_down.ele_bought_for_ele)
            for t in range(0, 7, Parameters.delttime):
                heat_during_shut_down = HeatDuringShutDown(
                    temporary, t, heat_stor)
                ele_during_shut_down = EleDuringShutDown(
                    temporary, t, ele_stor, 1)
                heat_stor = heat_during_shut_down.heat_stor
                ele_stor = ele_during_shut_down.ele_stor
                self.heat_gas_boiler.append(
                    heat_during_shut_down.heat_gas_boiler)
                self.fuel.append(heat_during_shut_down.fuel)
                self.ele_bought.append(ele_during_shut_down.ele_bought_for_ele)
Exemple #12
0
 def __init__(self, temporary, number):
     chp = CHPInternalCombustionEngine(temporary, number)
     heat_pump = HeatPump(temporary)
     elestorage = EleStorage(temporary)
     coldstorage = ColdStorage(temporary)
     ice = InternalCombustionEngine(number, temporary)
     demand = DemandData()
     cold_stor = 0
     ele_stor = 0
     self.fuel = []
     self.ele_bought = []
     self.ele_ice = []
     self.cold_absorption_chiller = []
     self.cold_heat_pump = []
     self.cold_waste = []
     self.ele_waste = []
     for t in range(7, 23, Parameters.delttime):
         ele = ice.nominal
         cold = chp.cold_out_max
         if demand.C[t] > cold + coldstorage.get_C_out_max(
                 cold_stor) + heat_pump.nominal:
             self.judge = 0
             break
         else:
             self.judge = 1
             if demand.C[t] <= cold:
                 cold_stor = coldstorage.get_S(cold_stor,
                                               cold - demand.C[t], 0)
                 cold_heat_pump = 0
                 ele_needed_for_heat_pump = 0
             elif (demand.C[t] >
                   cold) & (demand.C[t] <=
                            (cold + coldstorage.get_C_out_max(cold_stor))):
                 coldstorage_cold_out = coldstorage.get_C_out_max(
                     cold_stor) + cold - demand.C[t]
                 cold_stor = coldstorage.get_S(cold_stor, 0,
                                               coldstorage_cold_out)
                 cold_heat_pump = 0
                 ele_needed_for_heat_pump = 0
             else:
                 coldstorage_cold_out = coldstorage.get_C_out_max(cold_stor)
                 cold_heat_pump = demand.C[t] - coldstorage.get_C_out_max(
                     cold_stor) - cold
                 ele_needed_for_heat_pump = heat_pump.get_E_in(
                     cold_heat_pump)
                 cold_stor = coldstorage.get_S(cold_stor, 0,
                                               coldstorage_cold_out)
             if demand.cold_E[t] <= ele:
                 ele_bought_for_ele = 0
                 if ele_needed_for_heat_pump > 0:
                     if ele - demand.cold_E[t] >= ele_needed_for_heat_pump:
                         elestorage_ele_in = ele - demand.cold_E[
                             t] - ele_needed_for_heat_pump
                         ele_bought_for_heat_pump = 0
                     else:
                         elestorage_ele_in = 0
                         ele_bought_for_heat_pump = ele_needed_for_heat_pump - (
                             ele - demand.cold_E[t])
                 else:
                     elestorage_ele_in = ele - demand.cold_E[t]
                     ele_bought_for_heat_pump = 0
                 ele_stor = elestorage.get_S(ele_stor, elestorage_ele_in, 0)
             elif (demand.cold_E[t] >
                   ele) & (demand.cold_E[t] <=
                           (ele + elestorage.get_E_out_max(ele_stor))):
                 ele_bought_for_ele = 0
                 ele_bought_for_heat_pump = ele_needed_for_heat_pump
                 elestorage_ele_out = ele + elestorage.get_E_out_max(
                     ele_stor) - demand.cold_E[t]
                 ele_stor = elestorage.get_S(ele_stor, 0,
                                             elestorage_ele_out)
             else:
                 ele_bought_for_heat_pump = ele_needed_for_heat_pump
                 ele_bought_for_ele = demand.cold_E[
                     t] - ele - elestorage.get_E_out_max(ele_stor)
                 elestorage_ele_out = elestorage.get_E_out_max(ele_stor)
                 ele_stor = elestorage.get_S(ele_stor, 0,
                                             elestorage_ele_out)
             if cold_stor > coldstorage.nominal:
                 self.cold_waste.append(cold_stor - coldstorage.nominal)
                 cold_stor = coldstorage.nominal
             else:
                 self.cold_waste.append(0)
             if ele_stor > elestorage.nominal:
                 self.ele_waste.append(ele_stor - elestorage.nominal)
                 ele_stor = elestorage.nominal
             else:
                 self.ele_waste.append(0)
             self.ele_ice.append(ele)
             self.cold_absorption_chiller.append(cold)
             self.cold_heat_pump.append(cold_heat_pump)
             self.ele_bought.append(ele_bought_for_heat_pump +
                                    ele_bought_for_ele)
             self.fuel.append(ice.get_fuel(1))
     if self.judge == 1:
         for t in range(23, 24, Parameters.delttime):
             # 把以下cold,ele,heat部分写成class
             cold_during_shut_down = ColdDuringShutDown(
                 temporary, t, cold_stor)
             ele_during_shut_down = EleDuringShutDown(
                 temporary, t, ele_stor, 0)
             cold_stor = cold_during_shut_down.cold_stor
             ele_stor = ele_during_shut_down.ele_stor
             self.ele_ice.append(0)
             self.cold_absorption_chiller.append(0)
             self.cold_heat_pump.append(
                 cold_during_shut_down.cold_heat_pump)
             self.ele_bought.append(
                 ele_during_shut_down.ele_bought_for_ele +
                 cold_during_shut_down.ele_bought_for_heat_pump)
             self.fuel.append(0)
         for t in range(0, 7, Parameters.delttime):
             cold_during_shut_down = ColdDuringShutDown(
                 temporary, t, cold_stor)
             ele_during_shut_down = EleDuringShutDown(
                 temporary, t, ele_stor, 0)
             cold_stor = cold_during_shut_down.cold_stor
             ele_stor = ele_during_shut_down.ele_stor
             self.ele_ice.append(0)
             self.cold_absorption_chiller.append(0)
             self.cold_heat_pump.append(
                 cold_during_shut_down.cold_heat_pump)
             self.ele_bought.append(
                 ele_during_shut_down.ele_bought_for_ele +
                 cold_during_shut_down.ele_bought_for_heat_pump)
             self.fuel.append(0)
Exemple #13
0
 def __init__(self, temporary, number):
     chp = CHPInternalCombustionEngine(temporary, number)
     heat_pump = HeatPump(temporary)
     elestorage = EleStorage(temporary)
     coldstorage = ColdStorage(temporary)
     absorption_chiller = DoubleEffectAbsorptionChiller(temporary)
     ice = InternalCombustionEngine(number, temporary)
     demand = DemandData()
     time = demand.E_sheetnrows - 1
     cold_stor = 0
     ele_stor = 0
     self.fuel = []
     self.ele_bought = []
     self.ele_ice = []
     self.cold_absorption_chiller = []
     self.cold_heat_pump = []
     self.cold_waste = []
     self.ele_waste = []
     for t in range(0, time, Parameters.delttime):
         judge_ele = min(demand.cold_E[t] - elestorage.get_E_out_max(ele_stor), ice.nominal)
         judge_cold = chp.get_cold_through_ele(judge_ele)
         if demand.C[t] > coldstorage.get_C_out_max(cold_stor) + judge_cold + heat_pump.nominal:
             self.judge = 0
             break
         else:
             self.judge = 1
             ele_drive = EleDrive(t, temporary, number, ele_stor, 0)
             if ele_drive.ele == 0:
                 cold_drive = ColdDrive(t, temporary, number, cold_stor)
                 cold_stor = cold_drive.cold_stor
                 cold = cold_drive.cold
                 cold_heat_pump = 0
                 ele = ice.get_ele_out_through_cold(cold)
                 pl = ele / ice.nominal
                 ele_stor = elestorage.get_S(ele_stor, ele, ele_drive.elestorage_out)
                 self.fuel.append(ice.get_fuel(pl))
                 self.ele_bought.append(heat_pump.get_E_in(cold_drive.heat_pump_out))
             else:
                 ele = ele_drive.ele
                 pl = ele / ice.nominal
                 exhaust_gas = ice.get_exhaust_gas_pl(pl)
                 jacket_water = ice.get_jacket_water_pl(pl)
                 cold = absorption_chiller.get_cold_out(exhaust_gas, jacket_water)
                 cold_follow = ColdFollow(t, temporary, cold_stor, cold)
                 cold_stor = cold_follow.cold_stor
                 cold_heat_pump = cold_follow.heat_pump_out
                 ele_stor = elestorage.get_S(ele_stor, 0, ele_drive.elestorage_out)
                 self.fuel.append(ice.get_fuel(pl))
                 self.ele_bought.append(ele_drive.ele_bought + heat_pump.get_E_in(cold_follow.heat_pump_out))
             self.ele_ice.append(ele)
             self.cold_absorption_chiller.append(cold)
             self.cold_heat_pump.append(cold_heat_pump)
             if cold_stor > coldstorage.nominal:
                 self.cold_waste.append(cold_stor - coldstorage.nominal)
                 cold_stor = coldstorage.nominal
             else:
                 self.cold_waste.append(0)
             if ele_stor > elestorage.nominal:
                 self.ele_waste.append(ele_stor - elestorage.nominal)
                 ele_stor = elestorage.nominal
             else:
                 self.ele_waste.append(0)
Exemple #14
0
 def __init__(self, temporary, number):
     demand = DemandData()
     heatstorage = HeatStorage(temporary)
     coldstorage = ColdStorage(temporary)
     elestorage = EleStorage(temporary)
     gas_boiler = GasBoiler(temporary)
     heat_pump = HeatPump(temporary)
     ice = InternalCombustionEngine(number, temporary)
     absorption_chiller = DoubleEffectAbsorptionChiller(temporary)
     chp = CHPInternalCombustionEngine(temporary, number)
     time = demand.E_sheetnrows - 1
     heat_stor = 0
     ele_stor = 0
     cold_stor = 0
     self.fuel = []
     self.ele_bought = []
     self.ele_ice = []
     self.heat = []
     self.heat_gas_boiler = []
     self.cold_absorption_chiller = []
     self.cold_heat_pump = []
     self.cold_waste = []
     self.heat_waste = []
     self.ele_waste = []
     for t in range(0, time, Parameters.delttime):
         ele = min(demand.transition_E[t] - elestorage.get_E_out_max(ele_stor), ice.nominal)
         cold_heat = chp.get_cold_and_heat_through_ele(ele)
         judge_cold = cold_heat[0]
         judge_heat = cold_heat[1]
         if ((demand.C[t] > coldstorage.get_C_out_max(cold_stor) + judge_cold + heat_pump.nominal)
                 | (demand.H[t] > heatstorage.get_H_out_max(heat_stor) + judge_heat + gas_boiler.nominal)):
             self.judge = 0
             break
         else:
             self.judge = 1
             ele_drive = EleDrive(t, temporary, number, ele_stor, 2)
             if ele_drive == 0:
                 heat_drive = HeatDriveJW(t, temporary, number, heat_stor)
                 gas_boiler_out = heat_drive.gas_boiler_out
                 if heat_drive == 0:
                     cold_drive = ColdDrive(t, temporary, number, cold_stor)
                     cold = cold_drive.cold
                     exhaust_gas = cold / absorption_chiller.COP_double
                     pl = ice.get_pl_through_exhaust_gas(exhaust_gas)
                     ele = pl * ice.nominal
                     heat = ice.get_jacket_water_pl(pl)
                     cold_stor = cold_drive.cold_stor
                     heat_stor = heatstorage.get_S(heat_stor, heat, heat_drive.heatstorage_out)
                     ele_stor = elestorage.get_S(ele_stor, ele, ele_drive.elestorage_out)
                     self.cold_heat_pump.append(cold_drive.heat_pump_out)
                     self.fuel.append(ice.get_fuel(pl))
                     self.ele_bought.append(heat_pump.get_E_in(cold_drive.heat_pump_out))
                 else:
                     heat = heat_drive.heat
                     pl = ice.get_pl_through_jacket_water(heat)
                     ele = pl * ice.nominal
                     exhaust_gas = ice.get_exhaust_gas_pl(pl)
                     cold = exhaust_gas * absorption_chiller.COP_double
                     cold_follow = ColdFollow(t, temporary, cold_stor, cold)
                     cold_stor = cold_follow.cold_stor
                     heat_stor = heat_drive.heat_stor
                     ele_stor = elestorage.get_S(ele_stor, ele, ele_drive.elestorage_out)
                     self.cold_heat_pump.append(cold_follow.heat_pump_out)
                     self.fuel.append(ice.get_fuel(pl) + gas_boiler.get_Fuel_in(heat_drive.gas_boiler_out))
                     self.ele_bought.append(heat_pump.get_E_in(cold_follow.heat_pump_out))
             else:
                 ele = ele_drive.ele
                 pl = ele / ice.nominal
                 heat = ice.get_jacket_water_pl(pl)
                 cold = ice.get_exhaust_gas_pl(pl) * absorption_chiller.COP_double
                 heat_follow = HeatFollow(t, temporary, heat_stor, heat)
                 cold_follow = ColdFollow(t, temporary, cold_stor, cold)
                 gas_boiler_out = heat_follow.gas_boiler_out
                 cold_stor = cold_follow.cold_stor
                 heat_stor = heat_follow.heat_stor
                 ele_stor = ele_drive.ele_stor
                 self.cold_heat_pump.append(cold_follow.heat_pump_out)
                 self.fuel.append(ice.get_fuel(pl) + gas_boiler.get_Fuel_in(heat_follow.gas_boiler_out))
                 self.ele_bought.append(ele_drive.ele_bought + heat_pump.get_E_in(cold_follow.heat_pump_out))
             self.ele_ice.append(ele)
             self.heat.append(heat)
             self.heat_gas_boiler.append(gas_boiler_out)
             self.cold_absorption_chiller.append(cold)
             if cold_stor > coldstorage.nominal:
                 self.cold_waste.append(cold_stor - coldstorage.nominal)
                 cold_stor = coldstorage.nominal
             else:
                 self.cold_waste.append(0)
             if heat_stor > heatstorage.nominal:
                 self.heat_waste.append(heat_stor - heatstorage.nominal)
                 heat_stor = heatstorage.nominal
             else:
                 self.heat_waste.append(0)
             if ele_stor > elestorage.nominal:
                 self.ele_waste.append(ele_stor - elestorage.nominal)
                 ele_stor = elestorage.nominal
             else:
                 self.ele_waste.append(0)
Exemple #15
0
class CHPInternalCombustionEngine:
    # 只有制冷模式和制热模式两种
    def __init__(self, temporary, number):
        self.internal_combustion_engine = InternalCombustionEngine(
            number, temporary)
        self.boiler = Boiler(temporary)
        self.absorption_chiller = DoubleEffectAbsorptionChiller(temporary)
        self.number = number
        self.temporary = temporary
        self.ele_out_max = self.internal_combustion_engine.nominal
        # chp.heat_steam_out_max是exhaust gas全部进入锅炉的蒸汽
        # chp.heat_out_max 是exhaust gas全部进入锅炉的蒸汽 + 缸套水热
        # chp.heat_space_water_max 是exhaust gas全部进入制冷机制热 + 缸套水热
        # chp.cold_out_max 是exhaust gas和jacket water全部进入制冷剂的情况
        # chp.cold_out_max_exhaust_gas 是exhaust gas全进入制冷机的情况
        if self.internal_combustion_engine.get_exhaust_gas_pl(
                1) * self.boiler.effi >= self.boiler.nominal:
            self.heat_steam_out_max = self.boiler.nominal
        else:
            self.heat_steam_out_max = self.internal_combustion_engine.get_exhaust_gas_pl(
                1) * self.boiler.effi
        self.heat_out_max = self.heat_steam_out_max + self.internal_combustion_engine.get_jacket_water_pl(
            1)

        if (self.internal_combustion_engine.get_exhaust_gas_pl(1) *
                self.absorption_chiller.COP_heat >=
                self.absorption_chiller.heat_nominal):
            self.heat_space_water_max = (
                self.absorption_chiller.heat_nominal +
                self.internal_combustion_engine.get_jacket_water_pl(1))
        else:
            self.heat_space_water_max = (
                self.internal_combustion_engine.get_exhaust_gas_pl(1) *
                self.absorption_chiller.COP_heat +
                self.internal_combustion_engine.get_jacket_water_pl(1))

        cold = (self.internal_combustion_engine.get_exhaust_gas_pl(1) *
                self.absorption_chiller.COP_double +
                self.internal_combustion_engine.get_jacket_water_pl(1) *
                self.absorption_chiller.COP_single)
        if cold >= self.absorption_chiller.nominal:
            self.cold_out_max = self.absorption_chiller.nominal
        else:
            self.cold_out_max = cold

        if (self.internal_combustion_engine.get_exhaust_gas_pl(1) *
                self.absorption_chiller.COP_double >=
                self.absorption_chiller.nominal):
            self.cold_out_max_exhaust_gas = self.absorption_chiller.nominal
        else:
            self.cold_out_max_exhaust_gas = (
                self.internal_combustion_engine.get_exhaust_gas_pl(1) *
                self.absorption_chiller.COP_double)

    def get_heat_out_pl(self, pl):  # exhaust gas进入制冷机制热水,jacket water直接制热水
        heat_out = (self.internal_combustion_engine.get_exhaust_gas_pl(pl) *
                    self.absorption_chiller.COP_heat +
                    self.internal_combustion_engine.get_jacket_water_pl(pl))
        return heat_out

    def get_heat_water_though_cold(self, judge_cold):  # 冷热模式,无热蒸汽,以热定电
        exhaust_gas = judge_cold / self.absorption_chiller.COP_double
        pl = self.internal_combustion_engine.get_pl_through_exhaust_gas(
            exhaust_gas)
        coefficient = (
            (self.internal_combustion_engine.ice_database_one[4] * pl +
             self.internal_combustion_engine.ice_database_one[5]) /
            ((self.internal_combustion_engine.ice_database_one[6] * pl +
              self.internal_combustion_engine.ice_database_one[7]) *
             self.absorption_chiller.COP_double))
        heat_water = coefficient * judge_cold
        return heat_water

    def get_heat_through_steam(self, steam, jacket_water_k):  # 冷热电模式,有热蒸汽,以热定电
        exhaust_gas = self.boiler.get_H_in(steam)
        pl = self.internal_combustion_engine.get_pl_through_exhaust_gas(
            exhaust_gas)
        heat_water = self.internal_combustion_engine.get_jacket_water_pl(
            pl) * (1 - jacket_water_k)
        return heat_water

    def get_cold_through_steam(self, steam, jacket_water_k):  # 冷热电模式,有热蒸汽,以热定电
        exhaust_gas = self.boiler.get_H_in(steam)
        pl = self.internal_combustion_engine.get_pl_through_exhaust_gas(
            exhaust_gas)
        jacket_water = self.internal_combustion_engine.get_jacket_water_pl(pl)
        cold = self.absorption_chiller.COP_single * jacket_water * jacket_water_k
        return cold

    def get_cold_through_ele(self, ele):  # 冷模式,以电定冷
        pl = ele / self.internal_combustion_engine.nominal
        exhaust_gas = self.internal_combustion_engine.get_exhaust_gas_pl(pl)
        jacket_water = self.internal_combustion_engine.get_jacket_water_pl(pl)
        cold = self.absorption_chiller.get_cold_out(exhaust_gas, jacket_water)
        return cold

    def get_heat_through_ele(self, ele):  # 热模式,以电定热
        pl = ele / self.internal_combustion_engine.nominal
        exhaust_gas = self.internal_combustion_engine.get_exhaust_gas_pl(pl)
        heat = (self.absorption_chiller.get_heat_out(exhaust_gas) +
                self.internal_combustion_engine.get_jacket_water_pl(pl))
        return heat

    def get_cold_and_heat_through_ele(self, ele):  # 冷热电模式,以电定热
        pl = ele / self.internal_combustion_engine.nominal
        exhaust_gas = self.internal_combustion_engine.get_exhaust_gas_pl(pl)
        jacket_water = self.internal_combustion_engine.get_jacket_water_pl(pl)
        cold = self.absorption_chiller.get_cold_out_only_gas(exhaust_gas)
        heat = jacket_water
        return cold, heat
Exemple #16
0
 def __init__(self, temporary, number):
     heat_stor = 0
     ele_stor = 0
     chp = CHPInternalCombustionEngine(temporary, number)
     ice = InternalCombustionEngine(number, temporary)
     absorption_chiller = DoubleEffectAbsorptionChiller(temporary)
     heatstorage = HeatStorage(temporary)
     elestorage = EleStorage(temporary)
     gas_boiler = GasBoiler(temporary)
     demand = DemandData()
     time = demand.E_sheetnrows - 1
     self.fuel = []
     self.ele_bought = []
     self.ele_ice = []
     self.heat = []
     self.heat_absorption_chiller = []
     self.heat_gas_boiler = []
     self.heat_waste = []
     self.ele_waste = []
     for t in range(0, time, Parameters.delttime):
         if demand.H[t] > heatstorage.get_H_out_max(
                 heat_stor) + chp.heat_space_water_max + gas_boiler.nominal:
             self.judge = 0
             break
         else:
             self.judge = 1
             heat_drive = HeatDriveChiller(t, temporary, number, heat_stor)
             if heat_drive.heat == 0:
                 ele_drive = EleDrive(t, temporary, number, ele_stor, 1)
                 ele_stor = ele_drive.ele_stor
                 ele = ele_drive.ele
                 pl = ele / ice.nominal
                 heat_absorption_chiller = ice.get_exhaust_gas_pl(
                     pl) * absorption_chiller.COP_heat
                 heat = heat_absorption_chiller + ice.get_jacket_water_pl(
                     pl)
                 heat_stor = heatstorage.get_S(heat_stor, heat,
                                               heat_drive.heatstorage_out)
                 self.ele_bought.append(ele_drive.ele_bought)
                 self.fuel.append(ice.get_fuel(ele / ice.nominal))
                 heat_gas_boiler = 0
             else:
                 heat = heat_drive.heat
                 heat_gas_boiler = heat_drive.gas_boiler_out
                 heat_stor = heat_drive.heat_stor
                 ele = ice.get_ele_out_through_heat_mode(heat_drive.heat)
                 pl = ele / ice.nominal
                 heat_absorption_chiller = heat - ice.get_jacket_water_pl(
                     pl)
                 ele_follow = EleFollow(t, temporary, ele_stor, ele, 1)
                 ele_stor = ele_follow.ele_stor
                 self.ele_bought.append(ele_follow.ele_bought)
                 self.fuel.append(
                     ice.get_fuel(ele / ice.nominal) +
                     gas_boiler.get_Fuel_in(heat_gas_boiler))
             self.ele_ice.append(ele)
             self.heat.append(heat)
             self.heat_gas_boiler.append(heat_gas_boiler)
             self.heat_absorption_chiller.append(heat_absorption_chiller)
             if heat_stor > heatstorage.nominal:
                 self.heat_waste.append(heat_stor - heatstorage.nominal)
                 heat_stor = heatstorage.nominal
             else:
                 self.heat_waste.append(0)
             if ele_stor > elestorage.nominal:
                 self.ele_waste.append(ele_stor - elestorage.nominal)
                 ele_stor = elestorage.nominal
             else:
                 ele_stor = elestorage.nominal
Exemple #17
0
 def __init__(self, temporary, number):
     heat_stor = 0
     cold_stor = 0
     ele_stor = 0
     chp = CHPInternalCombustionEngine(temporary, number)
     ice = InternalCombustionEngine(number, temporary)
     absorption_chiller = DoubleEffectAbsorptionChiller(temporary)
     gas_boiler = GasBoiler(temporary)
     heat_pump = HeatPump(temporary)
     heatstorage = HeatStorage(temporary)
     coldstorage = ColdStorage(temporary)
     elestorage = EleStorage(temporary)
     demand = DemandData()
     time = demand.E_sheetnrows - 1
     self.fuel = []
     self.ele_bought = []
     self.ele_ice = []
     self.heat = []
     self.heat_gas_boiler = []
     self.cold_absorption_chiller = []
     self.cold_heat_pump = []
     self.cold_waste = []
     self.heat_waste = []
     self.ele_waste = []
     for t in range(0, time, Parameters.delttime):
         if demand.C[t] > coldstorage.get_C_out_max(
                 cold_stor
         ) + chp.cold_out_max_exhaust_gas + heat_pump.nominal:
             self.judge = 0
         else:
             judge_cold = min(
                 demand.C[t] - coldstorage.get_C_out_max(cold_stor),
                 chp.cold_out_max_exhaust_gas)
             judge_heat = chp.get_heat_water_though_cold(judge_cold)
             if demand.H[t] > heatstorage.get_H_out_max(
                     heat_stor) + judge_heat + gas_boiler.nominal:
                 self.judge = 0
             else:
                 self.judge = 1
         if self.judge == 0:
             break
         else:
             heat_drive = HeatDriveJW(t, temporary, number, heat_stor)
             if heat_drive.heat == 0:
                 cold_drive = ColdDrive(t, temporary, number, cold_stor)
                 if cold_drive.cold == 0:
                     ele_drive = EleDrive(t, temporary, number, ele_stor, 2)
                     ele_stor = ele_drive.ele_stor
                     ele = ele_drive.ele
                     pl = ele / ice.nominal
                     heat = ice.get_jacket_water_pl(pl)
                     cold = ice.get_exhaust_gas_pl(
                         pl) * absorption_chiller.COP_double
                     cold_heat_pump = []
                     cold_stor = coldstorage.get_S(
                         cold_stor, cold, cold_drive.coldstorage_out)
                     heat_stor = heatstorage.get_S(
                         heat_stor, heat, heat_drive.heatstorage_out)
                     self.fuel.append(ice.get_fuel(ele / ice.nominal))
                     self.ele_bought.append(ele_drive.ele_bought)
                 else:
                     cold = cold_drive.cold
                     cold_heat_pump = cold_drive.heat_pump_out
                     cold_stor = cold_drive.cold_stor
                     exhaust_gas = cold_drive.cold / absorption_chiller.COP_double
                     pl = ice.get_pl_through_exhaust_gas(exhaust_gas)
                     ele = pl * ice.nominal
                     heat = ice.get_jacket_water_pl(pl)
                     heat_stor = heatstorage.get_S(
                         heat_stor, heat, heat_drive.heatstorage_out)
                     ele_follow = EleFollow(t, temporary, ele_stor, ele, 2)
                     ele_stor = ele_follow.ele_stor
                     self.fuel.append(ice.get_fuel(pl))
                     self.ele_bought.append(
                         ele_follow.ele_bought +
                         heat_pump.get_E_in(cold_drive.heat_pump_out))
                 gas_boiler_out = 0
             else:
                 heat_stor = heat_drive.heat_stor
                 heat = heat_drive.heat
                 pl = ice.get_pl_through_jacket_water(heat_drive.heat)
                 ele = pl * ice.nominal
                 cold = ice.get_exhaust_gas_pl(
                     pl) * absorption_chiller.COP_double
                 cold_follow = ColdFollow(t, temporary, cold_stor, cold)
                 cold_heat_pump = cold_follow.heat_pump_out
                 cold_stor = cold_follow.cold_stor
                 ele_follow = EleFollow(t, temporary, ele_stor, ele, 2)
                 ele_stor = ele_follow.ele_stor
                 gas_boiler_out = heat_drive.gas_boiler_out
                 self.fuel.append(
                     ice.get_fuel(pl) +
                     gas_boiler.get_Fuel_in(heat_drive.gas_boiler_out))
                 self.ele_bought.append(
                     ele_follow.ele_bought +
                     heat_pump.get_E_in(cold_follow.heat_pump_out))
             self.ele_ice.append(ele)
             self.heat.append(heat)
             self.heat_gas_boiler.append(gas_boiler_out)
             self.cold_absorption_chiller.append(cold)
             self.cold_heat_pump.append(cold_heat_pump)
             if cold_stor > coldstorage.nominal:
                 self.cold_waste.append(cold_stor - coldstorage.nominal)
                 cold_stor = coldstorage.nominal
             else:
                 self.cold_waste.append(0)
             if heat_stor > heatstorage.nominal:
                 self.heat_waste.append(heat_stor - heatstorage.nominal)
                 heat_stor = heatstorage.nominal
             else:
                 self.heat_waste.append(0)
             if ele_stor > elestorage.nominal:
                 self.ele_waste.append(ele_stor - elestorage.nominal)
                 ele_stor = elestorage.nominal
             else:
                 self.ele_waste.append(0)
Exemple #18
0
 def __init__(self, temporary, number):
     heat_stor = 0
     cold_stor = 0
     ele_stor = 0
     chp = CHPInternalCombustionEngine(temporary, number)
     ice = InternalCombustionEngine(number, temporary)
     boiler = Boiler(temporary)
     absorption_chiller = DoubleEffectAbsorptionChiller(temporary)
     gas_boiler = GasBoiler(temporary)
     heat_pump = HeatPump(temporary)
     heatstorage = HeatStorage(temporary)
     coldstorage = ColdStorage(temporary)
     elestorage = EleStorage(temporary)
     demand = DemandData()
     time = demand.E_sheetnrows - 1
     sum_heat = sum(demand.H)
     sum_cold = sum(demand.C)
     jacket_water_k = sum_cold / (sum_cold + sum_heat)
     fuel = []
     ele_bought = []
     ele_ice = []
     heat_boiler = []
     cold_absorption_chiller = []
     for t in range(0, time, Parameters.delttime):
         if demand.H_steam[t] > chp.heat_steam_out_max + gas_boiler.nominal:
             self.judge = 0
         else:
             judge_heat_steam = min(demand.H_steam[t],
                                    chp.heat_steam_out_max)
             judge_heat = chp.get_heat_through_steam(
                 judge_heat_steam, jacket_water_k)
             judge_cold = chp.get_cold_through_steam(
                 judge_heat_steam, jacket_water_k)
             if ((demand.H[t] + demand.H_steam[t] >
                  heatstorage.get_H_out_max(heat_stor) + judge_heat +
                  chp.heat_steam_out_max + gas_boiler.nominal)
                     | (demand.C[t] > coldstorage.get_C_out_max(cold_stor) +
                        judge_cold + heat_pump.nominal)):
                 self.judge = 0
             else:
                 self.judge = 1
         if self.judge == 0:
             break
         else:
             heat_steam_drive = HeatSteamDrive(t, temporary, number)
             self.heat_steam = heat_steam_drive.steam
             self.gas_boiler_for_steam = heat_steam_drive.gas_boiler_out_for_steam
             exhaust_gas = boiler.get_H_in(self.heat_steam)
             pl = ice.get_pl_through_exhaust_gas(exhaust_gas)
             self.ele = pl * ice.nominal
             jacket_water = ice.get_jacket_water_pl(pl)
             self.heat_for_other = jacket_water * (1 - jacket_water_k)
             if jacket_water * jacket_water_k * absorption_chiller.COP_single >= absorption_chiller.nominal:
                 self.cold = absorption_chiller.nominal
             else:
                 self.cold = jacket_water * jacket_water_k * absorption_chiller.COP_single
             heat_follow = HeatFollow(t, temporary, heat_stor,
                                      self.heat_for_other)
             heat_stor = heat_follow.heat_stor
             self.gas_boiler_for_other = heat_follow.gas_boiler_out
             self.gas_boiler_total = self.gas_boiler_for_steam + self.gas_boiler_for_other
             cold_follow = ColdFollow(t, temporary, cold_stor, self.cold)
             cold_stor = cold_follow.cold_stor
             ele_follow = EleFollow(t, temporary, ele_stor, self.ele)
             ele_stor = ele_follow.ele_stor
             fuel.append(
                 ice.get_fuel(pl) +
                 gas_boiler.get_Fuel_in(self.gas_boiler_total))
             ele_bought.append(
                 ele_follow.ele_bought +
                 heat_pump.get_E_in(cold_follow.heat_pump_out))
         ele_ice.append(self.ele)
         heat_boiler.append(self.heat_steam + self.gas_boiler_total)
         cold_absorption_chiller.append(self.cold)
         if cold_stor > coldstorage.nominal:
             cold_stor = coldstorage.nominal
         if heat_stor > heatstorage.nominal:
             heat_stor = heatstorage.nominal
         if ele_stor > elestorage.nominal:
             ele_stor = elestorage.nominal
     self.fuel = sum(fuel)
     self.ele_bought = sum(ele_bought)
     self.emission_calculate_ice = sum(ele_ice)
     self.emission_calculate_boiler = sum(heat_boiler)
     self.emission_calculate_absorption_chiller = sum(
         cold_absorption_chiller)
     self.emission_calculate_grid = self.ele_bought