diff --git a/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo b/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo index 0d7dfae653..9256996f82 100644 --- a/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo +++ b/IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo @@ -10,9 +10,9 @@ partial model DoorDiscretized displayUnit="Pa") = 0.01 "Pressure difference where laminar and turbulent flow relation coincide. Recommended: 0.01"; - Modelica.Units.SI.PressureDifference dpAB[nCom](each nominal=1) + Modelica.Units.SI.PressureDifference dpAB[nCom](each nominal=((1/3600)/(A*sqrt(2/rho_default)))^(1/m)) "Pressure difference between compartments"; - Modelica.Units.SI.Velocity v[nCom](each nominal=0.01) + Modelica.Units.SI.Velocity v[nCom](each nominal=0.001) "Velocity in compartment from A to B"; Modelica.Units.SI.Velocity vTop "Velocity at top of opening from A to B"; Modelica.Units.SI.Velocity vBot "Velocity at bottom of opening from A to B"; diff --git a/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo b/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo index 07d1e2ce5e..041413d556 100644 --- a/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo +++ b/IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo @@ -69,10 +69,11 @@ model CrackOrOperableDoor final parameter Boolean openDoorOnePort = useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort "Sets whether a door is open or closed in one port configuration" ; - parameter Modelica.Units.SI.PressureDifference dp_turbulent(min=0,displayUnit="Pa") = - if useDoor then (MFtrans/(rho_default*(CDOpe * hOpe*wOpe * sqrt(2/rho_default))))^(1/mOpe) else 0.01 - "Pressure difference where laminar and turbulent flow relation coincide for large cavities" - annotation (Dialog(tab="Advanced",group="Model regularisation", enable=useDoor)); + parameter Modelica.Units.SI.PressureDifference dp_turbulent(min=0,displayUnit="Pa") = + 0.01 + "Pressure difference where laminar and turbulent flow relation coincide for large cavities" + annotation (Dialog(tab="Advanced",group="Model regularisation", enable=useDoor)); + //dp_turbulent(min=0,displayUnit="Pa") = if useDoor then max(10e-10, (MFtrans/(rho_default*(CDOpe * hOpe*wOpe * sqrt(2/rho_default))))^(1/mOpe)) else 0.01 parameter Modelica.Units.SI.MassFlowRate MFtrans=(hOpe*wOpe)*VItrans*REtrans/DOpe "Mass flow rate used for reguralisation" annotation (Dialog(tab="Advanced",group="Model regularisation", enable=useDoor)); diff --git a/IDEAS/Buildings/Components/Shading/Box.mo b/IDEAS/Buildings/Components/Shading/Box.mo index 7b79e8503f..dedcac2b43 100644 --- a/IDEAS/Buildings/Components/Shading/Box.mo +++ b/IDEAS/Buildings/Components/Shading/Box.mo @@ -159,9 +159,9 @@ equation connect(TDryBul, sideFins.TDryBul) annotation (Line(points={{40,-10},{3.5,-10}, {3.5,26.6667}}, color={0,0,127})); connect(m_flow, sideFins.m_flow) annotation( - Line(points = {{40, -90}, {2, -90}, {2, 20}}, color = {0, 0, 127})); + Line(points={{40,-90},{2.5,-90},{2.5,20}}, color = {0, 0, 127})); connect(m_flow, overhang.m_flow) annotation( - Line(points = {{40, -90}, {4, -90}, {4, 60}}, color = {0, 0, 127})); + Line(points={{40,-90},{4.5,-90},{4.5,60}}, color = {0, 0, 127})); annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, -100},{100,200}})), Documentation(info="

