Skip to content

Commit

Permalink
propagated variables from hev to bev
Browse files Browse the repository at this point in the history
  • Loading branch information
calbaker committed Feb 3, 2025
1 parent d841930 commit 892fddb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion cal_and_val/thermal/cal_bev.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import fastsim as fsim
from fastsim import pymoo_api

# Unit conversion constants
mps_per_mph = 0.447
celsius_to_kelvin_offset = 273.15

Expand All @@ -34,6 +35,13 @@
cyc_folder_path = Path(__file__).parent / "dyno_test_data/2020 Chevrolet Bolt EV/Extended Datasets"
assert cyc_folder_path.exists(), cyc_folder_path

# Test data columns
time_column = "Time[s]_RawFacilities"
speed_column = "Dyno_Spd[mph]"
cabin_temp_column = "Cabin_Temp[C]"
eng_clnt_temp_column = "engine_coolant_temp_PCAN__C"
cell_temp_column = "Cell_Temp[C]"

# See 2020_Chevrolet_Bolt_TestSummary_201005.xlsm for cycle-level data
cyc_files: List[str] = [
# TODO: check for seat heater usage in cold cycles and account for that in model!
Expand Down Expand Up @@ -77,7 +85,7 @@ def df_to_cyc(df: pd.DataFrame) -> fsim.Cycle:
cyc_dict = {
"time_seconds": df["Time[s]_RawFacilities"].to_list(),
"speed_meters_per_second": (df["Dyno_Spd[mph]"] * mps_per_mph).to_list(),
"temp_amb_air_kelvin": (df["Cell_Temp[C]"] + celsius_to_kelvin_offset).to_list(),
"temp_amb_air_kelvin": (df[cell_temp_column] + celsius_to_kelvin_offset).to_list(),
# TODO: pipe solar load from `Cycle` into cabin thermal model
# TODO: use something (e.g. regex) to determine solar load
# see column J comments in 2021_Hyundai_Sonata_Hybrid_TestSummary_2022-03-01_D3.xlsx
Expand Down
4 changes: 3 additions & 1 deletion cal_and_val/thermal/cal_hev.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import fastsim as fsim
from fastsim import pymoo_api

# Unit conversion constants
mps_per_mph = 0.447
celsius_to_kelvin_offset = 273.15
lhv_btu_per_lbm = 18_575
Expand All @@ -37,6 +38,7 @@
cyc_folder_path = Path(__file__).parent / "dyno_test_data/2021 Hyundai Sonata Hybrid/Extended Datasets"
assert cyc_folder_path.exists()

# Test data columns
time_column = "Time[s]_RawFacilities"
speed_column = "Dyno_Spd[mph]"
cabin_temp_column = "Cabin_Temp[C]"
Expand Down Expand Up @@ -401,7 +403,7 @@ def get_mod_pwr_hvac(sd_dict):
return np.array(sd_dict['veh']['hvac']['LumpedCabin']['history']['pwr_aux_for_hvac_watts'])

def get_exp_pwr_hvac(df):
if df["Cell_Temp[C]"].mean() < 15:
if df[cell_temp_column].mean() < 15:
pwr_hvac = [0] * len(df)
else:
pwr_hvac = df["HVAC_Power_Hioki_P3[W]"]
Expand Down

0 comments on commit 892fddb

Please sign in to comment.