functions

edit2
Shahla Huseynova 2 years ago
parent bf569a798e
commit 5e68ecb6cf

File diff suppressed because one or more lines are too long

@ -6884,23 +6884,39 @@
"metadata": {},
"outputs": [],
"source": [
"Tref = 0\n",
"Cp = 4190 #J/kgK\n",
"MWtoJs = 1000_000\n",
"# Tref = 0\n",
"# Cp = 4190 #J/kgK\n",
"# MWtoJs = 1000_000\n",
"power_unit_input = 0.6 \n",
"COP = 2.5\n",
"charging_speed = 6 #h/day\n",
"dischaging_speed = 3 #h/day\n",
"def heat_pump_output(power_unit_input, COP)):\n",
" return power_unit_input * COP\n",
"\n",
"def power_to_mass_flow(power_MW, Tsink, Tref, Cp):\n",
" return power_MW * MWtoJs /(Cp*(Tsink - Tref))\n",
"def energy_to_storage(hp_heat_output_MW, process_demand_MW):\n",
" return hp_heat_output_MW - process_demand_MW #MW\n",
"#I need to add a logic later in order to charge and discharge the storage. Check the hp_storage_opt_enginge later.\n",
"if heat_pump_output > process_demand_MW:\n",
" to_storage_vdg__MW = heat_pump_output - process_demand_MW\n",
" used_heat = process_demand_MW\n",
"else:\n",
" to_storage_vdg__MW = 0\n",
" used_heat = heat_pump_output\n",
"\n",
"def Tsource_calculation(Tstorage, discharge_power, Tsource, process_mass_flow): \n",
" discharge_mass_flow = power_to_mass_flow(discharge_power, Tstorage, Tref, Cp)\n",
"def storage_capacity (charging_speed, to_storage_vdg__MW)\n",
" return charging_speed * to_storage_vdg__MW\n",
"def from_storage_vdg_MW (storage_capacity, discharging_speed)\n",
" return storage_capacity/discharging_speed\n",
"# def energy_to_storage(hp_heat_output_MW, process_demand_MW):\n",
"# return hp_heat_output_MW - process_demand_MW #MW\n",
"\n",
"# def Tsource_calculation(Tstorage, discharge_power, Tsource, process_mass_flow): \n",
"# discharge_mass_flow = power_to_mass_flow(discharge_power, Tstorage, Tref, Cp)\n",
" \n",
" combined_mass_flow = (discharge_mass_flow + process_mass_flow)\n",
" if combined_mass_flow == 0:\n",
" return Tsource\n",
" else: \n",
" return (Tstorage * discharge_mass_flow + Tsource * process_mass_flow) / combined_mass_flow"
"# combined_mass_flow = (discharge_mass_flow + process_mass_flow)\n",
"# if combined_mass_flow == 0:\n",
"# return Tsource\n",
"# else: \n",
"# return (Tstorage * discharge_mass_flow + Tsource * process_mass_flow) / combined_mass_flow"
]
},
{

@ -41,14 +41,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 13,
"id": "6631d1f4-75ae-4b99-8752-b17c1b7579b1",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Electrical Input to Heat Pump: 0.6 MW\n",
"Waste Heat Input to Heat Pump: 0.6699999999999999 MW\n",
"Total Input to Heat Pump: 1.27 MW\n",
"Heat Pump Output (to PCM and other uses): 3.175 MW\n",
"Heat pump output meets or exceeds steam requirements for the process.\n"
]
}
],
"source": [
"# Constants\n",
"cop_heat_pump = 2.5 # Coefficient of Performance of the heat pump\n",
"electrical_input = 0.06 # Electrical input to the heat pump in MW\n",
"electrical_input = 0.6 # Electrical input to the heat pump in MW\n",
"\n",
"# Process Block Outputs (from earlier calculations)\n",
"cooling_water_output = 0.33 # Cooling water output in MW\n",
@ -73,6 +85,14 @@
"else:\n",
" print(\"Additional energy required to meet steam requirements.\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "af4b0615-5935-43d4-8bb6-f6f1879d3dc8",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {

Loading…
Cancel
Save