Skip to content

Commit

Permalink
correct name of orientation field on building element variants
Browse files Browse the repository at this point in the history
  • Loading branch information
shieldo committed Jan 4, 2024
1 parent 70277c5 commit 7d35219
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
19 changes: 7 additions & 12 deletions src/core/space_heat_demand/building_element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,7 @@ pub fn i_sol_dir_dif_for(
) -> (f64, f64) {
match element {
BuildingElement::Opaque {
pitch,
orientation360: orientation,
..
pitch, orientation, ..
} => {
let (i_sol_dir, i_sol_dif, _, _) = external_conditions
.calculated_direct_diffuse_total_irradiance(
Expand Down Expand Up @@ -521,10 +519,7 @@ pub fn mid_height_for(element: &BuildingElement) -> Option<f64> {

pub fn orientation_for(element: &BuildingElement) -> Option<f64> {
match element {
BuildingElement::Transparent {
orientation360: orientation,
..
} => Some(*orientation),
BuildingElement::Transparent { orientation, .. } => Some(*orientation),
_ => None,
}
}
Expand Down Expand Up @@ -652,7 +647,7 @@ mod test {
k_m: 19000.0,
mass_distribution_class: MassDistributionClass::I,
is_external_door: None,
orientation360: 0.0,
orientation: 0.0,
base_height: 0.0,
height: 2.0,
width: 10.0,
Expand All @@ -674,7 +669,7 @@ mod test {
k_m: 18000.0,
mass_distribution_class: MassDistributionClass::E,
is_external_door: None,
orientation360: 180.0,
orientation: 180.0,
base_height: 0.0,
height: 2.25,
width: 10.0,
Expand All @@ -696,7 +691,7 @@ mod test {
k_m: 17000.0,
mass_distribution_class: MassDistributionClass::IE,
is_external_door: None,
orientation360: 90.0,
orientation: 90.0,
base_height: 0.0,
height: 2.5,
width: 10.0,
Expand All @@ -718,7 +713,7 @@ mod test {
k_m: 16000.0,
mass_distribution_class: MassDistributionClass::D,
is_external_door: None,
orientation360: -90.0,
orientation: -90.0,
base_height: 0.0,
height: 2.75,
width: 10.0,
Expand All @@ -740,7 +735,7 @@ mod test {
k_m: 15000.0,
mass_distribution_class: MassDistributionClass::M,
is_external_door: None,
orientation360: 0.0,
orientation: 0.0,
base_height: 0.0,
height: 3.0,
width: 10.0,
Expand Down
6 changes: 3 additions & 3 deletions src/core/space_heat_demand/zone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ mod test {
k_m: 19000.,
mass_distribution_class: MassDistributionClass::I,
is_external_door: None,
orientation360: 0.,
orientation: 0.,
base_height: 0.,
height: 2.,
width: 10.,
Expand All @@ -1371,7 +1371,7 @@ mod test {
k_m: 16000.,
mass_distribution_class: MassDistributionClass::D,
is_external_door: None,
orientation360: 0.,
orientation: 0.,
base_height: 0.,
height: 2.,
width: 10.,
Expand Down Expand Up @@ -1404,7 +1404,7 @@ mod test {
let be_transparent = BuildingElement::Transparent {
pitch: 90.,
r_c: Some(0.4),
orientation360: 180.,
orientation: 180.,
g_value: 0.75,
frame_area_fraction: 0.25,
base_height: 1.0,
Expand Down
6 changes: 4 additions & 2 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,9 @@ pub enum BuildingElement {
mass_distribution_class: MassDistributionClass,
is_external_door: Option<bool>,
pitch: f64,
#[serde(rename(deserialize = "orientation360"))]
#[serde(deserialize_with = "deserialize_orientation")]
orientation360: f64,
orientation: f64,
base_height: f64,
height: f64,
width: f64,
Expand All @@ -730,8 +731,9 @@ pub enum BuildingElement {
area: Option<f64>,
r_c: Option<f64>,
pitch: f64,
#[serde(rename(deserialize = "orientation360"))]
#[serde(deserialize_with = "deserialize_orientation")]
orientation360: f64,
orientation: f64,
g_value: f64,
frame_area_fraction: f64,
base_height: f64,
Expand Down

0 comments on commit 7d35219

Please sign in to comment.