Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue1417_Inlcude implementation for internal floor thicknesses in TwoPort #1419

Open
wants to merge 13 commits into
base: issue1338_verifyVerticalHeights
Choose a base branch
from
Open
68 changes: 35 additions & 33 deletions IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,34 @@ model CrackOrOperableDoor
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";
final parameter Modelica.Units.SI.PressureDifference dpCloRat(displayUnit="Pa")=50
"Pressure drop at rating condition of closed door"
annotation (Dialog(group="Rating conditions"));

parameter Modelica.Units.SI.Length h_b1 "Height at port b1 (hasCavity=false)";
parameter Modelica.Units.SI.Length h_b2 = 0 "Height at port b2(hasCavity=false)";
parameter Modelica.Units.SI.Length h_a1 = 0 "Height at port a1(hasCavity=false)";
parameter Modelica.Units.SI.Length h_a2 "Height at port a2(hasCavity=false)";
parameter SI.Angle inc=Modelica.Constants.pi/2 "inclination angle (vertical=pi/2)";
parameter Modelica.Units.SI.Area A_q50 "Surface area for leakage computation (closed door)" annotation (Dialog(group="Crack or Closed door"));
parameter Real q50(unit="m3/(h.m2)") "Surface air tightness" annotation (Dialog(group="Crack or Closed door"));
parameter Modelica.Units.SI.Length wOpe=0.9 "Width of opening" annotation (Dialog(group="Open door"));
parameter Modelica.Units.SI.Length hOpe=2.1 "Height of opening" annotation (Dialog(group="Open door"));
parameter Integer nCom=if abs(hOpe*sin(inc)) < 0.01 then 2 else max(2,integer(abs(hOpe*sin(inc))/4)) "Number of compartments for the discretization" annotation (Dialog(group="Open door"));

parameter Modelica.Units.SI.Length h_b1 "Height of crack at port b1 (hasCavity=false), center of conected zone is 0" annotation (Dialog(group="Density Column Heights"));
parameter Modelica.Units.SI.Length h_b2 = 0 "Height of crack at port b2(hasCavity=false), center of conected zone is 0" annotation (Dialog(group="Density Column Heights"));
parameter Modelica.Units.SI.Length h_a1 = 0 "Height of crack at port a1(hasCavity=false), center of conected zone is 0" annotation (Dialog(group="Density Column Heights"));
parameter Modelica.Units.SI.Length h_a2 "Height at of crack port a2(hasCavity=false), center of conected zone is 0" annotation (Dialog(group="Density Column Heights"));

parameter SI.Length hA=(h_a1 + h_b2)/2
"Height of reference pressure at port a1 for opening (hasCavity=true) model";
"Height of reference pressure at port a1 for opening (hasCavity=true) model, opening starting height is 0"
annotation (Dialog(group="Density Column Heights"));
parameter SI.Length hB=(h_a2 + h_b1)/2
"Height of reference pressure at port b1 for opening (hasCavity=true) model";
"Height of reference pressure at port b1 for opening (hasCavity=true) model, opening starting height is 0"
annotation (Dialog(group="Density Column Heights"));

final parameter Modelica.Units.SI.PressureDifference dpCloRat(displayUnit="Pa")=50
"Pressure drop at rating condition of closed door"
annotation (Dialog(group="Rating conditions"));
final 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";


final parameter Modelica.Units.SI.Area LClo(min=0) = ((q50*A_q50/3600)/(dpCloRat)^mClo)/(((dpCloRat)^(0.5-mClo))*sqrt(2/rho_default))
"Effective leakage area of internal wall (when door is fully closed)"
Expand All @@ -59,23 +58,27 @@ model CrackOrOperableDoor
parameter Real mClo= 0.65 "Flow exponent for crack or crack of closed door"
annotation (Dialog(group="Crack or Closed door"));

parameter Integer nCom=if abs(hOpe*sin(inc)) < 0.01 then 2 else max(2,integer(abs(hOpe*sin(inc))/4)) "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 Boolean openDoorOnePort = false "Sets whether a door is open or closed in one port configuration";
parameter Boolean useDoor = false "=true, to use operable door instead of a crack" annotation (Dialog(group="Open door"));
parameter Boolean use_y = true "=true, to use control input" annotation (Dialog(group="Open door"));
parameter Boolean openDoorOnePort = false "Sets whether a door is open or closed in one port configuration" annotation (Dialog(group="Open door"));

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";
"Pressure difference where laminar and turbulent flow relation coincide. Recommended: 0.01" annotation (Dialog(tab="Advanced",group="Crack model regularisation"));

