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

Stack effect airflow - Project itz fixes #1327

Open
wants to merge 177 commits into
base: stack_effect_project_itz_master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 150 commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
8ee08bf
Merge pull request #5 from open-ideas/master
kldjonge Dec 11, 2020
489b0bb
Merge branch 'open-ideas:master' into master
kldjonge Jun 4, 2021
715724d
Merge branch 'open-ideas:master' into master
kldjonge Jun 10, 2021
60a2cda
Merge remote-tracking branch 'upstream/master'
kldjonge Sep 20, 2021
21a02cf
Merge remote-tracking branch 'upstream/master'
kldjonge Sep 28, 2021
9107868
Merge branch 'open-ideas:master' into master
kldjonge Dec 16, 2021
a38555d
Provide information of zone heights and zone absolute height at the z…
kldjonge Dec 16, 2021
386af27
Changes in propsbus and multiplicator
kldjonge Dec 21, 2021
754492f
Update PartialSurface.mo
kldjonge Dec 21, 2021
0a62abb
Update PartialZone.mo
kldjonge Dec 21, 2021
d4c7185
Update InternalWall.mo
kldjonge Dec 21, 2021
5074221
Update OuterWall.mo
kldjonge Dec 21, 2021
dcf9962
Update Window.mo
kldjonge Dec 21, 2021
79b184b
PartialSurface Debugging
kldjonge Dec 21, 2021
61af6e7
hfloor_a defined as parameter in initial equation
kldjonge Dec 21, 2021
5030954
Update PartialSurface.mo
kldjonge Dec 21, 2021
fe8c84d
Update InternalWall.mo
kldjonge Dec 21, 2021
7c4d256
Update BuildingO5_Exp1_2Port.mo
kldjonge Dec 21, 2021
95344a1
Merge branch 'open-ideas:master' into StackEffectAirflow
kldjonge Dec 21, 2021
96a4087
Update PartialSurface.mo
kldjonge Jan 10, 2022
d0f7ab6
Update PartialSurface.mo
kldjonge Jan 18, 2022
7795acd
Updated airflow part of PartialSurface
kldjonge Jan 19, 2022
c86cad2
Update InternalWall.mo
kldjonge Jan 19, 2022
1444989
Changed documentation of PowerLaw_q50_stack
kldjonge Jan 19, 2022
337f555
Assign height difference between meteorological pressure measurements…
kldjonge Jan 19, 2022
a9e4c01
Update PartialSurface.mo
kldjonge Jan 19, 2022
cb815c6
Internal references for Cs
kldjonge Jan 19, 2022
7797995
Update Window.mo
kldjonge Jan 19, 2022
40ed854
Check Ceiling vs Floor succesfull
kldjonge Jan 19, 2022
82c4b3d
Added replaceable records for wind pressur coefficient
kldjonge Jan 20, 2022
164357a
Fine-tuned default voor Cp_table
kldjonge Jan 20, 2022
82cfd9f
Update Lowrise_Square_Exposed.mo
kldjonge Jan 20, 2022
894876e
Simple zone template examples with 3 different airflow implementation…
kldjonge Jan 24, 2022
a316235
Merge branch 'open-ideas:master' into master
kldjonge Feb 18, 2022
62d413e
Merge branch 'master' into StackEffectAirflow
kldjonge Apr 20, 2022
af5a797
Merge branch 'open-ideas:master' into master
kldjonge Apr 20, 2022
e5da395
Merge branch 'master' into StackEffectAirflow
kldjonge Apr 20, 2022
f1d523d
Additional MSL4.0 updates
kldjonge Apr 21, 2022
3e68759
Replace Res to Airflow.Multizone.Point_m_flow model
kldjonge Apr 21, 2022
ec00e8b
Update ZoneInterface.mo
kldjonge Apr 21, 2022
93fbc64
Un-protect parameters
kldjonge Apr 21, 2022
d345e16
Update PartialZone.mo
kldjonge Apr 21, 2022
05f7859
Update PartialSurface.mo
kldjonge Apr 21, 2022
214bcc6
Update PartialSimInfoManager.mo
kldjonge Apr 21, 2022
71d0aef
Update PartialSurface.mo
kldjonge Apr 21, 2022
06aa135
Merge branch 'open-ideas:master' into master
kldjonge Aug 22, 2022
e6b7445
Merge branch 'master' into StackEffectAirflow
kldjonge Aug 22, 2022
d88a752
Added density columns for internal wall 1-port implementation
kldjonge Aug 22, 2022
7b59d9f
Clarifies convention for INC
kldjonge Aug 23, 2022
97789c2
Proposal: assert statement can check if floorheights and INC makes sense
kldjonge Aug 23, 2022
76b5b2a
Corrected propsbus_a <>b
kldjonge Aug 23, 2022
5f28c8c
Make correction for height when the opening is inclined/horizontal
kldjonge Aug 23, 2022
47f4b08
Simplify hRef input
kldjonge Aug 23, 2022
c56964c
Clean up implementation by making ReversibleDensityColumn a class
kldjonge Aug 23, 2022
c692dbc
Added Habs to surface
kldjonge Aug 25, 2022
4ada5dc
pi() -> constants.pi
kldjonge Aug 25, 2022
7523b76
Update PartialSurface.mo
kldjonge Aug 25, 2022
777d145
Airtight internal floors and ceilings
kldjonge Aug 26, 2022
39cea70
Added 2-port variation
kldjonge Aug 26, 2022
69e9b92
Extend instead of duplicate
kldjonge Aug 26, 2022
442b202
Proposal: hfloor1 >hfloor2
kldjonge Aug 26, 2022
728119e
final Habs_surf
kldjonge Aug 26, 2022
466e8de
Simplify horizontal openings
kldjonge Aug 26, 2022
e25590c
Assigned column heights for sloped roof
kldjonge Aug 26, 2022
121cb9c
Merge branch 'open-ideas:master' into master
kldjonge Aug 29, 2022
b87cb1c
Squashed commit of the following:
kldjonge Aug 29, 2022
b274c74
Uprotected A0, a and Hwin and moved it to Overwrite tab
kldjonge Aug 29, 2022
95e84bf
Fixed internal references
kldjonge Aug 29, 2022
c39e5cc
Update OutsideAir.mo
kldjonge Aug 29, 2022
a8f089b
Update Structure.mo
kldjonge Aug 29, 2022
39e8984
Merge branch 'master' into StackEffectAirflow
kldjonge Aug 29, 2022
55bf8c6
Merge branch 'master' into BeforeMergefault_210042022
kldjonge Aug 29, 2022
2d5604a
Merge fixes
kldjonge Aug 29, 2022
f61f67f
Merge branch 'BeforeMergefault_210042022' into StackEffectAirflow
kldjonge Aug 29, 2022
1a8139b
Update Window.mo
kldjonge Aug 29, 2022
678ef99
Merge pull request #1246 from kldjonge/StackEffectAirflow
Mathadon Aug 30, 2022
62a2a95
Simple TwoPort model that still works.
kldjonge Aug 31, 2022
45e58d9
Implementation using Multi-Port in partial surf
kldjonge Sep 7, 2022
1e4fd13
Deleted ScalingComponentsTwoPort
kldjonge Sep 7, 2022
7f4b7aa
Multiport at propsbus_b of internal wall.
kldjonge Sep 7, 2022
514718d
Use resDoo <> opeDoo when the opening is horizontal
kldjonge Sep 7, 2022
e212fca
Debug. ResDoor should not appear when interzonalairflow.non
kldjonge Sep 7, 2022
94fe7f4
Got rid of weird if statement
kldjonge Sep 7, 2022
586c7b9
Revert tricklevent implementation
kldjonge Sep 9, 2022
87faef9
Merge pull request #1297 from kldjonge/StackEffectAirflow
Mathadon Sep 18, 2022
52381f3
code cleanups
Mathadon Sep 21, 2022
ad7b6c9
revised cardinality
Mathadon Oct 12, 2022
cd1d89e
not adding cracks when there is an open door in IDEAS/Buildings/Compo…
Mathadon Oct 15, 2022
bb48952
parameter revisions for #1244
Mathadon Dec 18, 2022
4d596fb
comment indent
Mathadon Dec 18, 2022
83f1f21
fixed singular system error for #1244
Mathadon Dec 18, 2022
ff7a7de
Merge pull request #1310 from Mathadon/StackEffectAirflow
jelgerjansen Dec 20, 2022
0567df5
WallUnitTest update for interzonal airflow v2
Mathadon Dec 28, 2022
5a3ccad
newlines at the end of files
Mathadon Jan 2, 2023
b7c34aa
newline fix
Mathadon Jan 2, 2023
a11680f
revision history and code formatting
Mathadon Jan 2, 2023
65b5630
docs
Mathadon Jan 2, 2023
224f2c1
Merge pull request #1311 from Mathadon/StackEffectAirflow
jelgerjansen Jan 2, 2023
5be2d6d
extending ReversibleDensityColumn.mo from MediumColumn and moved from…
Mathadon Jun 22, 2023
0643e39
documentation and renamed Use_custom_Cs to use_custom_Cs
Mathadon Jun 22, 2023
5e4877a
refactoring in PartialSurface
Mathadon Jun 22, 2023
1eba0de
cleaned icon
Mathadon Jun 22, 2023
a302cfe
removed density columns from 1 port mode in internal wall
Mathadon Jun 22, 2023
cde76d4
HideResult annotation
Mathadon Jun 22, 2023
284d2d0
improved warning in MonoLayerAir
Mathadon Jun 24, 2023
5c37fe2
changes as part of a consulting project:
Mathadon Jul 25, 2023
5ae2aeb
valve leakage for trickle vent
Mathadon Jul 25, 2023
ce95f4d
icon fixes in IDEAS/Buildings/Components/Window.mo
Mathadon Jul 25, 2023
dfba25c
reverted to OnePort in zoneexample
Mathadon Jul 25, 2023
e99c192
fixes
Mathadon Aug 11, 2023
93ea224
Merge branch 'master' into StackEffectAirflow
jelgerjansen Sep 1, 2023
4dd515e
Update reference results
jelgerjansen Sep 4, 2023
c0cc950
truncating window control signal
Mathadon Sep 6, 2023
1c3f2a4
added error control
Mathadon Sep 7, 2023
dbc8c67
fixed mos file path
Mathadon Sep 7, 2023
bfd9308
added 2port unit test for twinhouse
Mathadon Sep 7, 2023
373f853
added missing port connection
Mathadon Sep 7, 2023
34a2bec
Merge pull request #1326 from Mathadon/stackeffectfix
jelgerjansen Sep 7, 2023
d551b6b
Revert reference results of TwinHouses port 1 to te previous results.
jelgerjansen Sep 7, 2023
f468675
revision where screen temperature depends on mass flow rate
Mathadon Sep 7, 2023
c65aa81
y_window_internal added
Mathadon Sep 7, 2023
7bedff5
fixes for m_flow in DoubleShading
Mathadon Sep 11, 2023
aae5369
added missing connections
Mathadon Sep 11, 2023
552db2e
extended IDEAS/Buildings/Components/Examples/BuildingShadeExample.mo
Mathadon Sep 13, 2023
478ccad
bugfix in IDEAS/Buildings/Components/Shading/Interfaces/DoubleShadin…
Mathadon Sep 13, 2023
d2e4e45
set haveBoundaryPorts in IDEAS/Buildings/Components/Shading/OverhangA…
Mathadon Sep 14, 2023
da8c75d
unit fix
Mathadon Sep 14, 2023
a455035
Update time-out times and remove density column of door for 1-port im…
jelgerjansen Sep 18, 2023
26a6beb
fixes to the computation of Cs based on discussion in https://github.…
Mathadon Sep 19, 2023
7c741ed
Add brackets in Cs computation
jelgerjansen Sep 20, 2023
132a1f2
Remove w40 from TwinHouses.Building05_Exp1_2Port.mo(s) and add refere…
jelgerjansen Sep 20, 2023
dc4adcb
Revert to 'original' reference results for all packages except IDEAS.…
jelgerjansen Sep 20, 2023
7eb16f8
Update and add reference results (correct Cs calculation)
jelgerjansen Sep 21, 2023
074def0
Merge branch 'StackEffectAirflow' (PR1296) into 'StackEffectAirflow' …
jelgerjansen Sep 21, 2023
c4420c1
Merge pull request #1322 from Mathadon/StackEffectAirflow
jelgerjansen Sep 22, 2023
c44538d
Merge branch 'StackEffectAirflow' into project_itz_fixes
jelgerjansen Sep 22, 2023
2157742
Fix merge conflict in OuterWall
jelgerjansen Sep 22, 2023
0a0f149
variable propagation fixes in rectangularzonetemplate
Mathadon Oct 16, 2023
2ade9ac
Merge branch 'project_itz_fixes' of github.com:Mathadon/IDEAS into pr…
Mathadon Oct 16, 2023
d6df006
Fix typo in mos file CavityInternalWall
jelgerjansen Oct 16, 2023
f7146a0
conditional frame types to avoid warning in ideas
Mathadon Oct 16, 2023
5023123
Merge branch 'project_itz_fixes' of github.com:Mathadon/IDEAS into pr…
Mathadon Oct 16, 2023
3773c4a
Fix 'overriding final modifier for len'
jelgerjansen Oct 17, 2023
416191f
Fix 'overriding final modifier for len' for TwinHouses examples (ther…
jelgerjansen Oct 17, 2023
6900db4
removed obsolete empty lines
Mathadon Oct 17, 2023
b6eae69
added accidentally removed revision note
Mathadon Oct 17, 2023
3a2c797
Merge branch 'project_itz_fixes' of https://github.com/Mathadon/IDEAS…
jelgerjansen Oct 18, 2023
99fae21
shading parameter fixes for project_itz_fixes
Mathadon Oct 18, 2023
6ecc359
Merge remote-tracking branch 'filip/project_itz_fixes' into project_i…
jelgerjansen Oct 18, 2023
1194908
various fixes for modelica spec compliance
Mathadon Oct 18, 2023
af286d0
Change location of input/output connectors of zone model icon to avoi…
jelgerjansen Oct 18, 2023
a1da0d4
Merge remote-tracking branch 'filip/project_itz_fixes' into project_i…
jelgerjansen Oct 18, 2023
b92f563
Merge branch 'master' into StackEffectAirflow (airflow unit tests)
jelgerjansen Oct 19, 2023
bb2dc38
Merge branch 'StackEffectAirflow' into project_itz_fixes (air flow un…
jelgerjansen Oct 19, 2023
3f4ac1a
bugfix when using door and OnePort
Mathadon Oct 20, 2023
1ffd9b3
Merge remote-tracking branch 'filip/project_itz_fixes' into project_i…
jelgerjansen Oct 20, 2023
304135e
added openDoorOnePort to CrackOrOperableDoor
Mathadon Oct 20, 2023
f9fc0e9
Change default calculation of hWin to avoid a division by 0 in the Re…
jelgerjansen Oct 20, 2023
c6de19a
Merge remote-tracking branch 'filip/project_itz_fixes' into project_i…
jelgerjansen Oct 20, 2023
5ac5f7b
Change resDoor.m_flow to crackOrOperableDoor.m1_flow for validating
jelgerjansen Oct 20, 2023
e21e3ab
Fix package order of IDEAS.Airflow.Multizone
jelgerjansen Oct 20, 2023
e9094a4
Set default of 'openDoorOnePort' to true
jelgerjansen Oct 20, 2023
9a50ced
Set default of 'openDoorOnePort' to false
jelgerjansen Oct 20, 2023
001d8f0
surface area fix
Mathadon Oct 23, 2023
ae7a816
Merge remote-tracking branch 'filip/project_itz_fixes' into project_i…
jelgerjansen Oct 23, 2023
13f6de5
Update and generate new reference results
jelgerjansen Oct 23, 2023
490e592
Increase time-out time of Examples.Tutorial.Example9 to 2700 seconds …
jelgerjansen Oct 23, 2023
02d766c
Update tolerance.
javiarrobas Oct 26, 2023
88c679e
Merge pull request #1 from open-ideas/project_itz_fixes
Mathadon Oct 27, 2023
8e37c06
copied parameter value from master branch
Mathadon Nov 6, 2023
3a599f9
working on fix
Mathadon Nov 8, 2023
15c8246
conditional density columns
Mathadon Nov 8, 2023
aad7465
propagated CD in IDEAS/Buildings/Components/InternalWall.mo
Mathadon Nov 8, 2023
fabe0e6
Partial revert to reset reference results to those of the StackEffect…
jelgerjansen Nov 15, 2023
69d307e
Revert of previous update of reference results and generated new refe…
jelgerjansen Nov 15, 2023
4416ecb
Already add W40 comparison in BuildingO5_Exp1_2Port files. To be unco…
jelgerjansen Nov 16, 2023
0eb58da
Remove commented line of plotting W40 results because this triggers a…
jelgerjansen Nov 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 176 additions & 0 deletions IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo
Original file line number Diff line number Diff line change
@@ -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(forceErrorControlOnFlow=true); //force error control on flow rates

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 "Height at port b1";
parameter Modelica.Units.SI.Length h_b2 = 0 "Height at port b2";
parameter Modelica.Units.SI.Length h_a1 = 0 "Height at port a1";
parameter Modelica.Units.SI.Length h_a2 "Height at port 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;
53 changes: 53 additions & 0 deletions IDEAS/Airflow/Multizone/Examples/TrickleVentIDEAS.mo
Original file line number Diff line number Diff line change
@@ -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="<html>
<p>
This model illustrates the use of the models
<a href=\"modelica://IDEAS.Airflow.Multizone.TrickleVent\">
IDEAS.Airflow.Multizone.Table_V_flow</a>,
which is an analytic alternative to the table implementation of
<a href=\"modelica://IDEAS.Airflow.Multizone.Table_m_flow\">
IDEAS.Airflow.Multizone.Table_m_flow</a> for

modelling self regulating inlet vents.
</p>
</html>", revisions="<html>
<ul>
<li>
July 9, 2023 by Filip Jorissen:<br/>
First implementation.
</li>
</ul>
</html>"),
Diagram);
end TrickleVentIDEAS;
1 change: 1 addition & 0 deletions IDEAS/Airflow/Multizone/Examples/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ PressurizationData
ReverseBuoyancy
ReverseBuoyancy3Zones
TrickleVent
TrickleVentIDEAS
ZonalFlow
42 changes: 42 additions & 0 deletions IDEAS/Airflow/Multizone/ReversibleDensityColumn.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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="<html>
<p>
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.
</p>
</html>",
revisions="<html>
<ul>
<li>
January 19, 2022, by Klaas De Jonge:<br/>
Adapted IDEAS.Airflow.Multizone.MediumColumn to obtain the current model where input of
h can be negative and cleaned out the model as the density should always be set by port_b.
This makes port_a not nececarilly always the top port.
</li>
</ul>
</html>"));
end ReversibleDensityColumn;
25 changes: 22 additions & 3 deletions IDEAS/Airflow/Multizone/TrickleVent.mo
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -23,13 +29,18 @@ 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.");
end if;

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
Expand All @@ -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
Expand All @@ -56,12 +67,20 @@ The positive mass flow rate is limited to <code>m_flow_nominal</code>
at a pressure difference of <code>dp_nominal</code>.
For negative pressure differences the mass flow rate is not limited.
</p>
<p>
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.
</p>
</html>", revisions="<html>
<ul>
<li>
July 9, 2023, by Filip Jorissen:<br/>
Add control input.
</li>
<li>
September 21, 2021, by Filip Jorissen:<br/>
First implementation.
</li>
</ul>
</html>"));
end TrickleVent;
end TrickleVent;
2 changes: 2 additions & 0 deletions IDEAS/Airflow/Multizone/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ MediumColumnDynamic
Orifice
Point_m_flow
Points_m_flow
ReversibleDensityColumn
Table_V_flow
Table_m_flow
ZonalFlow_ACS
Expand All @@ -20,3 +21,4 @@ Examples
Validation
BaseClasses
TrickleVent
CrackOrOperableDoor
Loading
Loading