Skip to content

Commit

Permalink
update static file output for 0.32
Browse files Browse the repository at this point in the history
  • Loading branch information
shieldo committed Feb 26, 2025
1 parent 32fa54a commit c4ac7ba
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4953,6 +4953,10 @@ impl InputForProcessing {
self.input.zone = zone;
self
}

pub(crate) fn temp_internal_air_static_calcs(&self) -> Option<f64> {
self.input.temp_internal_air_static_calcs
}
}

impl TryFrom<&InputForProcessing> for Corpus {
Expand Down
17 changes: 17 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ pub fn run_project(
heat_loss_parameter,
heat_capacity_parameter,
heat_loss_form_factor,
temp_internal_air: cloned_input.temp_internal_air_static_calcs().ok_or_else(|| anyhow!("A value for the temp_internal_air_static_calcs field was expected to have been provided on the input."))?,
temp_external_air: corpus.external_conditions.air_temp_annual_daily_average_min(),
},
)?;

Expand Down Expand Up @@ -1550,6 +1552,8 @@ struct StaticOutputFileArgs {
heat_loss_parameter: f64,
heat_capacity_parameter: f64,
heat_loss_form_factor: f64,
temp_internal_air: f64,
temp_external_air: f64,
}

fn write_core_output_file_static(
Expand All @@ -1562,6 +1566,8 @@ fn write_core_output_file_static(
heat_loss_parameter,
heat_capacity_parameter,
heat_loss_form_factor,
temp_internal_air,
temp_external_air,
} = args;

debug!("writing out to {output_key}");
Expand Down Expand Up @@ -1589,6 +1595,17 @@ fn write_core_output_file_static(
"".to_owned(),
heat_loss_form_factor.to_string(),
])?;
writer.write_record(["Assumptions used for HTC/HLP calculation:"])?;
writer.write_record([
"Internal air temperature".to_owned(),
"Celsius".to_owned(),
temp_internal_air.to_string(),
])?;
writer.write_record([
"External air temperature".to_owned(),
"Celsius".to_owned(),
temp_external_air.to_string(),
])?;

debug!("flushing out static CSV");
writer.flush()?;
Expand Down

0 comments on commit c4ac7ba

Please sign in to comment.