@@ -199,4 +199,4 @@ Cleaned up implementation and documentation. "), Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, 200}}))); -end Box; \ No newline at end of file +end Box; diff --git a/IDEAS/Buildings/Components/Shading/BuildingShade.mo b/IDEAS/Buildings/Components/Shading/BuildingShade.mo index 45cb396064..e7ee3590d6 100644 --- a/IDEAS/Buildings/Components/Shading/BuildingShade.mo +++ b/IDEAS/Buildings/Components/Shading/BuildingShade.mo @@ -2,7 +2,7 @@ within IDEAS.Buildings.Components.Shading; model BuildingShade "Component for modeling shade cast by distant objects such as buildings and treelines" extends IDEAS.Buildings.Components.Shading.Interfaces.PartialShadingDevice( - final controlled=false); + use_m_flow=false, final controlled=false); parameter Modelica.Units.SI.Length L(min=0) "Distance to object perpendicular to window" @@ -10,10 +10,12 @@ model BuildingShade parameter Modelica.Units.SI.Length dh "Height difference between top of object and top of window glazing" annotation (Dialog(group="Dimensions (see illustration in documentation)")); - parameter Modelica.Units.SI.Length hWin(min=0) = 1 + parameter Modelica.Units.SI.Length hWin(min=0)=1 "Window height: distance between top and bottom of window glazing" annotation (Dialog(group="Dimensions (see illustration in documentation)")); - parameter Real fraSha(min=0,max=1) = 1 + parameter Real fraSha( + max=1, + min=0)=1 "Fraction of the light that is shaded, e.g. smaller than 1 for shading cast by tree lines."; final parameter Real fraSunDifSky(final min=0,final max=1, final unit="1") = 1-vieAngObj/(Modelica.Constants.pi/2) "Fraction of window area exposed to diffuse sun light"; @@ -23,6 +25,11 @@ model BuildingShade // Computation assumes that window base is at ground level. // Viewing angle computed from center of glazing. + Modelica.Blocks.Sources.RealExpression HShaDirexpr(y=fraSunDir*HDirTil) + annotation (Placement(transformation(extent={{-30,40},{-10,60}}))); + Modelica.Blocks.Sources.RealExpression HShaSkyDifexpr(y=fraSunDifSky* + HSkyDifTil) + annotation (Placement(transformation(extent={{-30,20},{-10,40}}))); protected parameter Modelica.Units.SI.Angle vieAngObj=atan((hWin/2 + dh)/L) "Viewing angle of opposite object"; @@ -57,13 +64,16 @@ equation fraSunDir=1; end if; - HShaDirTil=fraSunDir*HDirTil; - HShaSkyDifTil = fraSunDifSky*HSkyDifTil; + connect(angInc, iAngInc) annotation (Line(points={{-60,-50},{-14,-50},{-14,-50}, {40,-50}}, color={0,0,127})); - connect(HGroDifTil, HShaGroDifTil) - annotation (Line(points={{-60,10},{40,10},{40,10}}, color={0,0,127})); + connect(HShaDirexpr.y, HShaDir.u) + annotation (Line(points={{-9,50},{-1.2,50}}, color={0,0,127})); + connect(HShaSkyDifexpr.y, HShaSkyDif.u) + annotation (Line(points={{-9,30},{-1.2,30}}, color={0,0,127})); + connect(HGroDifTil, HShaSkyGro.u) + annotation (Line(points={{-60,10},{-1.2,10}}, color={0,0,127})); annotation ( Icon(coordinateSystem(extent = {{-100, -100}, {100, 200}})), Documentation(info=" diff --git a/IDEAS/Buildings/Components/Shading/HorizontalFins.mo b/IDEAS/Buildings/Components/Shading/HorizontalFins.mo index b85c259245..cda7a17eff 100644 --- a/IDEAS/Buildings/Components/Shading/HorizontalFins.mo +++ b/IDEAS/Buildings/Components/Shading/HorizontalFins.mo @@ -44,6 +44,12 @@ protected Modelica.Units.SI.Length dy3Dif=max(0, min(dzDif*tan(angAltDif), s)); Modelica.Units.SI.Length dzDif=dx/cos(angAltDif); +public + Modelica.Blocks.Sources.RealExpression HShaDirexpr(y=(1 - shaFrac)*HDirTil) + annotation (Placement(transformation(extent={{-32,40},{-12,60}}))); + Modelica.Blocks.Sources.RealExpression HShaSkyDifexpr(y=(1 - shaFracDif)* + HSkyDifTil) + annotation (Placement(transformation(extent={{-32,20},{-12,40}}))); initial equation if not use_betaInput then assert(beta >= 0 and beta < acos(t/s), "In " + getInstanceName() + ": Beta must be within the feasible range."); @@ -84,12 +90,16 @@ equation shaFracDif = disp_internal*(1 - (dy1-min(dy1,dy3Dif))/s); end if; - HShaDirTil = (1-shaFrac)*HDirTil; - HShaSkyDifTil = (1-shaFracDif)*HSkyDifTil; angInc = iAngInc; - connect(HGroDifTil, HShaGroDifTil); + + connect(HGroDifTil, HShaSkyGro.u) + annotation (Line(points={{-60,10},{-1.2,10}}, color={0,0,127})); + connect(HShaDirexpr.y, HShaDir.u) + annotation (Line(points={{-11,50},{-1.2,50}}, color={0,0,127})); + connect(HShaSkyDifexpr.y, HShaSkyDif.u) + annotation (Line(points={{-11,30},{-1.2,30}}, color={0,0,127})); annotation ( Icon(coordinateSystem(extent = {{-100, -100}, {100, 200}})), Documentation(info=" diff --git a/IDEAS/Buildings/Components/Shading/Interfaces/DoubleShading.mo b/IDEAS/Buildings/Components/Shading/Interfaces/DoubleShading.mo index 2fff4d0d47..8941e1110b 100644 --- a/IDEAS/Buildings/Components/Shading/Interfaces/DoubleShading.mo +++ b/IDEAS/Buildings/Components/Shading/Interfaces/DoubleShading.mo @@ -3,7 +3,7 @@ model DoubleShading "Two shading components in series" extends PartialShading( final controlled=stateShading1.controlled or stateShading2.controlled); - replaceable PartialShading stateShading1 + replaceable PartialShading stateShading1(use_m_flow=use_m_flow) constrainedby PartialShading( haveFrame=haveFrame, A_glazing=A_glazing, @@ -19,7 +19,7 @@ model DoubleShading "Two shading components in series" azi=azi) "First shading device" annotation (Placement(transformation(extent={{-28,-18},{-18,2}}))); - replaceable PartialShading stateShading2 + replaceable PartialShading stateShading2(use_m_flow=use_m_flow) constrainedby PartialShading( haveFrame=haveFrame, A_glazing=A_glazing, @@ -109,16 +109,16 @@ equation connect(stateShading1.TDryBul, TDryBul) annotation ( Line(points={{-20.5,-11.3333},{40,-11.3333},{40,-10}}, color = {0, 0, 127})); - connect(Te, stateShading1.Te) annotation (Line(points={{-60,130},{-6,130},{-6, + connect(Te, stateShading1.Te) annotation (Line(points={{-60,130},{-8,130},{-8, -2},{-25.5,-2}},color={0,0,127})); connect(hForcedConExt, stateShading1.hForcedConExt) annotation (Line(points={{-60,110}, {-8,110},{-8,-3.33333},{-25.5,-3.33333}}, color={0,0,127})); connect(TEnv, stateShading1.TEnv) annotation (Line(points={{-60,90},{-10,90}, - {-10,-4.66667},{-25.5,-4.66667}},color={0,0,127})); + {-10,-4.66667},{-25.5,-4.66667}},color={0,0,127})); connect(stateShading2.m_flow, m_flow) annotation( - Line(points = {{2, -18}, {40, -18}, {40, -90}}, color = {0, 0, 127})); + Line(points={{2.5,-18},{40,-18},{40,-90}}, color = {0, 0, 127})); connect(stateShading1.m_flow, m_flow) annotation( - Line(points = {{-22, -18}, {40, -18}, {40, -90}}, color = {0, 0, 127})); + Line(points={{-21.5,-18},{40,-18},{40,-90}}, color = {0, 0, 127})); annotation (Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 200}})), Documentation(revisions="