-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add initial fast solver implementation 🤞
- Loading branch information
Showing
9 changed files
with
863 additions
and
68 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
use crate::input::{BuildingElement, MassDistributionClass}; | ||
|
||
pub fn area_for_building_element_input(element: &BuildingElement) -> f64 { | ||
match element { | ||
&BuildingElement::Opaque { area: a, .. } => a, | ||
&BuildingElement::Transparent { area: a, .. } => match a { | ||
Some(a) => a, | ||
None => 0.0, // just to give some nominal value | ||
}, | ||
&BuildingElement::Ground { area: a, .. } => a, | ||
&BuildingElement::AdjacentZTC { area: a, .. } => a, | ||
&BuildingElement::AdjacentZTUSimple { area: a, .. } => a, | ||
} | ||
} | ||
|
||
/// Calculate the number of nodes for a building element | ||
/// (this is a shortcut to properly implementing building elements!) | ||
pub fn number_of_building_element_nodes(element: &BuildingElement) -> u32 { | ||
let k_pli = match element { | ||
&BuildingElement::Opaque { | ||
mass_distribution_class: ref dist_class, | ||
ref k_m, | ||
.. | ||
} => match dist_class { | ||
MassDistributionClass::I => vec![0.0, 0.0, 0.0, 0.0, *k_m], | ||
MassDistributionClass::E => vec![*k_m, 0.0, 0.0, 0.0, 0.0], | ||
MassDistributionClass::IE => { | ||
let k_ie = k_m / 2.0; | ||
vec![k_ie, 0.0, 0.0, 0.0, k_ie] | ||
} | ||
MassDistributionClass::D => { | ||
let k_inner = *k_m / 4.0; | ||
let k_outer = *k_m / 8.0; | ||
vec![k_outer, k_inner, k_inner, k_inner, k_outer] | ||
} | ||
MassDistributionClass::M => vec![0.0, 0.0, *k_m, 0.0, 0.0], | ||
}, | ||
&BuildingElement::AdjacentZTC { | ||
mass_distribution_class: ref dist_class, | ||
ref k_m, | ||
.. | ||
} => match dist_class { | ||
MassDistributionClass::I => vec![0.0, 0.0, 0.0, 0.0, *k_m], | ||
MassDistributionClass::E => vec![*k_m, 0.0, 0.0, 0.0, 0.0], | ||
MassDistributionClass::IE => { | ||
let k_ie = *k_m / 2.0; | ||
vec![k_ie, 0.0, 0.0, 0.0, k_ie] | ||
} | ||
MassDistributionClass::D => { | ||
let k_inner = *k_m / 4.0; | ||
let k_outer = *k_m / 8.0; | ||
vec![k_outer, k_inner, k_inner, k_inner, k_outer] | ||
} | ||
MassDistributionClass::M => vec![0.0, 0.0, *k_m, 0.0, 0.0], | ||
}, | ||
&BuildingElement::AdjacentZTUSimple { | ||
mass_distribution_class: ref dist_class, | ||
ref k_m, | ||
.. | ||
} => match dist_class { | ||
MassDistributionClass::I => vec![0.0, 0.0, 0.0, 0.0, *k_m], | ||
MassDistributionClass::E => vec![*k_m, 0.0, 0.0, 0.0, 0.0], | ||
MassDistributionClass::IE => { | ||
let k_ie = k_m / 2.0; | ||
vec![k_ie, 0.0, 0.0, 0.0, k_ie] | ||
} | ||
MassDistributionClass::D => { | ||
let k_inner = *k_m / 4.0; | ||
let k_outer = *k_m / 8.0; | ||
vec![k_outer, k_inner, k_inner, k_inner, k_outer] | ||
} | ||
MassDistributionClass::M => vec![0.0, 0.0, *k_m, 0.0, 0.0], | ||
}, | ||
&BuildingElement::Ground { | ||
mass_distribution_class: ref dist_class, | ||
ref k_m, | ||
.. | ||
} => { | ||
let k_gr = THICKNESS_GROUND_LAYER * HEAT_CAPACITY_PER_VOLUME_OF_GROUND; | ||
match dist_class { | ||
MassDistributionClass::I => vec![0.0, k_gr, 0.0, 0.0, *k_m], | ||
MassDistributionClass::E => vec![0.0, k_gr, *k_m, 0.0, 0.0], | ||
MassDistributionClass::IE => { | ||
let k_ie = *k_m / 2.0; | ||
vec![0.0, k_gr, k_ie, 0.0, k_ie] | ||
} | ||
MassDistributionClass::D => { | ||
let k_inner = *k_m / 2.0; | ||
let k_outer = *k_m / 4.0; | ||
vec![0.0, k_gr, k_outer, k_inner, k_outer] | ||
} | ||
MassDistributionClass::M => vec![0.0, k_gr, 0.0, *k_m, 0.0], | ||
} | ||
} | ||
&BuildingElement::Transparent { .. } => vec![0.0, 0.0], | ||
}; | ||
|
||
k_pli.len() as u32 | ||
} | ||
|
||
// # Thermal properties of ground from BS EN ISO 13370:2017 Table 7 | ||
// # Use values for clay or silt (same as BR 443 and SAP 10) | ||
const THERMAL_CONDUCTIVITY_OF_GROUND: f64 = 1.5; // in W/(m.K) | ||
const HEAT_CAPACITY_PER_VOLUME_OF_GROUND: f64 = 3000000.0; // in J/(m3.K) | ||
const THICKNESS_GROUND_LAYER: f64 = 0.5; // in m. Specified in BS EN ISO 52016-1:2017 section 6.5.8.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
mod building_element; | ||
mod thermal_bridge; | ||
mod ventilation_element; | ||
pub mod zone; |
Oops, something went wrong.