Skip to content

Commit

Permalink
EC-54 Test and implement edit_lighting_efficacy
Browse files Browse the repository at this point in the history
  • Loading branch information
kpinakula committed Oct 17, 2024
1 parent 74ec8d5 commit 6491ca8
Showing 1 changed file with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ use crate::{
HeatSourceWetDetails::{HeatPump, Hiu},
InputForProcessing,
},
wrappers::future_homes_standard::future_homes_standard::calc_tfa,
};

/// Apply assumptions and pre-processing steps for the Future Homes Standard Notional building
fn apply_fhs_not_preprocessing(
input: InputForProcessing,
mut input: InputForProcessing,
fhs_not_a_assumptions: bool,
_fhs_not_b_assumptions: bool,
fhs_fee_not_a_assumptions: bool,
Expand All @@ -34,6 +35,15 @@ fn apply_fhs_not_preprocessing(
_ => panic!("Error: There should be exactly one cold water type"),
};

// Retrieve the number of bedrooms and total volume
let _bedroom_number = input.number_of_bedrooms();
// Loop through zones to sum up volume.
let _total_volume = input.total_zone_area();

// Determine the TFA
let _tfa = calc_tfa(&input);
edit_lighting_efficacy(&mut input);

todo!()
}

Expand Down Expand Up @@ -63,6 +73,13 @@ fn check_heatnetwork_present(input: &InputForProcessing) -> bool {
is_heat_network
}

/// Apply notional lighting efficacy
/// efficacy = 120 lm/W
fn edit_lighting_efficacy(input: &mut InputForProcessing) -> () {
let lighting_efficacy = 120.0;
input.set_lighting_efficacy_for_all_zones(lighting_efficacy);
}

/// Calculate effective air change rate accoring to according to Part F 1.24 a
pub fn minimum_air_change_rate(
_input: &InputForProcessing,
Expand Down Expand Up @@ -93,6 +110,7 @@ pub fn minimum_air_change_rate(
mod tests {
use super::*;
use rstest::{fixture, rstest};
use std::borrow::BorrowMut;
use std::fs::File;
use std::io::BufReader;
use std::path::Path;
Expand All @@ -114,7 +132,7 @@ mod tests {
let fhs_fee_not_a_assumptions = false;
let fhs_fee_not_b_assumptions = false;

let actual = apply_fhs_not_preprocessing(
let _actual = apply_fhs_not_preprocessing(
test_input,
fhs_not_a_assumptions,
_fhs_not_b_assumptions,
Expand All @@ -129,4 +147,20 @@ mod tests {
fn test_check_heatnetwork_present(test_input: InputForProcessing) {
assert_eq!(check_heatnetwork_present(&test_input), false);
}

#[rstest]
fn test_edit_lighting_efficacy(mut test_input: InputForProcessing) {
let test_input = test_input.borrow_mut();
edit_lighting_efficacy(test_input);

for zone in test_input.zone_keys() {
let lighting_efficacy = test_input.lighting_efficacy_for_zone(&zone);
assert_eq!(
lighting_efficacy
.unwrap()
.expect("expected lighting in zone and efficacy in lighting"),
120.
)
}
}
}

0 comments on commit 6491ca8

Please sign in to comment.