Skip to content

Commit

Permalink
fix(eplus_model): handle gas mixture properly
Browse files Browse the repository at this point in the history
  • Loading branch information
taoning committed Nov 27, 2024
1 parent 3720e19 commit bfa7841
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions frads/eplus_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,23 @@ def add_glazing_system(self, glzsys: GlazingSystem):
name = glzsys.name
gap_inputs = []
for i, gap in enumerate(glzsys.gaps):
gap_inputs.append(
epmodel.ConstructionComplexFenestrationStateGapInput(
gas=gap.gas[0].gas.capitalize(), thickness=gap.thickness
if len(gap.gas) == 1:
gap_inputs.append(
epm.WindowMaterialGas(
gas_type=gap.gas[0].gas.capitalize(),
thickness=gap.thickness,
)
)
)
else:
gas_dict = {
"thickness": gap.thickness,
"number_of_gases_in_mixture": len(gap.gas),
}
for idx, gas in enumerate(gap.gas):
gas_dict[f"gas_{idx+1}_type"] = gas.gas.capitalize()
gas_dict[f"gas_{idx+1}_fraction"] = gas.ratio
gap_inputs.append(epm.WindowMaterialGasMixture.model_validate(gas_dict))

layer_inputs: list[epmodel.ConstructionComplexFenestrationStateLayerInput] = []
for i, layer in enumerate(glzsys.layers):
layer_inputs.append(
Expand Down

0 comments on commit bfa7841

Please sign in to comment.