Skip to content

Commit

Permalink
Merge branch 'main' of github.com:BenWinchester/PVTModel
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWinchester committed Aug 16, 2024
2 parents d242bfc + 3661606 commit 157ea13
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 29 deletions.
6 changes: 2 additions & 4 deletions src/pvt_model/analysis/__utils__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

import seaborn as sns

import matplotlib.colors as mcolors

from matplotlib.axes import Axes
from matplotlib import cm
from matplotlib import pyplot as plt
Expand Down Expand Up @@ -759,10 +761,6 @@ def _process_layer_data(key_to_process: str) -> numpy.ndarray:
axes[1].tick_params(labelleft=False)
axes[2].tick_params(labelleft=False)

import pdb

pdb.set_trace()

figname: str = "pvt_temperatures_1.png"

plt.savefig(figname, transparent=True, dpi=300, bbox_inches="tight")
Expand Down
68 changes: 62 additions & 6 deletions src/pvt_model/analysis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from logging import Logger
from typing import Any, List, Dict, Optional, Union

import seaborn as sns
import yaml

from matplotlib import pyplot as plt
Expand Down Expand Up @@ -998,6 +999,10 @@ def analyse_decoupled_steady_state_data(
# Thermal efficiency plot.
logger.info("Plotting thermal efficiency against the reduced temperature.")

import pdb

pdb.set_trace()

# Plot the experimental data.
_, ax1 = plt.subplots()
ax1.scatter(
Expand Down Expand Up @@ -1025,19 +1030,70 @@ def analyse_decoupled_steady_state_data(
)

# Plot the experimental data.
_, ax1 = plt.subplots()
ax1.scatter(
from matplotlib import rc

rc("font", **{"family": "sans-serif", "sans-serif": ["Arial"]})

thesis_palette = sns.color_palette(
[
entry["collector_input_temperature"]
"#E04606",
"#F9A130",
"#EFF2DD",
"#27BFE6", # SDG 6
"#144E56",
"#D8247C", # Pink
"#EDEDED", # Pale pink
"#E7DFBE", # Pale yellow
]
)

sns.set_palette(thesis_palette)

sns.set_style("ticks")
sns.set_context("notebook")

fig = plt.figure(figsize=(48 / 5, 32 / 5))

sns.scatterplot(
x = [
entry["reduced_temperature"]
for entry in experimental_steady_state_data
],
[
entry["collector_temperature_gain"]
y = [
entry["thermal_efficiency"]
for entry in experimental_steady_state_data
],
marker="s",
marker="h",
s=270,
alpha=0.55,
color="C4",
linewidth=0,
label="Experimental data"
)

def _extract_reduced_temperature(entry) -> float:
return ((entry["absorber_temperature"] + entry["pv_temperature"]) / 2 - entry["ambient_temperature"]) / entry["solar_irradiance"]

sns.scatterplot(
x = [entry["reduced_collector_temperature"] for entry in data.values()],
y = [entry["thermal_efficiency"] for entry in data.values()],
marker="H",
s=270,
alpha=0.55,
color="C0",
linewidth=0,
label="PVTModel output"
)

axis = plt.gca()
axis.set_xlabel("Reduced collector temperature / Km$^2$/W")
axis.set_ylabel("Thermal efficiency")
axis.legend(loc="upper right")

plt.savefig("solimpeks_standard_collector_validation_scatter.png", transparent=True, dpi=400, bbox_inches="tight")

plt.show()

# Add the model data.
plot_figure(
"collector_tempreature_gain_against_input_temperature",
Expand Down
38 changes: 19 additions & 19 deletions system_data/steady_state_data/feb_24_runs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@
collector_input_temperature: 15
collector_temperature_gain: 5.7
irradiance: 983
mass_flow_rate: 8
mass_flow_rate: 1.72
thermal_efficiency: 0.5
thermal_power: 684
wind_speed: 1.63

- ambient_temperature: 22.2
average_bulk_water_temperature: 17.85
collector_input_temperature: 45
collector_temperature_gain: 5.7
irradiance: 983
mass_flow_rate: 8
thermal_efficiency: 0.5
thermal_power: 684
wind_speed: 1.63
- ambient_temperature: 23.1
average_bulk_water_temperature: 41.12
collector_input_temperature: 38.81
collector_temperature_gain: 4.63
mass_flow_rate: 1.72
irradiance: 1006
thermal_efficiency: 0.39
thermal_power: 553
wind_speed: 1.51

- ambient_temperature: 22.2
average_bulk_water_temperature: 17.85
collector_input_temperature: 45
collector_temperature_gain: 5.7
irradiance: 983
mass_flow_rate: 8
thermal_efficiency: 0.5
thermal_power: 684
wind_speed: 1.63
- ambient_temperature: 28
average_bulk_water_temperature: 56.04
collector_input_temperature: 54.21
collector_temperature_gain: 3.66
irradiance: 992
mass_flow_rate: 1.73
thermal_efficiency: 0.32
thermal_power: 441
wind_speed: 1.1

0 comments on commit 157ea13

Please sign in to comment.