diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml new file mode 100644 index 0000000000..a881df6575 --- /dev/null +++ b/.github/workflows/github-actions.yml @@ -0,0 +1,85 @@ +name: CI of IDEAS using GitHub Actions +on: [push, pull_request] +jobs: + build: + runs-on: self-hosted + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server called tony-de-rekenpony hosted by The Sysis team at KU Leuven" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v3 + with: + clean: true + - name: Change permissions of repository folder + run: chmod -R 777 /home/actions-runner/_work + - name: List of files in the repository + run: | + ls ${{ github.workspace }} + test: + runs-on: self-hosted + needs: build + defaults: + run: + working-directory: IDEAS/Resources/Scripts/tests + steps: + - name: Test IDEAS.Buildings.Components + run: make test-dymola PACKAGE=\"IDEAS.Buildings.Components\" INTERACTIVE=false + - name: Test IDEAS.Buildings.Examples + run: make test-dymola PACKAGE=\"IDEAS.Buildings.Examples\" INTERACTIVE=false + - name: Test IDEAS.Buildings.Validation + run: make test-dymola PACKAGE=\"IDEAS.Buildings.Validation\" INTERACTIVE=false + - name: Test IDEAS.Fluid.Actuators + run: make test-dymola PACKAGE=\"IDEAS.Fluid.Actuators\" INTERACTIVE=false + - name: Test IDEAS.Fluid.BaseClasses + run: make test-dymola PACKAGE=\"IDEAS.Fluid.BaseClasses\" INTERACTIVE=false + - name: Test IDEAS.Fluid.Chillers + run: make test-dymola PACKAGE=\"IDEAS.Fluid.Chillers\" INTERACTIVE=false + - name: Test IDEAS.Fluid.Delays + run: make test-dymola PACKAGE=\"IDEAS.Fluid.Delays\" INTERACTIVE=false + - name: Test IDEAS.Fluid.Examples + run: make test-dymola PACKAGE=\"IDEAS.Fluid.Examples\" INTERACTIVE=false + - name: Test IDEAS.Fluid.FixedResistances + run: make test-dymola PACKAGE=\"IDEAS.Fluid.FixedResistances\" INTERACTIVE=false + - name: Test IDEAS.Fluid.Geothermal + run: make test-dymola PACKAGE=\"IDEAS.Fluid.Geothermal\" INTERACTIVE=false + - name: Test IDEAS.Fluid.HeatExchangers + run: make test-dymola PACKAGE=\"IDEAS.Fluid.HeatExchangers\" INTERACTIVE=false + - name: Test IDEAS.Fluid.HeatPumps + run: make test-dymola PACKAGE=\"IDEAS.Fluid.HeatPumps\" INTERACTIVE=false + - name: Test IDEAS.Fluid.Interfaces + run: make test-dymola PACKAGE=\"IDEAS.Fluid.Interfaces\" INTERACTIVE=false + - name: Test IDEAS.Fluid.MassExchangers + run: make test-dymola PACKAGE=\"IDEAS.Fluid.MassExchangers\" INTERACTIVE=false + - name: Test IDEAS.Fluid.MixingVolumes + run: make test-dymola PACKAGE=\"IDEAS.Fluid.MixingVolumes\" INTERACTIVE=false + - name: Test IDEAS.Fluid.Movers + run: make test-dymola PACKAGE=\"IDEAS.Fluid.Movers\" INTERACTIVE=false + - name: Test IDEAS.Fluid.Sensors + run: make test-dymola PACKAGE=\"IDEAS.Fluid.Sensors\" INTERACTIVE=false + - name: Test IDEAS.Fluid.Sources + run: make test-dymola PACKAGE=\"IDEAS.Fluid.Sources\" INTERACTIVE=false + - name: Test IDEAS.Fluid.Storage + run: make test-dymola PACKAGE=\"IDEAS.Fluid.Storage\" INTERACTIVE=false + - name: Test IDEAS.Fluid.Taps + run: make test-dymola PACKAGE=\"IDEAS.Fluid.Taps\" INTERACTIVE=false + - name: Test IDEAS.ThermalZones + run: make test-dymola PACKAGE=\"IDEAS.ThermalZones\" INTERACTIVE=false + - name: Test IDEAS.BoundaryConditions + run: make test-dymola PACKAGE=\"IDEAS.BoundaryConditions\" INTERACTIVE=false + - name: Test IDEAS.Controls + run: make test-dymola PACKAGE=\"IDEAS.Controls\" INTERACTIVE=false + - name: Test IDEAS.Media + run: make test-dymola PACKAGE=\"IDEAS.Media\" INTERACTIVE=false + - name: Test IDEAS.Utilities + run: make test-dymola PACKAGE=\"IDEAS.Utilities\" INTERACTIVE=false + - name: Test IDEAS.Templates + run: make test-dymola PACKAGE=\"IDEAS.Templates\" INTERACTIVE=false + - name: Test IDEAS.Examples.PPD12 + run: make test-dymola PACKAGE=\"IDEAS.Examples.PPD12\" INTERACTIVE=false + - name: Test IDEAS.Examples.IBPSA + run: make test-dymola PACKAGE=\"IDEAS.Examples.IBPSA\" INTERACTIVE=false + - name: Test IDEAS.Examples.Tutorial + run: make test-dymola PACKAGE=\"IDEAS.Examples.Tutorial\" INTERACTIVE=false + - name: Test IDEAS.Examples.TwinHouses + run: make test-dymola PACKAGE=\"IDEAS.Examples.TwinHouses\" INTERACTIVE=false \ No newline at end of file diff --git a/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo b/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo deleted file mode 100644 index f831d0982c..0000000000 --- a/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo +++ /dev/null @@ -1,145 +0,0 @@ -within IDEAS.Airflow.Multizone.BaseClasses; -model ReversibleDensityColumn - "Vertical shaft with no friction and no storage of heat and mass, reversible because it can handle negative column heights" - replaceable package Medium = IDEAS.Media.Air - "Medium in the component" - annotation (choices( - choice(redeclare package Medium = IDEAS.Media.Air "Moist air"))); - parameter Modelica.Units.SI.Length h = 3 "Height of shaft"; - - Modelica.Fluid.Interfaces.FluidPort_a port_a( - redeclare package Medium = Medium, - p(start=Medium.p_default)) - "Fluid connector a (positive design flow direction is from port_a to port_b)" -annotation (Placement(transformation(extent={{-10,90},{10,110}}), - iconTransformation(extent={{-10,90},{10,110}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b( - redeclare package Medium = Medium, - p(start=Medium.p_default)) - "Fluid connector b (positive design flow direction is from port_a to port_b)" -annotation (Placement(transformation(extent={{10,-110},{-10,-90}}), iconTransformation(extent={{10,-110},{-10,-90}}))); - - Modelica.Units.SI.VolumeFlowRate V_flow = m_flow/Medium.density(sta_b) - "Volume flow rate at inflowing port (positive when flow from port_a to port_b)"; - Modelica.Units.SI.MassFlowRate m_flow = port_a.m_flow - "Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction)"; - Modelica.Units.SI.PressureDifference dp(displayUnit="Pa") = port_a.p - port_b.p - "Pressure difference between port_a and port_b"; - Modelica.Units.SI.Density rho = IDEAS.Utilities.Psychrometrics.Functions.density_pTX( - p=Medium.p_default, - T=Medium.temperature(Medium.setState_phX( - port_b.p, - inStream(port_b.h_outflow), - Xi)), - X_w=if Medium.nXi == 0 then 0 else Xi[1]) - "Density in medium column"; - -protected - Medium.ThermodynamicState sta_b=Medium.setState_phX( - port_b.p, - actualStream(port_b.h_outflow), - actualStream(port_b.Xi_outflow)) - "Medium properties in port_a"; - Medium.MassFraction Xi[Medium.nXi] = inStream(port_b.Xi_outflow) - "Mass fraction used to compute density"; - -equation - // Pressure difference between ports - // Xi is computed first as it is used in two expression, and in one - // of them only one component is used. - // We test for Medium.nXi == 0 as Modelica.Media.Air.SimpleAir has no - // moisture and hence Xi[1] is an illegal statement. - // We first compute temperature and then invoke a density function that - // takes temperature as an argument. Simply calling a density function - // of a medium that takes enthalpy as an argument would be dangerous - // as different media can have different datum for the enthalpy. - - dp=-h*rho*Modelica.Constants.g_n; - - // Isenthalpic state transformation (no storage and no loss of energy) - port_a.h_outflow = inStream(port_b.h_outflow); - port_b.h_outflow = inStream(port_a.h_outflow); - - // Mass balance (no storage) - port_a.m_flow + port_b.m_flow = 0; - - // Transport of substances - port_a.Xi_outflow = inStream(port_b.Xi_outflow); - port_b.Xi_outflow = inStream(port_a.Xi_outflow); - - port_a.C_outflow = inStream(port_b.C_outflow); - port_b.C_outflow = inStream(port_a.C_outflow); - - annotation ( -Icon(graphics={ - Line( - points={{0,100},{0,-100},{0,-98}}), - Text( - extent={{24,-78},{106,-100}}, - lineColor={0,0,127}, - textString="Zone/Amb"), - Text( - extent={{32,104},{98,70}}, - lineColor={0,0,127}, - textString="FlowElem"), - Text( - extent={{36,26},{88,-10}}, - lineColor={0,0,127}, - fillColor={255,0,0}, - fillPattern=FillPattern.Solid, - textString="h=%h"), - Rectangle( - extent={{-16,80},{16,-80}}, - fillColor={255,0,0}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromTop, - extent={{-16,80},{16,0}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0}), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, - extent={{-16,80},{16,54}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0}), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom, - extent={{-16,0},{16,-82}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0}), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, - extent={{-16,-55},{16,-80}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0})}), - defaultComponentName="col", - Documentation(info=" -

