Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kldjonge committed Jan 23, 2025
2 parents 07479a2 + 8b3818d commit 45dd567
Show file tree
Hide file tree
Showing 82 changed files with 1,390 additions and 927 deletions.
12 changes: 8 additions & 4 deletions IDEAS/Airflow/Multizone/BaseClasses/DoorDiscretized.mo
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ partial model DoorDiscretized
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";

protected
parameter Modelica.Units.SI.Length dh=hOpe/nCom "Height of each compartment";

input Modelica.Units.SI.Length dh=hOpe/nCom "Height of each compartment";
protected
parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX(
T=Medium.T_default,
p=Medium.p_default,
Expand All @@ -28,11 +28,11 @@ protected
parameter Modelica.Units.SI.Density rho_default=Medium.density(sta_default)
"Density, used to compute fluid volume";

parameter Real hAg[nCom](each unit="m2/s2")=
input Real hAg[nCom](each unit="m2/s2")=
{Modelica.Constants.g_n*(hA - (i - 0.5)*dh) for i in 1:nCom}
"Product g*h_i for each compartment";

parameter Real hBg[nCom](each unit="m2/s2")=
input Real hBg[nCom](each unit="m2/s2")=
{Modelica.Constants.g_n*(hB - (i - 0.5)*dh) for i in 1:nCom}
"Product g*h_i for each compartment";
Modelica.Units.SI.AbsolutePressure pA[nCom](each nominal=101325)
Expand Down Expand Up @@ -118,6 +118,10 @@ using the model for a door that can be open or closed.
revisions="<html>
<ul>
<li>
October 29, 2024, by Klaas De Jonge:<br/>
Unprotected <code>dh</code> and changed prefixes of <code>dh</code>,<code>hAg</code> and <code>hBg</code> to <code>input</code>. This is for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1935\">#1935</a>.
</li>
<li>
January 8, 2019, by Michael Wetter:<br/>
Moved parameter <code>CD</code> from
<a href=\"modelica://IDEAS.Airflow.Multizone.BaseClasses.DoorDiscretized\">
Expand Down
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
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;
1 change: 1 addition & 0 deletions IDEAS/Airflow/Multizone/Validation/package.order
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DoorOpenClosed
LargeHorizontalOpening
OneWayFlow
OpenDoorBuoyancyDynamic
OpenDoorBuoyancyPressureDynamic
Expand Down
4 changes: 3 additions & 1 deletion IDEAS/Airflow/Multizone/package.order
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
UsersGuide
Coefficient_V_flow
Coefficient_m_flow
CrackOrOperableDoor
DoorDiscretizedOpen
DoorDiscretizedOperable
DoorOpen
DoorOperable
EffectiveAirLeakageArea
MediumColumn
MediumColumnDynamic
MediumColumnReversible
Orifice
Point_m_flow
Points_m_flow
Table_V_flow
Table_m_flow
TrickleVent
ZonalFlow_ACS
ZonalFlow_m_flow
Types
Examples
Validation
BaseClasses
TrickleVent
34 changes: 27 additions & 7 deletions IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ partial model PartialSimInfoManager
parameter Boolean openSystemConservationOfEnergy=false
"Compute conservation of energy for open system" annotation (Evaluate=true,
Dialog(tab="Conservation of energy", enable=computeConservationOfEnergy));

final parameter Boolean use_port_1 = interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None
"Whether port_1 of the propsbus connector should be used";
final parameter Boolean use_port_2 = interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts
"Whether port_2 of the propsbus connector should be used";
parameter Boolean lineariseDymola=false "Linearises building model equations for Dymola linearisation approach"
annotation (Dialog(tab="Linearisation"));
parameter Boolean lineariseJModelica=false "Linearises building model equations for optimisations in JModelica"
Expand Down Expand Up @@ -101,18 +104,23 @@ partial model PartialSimInfoManager
annotation(Dialog(enable=interZonalAirFlowType<>
IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None or unify_n50,group="Interzonal airflow"));

parameter Boolean use_sim_Cs =true "if checked, the default Cs of each surface in the building is sim.Cs"
annotation(choices(checkBox=true),Dialog(group="Wind"));

parameter Modelica.Units.SI.Length H=10 "Building or roof height"
annotation (Dialog(group="Wind"));
parameter Real A0=0.6 "Local terrain constant. 0.6 for Suburban,0.35 for Urban and 1 for Unshielded (Ashrae 1993) " annotation(Dialog(group="Wind"));
parameter Real A0=0.6 "Local terrain constant. 0.6 for Suburban,0.35 for Urban and 1 for Unshielded (Ashrae 1993) "
annotation(Dialog(group="Wind"));
parameter Real a=0.28 "Velocity profile exponent. 0.28 for Suburban, 0.4 for Urban and 0.15 for Unshielded (Ashrae 1993) "
annotation(Dialog(group="Wind"));
parameter Modelica.Units.SI.Length Hwin=10
annotation(Dialog(group="Wind"));
parameter Modelica.Units.SI.Length Hwind=10
"Height above ground of meteorological wind speed measurement"
annotation (Dialog(group="Wind"));
parameter Modelica.Units.SI.Length HPres=1 "Height above ground of meteorological atmospheric pressure measurement" annotation (Dialog(group="Wind"));
parameter Real Cs_coeff = (A0*A0)*((1/Hwind)^(2*a)) "Multiplication factor for Habs"
annotation(Dialog(group="Wind"));

parameter Real Cs= (A0*A0)*((H/Hwin)^(2*a)) "Wind speed modifier"
annotation(Dialog(group="Wind"));

parameter Real Cs= Cs_coeff*(H^(2*a)) "Wind speed modifier" annotation(Dialog(group="Wind"));

final parameter Integer numIncAndAziInBus = size(incAndAziInBus,1)
"Number of pre-computed azimuth";
Expand Down Expand Up @@ -576,6 +584,18 @@ equation
</html>", revisions="<html>
<ul>
<li>
October 30, 2024, by Klaas De Jonge:<br/>
Modifications for wind pressure,ambient pressure and wind speed modifiers used in interzonal airflow.
</li>
<li>
October 18, 2023 by Filip Jorissen:<br/>
Added use_port_1 and use_port_2 for convenience.
</li>
<li>
December 18, 2022 by Filip Jorissen:<br/>
parameter revisions for #1244
</li>
<li>
April 28, 2022 by Filip Jorissen:<br/>
Changed the default weather file to BEL_VLG_Uccle.064470_TMYx.2007-2021.mos.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1239\">
Expand Down
2 changes: 1 addition & 1 deletion IDEAS/BoundaryConditions/Validation/BESTEST/WD100.mo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
within IDEAS.BoundaryConditions.Validation.BESTEST;
within IDEAS.BoundaryConditions.Validation.BESTEST;
model WD100
"Test model for BESTEST weather data: base case"
extends Modelica.Icons.Example;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
Loading

0 comments on commit 45dd567

Please sign in to comment.