parameter Modelica.Units.SI.PressureDifference dp_turbulent_ope(min=0,displayUnit="Pa") = (MFtrans/(rho_default*(CDOpe * hOpe*wOpe * sqrt(2/rho_default))))^(1/mOpe)
if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Pressure difference where laminar and turbulent flow relation coincide for large cavities";
parameter Modelica.Units.SI.MassFlowRate MFtrans=(hOpe*wOpe)*VItrans*REtrans/DOpe if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Recommended massflowrate used for reguralisation";
parameter Modelica.Units.SI.Length DOpe=4*hOpe*wOpe/(2*hOpe+2*wOpe) if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Estimated hydraulic diameter of the opening - 4*A/Perimeter";
constant Modelica.Units.SI.ReynoldsNumber REtrans=30 if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Assumed Reynolds number at transition";
constant Modelica.Units.SI.DynamicViscosity VItrans=0.0000181625 if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Assumed dynamic viscosity of air at transition";
if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Pressure difference where laminar and turbulent flow relation coincide for large cavities"
annotation (Dialog(tab="Advanced",group="Door model regularisation"));
parameter Modelica.Units.SI.MassFlowRate MFtrans=(hOpe*wOpe)*VItrans*REtrans/DOpe if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Recommended massflowrate used for reguralisation"
annotation (Dialog(tab="Advanced",group="Door model regularisation"));
parameter Modelica.Units.SI.Length DOpe=4*hOpe*wOpe/(2*hOpe+2*wOpe) if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Estimated hydraulic diameter of the opening - 4*A/Perimeter"
annotation (Dialog(tab="Advanced",group="Door model regularisation"));
constant Modelica.Units.SI.ReynoldsNumber REtrans=30 if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Assumed Reynolds number at transition"
annotation (Dialog(tab="Advanced",group="Door model regularisation"));
constant Modelica.Units.SI.DynamicViscosity VItrans=0.0000181625 if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Assumed dynamic viscosity of air at transition"
annotation (Dialog(tab="Advanced",group="Door model regularisation"));