-This model describes the pressure difference of a vertical medium -column. It can be used to model the pressure difference caused by -stack effect. - -It is a variation on IDEAS.Airflow.Multizone.MediumColumn. - -

-", - revisions=" - -")); -end ReversibleDensityColumn; diff --git a/IDEAS/Airflow/Multizone/BaseClasses/package.order b/IDEAS/Airflow/Multizone/BaseClasses/package.order index b7c99a59a1..698bba52a4 100644 --- a/IDEAS/Airflow/Multizone/BaseClasses/package.order +++ b/IDEAS/Airflow/Multizone/BaseClasses/package.order @@ -3,7 +3,6 @@ DoorDiscretized ErrorControl PartialOneWayFlowElement PowerLawResistanceParameters -ReversibleDensityColumn TwoWayFlowElement TwoWayFlowElementBuoyancy ZonalFlow diff --git a/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo b/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo new file mode 100644 index 0000000000..2614c925e7 --- /dev/null +++ b/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo @@ -0,0 +1,176 @@ +within IDEAS.Airflow.Multizone; + +model CrackOrOperableDoor + "Door model using discretization along height coordinate" + extends IDEAS.Fluid.Interfaces.PartialFourPortInterface( + redeclare final package Medium1 = Medium, + redeclare final package Medium2 = Medium, + final allowFlowReversal1=true, + final allowFlowReversal2=true, + final m1_flow_nominal=10/3600*1.2, + final m2_flow_nominal=m1_flow_nominal, + final m1_flow_small=1E-4*abs(m1_flow_nominal), + final m2_flow_small=1E-4*abs(m2_flow_nominal)); + extends IDEAS.Airflow.Multizone.BaseClasses.ErrorControl; + + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium in the component" + annotation (choices( + choice(redeclare package Medium = IDEAS.Media.Air "Moist air"))); + + parameter Modelica.Units.SI.Velocity vZer=0.001 + "Minimum velocity to prevent zero flow. Recommended: 0.001"; + parameter Modelica.Units.SI.Length wOpe=0.9 "Width of opening" + annotation (Dialog(group="Geometry")); + parameter Modelica.Units.SI.Length hOpe=2.1 "Height of opening" + annotation (Dialog(group="Geometry")); + + parameter BoundaryConditions.Types.InterZonalAirFlow interZonalAirFlowType + "Interzonal air flow type"; + parameter Modelica.Units.SI.PressureDifference dpCloRat( + min=0, + displayUnit="Pa") = 50 "Pressure drop at rating condition of closed door" + annotation (Dialog(group="Rating conditions")); + + parameter Modelica.Units.SI.Length h_b1; + parameter Modelica.Units.SI.Length h_b2 = 0; + parameter Modelica.Units.SI.Length h_a1 = 0; + parameter Modelica.Units.SI.Length h_a2; + + parameter Real CDCloRat(min=0, max=1)=1 + "Discharge coefficient at rating conditions of closed door" + annotation (Dialog(group="Rating conditions")); + parameter Modelica.Units.SI.Area A_q50 "Surface area for leakage computation (closed door)"; + parameter Real q50(unit="m3/(h.m2)") "Surface air tightness"; + + parameter Modelica.Units.SI.Area LClo(min=0) = q50*A_q50*1.2/3600 *(1.2/2/dpCloRat)^mClo/CDClo + "Effective leakage area of closed door" + annotation (Dialog(group="Closed door")); + + parameter Real CDOpe=0.65 "Discharge coefficient of open door" + annotation (Dialog(group="Open door")); + parameter Real CDClo=0.65 "Discharge coefficient of closed door" + annotation (Dialog(group="Closed door")); + + parameter Real mOpe = 0.5 "Flow exponent for door of open door" + annotation (Dialog(group="Open door")); + parameter Real mClo= 0.65 "Flow exponent for crack of closed door" + annotation (Dialog(group="Closed door")); + + parameter Integer nCom=10 "Number of compartments for the discretization"; + + parameter Boolean useDoor = false "=true, to use operable door instead of a crack"; + parameter Boolean use_y = true "=true, to use control input"; + + parameter Modelica.Units.SI.PressureDifference dp_turbulent( + min=0, + displayUnit="Pa") = 0.01 + "Pressure difference where laminar and turbulent flow relation coincide. Recommended: 0.01"; + + Modelica.Blocks.Interfaces.RealInput y(min=0, max=1, unit="1") if useDoor and use_y + "Opening signal, 0=closed, 1=open" + annotation (Placement(transformation(extent={{-120,-10},{-100,10}}), iconTransformation(extent={{-120,-10},{-100,10}}))); + IDEAS.Airflow.Multizone.Point_m_flow point_m_flow1( + redeclare package Medium = Medium, + dpMea_nominal = dpCloRat, + forceErrorControlOnFlow = false, + mMea_flow_nominal = (if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then LClo/2 else LClo)*CDClo*(2*dpCloRat/1.2)^mClo, + m = mClo, + useDefaultProperties = false) if not useDoor "Pressure drop equation" annotation( + Placement(visible = true, transformation(origin = {0, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + IDEAS.Airflow.Multizone.ReversibleDensityColumn col_b1(redeclare package Medium = Medium, h=h_b1) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Column for port b1" annotation( + Placement(visible = true, transformation(origin = {0, 70}, extent = {{50, -10}, {70, 10}}, rotation = 0))); + IDEAS.Airflow.Multizone.ReversibleDensityColumn col_a1(redeclare package Medium = Medium, h=h_a1) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Column for port a1" annotation( + Placement(visible = true, transformation(origin = {0, 70}, extent = {{-70, -10}, {-50, 10}}, rotation = 0))); + IDEAS.Airflow.Multizone.ReversibleDensityColumn col_b2(redeclare package Medium = Medium, h=h_b2) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Column for port b2" annotation( + Placement(visible = true, transformation(origin = {0, -50}, extent = {{-70, -10}, {-50, 10}}, rotation = 0))); + IDEAS.Airflow.Multizone.ReversibleDensityColumn col_a2(redeclare package Medium = Medium, h=h_a2) if interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Column for port a2" annotation( + Placement(visible = true, transformation(origin = {0, -50}, extent = {{50, -10}, {70, 10}}, rotation = 0))); + IDEAS.Airflow.Multizone.Point_m_flow point_m_flow2( + redeclare package Medium = Medium, + dpMea_nominal = dpCloRat, + forceErrorControlOnFlow = false, + m = mClo, + mMea_flow_nominal = LClo/2*CDClo*(2*dpCloRat/1.2)^mClo, + useDefaultProperties = false) if not useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Pressure drop equation" annotation( + Placement(visible = true, transformation(origin = {0, -60}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + IDEAS.Airflow.Multizone.DoorDiscretizedOperable doo( + redeclare package Medium = Medium, + final hA = 0, + final hB = 0, + final forceErrorControlOnFlow=false, + dp_turbulent=dp_turbulent, + nCom=nCom, + CDOpe=CDOpe, + CDClo=CDClo, + mOpe=mOpe, + mClo=mClo, + CDCloRat=CDCloRat, + wOpe=wOpe, + hOpe=hOpe, + dpCloRat=dpCloRat, + LClo=LClo, + vZer=vZer) if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts annotation( + Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); + IDEAS.Fluid.Sources.Boundary_pT bou( + redeclare package Medium = Medium, + nPorts = 2) + if interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + "Sets absolute pressure when the ports are not connected externally" annotation( + Placement(visible = true, transformation(origin = {0, -90}, extent = {{-10, 10}, {10, -10}}, rotation = 90))); + Modelica.Blocks.Sources.Constant constOne(final k=1) + if not use_y + "Door constantly opened" annotation( + Placement(visible = true, transformation(origin = {-54, -14}, extent = {{-6, -6}, {6, 6}}, rotation = 0))); +initial equation + assert( not (interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and useDoor), + "In " +getInstanceName() + ": Cannot use a controllable door unless interZonalAirFlowType == TwoPorts."); + +equation + connect(col_a1.port_a, point_m_flow1.port_a) annotation( + Line(points = {{-60, 80}, {-60, 84}, {-20, 84}, {-20, 60}, {-10, 60}}, color = {0, 127, 255})); + connect(col_b1.port_a, point_m_flow1.port_b) annotation( + Line(points = {{60, 80}, {60, 84}, {20, 84}, {20, 60}, {10, 60}}, color = {0, 127, 255})); + connect(col_b2.port_a, point_m_flow2.port_a) annotation( + Line(points = {{-60, -40}, {-60, -36}, {-20, -36}, {-20, -60}, {-10, -60}}, color = {0, 127, 255})); + connect(col_a2.port_a, point_m_flow2.port_b) annotation( + Line(points = {{60, -40}, {60, -36}, {20, -36}, {20, -60}, {10, -60}}, color = {0, 127, 255})); + connect(col_b2.port_b, port_b2) annotation( + Line(points = {{-60, -60}, {-100, -60}}, color = {0, 127, 255})); + connect(col_a2.port_b, port_a2) annotation( + Line(points = {{60, -60}, {100, -60}}, color = {0, 127, 255})); + connect(col_b1.port_b, port_b1) annotation( + Line(points = {{60, 60}, {100, 60}}, color = {0, 127, 255})); + connect(col_a1.port_b, port_a1) annotation( + Line(points = {{-60, 60}, {-100, 60}}, color = {0, 127, 255})); + connect(y, doo.y) annotation( + Line(points = {{-110, 0}, {-10, 0}}, color = {0, 0, 127})); + connect(doo.port_a1, col_a1.port_a) annotation( + Line(points = {{-10, 6}, {-20, 6}, {-20, 84}, {-60, 84}, {-60, 80}}, color = {0, 127, 255})); + connect(doo.port_b1, col_b1.port_a) annotation( + Line(points = {{10, 6}, {20, 6}, {20, 84}, {60, 84}, {60, 80}}, color = {0, 127, 255})); + connect(doo.port_b2, col_b2.port_a) annotation( + Line(points = {{-10, -6}, {-20, -6}, {-20, -36}, {-60, -36}, {-60, -40}}, color = {0, 127, 255})); + connect(doo.port_a2, col_a2.port_a) annotation( + Line(points = {{10, -6}, {20, -6}, {20, -36}, {60, -36}, {60, -40}}, color = {0, 127, 255})); + connect(bou.ports[1], port_a2) annotation( + Line(points = {{0, -80}, {100, -80}, {100, -60}}, color = {0, 127, 255})); + if interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then + connect(point_m_flow1.port_a, port_a1) annotation( + Line(points = {{-10, 60}, {-100, 60}}, color = {0, 127, 255})); + connect(point_m_flow1.port_b, port_b1) annotation( + Line(points = {{10, 60}, {100, 60}}, color = {0, 127, 255})); + connect(doo.port_b1, port_b1) annotation( + Line(points = {{10, 6}, {20, 6}, {20, 60}, {100, 60}}, color = {0, 127, 255})); + connect(doo.port_a1, port_a1) annotation( + Line(points = {{-10, 6}, {-20, 6}, {-20, 60}, {-100, 60}}, color = {0, 127, 255})); + end if; + connect(constOne.y, doo.y) annotation( + Line(points = {{-48, -14}, {-32, -14}, {-32, 0}, {-10, 0}}, color = {0, 0, 127})); + connect(bou.ports[2], port_b2) annotation( + Line(points = {{0, -80}, {-100, -80}, {-100, -60}}, color = {0, 127, 255})); + +annotation( + Diagram, + Icon(graphics = {Polygon(lineColor = {0, 0, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-30, -10}, {-16, -8}, {-16, -14}, {-30, -16}, {-30, -10}}), Line(points = {{-54, 48}, {-36, 48}}), Line(points = {{-54, 20}, {-36, 20}}), Rectangle(fillColor = {255, 255, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Line(points = {{-54, -58}, {-36, -58}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {255, 128, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-46, -16}, {-20, -20}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {85, 75, 55}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-60, 80}, {60, -84}}), Rectangle(fillColor = {215, 215, 215}, fillPattern = FillPattern.Solid, extent = {{-54, 72}, {56, -84}}), Polygon(fillColor = {95, 95, 95}, fillPattern = FillPattern.Solid, points = {{56, 72}, {-36, 66}, {-36, -90}, {56, -84}, {56, 72}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {255, 128, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-100, 2}, {-46, -2}}), Polygon(visible = false, origin = {75, 50}, rotation = 360, lineColor = {0, 128, 255}, fillColor = {0, 128, 255}, fillPattern = FillPattern.Solid, points = {{-5, 10}, {25, 10}, {-5, -10}, {-5, 10}}), Text(textColor = {0, 0, 127}, extent = {{-118, 34}, {-98, 16}}, textString = "y"), Line(points = {{-54, -6}, {-36, -6}}), Line(points = {{-54, -32}, {-36, -32}}), Polygon(visible = false, origin = {-79, -50}, rotation = 360, lineColor = {0, 128, 255}, fillColor = {0, 128, 255}, fillPattern = FillPattern.Solid, points = {{10, 10}, {-20, -10}, {10, -10}, {10, 10}}), Rectangle(lineColor = {0, 0, 255}, fillColor = {255, 128, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-46, 2}, {-40, -16}})}, coordinateSystem(extent = {{-100, -100}, {100, 100}}))); +end CrackOrOperableDoor; \ No newline at end of file diff --git a/IDEAS/Airflow/Multizone/Examples/TrickleVentIDEAS.mo b/IDEAS/Airflow/Multizone/Examples/TrickleVentIDEAS.mo new file mode 100644 index 0000000000..b7b4982b02 --- /dev/null +++ b/IDEAS/Airflow/Multizone/Examples/TrickleVentIDEAS.mo @@ -0,0 +1,53 @@ +within IDEAS.Airflow.Multizone.Examples; +model TrickleVentIDEAS + "Model with a trickle vent modelled using the models with flow based on tabulated data" + extends IDEAS.Airflow.Multizone.Examples.TrickleVent(west(nPorts=2), east(nPorts=2)); + + IDEAS.Airflow.Multizone.TrickleVent vent( + redeclare package Medium = Medium, + dp_nominal = 10, + m_flow_nominal = 0.02614, + use_y = true) + "Analytic trickle vent implementation" annotation( + Placement(visible = true, transformation(origin = {20, -70}, extent = {{-10, 10}, {10, -10}}, rotation = 0))); + Modelica.Blocks.Sources.Ramp ramp( + duration = 1e6, + height = -1, + offset = 1, + startTime = 1592000) + "Step control signal" annotation( + Placement(visible = true, transformation(origin = {-90, -88}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); +equation + connect(vent.port_a, east.ports[2]) annotation( + Line(points = {{10, -70}, {-25, -70}, {-25, -30}, {-30, -30}}, color = {0, 127, 255})); + connect(vent.port_b, west.ports[2]) annotation( + Line(points = {{30, -70}, {65, -70}, {65, -30}, {70, -30}}, color = {0, 127, 255})); + connect(ramp.y, vent.y) annotation( + Line(points = {{-79, -88}, {20.5, -88}, {20.5, -82}, {20, -82}}, color = {0, 0, 127})); + annotation (__Dymola_Commands(file="modelica://IDEAS/Resources/Scripts/Dymola/Airflow/Multizone/Examples/TrickleVentIDEAS.mos" + "Simulate and plot"), + experiment( + StopTime=2592000, + Interval=600, + Tolerance=1e-06), + Documentation(info=" +

+This model illustrates the use of the models + +IDEAS.Airflow.Multizone.Table_V_flow, +which is an analytic alternative to the table implementation of + +IDEAS.Airflow.Multizone.Table_m_flow for + +modelling self regulating inlet vents. +

+", revisions=" + +"), + Diagram); +end TrickleVentIDEAS; \ No newline at end of file diff --git a/IDEAS/Airflow/Multizone/Examples/package.order b/IDEAS/Airflow/Multizone/Examples/package.order index 162a3ed47f..9940a37007 100644 --- a/IDEAS/Airflow/Multizone/Examples/package.order +++ b/IDEAS/Airflow/Multizone/Examples/package.order @@ -12,4 +12,5 @@ PressurizationData ReverseBuoyancy ReverseBuoyancy3Zones TrickleVent +TrickleVentIDEAS ZonalFlow diff --git a/IDEAS/Airflow/Multizone/ReversibleDensityColumn.mo b/IDEAS/Airflow/Multizone/ReversibleDensityColumn.mo new file mode 100644 index 0000000000..1a9f81f9e8 --- /dev/null +++ b/IDEAS/Airflow/Multizone/ReversibleDensityColumn.mo @@ -0,0 +1,44 @@ +within IDEAS.Airflow.Multizone; +model ReversibleDensityColumn + "Vertical shaft with no friction and no storage of heat and mass, reversible because it can handle negative column heights" + + extends IDEAS.Airflow.Multizone.MediumColumn( + h(min=-Modelica.Constants.inf), + final densitySelection = IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom); + // by convention, port_b must be connected to a zone instead of a flow element + // h is allowed to be negative to accomodate for this convention + + annotation ( +Icon(graphics={ + Line( + points={{0,100},{0,-100},{0,-98}}), + Text(origin = {-126, 2},lineColor = {0, 0, 127}, extent = {{24, -78}, {106, -100}}, textString = "Zone/Amb"), + Text(origin = {-130, 4}, lineColor = {0, 0, 127}, extent = {{32, 104}, {98, 70}}, textString = "FlowElem"), + Text(lineColor = {0, 0, 127}, extent = {{36, 26}, {88, -10}}, textString = "h=%h"), + Rectangle(fillColor = {255, 0, 0}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-16, 80}, {16, -80}}), + Rectangle(visible = false, fillColor = {85, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-16, 80}, {16, 0}}), + Rectangle(visible = false, fillColor = {85, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-16, 80}, {16, 54}}), + Rectangle(fillColor = {85, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-16, 0}, {16, -82}}), + Rectangle(visible = false, fillColor = {85, 170, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-16, -55}, {16, -80}})}), + defaultComponentName="col", + Documentation(info=" +

+This model describes the pressure difference of a vertical medium +column. It can be used to model the pressure difference caused by +stack effect. + +It is a variation on IDEAS.Airflow.Multizone.MediumColumn. + +

+", + revisions=" + +")); +end ReversibleDensityColumn; \ No newline at end of file diff --git a/IDEAS/Airflow/Multizone/TrickleVent.mo b/IDEAS/Airflow/Multizone/TrickleVent.mo index 0a7ba4b9eb..74bcaa31e8 100644 --- a/IDEAS/Airflow/Multizone/TrickleVent.mo +++ b/IDEAS/Airflow/Multizone/TrickleVent.mo @@ -5,15 +5,21 @@ model TrickleVent "Self regulating trickle vent" final from_dp=true, final homotopyInitialization=true); + parameter Real l(min=1e-10, max=1) = 0.0001 + "Valve leakage, l=Kv(y=0)/Kv(y=1)"; parameter Real deltaM(min=1E-6) = 0.3 "Fraction of nominal mass flow rate where transition to turbulent occurs" annotation(Evaluate=true, Dialog(group = "Transition to laminar", enable = not linearized)); - + parameter Boolean use_y = false + "=true, to enable control input" + annotation(Evaluate=true, Dialog(group="Control")); final parameter Real k = if computeFlowResistance then m_flow_nominal_pos / sqrt(dp_nominal_pos) else 0 "Flow coefficient, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2)"; + Modelica.Blocks.Interfaces.RealInput y(min=0,max=1) if use_y "Control input for trickle vent Kv value" annotation( + Placement(visible = true, transformation(origin = {0, 120}, extent = {{-20, -20}, {20, 20}}, rotation = -90), iconTransformation(origin = {0, 120}, extent = {{-20, -20}, {20, 20}}, rotation = -90))); protected final parameter Boolean computeFlowResistance=(dp_nominal_pos > Modelica.Constants.eps) "Flag to enable/disable computation of flow resistance" @@ -23,6 +29,7 @@ protected then if from_dp then k^2/m_flow_nominal_pos else m_flow_nominal_pos/k^2 else 0 "Precomputed coefficient to avoid division by parameter"; + Modelica.Blocks.Interfaces.RealInput y_internal "Internal variable for conditional variables"; initial equation if computeFlowResistance then assert(m_flow_turbulent > 0, "m_flow_turbulent must be bigger than zero."); @@ -30,6 +37,10 @@ initial equation assert(m_flow_nominal_pos > 0, "m_flow_nominal_pos must be non-zero. Check parameters."); equation + connect(y, y_internal); + if not use_y then + y_internal = 1; + end if; // Pressure drop calculation if computeFlowResistance then if linearized then @@ -40,7 +51,7 @@ equation m_flow_nominal, IDEAS.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp( dp=dp, - k=k, + k=k*(l + (1-l)*y_internal), m_flow_turbulent=m_flow_turbulent), m_flow_nominal/10); end if; // linearized @@ -56,12 +67,20 @@ The positive mass flow rate is limited to m_flow_nominal at a pressure difference of dp_nominal. For negative pressure differences the mass flow rate is not limited.

+

+An optional control input can be enabled, which reduces the flow rate for the same +pressure difference, but which does not affect the maximum flow rate. +

", revisions=" ")); -end TrickleVent; +end TrickleVent; \ No newline at end of file diff --git a/IDEAS/Airflow/Multizone/package.order b/IDEAS/Airflow/Multizone/package.order index cc28cc1a97..51793b3305 100644 --- a/IDEAS/Airflow/Multizone/package.order +++ b/IDEAS/Airflow/Multizone/package.order @@ -11,6 +11,7 @@ MediumColumnDynamic Orifice Point_m_flow Points_m_flow +ReversibleDensityColumn Table_V_flow Table_m_flow ZonalFlow_ACS @@ -20,3 +21,4 @@ Examples Validation BaseClasses TrickleVent +CrackOrOperableDoor diff --git a/IDEAS/BoundaryConditions/UsersGuide.mo b/IDEAS/BoundaryConditions/UsersGuide.mo index a95c6becc8..449eb82848 100644 --- a/IDEAS/BoundaryConditions/UsersGuide.mo +++ b/IDEAS/BoundaryConditions/UsersGuide.mo @@ -3,7 +3,7 @@ package UsersGuide "User's Guide" extends Modelica.Icons.Information; annotation (preferredView="info", Documentation(info=" -

This package contains models to read or compute boundary conditions, such as weather data, solar irradition and sky temperatures. +

This package contains models to read or compute boundary conditions, such as weather data, solar irradiation and sky temperatures. The calculations follow the description in Wetter (2004), Appendix A.4.2.

Accessing weather data

diff --git a/IDEAS/Buildings/Components/BaseClasses/ConvectiveHeatTransfer/MonoLayerAir.mo b/IDEAS/Buildings/Components/BaseClasses/ConvectiveHeatTransfer/MonoLayerAir.mo index 9b3f8682ae..9a428e9026 100644 --- a/IDEAS/Buildings/Components/BaseClasses/ConvectiveHeatTransfer/MonoLayerAir.mo +++ b/IDEAS/Buildings/Components/BaseClasses/ConvectiveHeatTransfer/MonoLayerAir.mo @@ -64,7 +64,9 @@ model MonoLayerAir then 0.028154*Ra^0.41399 else 1+1.75967e-10*Ra^2.2984755) else 1 "Correlations from Hollands et al. and Wright et al."; - + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_emb "Internal port" + annotation (Placement(transformation(extent={{-10,90},{10,110}}))); + protected final parameter Boolean ceiling= IDEAS.Utilities.Math.Functions.isAngle(inc,IDEAS.Types.Tilt.Ceiling) @@ -83,16 +85,9 @@ protected abs(port_a.T-port_b.T))*coeffRa); Modelica.Units.SI.CoefficientOfHeatTransfer h=Nu*k/d; -public - Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_emb "Internal port" - annotation (Placement(transformation(extent={{-10,90},{10,110}}))); - equation - if not (ceiling or floor or vertical) then - assert(false, "Could not find suitable correlation for air cavity! Please - change the inclination to wall, ceiling or floor or remove the air layer.", + assert(ceiling or floor or vertical, "In " + getInstanceName() +": Could not find suitable correlation for air cavity in a wall. Results may be less accurate than expected.", level=AssertionLevel.warning); - end if; if checkCoating then assert(abs(epsLw_a - IDEAS.Buildings.Data.Constants.epsLw_glass) > 1e-5 diff --git a/IDEAS/Buildings/Components/BaseClasses/RadiativeHeatTransfer/SwWindowResponse.mo b/IDEAS/Buildings/Components/BaseClasses/RadiativeHeatTransfer/SwWindowResponse.mo index 16a482364b..e3bb2a0db7 100644 --- a/IDEAS/Buildings/Components/BaseClasses/RadiativeHeatTransfer/SwWindowResponse.mo +++ b/IDEAS/Buildings/Components/BaseClasses/RadiativeHeatTransfer/SwWindowResponse.mo @@ -40,23 +40,17 @@ model SwWindowResponse "Shortwave window respone" annotation (Placement(transformation(extent={{10,-110},{30,-90}}))); Modelica.Blocks.Math.Gain radToDeg(final k=180/Modelica.Constants.pi) "Conversion of radians to degrees" - annotation (Placement(transformation(extent={{-60,-50},{-40,-30}}))); + annotation (Placement(visible = true, transformation(origin = {-20, 0}, extent = {{-60, -50}, {-40, -30}}, rotation = 0))); Modelica.Blocks.Tables.CombiTable1Ds SwAbsDir( final table=SwAbs, final smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments, final columns=columns) "lookup table for AOI dependent absorptance" - annotation (Placement(transformation( - extent={{-9,-9},{9,9}}, - rotation=90, - origin={-29,-11}))); + annotation (Placement(visible = true, transformation(origin = {-39, -29}, extent = {{-9, -9}, {9, 9}}, rotation = 0))); Modelica.Blocks.Tables.CombiTable1Ds SwTransDir( final table=SwTrans, final smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments, final columns={2}) "lookup table for AOI dependent transmittance" - annotation (Placement(transformation( - extent={{-9,-9},{9,9}}, - rotation=90, - origin={-3,-11}))); + annotation (Placement(visible = true, transformation(origin = {-39, -61}, extent = {{-9, -9}, {9, 9}}, rotation = 0))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow[nLay] Abs_flow "Solar absorptance in the panes source" annotation (Placement( transformation( @@ -76,154 +70,75 @@ model SwWindowResponse "Shortwave window respone" rotation=-90, origin={20,-78}))); Modelica.Blocks.Math.Product[nLay] SwAbsDirProd annotation (Placement( - transformation( - extent={{-7,-7},{7,7}}, - rotation=90, - origin={-33,19}))); + visible = true, transformation(origin = {-9, 31}, extent = {{-7, -7}, {7, 7}}, rotation = 90))); Modelica.Blocks.Math.Product SwTransDirProd annotation (Placement( - transformation( - extent={{-7,-7},{7,7}}, - rotation=90, - origin={-7,19}))); - Modelica.Blocks.Math.Add[nLay] add annotation (Placement(transformation( - extent={{8,-8},{-8,8}}, - rotation=-90, - origin={-32,48}))); - - Modelica.Blocks.Math.Gain[nLay] SwAbsDifProd(k=SwAbsDif) annotation (Placement( - transformation( - extent={{-7,-7},{7,7}}, - rotation=90, - origin={25,21}))); - Modelica.Blocks.Math.Gain SwTransDifProd(k=SwTransDif) annotation (Placement( - transformation( - extent={{-7,-7},{7,7}}, - rotation=90, - origin={51,21}))); + visible = true, transformation(origin = {-20, -28}, extent = {{-6, -6}, {6, 6}}, rotation = -90))); + Modelica.Blocks.Math.Add[nLay] add annotation (Placement(visible = true, transformation(origin = {4.44089e-16, 54}, extent = {{6, -6}, {-6, 6}}, rotation = -90))); + Modelica.Blocks.Interfaces.RealInput y + "Window opening, y=0 is closed" annotation( + Placement(visible = true, transformation(origin = {0, -40}, extent = {{-120, -60}, {-80, -20}}, rotation = 0), iconTransformation(origin = {0, -40}, extent = {{-120, -60}, {-80, -20}}, rotation = 0))); + Modelica.Blocks.Sources.RealExpression[nLay] SwAbsDirExp(y = { (1 - y)*SwAbsDir.y[i] for i in 1:nLay}) + "Shortwave absorptance only when window is closed" annotation( + Placement(visible = true, transformation(origin = {-70, -2}, extent = {{-30, -10}, {30, 10}}, rotation = 0))); + Modelica.Blocks.Sources.RealExpression SwTransDirExp(y = (1 - y)*SwTransDir.y[1] + y ) + "Shortwave transmission increases when window is open" annotation( + Placement(visible = true, transformation(origin = {-70, -10}, extent = {{-30, 10}, {30, -10}}, rotation = 0))); + Modelica.Blocks.Math.Product[nLay] SwAbsDifProd annotation( + Placement(visible = true, transformation(origin = {11, 31}, extent = {{-7, -7}, {7, 7}}, rotation = 90))); + Modelica.Blocks.Sources.RealExpression[nLay] SwAbsDifExp(y = {(1 - y)*SwAbsDif[i] for i in 1:nLay}) + "Shortwave diffuse absorption" annotation( + Placement(visible = true, transformation(origin = {70, 16}, extent = {{30, -10}, {-30, 10}}, rotation = 0))); + Modelica.Blocks.Sources.RealExpression SwTransDifExp(y = (1 - y)*SwTransDif + y) + "Shortwave diffuse transmission increases when window is open" annotation( + Placement(visible = true, transformation(origin = {70, -16}, extent = {{30, 10}, {-30, -10}}, rotation = 0))); + Modelica.Blocks.Math.Product SwTransDifProd + "Shortwave transmission product" annotation( + Placement(visible = true, transformation(origin = {20, -28}, extent = {{6, 6}, {-6, -6}}, rotation = 90))); equation - - connect(Abs_flow.port, iSolAbs) annotation (Line( - points={{4.89859e-016,86},{0,86},{0,100}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(Dir_flow.port, iSolDir) annotation (Line( - points={{-20,-86},{-20,-100}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(Dif_flow.port, iSolDif) annotation (Line( - points={{20,-86},{20,-100}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(solDir, SwTransDirProd.u1) annotation (Line( - points={{-100,60},{-60,60},{-60,4},{-11.2,4},{-11.2,10.6}}, - color={0,0,127}, - smooth=Smooth.None)); - connect(SwAbsDir.y, SwAbsDirProd.u2) annotation (Line( - points={{-29,-1.1},{-29,13.45},{-28.8,13.45},{-28.8,10.6}}, - color={0,0,127}, - smooth=Smooth.None)); - connect(SwTransDir.y[1], SwTransDirProd.u2) annotation (Line( - points={{-3,-1.1},{-3,13.45},{-2.8,13.45},{-2.8,10.6}}, - color={0,0,127}, - smooth=Smooth.None)); - + connect(Abs_flow.port, iSolAbs) annotation( + Line(points = {{4.89859e-016, 86}, {0, 86}, {0, 100}}, color = {191, 0, 0}, smooth = Smooth.None)); + connect(Dir_flow.port, iSolDir) annotation( + Line(points = {{-20, -86}, {-20, -100}}, color = {191, 0, 0}, smooth = Smooth.None)); + connect(Dif_flow.port, iSolDif) annotation( + Line(points = {{20, -86}, {20, -100}}, color = {191, 0, 0}, smooth = Smooth.None)); + connect(solDir, SwTransDirProd.u1) annotation( + Line(points = {{-100, 60}, {-60, 60}, {-60, 13}, {-17.5, 13}, {-17.5, -21}, {-16, -21}}, color = {0, 0, 127})); for i in 1:nLay loop - connect(solDir, SwAbsDirProd[i].u1) annotation (Line( - points={{-100,60},{-60,60},{-60,4},{-37.2,4},{-37.2,10.6}}, - color={0,0,127}, - smooth=Smooth.None)); - connect(SwAbsDifProd[i].u, solDif) annotation (Line(points={{25,12.6},{25,2},{ - -64,2},{-64,20},{-100,20}}, color={0,0,127})); + connect(SwAbsDirProd[i].u1, solDir) annotation( + Line(points = {{-38, 18}, {-38, 14}, {-60, 14}, {-60, 60}, {-100, 60}}, color = {0, 0, 127})); + connect(SwAbsDifProd[i].u1, solDif) annotation( + Line(points = {{14, 18}, {16, 18}, {16, 8}, {-62, 8}, {-62, 20}, {-100, 20}}, color = {0, 0, 127})); end for; - - connect(SwTransDirProd.y, Dir_flow.Q_flow) annotation (Line( - points={{-7,26.7},{-7,50},{80,50},{80,-54},{-20,-54},{-20,-70}}, - color={0,0,127}, - smooth=Smooth.None)); - connect(SwAbsDirProd.y, add.u2) annotation (Line( - points={{-33,26.7},{-33,31.35},{-36.8,31.35},{-36.8,38.4}}, - color={0,0,127}, - smooth=Smooth.None)); - connect(add.y, Abs_flow.Q_flow) annotation (Line( - points={{-32,56.8},{-32,62},{-4.89859e-016,62},{-4.89859e-016,70}}, - color={0,0,127}, - smooth=Smooth.None)); - connect(radToDeg.u, angInc) annotation (Line(points={{-62,-40},{-76,-40},{ - -100,-40}}, color={0,0,127})); - connect(radToDeg.y, SwAbsDir.u) annotation (Line(points={{-39,-40},{-29,-40}, - {-29,-21.8}}, color={0,0,127})); - connect(radToDeg.y, SwTransDir.u) annotation (Line(points={{-39,-40},{-3,-40}, - {-3,-21.8}}, color={0,0,127})); - connect(SwAbsDifProd.y, add.u1) annotation (Line(points={{25,28.7},{25,34},{-27.2, - 34},{-27.2,38.4}}, color={0,0,127})); - connect(SwTransDifProd.y, Dif_flow.Q_flow) annotation (Line(points={{51,28.7}, - {51,34},{38,34},{38,-60},{20,-60},{20,-70}}, color={0,0,127})); - - connect(SwTransDifProd.u, solDif) annotation (Line(points={{51,12.6},{51,2},{-64, - 2},{-64,20},{-100,20}}, color={0,0,127})); - annotation ( - Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, - 100}})), - Icon(graphics={ - Rectangle( - extent={{-80,90},{80,70}}, - fillColor={192,192,192}, - fillPattern=FillPattern.Backward, - pattern=LinePattern.None), - Line( - points={{-80,70},{80,70}}, - pattern=LinePattern.None, - thickness=0.5, - smooth=Smooth.None), - Line( - points={{44,40},{44,-50}}, - smooth=Smooth.None, - color={127,0,0}), - Line( - points={{44,40},{38,30}}, - smooth=Smooth.None, - color={127,0,0}), - Line( - points={{44,40},{50,30}}, - smooth=Smooth.None, - color={127,0,0}), - Line( - points={{14,40},{14,-50}}, - smooth=Smooth.None, - color={127,0,0}), - Line( - points={{14,40},{8,30}}, - smooth=Smooth.None, - color={127,0,0}), - Line( - points={{14,40},{20,30}}, - smooth=Smooth.None, - color={127,0,0}), - Line( - points={{-16,40},{-16,-50}}, - smooth=Smooth.None, - color={127,0,0}), - Line( - points={{-16,40},{-22,30}}, - smooth=Smooth.None, - color={127,0,0}), - Line( - points={{-16,40},{-10,30}}, - smooth=Smooth.None, - color={127,0,0}), - Line( - points={{-46,40},{-46,-50}}, - smooth=Smooth.None, - color={127,0,0}), - Line( - points={{-46,40},{-52,30}}, - smooth=Smooth.None, - color={127,0,0}), - Line( - points={{-46,40},{-40,30}}, - smooth=Smooth.None, - color={127,0,0})}), - Documentation(info=" + connect(SwTransDirProd.y, Dir_flow.Q_flow) annotation( + Line(points = {{-20, -35}, {-20, -70}}, color = {0, 0, 127})); + connect(SwAbsDirProd.y, add.u2) annotation( + Line(points = {{-9, 39}, {-9, 38.5}, {-4, 38.5}, {-4, 47}}, color = {0, 0, 127})); + connect(add.y, Abs_flow.Q_flow) annotation( + Line(points = {{0, 61}, {0, 70}}, color = {0, 0, 127})); + connect(radToDeg.u, angInc) annotation( + Line(points = {{-82, -40}, {-100, -40}}, color = {0, 0, 127})); + connect(radToDeg.y, SwAbsDir.u) annotation( + Line(points = {{-59, -40}, {-50, -40}, {-50, -29}}, color = {0, 0, 127})); + connect(radToDeg.y, SwTransDir.u) annotation( + Line(points = {{-59, -40}, {-50, -40}, {-50, -61}}, color = {0, 0, 127})); + connect(SwAbsDirExp.y, SwAbsDirProd.u2) annotation( + Line(points = {{-37, -2}, {-37, -1.5}, {-4, -1.5}, {-4, 21}, {-5.5, 21}, {-5.5, 23}, {-5, 23}}, color = {0, 0, 127})); + connect(SwTransDirExp.y, SwTransDirProd.u2) annotation( + Line(points = {{-37, -10}, {-37, -15.5}, {-24, -15.5}, {-24, -21}}, color = {0, 0, 127})); + connect(SwAbsDifProd.y, add.u1) annotation( + Line(points = {{11, 39}, {11, 47}, {4, 47}}, color = {0, 0, 127}, thickness = 0.5)); + connect(SwAbsDifExp.y, SwAbsDifProd.u2) annotation( + Line(points = {{37, 16}, {37, 15.5}, {15, 15.5}, {15, 23}}, color = {0, 0, 127})); + connect(SwTransDifExp.y, SwTransDifProd.u1) annotation( + Line(points = {{37, -16}, {24, -16}, {24, -21}}, color = {0, 0, 127})); + connect(SwTransDifProd.u2, solDif) annotation( + Line(points = {{16, -21}, {16, 8}, {-62, 8}, {-62, 20}, {-100, 20}}, color = {0, 0, 127})); + connect(Dif_flow.Q_flow, SwTransDifProd.y) annotation( + Line(points = {{20, -70}, {20, -35}}, color = {0, 0, 127})); + annotation( + Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}})), + Icon(graphics = {Rectangle(fillColor = {192, 192, 192}, pattern = LinePattern.None, fillPattern = FillPattern.Backward, extent = {{-80, 90}, {80, 70}}), Line(points = {{-80, 70}, {80, 70}}, pattern = LinePattern.None, thickness = 0.5), Line(points = {{44, 40}, {44, -50}}, color = {127, 0, 0}), Line(points = {{44, 40}, {38, 30}}, color = {127, 0, 0}), Line(points = {{44, 40}, {50, 30}}, color = {127, 0, 0}), Line(points = {{14, 40}, {14, -50}}, color = {127, 0, 0}), Line(points = {{14, 40}, {8, 30}}, color = {127, 0, 0}), Line(points = {{14, 40}, {20, 30}}, color = {127, 0, 0}), Line(points = {{-16, 40}, {-16, -50}}, color = {127, 0, 0}), Line(points = {{-16, 40}, {-22, 30}}, color = {127, 0, 0}), Line(points = {{-16, 40}, {-10, 30}}, color = {127, 0, 0}), Line(points = {{-46, 40}, {-46, -50}}, color = {127, 0, 0}), Line(points = {{-46, 40}, {-52, 30}}, color = {127, 0, 0}), Line(points = {{-46, 40}, {-40, 30}}, color = {127, 0, 0})}, coordinateSystem(extent = {{-100, -100}, {100, 100}})), + Documentation(info = "

The properties for absorption by and transmission through the glazingare taken into account depending on the angle of incidence of solar irradiation and are based on the output of the [WINDOW 6.3] software, i.e. the shortwave properties itselves based on the layers in the window are not calculated in the model but are input parameters.

")); -end SwWindowResponse; +end SwWindowResponse; \ No newline at end of file diff --git a/IDEAS/Buildings/Components/BoundaryWall.mo b/IDEAS/Buildings/Components/BoundaryWall.mo index 0861c000a9..e062482bce 100644 --- a/IDEAS/Buildings/Components/BoundaryWall.mo +++ b/IDEAS/Buildings/Components/BoundaryWall.mo @@ -6,7 +6,7 @@ model BoundaryWall "Opaque wall with optional prescribed heat flow rate or tempe final nWin=1, QTra_design=U_value*A*(273.15 + 21 - TRef_a), dT_nominal_a=-1, - add_cracks=false, + add_door=false, layMul(disableInitPortB=use_T_in or use_T_fixed, monLay(monLayDyn(each addRes_b=(sim.lineariseDymola and (use_T_in or use_T_fixed)))))); diff --git a/IDEAS/Buildings/Components/Examples/CavityInternalWall.mo b/IDEAS/Buildings/Components/Examples/CavityInternalWall.mo new file mode 100644 index 0000000000..cee13bee0f --- /dev/null +++ b/IDEAS/Buildings/Components/Examples/CavityInternalWall.mo @@ -0,0 +1,30 @@ +within IDEAS.Buildings.Components.Examples; +model CavityInternalWall + "Illustration of an internal wall with an operable cavity" + extends IDEAS.Buildings.Examples.ZoneExample(sim.interZonalAirFlowType = IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts, internalWall(hasCavity = true, use_y_doo = true)); + Modelica.Blocks.Sources.Sine sine(amplitude = 0.5, f = 1 / 7200, offset = 0.5) annotation( + Placement(visible = true, transformation(origin = {-90, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));equation + connect(internalWall.y_doo, sine.y) annotation( + Line(points = {{-16, 6}, {-16, 10}, {-78, 10}}, color = {0, 0, 127})); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment( + StopTime=1000000, + Tolerance=1e-06, + __Dymola_Algorithm="Lsodar"), + __Dymola_Commands(file="Resources/Scripts/Dymola/Buildings/Components/Examples/CavityInternalWall.mos" + "Simulate and plot"), + Documentation(info=" +

+This example contains an example use of a controllable cavity in an internal wall. Note that it requires TwoPorts interzonal air flow. +

+", revisions=" + +")); +end CavityInternalWall; \ No newline at end of file diff --git a/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mo b/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mo index 083be8124d..d1026eb9b1 100644 --- a/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mo +++ b/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mo @@ -17,7 +17,7 @@ This example illustrates the use of the RectangularZoneTemplate to model a room ", revisions=" diff --git a/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mo b/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mo index 5c5bf68200..6f767b745b 100644 --- a/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mo +++ b/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mo @@ -17,7 +17,7 @@ This example illustrates the use of the RectangularZoneTemplate to model a room ", revisions=" diff --git a/IDEAS/Buildings/Components/Examples/package.order b/IDEAS/Buildings/Components/Examples/package.order index ec27110e2f..6c57dc3494 100644 --- a/IDEAS/Buildings/Components/Examples/package.order +++ b/IDEAS/Buildings/Components/Examples/package.order @@ -1,5 +1,6 @@ BeamRadiationOnFloor BuildingShadeExample +CavityInternalWall CavityWalls FacadeShadeExample HorizontalFinExample diff --git a/IDEAS/Buildings/Components/Interfaces/IntegerConnector.mo b/IDEAS/Buildings/Components/Interfaces/IntegerConnector.mo new file mode 100644 index 0000000000..c252b46381 --- /dev/null +++ b/IDEAS/Buildings/Components/Interfaces/IntegerConnector.mo @@ -0,0 +1,5 @@ +within IDEAS.Buildings.Components.Interfaces; +connector IntegerConnector = + Integer "Integer connector without input/output specifier" + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); \ No newline at end of file diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 1ac680a703..9d993717f0 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -1,9 +1,9 @@ within IDEAS.Buildings.Components.Interfaces; partial model PartialSurface "Partial model for building envelope component" - + outer IDEAS.BoundaryConditions.SimInfoManager sim "Simulation information manager for climate data" - annotation (Placement(transformation(extent={{30,-100},{50,-80}}))); + annotation (Placement(visible = true, transformation(origin = {50, 180}, extent = {{30, -100}, {50, -80}}, rotation = 0))); parameter Integer incOpt = 4 "Tilt angle option from simInfoManager, or custom using inc" annotation(choices(__Dymola_radioButtons=true, choice=1 "Wall", choice=2 "Floor", choice=3 "Ceiling", choice=4 "Custom")); @@ -93,39 +93,21 @@ partial model PartialSurface "Partial model for building envelope component" "Multilayer component for simulating walls, windows and other surfaces" annotation (Placement(transformation(extent={{10,-10},{-10,10}}))); - PowerLaw_q50_stack res1( - redeclare package Medium = Medium, - A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts - then A/2 else A, - h_b= -0.5*hzone_a + 0.25*hVertical +hRef_a, - final q50=q50_internal) - if add_cracks and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None - "Middle or bottom crack " - annotation (Placement(transformation(extent={{20,-46},{40,-26}}))); - - - PowerLaw_q50_stack res2( - redeclare package - Medium = Medium, - A=A/2, - h_b= -0.5*hzone_a + 0.75*hVertical +hRef_a, - final q50=q50_internal) - if add_cracks and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts - "Top crack" - annotation (Placement(transformation(extent={{20,-70},{40,-50}}))); - - Q50_parameterToConnector q50_zone( q50_inp=q50_internal, v50_surf=q50_internal*A, use_custom_q50=use_custom_q50) annotation (Placement(transformation(extent={{80,-60},{100,-40}}))); - - - + IDEAS.Airflow.Multizone.CrackOrOperableDoor crackOrOperableDoor( + A_q50 = A, + q50=q50_internal, + redeclare package Medium = Medium, + h_a2 = -0.5*hzone_a + 0.75*hVertical + hRef_a, + h_b1 = -0.5*hzone_a + 0.25*hVertical + hRef_a, + interZonalAirFlowType = sim.interZonalAirFlowType) if add_door and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None annotation( + Placement(visible = true, transformation(origin = {30, -52}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); protected - parameter Boolean add_cracks = true - "Add cracks"; + parameter Boolean add_door = true "Option to disable crackOrOperableDoor"; final parameter Modelica.Units.SI.Angle aziInt= if aziOpt==5 then azi @@ -156,6 +138,8 @@ protected "Gain for all propsBus variable to represent nWin surfaces instead of 1" annotation (Placement(transformation(extent={{70,6},{88,36}}))); IDEAS.Buildings.Components.Interfaces.ZoneBus propsBusInt( + port_1(m_flow(final min=0, final max=0)), + port_2(m_flow(final min=0, final max=0)), redeclare final package Medium = Medium, numIncAndAziInBus=sim.numIncAndAziInBus, outputAngles=sim.outputAngles, @@ -174,161 +158,6 @@ protected annotation (Placement(transformation(extent={{80,-100},{100,-80}}))); - - - - - -model PowerLaw_q50_stack - "Power law pressure drop with integrated stack effect" - replaceable package Medium = Modelica.Media.Interfaces.PartialMedium - constrainedby Modelica.Media.Interfaces.PartialMedium - annotation ( - __Dymola_choicesAllMatching=true); - outer BoundaryConditions.SimInfoManager sim - annotation (Placement(transformation(extent={{80,-100},{100,-80}}))); - - parameter Modelica.Units.SI.Area A "Surface area"; - parameter Real m=0.65 "Flow exponent"; - parameter Real h_a=0 "Column height, height at port_a" annotation (Dialog(group="Flow Path")); - parameter Real h_b=0 "Column height, height at port_b" annotation (Dialog(group="Flow Path")); - parameter Real q50 "Leaked volume flow rate per unit A at 50Pa"; - final parameter Boolean StackEff= sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "True if stack effect is used" annotation(Evaluate=true); - - Modelica.Fluid.Interfaces.FluidPort_a port_a( - redeclare package Medium =Medium) - "Port a" annotation (Placement(transformation(rotation=0, extent={{-110,-10}, - {-90,10}}), iconTransformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b( - redeclare package Medium =Medium) - "Port b" annotation (Placement(transformation(rotation=0, extent={{90,-10}, - {110,10}}), iconTransformation(extent={{90,-10},{110,10}}))); - IDEAS.Airflow.Multizone.Point_m_flow res1( - redeclare package Medium = Medium, - final forceErrorControlOnFlow=false, - m=m, - useDefaultProperties= not StackEff, - dpMea_nominal=50, - mMea_flow_nominal=A*(q50*1.2)/3600) - "Middle or bottom crack " - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - IDEAS.Airflow.Multizone.BaseClasses.ReversibleDensityColumn col_a_pos( - redeclare package Medium = Medium, - h=h_a) if StackEff - annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); - - IDEAS.Airflow.Multizone.BaseClasses.ReversibleDensityColumn col_b_pos( - redeclare package Medium = Medium, - h=h_b) if StackEff - annotation (Placement(transformation(extent={{50,-10},{70,10}}))); - - IDEAS.Fluid.FixedResistances.LosslessPipe No_stack_a( - redeclare package Medium = Medium, - allowFlowReversal=true, - m_flow_nominal=A*q50*1.2/3600) - if not StackEff - annotation (Placement(transformation(extent={{-68,30},{-48,50}}))); - IDEAS.Fluid.FixedResistances.LosslessPipe No_stack_b( - redeclare package Medium = Medium, - allowFlowReversal=true, - m_flow_nominal=A*q50*1.2/3600) - if not StackEff - annotation (Placement(transformation(extent={{50,30},{70,50}}))); - - -equation - - connect(port_a, No_stack_a.port_a) annotation (Line(points={{-100,0},{-80,0},{ - -80,40},{-68,40}}, color={0,127,255})); - connect(No_stack_a.port_b, res1.port_a) annotation (Line(points={{-48,40},{-20, - 40},{-20,0},{-10,0}}, color={0,127,255})); - connect(res1.port_b, No_stack_b.port_a) annotation (Line(points={{10,0},{20,0}, - {20,40},{50,40}}, color={0,127,255})); - connect(No_stack_b.port_b, port_b) annotation (Line(points={{70,40},{80,40},{80, - 0},{100,0}}, color={0,127,255})); - connect(port_a, col_a_pos.port_b) annotation (Line(points={{-100,0},{-80,0},{-80, - -10},{-60,-10}}, color={0,127,255})); - connect(col_a_pos.port_a, res1.port_a) annotation (Line(points={{-60,10},{-60, - 14},{-20,14},{-20,0},{-10,0}}, - color={0,127,255})); - connect(port_b, col_b_pos.port_b) annotation (Line(points={{100,0},{80,0},{80, - -10},{60,-10}}, color={0,127,255})); - connect(col_b_pos.port_a, res1.port_b) annotation (Line(points={{60,10},{60,14}, - {20,14},{20,0},{10,0}}, - color={0,127,255})); - - annotation (Icon(graphics={ - Text( - extent={{-100,100},{-40,60}}, - lineColor={28,108,200}, - fillColor={215,215,215}, - fillPattern=FillPattern.None, - textString="q50"), - Rectangle( - extent={{-20,80},{20,-80}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-60,58},{64,46}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-94,4},{-58,-8}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,127,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{54,6},{106,-8}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,127,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-64,2},{-46,-6}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,127,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-82,4},{-46,-8}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,127,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-58,36},{66,24}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-58,-54},{66,-66}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-56,-24},{68,-36}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-38,4},{40,-8}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid)})); -end PowerLaw_q50_stack; - - - - model Q50_parameterToConnector "Converts parameter values into connectors for propsBus" extends Modelica.Blocks.Icons.Block; @@ -411,11 +240,7 @@ equation points={{70,20.2105},{60,20.2105},{60,20},{56,20}}, color={255,204,51}, thickness=0.5)); - connect(res1.port_b, propsBusInt.port_1) annotation (Line(points={{40,-36},{50, - -36},{50,19.91},{56.09,19.91}}, color={0,127,255})); - connect(res2.port_b, propsBusInt.port_2) annotation (Line(points={{40,-60},{50, - -60},{50,19.91},{56.09,19.91}}, color={0,127,255})); - connect(setArea.areaPort, sim.areaPort); + connect(setArea.areaPort, sim.areaPort); connect(q50_zone.v50, propsBusInt.v50) annotation (Line(points={{79,-58},{56,-58}, {56,-20},{56.09,-20},{56.09,19.91}}, color={0,0,127})); connect(q50_zone.q50_zone, propsBusInt.q50_zone) annotation (Line(points={{79.4, @@ -430,10 +255,18 @@ equation -47.6},{80,-47.6},{80,-48},{56.09,-48},{56.09,19.91}}, color={0,0,127})); connect(q50_zone.dummy_h[2], propsBusInt.hfloor) annotation (Line(points={{79.4, -45.6},{80,-45.6},{80,-46},{56.09,-46},{56.09,19.91}}, color={0,0,127})); + if propsBusInt.use_port_1 then + connect(crackOrOperableDoor.port_b1, propsBusInt.port_1) annotation( + Line(points = {{40, -46}, {56, -46}, {56, 20}}, color = {0, 127, 255})); + end if; + if propsBusInt.use_port_2 then + connect(crackOrOperableDoor.port_a2, propsBusInt.port_2) annotation( + Line(points = {{40, -58}, {56, -58}, {56, 20}}, color = {0, 127, 255})); + end if; annotation ( Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 100,100}})), - Icon(coordinateSystem(preserveAspectRatio=false, extent={{-50,-100},{50,100}})), + Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-50, -100}, {50, 100}})), Documentation(revisions="