Skip to content

Commit

Permalink
reformulations for #1066 for avoiding linear system of equations
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathadon committed Dec 2, 2020
1 parent 52ccf1a commit 730d872
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
7 changes: 5 additions & 2 deletions IDEAS/Buildings/Components/Interfaces/PartialSurface.mo
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ partial model PartialSurface "Partial model for building envelope component"
annotation(Dialog(enable=aziOpt==5));
parameter Modelica.SIunits.Area A
"Component surface area";
parameter Real nWin = 1 "Use this factor to scale the component to nWin identical components";
parameter Real nWin = 1
"Use this factor to scale the component to nWin identical components"
annotation(Evaluate=true);
parameter Modelica.SIunits.Power QTra_design
"Design heat losses at reference temperature of the boundary space"
annotation (Dialog(group="Design power",tab="Advanced"));
Expand All @@ -42,7 +44,8 @@ partial model PartialSurface "Partial model for building envelope component"
replaceable package Medium = IDEAS.Media.Air
"Medium in the component"
annotation(Dialog(enable=custom_q50,tab="Airflow", group="Airtightness"));
parameter Boolean custom_q50=false annotation (Dialog(tab="Airflow", group="Airtightness"));
parameter Boolean custom_q50=false
annotation (Dialog(tab="Airflow", group="Airtightness"), Evaluate=true);
parameter Real q50=if custom_q50 then q50 else Read_q50.q50 "Envelope air tightness" annotation (Dialog(enable=custom_q50,tab="Airflow", group="Airtightness"));

IDEAS.Buildings.Components.Interfaces.ZoneBus propsBus_a(
Expand Down
20 changes: 8 additions & 12 deletions IDEAS/Buildings/Components/Interfaces/PartialZone.mo
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ model PartialZone "Building zone model"
annotation (choicesAllMatching = true);
parameter Boolean custom_n50=if sim.interZonalAirFlowType==IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None and not sim.useN50BuildingComputation then true else false "true if a custom n50 value is used" annotation(Dialog(tab="Airflow", group="Airtightness"));

parameter Real n50(unit="1/h",min=0.01)= if custom_n50 and not setq50.allSurfacesCustom then 0.4 else n50_int
parameter Real n50(unit="1/h",min=0.01)= sim.n50 "Optional n50 input"
annotation(Dialog(tab="Airflow", group="Airtightness"));
final parameter Real n50_computed(unit="1/h",min=0.01) = if custom_n50 and not setq50.allSurfacesCustom then n50 else n50_int "Computed n50 value";

protected
parameter Real n50_int(unit="1/h",min=0.01,fixed= false)
"n50 value cfr airtightness, i.e. the ACH at a pressure diffence of 50 Pa"
Expand Down Expand Up @@ -241,7 +243,9 @@ model Setq50 "q50 computation in zone"
parameter Boolean custom_n50 = false
" = true, to set custom n50 value for this zone";

parameter Boolean allSurfacesCustom(fixed=false) "Boolean indicating if all conected surfaces are custom";
parameter Boolean allSurfacesCustom(fixed=false)
"Boolean indicating if all conected surfaces are custom"
annotation(Evaluate=true);

parameter Real v50_cost[nSurf](fixed=false)
"0 if not a custom v50 value is defined by surfaces";
Expand Down Expand Up @@ -269,11 +273,7 @@ initial equation
end if;
end for;

if max(Modelica.Constants.small, sum(Area*nonCust))<=Modelica.Constants.small then
allSurfacesCustom=true;
else
allSurfacesCustom=false;
end if;
allSurfacesCustom = max(Modelica.Constants.small, sum(Area*nonCust))<=Modelica.Constants.small;

equation
custom_n50s=fill(custom_n50,nSurf);
Expand All @@ -299,12 +299,8 @@ end Setq50;

initial equation

if custom_n50 and not setq50.allSurfacesCustom then
n50_int = n50;
else
n50_int = sum(propsBusInt.v50)/V;
end if; //n50 is computed based on surfaces q50*A unless a custome n50 is defined

n50_int = if custom_n50 and not setq50.allSurfacesCustom then n50 else sum(propsBusInt.v50)/V;

Q_design=QInf_design+QRH_design+QTra_design; //Total design load for zone (additional ventilation losses are calculated in the ventilation system)

Expand Down

0 comments on commit 730d872

Please sign in to comment.