final parameter Medium.ThermodynamicState state_default=Medium.setState_pTX(
T=Medium.T_default,
Expand Down Expand Up @@ -151,7 +154,7 @@ model CrackOrOperableDoor
hOpe=hOpe,
dpCloRat=dpCloRat,
LClo=LClo,
vZer=MFtrans/(rho_default*doo.wOpe*doo.hOpe))
vZer=MFtrans/(rho_default*doo.wOpe*doo.hOpe)/1000)
if useDoor and interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts annotation (
Placement(visible = true, transformation(origin={-2,0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
IDEAS.Fluid.Sources.Boundary_pT bou(
Expand All @@ -165,8 +168,7 @@ model CrackOrOperableDoor
"Door constantly opened" annotation (
Placement(visible = true, transformation(origin = {-54, -14}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));

parameter SI.Angle inc=Modelica.Constants.pi/2
"inclination angle (vertical=pi/2)";

initial equation
assert( not (interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and useDoor and use_y),
"In " +getInstanceName() + ": Cannot use a controllable door unless interZonalAirFlowType == TwoPorts.");
Expand Down
43 changes: 43 additions & 0 deletions IDEAS/Buildings/Components/Examples/CavityInternalCeiling.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
within IDEAS.Buildings.Components.Examples;
model CavityInternalCeiling
"Illustration of an internal ceiling with an operable cavity"
extends IDEAS.Buildings.Examples.ZoneExample(
sim( interZonalAirFlowType = IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts),internalWall(
redeclare parameter
IDEAS.Buildings.Validation.Data.Constructions.LightRoof
constructionType,
incOpt=3, hasCavity = true),
zone1(hFloor=zone.hFloor + zone.hZone + 0.15));
equation

annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
coordinateSystem(preserveAspectRatio=false)),
experiment(
StopTime=108000,
Interval=720,
Tolerance=1e-06,
__Dymola_Algorithm="Dassl"),
__Dymola_Commands(file="Resources/Scripts/Dymola/Buildings/Components/Examples/CavityInternalCeiling.mos"
"Simulate and plot"),
Documentation(info="<html>
<p>
This example contains an example use of a controllable cavity in an internal wall. Note that it requires TwoPorts interzonal air flow.
</p>
</html>", revisions="<html>
<ul>
<li>
February 05 2025, Klaas De Jonge<br/>
First implementation.
</li>
</ul>
</html>"),
__Dymola_experimentSetupOutput,
__Dymola_experimentFlags(
Advanced(
EvaluateAlsoTop=false,
GenerateAnalyticJacobian=true,
OutputModelicaCode=false),
Evaluate=true,
OutputCPUtime=true,
OutputFlatModelica=false));
end CavityInternalCeiling;
2 changes: 1 addition & 1 deletion IDEAS/Buildings/Components/Examples/TwoStoreyBoxes.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ model TwoStoreyBoxes "Model with two zones on different floors, one zone above t
inner BoundaryConditions.SimInfoManager sim(interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts,n50=1) annotation (Placement(transformation(extent={{-100,80},{-80,100}})));

IDEAS.Buildings.Components.RectangularZoneTemplate Level(
hFloor=5,
hFloor=5.25,
T_start=291.15,
bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall,
bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall,
Expand Down
1 change: 1 addition & 0 deletions IDEAS/Buildings/Components/Examples/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ AirflowBoxModel
BeamRadiationOnFloor
BuildingShadeExample
CavityInternalWall
CavityInternalCeiling
CavityWalls
FacadeShadeExample
HorizontalFinExample
Expand Down
6 changes: 3 additions & 3 deletions IDEAS/Buildings/Components/Interfaces/PartialSurface.mo
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ partial model PartialSurface "Partial model for building envelope component"

final parameter Modelica.Units.SI.Length hzone_a( fixed=false);//connected with propsbus in inital equation
final parameter Modelica.Units.SI.Length hAbs_floor_a( fixed=false);
parameter Modelica.Units.SI.Length hVertical=if IDEAS.Utilities.Math.Functions.isAngle(inc,IDEAS.Types.Tilt.Floor) or IDEAS.Utilities.Math.Functions.isAngle(inc,IDEAS.Types.Tilt.Ceiling) then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings" annotation(Evaluate=true);
parameter Modelica.Units.SI.Length hRelSurfBot_a= if IDEAS.Utilities.Math.Functions.isAngle(inc,IDEAS.Types.Tilt.Ceiling) then hzone_a else 0 "Height between the lowest point of the surface (bottom) and the floor level of the zone connected at propsBus_a"
parameter Modelica.Units.SI.Length hVertical=if IDEAS.Utilities.Math.Functions.isAngle(incInt,IDEAS.Types.Tilt.Floor) or IDEAS.Utilities.Math.Functions.isAngle(incInt,IDEAS.Types.Tilt.Ceiling) then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings" annotation(Evaluate=true);
parameter Modelica.Units.SI.Length hRelSurfBot_a= if IDEAS.Utilities.Math.Functions.isAngle(incInt,IDEAS.Types.Tilt.Ceiling) then hzone_a else 0 "Height between the lowest point of the surface (bottom) and the floor level of the zone connected at propsBus_a"
annotation(Evaluate=true);
final parameter Modelica.Units.SI.Length Habs_surf=hAbs_floor_a+hRelSurfBot_a+(hVertical/2) "Absolute height of the middle of the surface, can be used to check the heights after initialisation";

Expand Down Expand Up @@ -102,7 +102,7 @@ partial model PartialSurface "Partial model for building envelope component"
h_b1=-0.5*hzone_a + 0.75*hVertical + hRelSurfBot_a,
h_a2=-0.5*hzone_a + 0.25*hVertical + hRelSurfBot_a,
interZonalAirFlowType = sim.interZonalAirFlowType,
inc=inc) if add_door and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None annotation (
inc=incInt) 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)));
Modelica.Blocks.Sources.RealExpression AExp(y = A) "Area expression" annotation(
Placement(transformation(origin = {0, 20}, extent = {{-10, -10}, {10, 10}})));
Expand Down
Loading
Loading