Skip to content

Commit

Permalink
fixed everything to accomodate the fact that uom/serde mess up Celsius
Browse files Browse the repository at this point in the history
  • Loading branch information
calbaker committed Jan 24, 2025
1 parent 6555233 commit 03c60f5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions cal_and_val/thermal/f3-vehicles/2020 Chevrolet Bolt EV.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ year: 2020
cabin:
LumpedCabin:
# 0.05 is Chad's uncalibrated estimate
cab_shell_htc_to_amb_watts_per_square_meter_degree_celsius: 0.05
cab_shell_htc_to_amb_watts_per_square_meter_kelvin: 0.05
# 0.05 is Chad's uncalibrated estimate
cab_htc_to_amb_stop_watts_per_square_meter_degree_celsius: 0.05
cab_htc_to_amb_stop_watts_per_square_meter_kelvin: 0.05
# 200,000 is Chad's uncalibrated estimate
heat_capacitance_joules_per_kelvin: 200000
# TODO: get actual vehicle length, but calibrate this later
Expand All @@ -16,7 +16,7 @@ cabin:
width_meters: 2
hvac:
LumpedCabinAndRES:
te_set_degrees_Celsius: 295.15
te_set_kelvin: 295.15
te_deadband_kelvin: 1.5
p_cabin_watts_per_kelvin: 0.0
i_cabin: 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ pt_type:
FuelConverterThermal:
heat_capacitance_joules_per_kelvin: 200000.0
length_for_convection_meters: 1.0
htc_to_amb_stop_watts_per_square_meter_degree_celsius: 50.0
htc_to_amb_stop_watts_per_square_meter_kelvin: 50.0
conductance_from_comb_watts_per_kelvin: 5.0
max_frac_from_comb: 0.5
tstat_te_sto_degrees_Celsius: 85.0
tstat_te_sto_kelvin: 358.15
tstat_te_delta_kelvin: 5.0
tstat_interp:
Interp1D:
Expand Down Expand Up @@ -199,8 +199,8 @@ pt_type:
frac_of_most_eff_pwr_to_run_fc: 1.0
frac_res_chrg_for_fc: 0.0
frac_res_dschrg_for_fc: 1.0
temp_fc_forced_on_degrees_Celsius: 62.0
temp_fc_allowed_off_degrees_Celsius: 65.0
temp_fc_forced_on_kelvin: 335.15
temp_fc_allowed_off_kelvin: 338.15
aux_cntrl: AuxOnResPriority
mass_kilograms: ~
sim_params:
Expand All @@ -226,14 +226,14 @@ chassis:
cargo_mass_kilograms: ~
cabin:
LumpedCabin:
cab_shell_htc_to_amb_watts_per_square_meter_degree_celsius: 0.05
cab_htc_to_amb_stop_watts_per_square_meter_degree_celsius: 0.05
cab_shell_htc_to_amb_watts_per_square_meter_kelvin: 0.05
cab_htc_to_amb_stop_watts_per_square_meter_kelvin: 0.05
heat_capacitance_joules_per_kelvin: 200000.0
length_meters: 2.5
width_meters: 2.0
hvac:
LumpedCabinAndRES:
te_set_degrees_Celsius: 22.0
te_set_kelvin: 295.15
te_deadband_kelvin: 1.5
p_cabin_watts_per_kelvin: 0.0
i_cabin: 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ pub(crate) fn impl_getters_and_setters(field: &mut syn::Field) -> Option<()> {
"Ratio" => extract_units!(uom::si::ratio::ratio),
"Time" => extract_units!(uom::si::time::second, uom::si::time::hour),
"HeatTransferCoeff" => extract_units!(
uom::si::heat_transfer::watt_per_square_meter_degree_celsius,
uom::si::heat_transfer::watt_per_square_meter_kelvin
uom::si::heat_transfer::watt_per_square_meter_kelvin,
uom::si::heat_transfer::watt_per_square_meter_degree_celsius
),
"HeatCapacity" => {
extract_units!(
Expand All @@ -204,7 +204,7 @@ pub(crate) fn impl_getters_and_setters(field: &mut syn::Field) -> Option<()> {
}
"TemperatureInterval" => extract_units!(uom::si::temperature_interval::kelvin),
"Temperature" => {
extract_units!(uom::si::thermodynamic_temperature::degree_celsius)
extract_units!(uom::si::thermodynamic_temperature::kelvin)
}
"ThermalConductance" => {
extract_units!(uom::si::thermal_conductance::watt_per_kelvin)
Expand Down
4 changes: 2 additions & 2 deletions fastsim-core/resources/vehicles/2016_TOYOTA_Prius_Two.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,8 @@ pt_type:
frac_of_most_eff_pwr_to_run_fc: 1.0
frac_res_chrg_for_fc: 0.0
frac_res_dschrg_for_fc: 1.0
temp_fc_forced_on_degrees_Celsius: ~
temp_fc_allowed_off_degrees_Celsius: ~
temp_fc_forced_on_kelvin: ~
temp_fc_allowed_off_kelvin: ~
aux_cntrl: AuxOnResPriority
mass_kilograms: ~
sim_params:
Expand Down
8 changes: 4 additions & 4 deletions python/fastsim/demos/demo_hev_thrml.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,24 @@ def plot_temperatures() -> Tuple[Figure, Axes]:
ax[0].set_prop_cycle(get_uni_cycler())
ax[0].plot(
df["cyc.time_seconds"],
df["cyc.temp_amb_air_degrees_Celsius"],
df["cyc.temp_amb_air_kelvin"] - 273.15,
label="amb",
)
ax[0].plot(
df["cyc.time_seconds"],
df["veh.cabin.LumpedCabin.history.temperature_degrees_Celsius"],
df["veh.cabin.LumpedCabin.history.temperature_kelvin"] - 273.15,
label="cabin",
)
ax[0].plot(
df["cyc.time_seconds"],
df["veh.pt_type.HybridElectricVehicle.res.thrml." +
"RESLumpedThermal.history.temperature_degrees_Celsius"],
"RESLumpedThermal.history.temperature_kelvin"] - 273.15,
label="res",
)
ax[0].plot(
df["cyc.time_seconds"],
df["veh.pt_type.HybridElectricVehicle.fc.thrml." +
"FuelConverterThermal.history.temperature_degrees_Celsius"],
"FuelConverterThermal.history.temperature_kelvin"] - 273.15,
label="fc",
)
ax[0].set_ylabel("Temperatures [°C]")
Expand Down

0 comments on commit 03c60f5

Please sign in to comment.