Extends from Modelica.Fluid.Icons.BaseClassLibrary (Icon for library).
Name | Description |
---|---|
DoorDiscretized | Door model using discretization along height coordinate |
powerLaw | Power law used in orifice equations |
PowerLawResistance | Flow resistance that uses the power law |
TwoWayFlowElement | Flow resistance that uses the power law |
TwoWayFlowElementBuoyancy | Flow resistance that uses the power law |
ZonalFlow | Flow across zonal boundaries of a room |
ErrorControl | Interface that defines parameters for error control |
This is a partial model for the bi-directional air flow through a door.
To compute the bi-directional flow, the door is discretize along the height coordinate, and uses an orifice equation to compute the flow for each compartment.
The compartment area dA
is a variable, which allows
using the model for a door that can be open or closed.
Extends from Buildings.Airflow.Multizone.BaseClasses.TwoWayFlowElementBuoyancy (Flow resistance that uses the power law).
Type | Name | Default | Description |
---|---|---|---|
Boolean | forceErrorControlOnFlow | true | Flag to force error control on m_flow. Set to true if interested in flow rate |
replaceable package Medium | PartialMedium | ||
Velocity | vZer | 0.001 | Minimum velocity to prevent zero flow. Recommended: 0.001 [m/s] |
Integer | nCom | 10 | Number of compartments for the discretization |
Pressure | dp_turbulent | 0.01 | Pressure difference where laminar and turbulent flow relation coincide. Recommended: 0.01 [Pa] |
Initialization | |||
MassFlowRate | m1_flow.start | 0 | Mass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction) [kg/s] |
Pressure | dp1.start | 0 | Pressure difference between port_a1 and port_b1 [Pa] |
MassFlowRate | m2_flow.start | 0 | Mass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction) [kg/s] |
Pressure | dp2.start | 0 | Pressure difference between port_a2 and port_b2 [Pa] |
Density | rho_a1_inflow.start | 1.2 | Density of air flowing in from port_a1 [kg/m3] |
Density | rho_a2_inflow.start | 1.2 | Density of air flowing in from port_a2 [kg/m3] |
Geometry | |||
Length | wOpe | 0.9 | Width of opening [m] |
Length | hOpe | 2.1 | Height of opening [m] |
Length | hA | 2.7/2 | Height of reference pressure zone A [m] |
Length | hB | 2.7/2 | Height of reference pressure zone B [m] |
Orifice characteristics | |||
Real | CD | 0.65 | Discharge coefficient |
Initialization | |||
SpecificEnthalpy | h_outflow_a1_start | Medium1.h_default | Start value for enthalpy flowing out of port a1 [J/kg] |
SpecificEnthalpy | h_outflow_b1_start | Medium1.h_default | Start value for enthalpy flowing out of port b1 [J/kg] |
SpecificEnthalpy | h_outflow_a2_start | Medium2.h_default | Start value for enthalpy flowing out of port a2 [J/kg] |
SpecificEnthalpy | h_outflow_b2_start | Medium2.h_default | Start value for enthalpy flowing out of port b2 [J/kg] |
Advanced | |||
MassFlowRate | m1_flow_small | 1E-4*m1_flow_nominal | Small mass flow rate for regularization of zero flow [kg/s] |
MassFlowRate | m2_flow_small | 1E-4*m2_flow_nominal | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics | |||
Boolean | show_V_flow | false | = true, if volume flow rate at inflowing port is computed |
Boolean | show_T | false | = true, if actual temperature at port is computed (may lead to events) |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a1 | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_a2 | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
partial model DoorDiscretized "Door model using discretization along height coordinate" extends Buildings.Airflow.Multizone.BaseClasses.TwoWayFlowElementBuoyancy; parameter Integer nCom=10 "Number of compartments for the discretization"; parameter Modelica.SIunits.Pressure dp_turbulent(min=0) = 0.01 "Pressure difference where laminar and turbulent flow relation coincide. Recommended: 0.01"; parameter Real CD=0.65 "|Orifice characteristics|Discharge coefficient"; Modelica.SIunits.Pressure dpAB[nCom](nominal=1) "Pressure difference between compartments"; Modelica.SIunits.Velocity v[nCom](nominal=0.01) "Velocity in compartment from A to B"; Modelica.SIunits.Velocity vTop "Velocity at top of opening from A to B"; Modelica.SIunits.Velocity vBot "Velocity at bottom of opening from A to B"; protected parameter Modelica.SIunits.Length dh=hOpe/nCom "Height of each compartment"; Modelica.SIunits.AbsolutePressure pA[nCom](nominal=101325) "Pressure in compartments of room A"; Modelica.SIunits.AbsolutePressure pB[nCom](nominal=101325) "Pressure in compartments of room B"; Modelica.SIunits.VolumeFlowRate dV_flow[nCom] "Volume flow rate through compartment from A to B"; Modelica.SIunits.VolumeFlowRate dVAB_flow[nCom] "Volume flow rate through compartment from A to B if positive"; Modelica.SIunits.VolumeFlowRate dVBA_flow[nCom] "Volume flow rate through compartment from B to A if positive"; Real m(min=0.5, max=1) "Flow exponent, m=0.5 for turbulent, m=1 for laminar"; Real kVal "Flow coefficient for each compartment, k = V_flow/ dp^m"; Modelica.SIunits.Area dA "Compartment area"; Modelica.SIunits.Density rhoAve "Average air density"; equation dA = A/nCom; rhoAve = (rho_a1_inflow + rho_a2_inflow)/2; for i in 1:nCom loop // pressure drop in each compartment pA[i] = port_a1.p + rho_a1_inflow*Modelica.Constants.g_n*(hA - (i - 0.5)*dh); pB[i] = port_a2.p + rho_a2_inflow*Modelica.Constants.g_n*(hB - (i - 0.5)*dh); dpAB[i] = pA[i] - pB[i]; // orifice equation dV_flow[i] = Buildings.Airflow.Multizone.BaseClasses.powerLaw( k=kVal, dp=dpAB[i], m=m, dp_turbulent=dp_turbulent); v[i] = dV_flow[i]/dA; // assignment of net volume flows dVAB_flow[i] = dV_flow[i]* Buildings.Utilities.Math.Functions.smoothHeaviside(x=dV_flow[i], delta= VZer_flow/nCom) + VZer_flow/nCom; dVBA_flow[i] = -dV_flow[i] + dVAB_flow[i] + 2*VZer_flow/nCom; end for; // add positive and negative flows VAB_flow = ones(nCom)*dVAB_flow; VBA_flow = ones(nCom)*dVBA_flow; vTop = v[nCom]; vBot = v[1];end DoorDiscretized;
This model describes the mass flow rate and pressure difference relation of an orifice in the form
m_flow = k * dp^m,where
k
is a variable and
m
a parameter.
For turbulent flow, set m=1/2
and
for laminar flow, set m=1
.
The model is used as a base for the interzonal air flow models.
Type | Name | Default | Description |
---|---|---|---|
Real | k | Flow coefficient, k = V_flow/ dp^m | |
Pressure | dp | Pressure difference [Pa] | |
Real | m | Flow exponent, m=0.5 for turbulent, m=1 for laminar | |
Pressure | dp_turbulent | 0.001 | Pressure difference where laminar and turbulent flow relation coincide [Pa] |
Type | Name | Description |
---|---|---|
VolumeFlowRate | V_flow | Volume flow rate [m3/s] |
function powerLaw "Power law used in orifice equations" input Real k "Flow coefficient, k = V_flow/ dp^m"; input Modelica.SIunits.Pressure dp "Pressure difference"; input Real m(min=0.5, max=1) "Flow exponent, m=0.5 for turbulent, m=1 for laminar"; input Modelica.SIunits.Pressure dp_turbulent(min=0)=0.001 "Pressure difference where laminar and turbulent flow relation coincide"; output Modelica.SIunits.VolumeFlowRate V_flow "Volume flow rate"; protected Modelica.SIunits.Pressure delP "Half-width of transition interval"; Modelica.SIunits.Pressure pTilFor "Pressure at which transition occurs at forward flow"; Modelica.SIunits.Pressure pTilRev "Pressure at which transition occurs at reverse flow"; Real s "Part of the linear slope that is independent of k"; algorithm s :=dp_turbulent^(m - 1); // m can be time dependent, for example for the operable door delP :=dp_turbulent/2.0; pTilFor :=dp - dp_turbulent; pTilRev :=dp + dp_turbulent; /*V_flow :=k*spliceFunction( spliceFunction( abs(dp)^m, s*dp, pTilFor, delP), -(abs(dp)^m), pTilRev, delP); */ if (dp >= dp_turbulent) then V_flow :=k*dp^m; elseif (dp <= -dp_turbulent) then V_flow :=-k*(-dp)^m; else // The test below avoids computing 0^(-0.5) in // Buildings.Airflow.Multizone.BaseClasses.powerLaw:derf, // which causes the following error: // Model error - power: (abs(dp)) ** (m-1) = (0) ** (-0.5) if (abs(dp)<Modelica.Constants.small) then V_flow := 0; else V_flow :=k*spliceFunction( spliceFunction( abs(dp)^m, s*dp, pTilFor, delP), -(abs(dp)^m), pTilRev, delP); end if; end if;end powerLaw;
This model describes the mass flow rate and pressure difference relation of an orifice in the form
V_flow = k * dp^m,where
k
is a variable and
m
a parameter.
For turbulent flow, set m=1/2
and
for laminar flow, set m=1
.
The model is used as a base for the interzonal air flow models.
Extends from Buildings.Fluid.Interfaces.PartialStaticTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Airflow.Multizone.BaseClasses.ErrorControl (Interface that defines parameters for error control).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Boolean | forceErrorControlOnFlow | true | Flag to force error control on m_flow. Set to true if interested in flow rate |
Real | m | Flow exponent, m=0.5 for turbulent, m=1 for laminar | |
Boolean | useConstantDensity | true | Set to false to use density based on state (as implemented by the Medium model) |
Pressure | dp_turbulent | 0.1 | Pressure difference where laminar and turbulent flow relation coincide. Recommended = 0.1 [Pa] |
Length | lWet | sqrt(A) | Wetted perimeter used for Reynolds number calculation [m] |
Nominal condition | |||
MassFlowRate | m_flow_nominal | rho_nominal*k*dp_turbulent | Nominal mass flow rate [kg/s] |
Initialization | |||
MassFlowRate | m_flow.start | 0 | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) [kg/s] |
Pressure | dp.start | 0 | Pressure difference between port_a and port_b [Pa] |
Orifice characteristics | |||
Area | A | Area of orifice [m2] | |
Assumptions | |||
Boolean | allowFlowReversal | system.allowFlowReversal | = true to allow flow reversal, false restricts to design direction (port_a -> port_b) |
Advanced | |||
MassFlowRate | m_flow_small | 1E-4*m_flow_nominal | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics | |||
Boolean | show_V_flow | true | = true, if volume flow rate at inflowing port is computed |
Boolean | show_T | false | = true, if actual temperature at port is computed (may lead to events) |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
partial model PowerLawResistance "Flow resistance that uses the power law" extends Buildings.Fluid.Interfaces.PartialStaticTwoPortInterface(final m_flow_nominal=rho_nominal*k*dp_turbulent, final show_V_flow=true); extends Buildings.Airflow.Multizone.BaseClasses.ErrorControl; parameter Modelica.SIunits.Area A "|Orifice characteristics|Area of orifice"; parameter Real m(min=0.5, max=1) "Flow exponent, m=0.5 for turbulent, m=1 for laminar"; parameter Boolean useConstantDensity=true "Set to false to use density based on state (as implemented by the Medium model)"; Modelica.SIunits.Density rho "Fluid density at port_a"; parameter Modelica.SIunits.Pressure dp_turbulent(min=0) = 0.1 "Pressure difference where laminar and turbulent flow relation coincide. Recommended = 0.1"; Modelica.SIunits.Velocity v(nominal=1) "Average velocity"; parameter Modelica.SIunits.Length lWet=sqrt(A) "Wetted perimeter used for Reynolds number calculation"; Real Re "Reynolds number"; protected parameter Real k(fixed=false) "Flow coefficient, k = V_flow/ dp^m"; parameter Medium.ThermodynamicState sta0=Medium.setState_pTX( T=Medium.T_default, p=Medium.p_default, X=Medium.X_default); parameter Modelica.SIunits.Density rho_nominal=Medium.density(sta0) "Density, used to compute fluid volume"; Modelica.SIunits.DynamicViscosity dynVis "Dynamic viscosity"; Modelica.SIunits.Mass mExc(start=0) "Air mass exchanged (for purpose of error control only)"; equation if forceErrorControlOnFlow then der(mExc) = port_a.m_flow; else der(mExc) = 0; end if; rho = if useConstantDensity then rho_nominal else Medium.density(sta_a); dynVis = Medium.dynamicViscosity(sta_a); port_a.m_flow = rho*Buildings.Airflow.Multizone.BaseClasses.powerLaw( k=k, dp=dp, m=m, dp_turbulent=dp_turbulent); v = V_flow/A; Re = v*lWet*rho/dynVis; // 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);end PowerLawResistance;
This is a partial model for models that describe the bi-directional air flow through large openings.
Models that extend this model need to compute
mAB_flow
and mBA_flow
,
or alternatively VAB_flow
and VBA_flow
,
and the face area area
.
The face area is a variable to allow this partial model to be used
for doors that can be open or closed as a function of an input signal.
Extends from Buildings.Fluid.Interfaces.PartialStaticFourPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Airflow.Multizone.BaseClasses.ErrorControl (Interface that defines parameters for error control).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium1 | PartialMedium | Medium 1 in the component | |
replaceable package Medium2 | PartialMedium | Medium 2 in the component | |
Boolean | forceErrorControlOnFlow | true | Flag to force error control on m_flow. Set to true if interested in flow rate |
Velocity | vZer | 0.001 | Minimum velocity to prevent zero flow. Recommended: 0.001 [m/s] |
Nominal condition | |||
MassFlowRate | m1_flow_nominal | 10/3600*1.2 | Nominal mass flow rate [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal | Nominal mass flow rate [kg/s] |
Initialization | |||
MassFlowRate | m1_flow.start | 0 | Mass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction) [kg/s] |
Pressure | dp1.start | 0 | Pressure difference between port_a1 and port_b1 [Pa] |
MassFlowRate | m2_flow.start | 0 | Mass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction) [kg/s] |
Pressure | dp2.start | 0 | Pressure difference between port_a2 and port_b2 [Pa] |
Assumptions | |||
Boolean | allowFlowReversal1 | false | = true to allow flow reversal in medium 1, false restricts to design direction (port_a -> port_b) |
Boolean | allowFlowReversal2 | false | = true to allow flow reversal in medium 2, false restricts to design direction (port_a -> port_b) |
Initialization | |||
SpecificEnthalpy | h_outflow_a1_start | Medium1.h_default | Start value for enthalpy flowing out of port a1 [J/kg] |
SpecificEnthalpy | h_outflow_b1_start | Medium1.h_default | Start value for enthalpy flowing out of port b1 [J/kg] |
SpecificEnthalpy | h_outflow_a2_start | Medium2.h_default | Start value for enthalpy flowing out of port a2 [J/kg] |
SpecificEnthalpy | h_outflow_b2_start | Medium2.h_default | Start value for enthalpy flowing out of port b2 [J/kg] |
Advanced | |||
MassFlowRate | m1_flow_small | 1E-4*m1_flow_nominal | Small mass flow rate for regularization of zero flow [kg/s] |
MassFlowRate | m2_flow_small | 1E-4*m2_flow_nominal | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics | |||
Boolean | show_V_flow | false | = true, if volume flow rate at inflowing port is computed |
Boolean | show_T | false | = true, if actual temperature at port is computed (may lead to events) |
Type | Name | Description |
---|---|---|
replaceable package Medium1 | Medium 1 in the component | |
replaceable package Medium2 | Medium 2 in the component | |
FluidPort_a | port_a1 | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_a2 | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
partial model TwoWayFlowElement "Flow resistance that uses the power law" extends Buildings.Fluid.Interfaces.PartialStaticFourPortInterface( redeclare final package Medium1 = Medium, redeclare final package Medium2 = Medium, final allowFlowReversal1=false, final allowFlowReversal2=false, final m1_flow_nominal=10/3600*1.2, final m2_flow_nominal=m1_flow_nominal); extends Buildings.Airflow.Multizone.BaseClasses.ErrorControl; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium; Modelica.SIunits.VolumeFlowRate VAB_flow(nominal=0.001) "Volume flow rate from A to B if positive"; Modelica.SIunits.VolumeFlowRate VBA_flow(nominal=0.001) "Volume flow rate from B to A if positive"; Modelica.SIunits.MassFlowRate mAB_flow(nominal=0.001) "Mass flow rate from A to B if positive"; Modelica.SIunits.MassFlowRate mBA_flow(nominal=0.001) "Mass flow rate from B to A if positive"; Modelica.SIunits.Velocity vAB(nominal=0.01) "Average velocity from A to B"; Modelica.SIunits.Velocity vBA(nominal=0.01) "Average velocity from B to A"; Modelica.SIunits.Density rho_a1_inflow(start=1.2) "Density of air flowing in from port_a1"; Modelica.SIunits.Density rho_a2_inflow(start=1.2) "Density of air flowing in from port_a2"; Modelica.SIunits.Area A "Face area"; parameter Modelica.SIunits.Velocity vZer=0.001 "Minimum velocity to prevent zero flow. Recommended: 0.001"; protected Modelica.SIunits.VolumeFlowRate VZer_flow(fixed=false) "Minimum net volume flow rate to prevent zero flow"; protected Modelica.SIunits.Mass mExcAB(start=0) "Air mass exchanged (for purpose of error control only)"; Modelica.SIunits.Mass mExcBA(start=0) "Air mass exchanged (for purpose of error control only)"; equation // enforcing error control on both direction rather than on the sum only // gives higher robustness. The reason may be that for bi-directional flow, // (VAB_flow - VBA_flow) may be close to zero. if forceErrorControlOnFlow then der(mExcAB) = mAB_flow; der(mExcBA) = mBA_flow; else der(mExcAB) = 0; der(mExcBA) = 0; end if; rho_a1_inflow = Medium.density(state_a1_inflow); rho_a2_inflow = Medium.density(state_a2_inflow); VZer_flow = vZer*A; mAB_flow = rho_a1_inflow*VAB_flow; mBA_flow = rho_a2_inflow*VBA_flow; // Average velocity (using the whole orifice area) vAB = VAB_flow/A; vBA = VBA_flow/A; port_a1.m_flow = mAB_flow; port_a2.m_flow = mBA_flow; // Energy balance (no storage, no heat loss/gain) port_a1.h_outflow = inStream(port_b1.h_outflow); port_b1.h_outflow = inStream(port_a1.h_outflow); port_a2.h_outflow = inStream(port_b2.h_outflow); port_b2.h_outflow = inStream(port_a2.h_outflow); // Mass balance (no storage) port_a1.m_flow = -port_b1.m_flow; port_a2.m_flow = -port_b2.m_flow; port_a1.Xi_outflow = inStream(port_b1.Xi_outflow); port_b1.Xi_outflow = inStream(port_a1.Xi_outflow); port_a2.Xi_outflow = inStream(port_b2.Xi_outflow); port_b2.Xi_outflow = inStream(port_a2.Xi_outflow); // Transport of trace substances port_a1.C_outflow = inStream(port_b1.C_outflow); port_b1.C_outflow = inStream(port_a1.C_outflow); port_a2.C_outflow = inStream(port_b2.C_outflow); port_b2.C_outflow = inStream(port_a2.C_outflow);end TwoWayFlowElement;
This is a partial model for models that describe the bi-directional air flow through large openings.
Models that extend this model need to compute
mAB_flow
and mBA_flow
,
or alternatively VAB_flow
and VBA_flow
,
and the face area area
.
The face area is a variable to allow this partial model to be used
for doors that can be open or closed as a function of an input signal.
Extends from Buildings.Airflow.Multizone.BaseClasses.TwoWayFlowElement (Flow resistance that uses the power law).
Type | Name | Default | Description |
---|---|---|---|
Boolean | forceErrorControlOnFlow | true | Flag to force error control on m_flow. Set to true if interested in flow rate |
replaceable package Medium | PartialMedium | ||
Velocity | vZer | 0.001 | Minimum velocity to prevent zero flow. Recommended: 0.001 [m/s] |
Initialization | |||
MassFlowRate | m1_flow.start | 0 | Mass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction) [kg/s] |
Pressure | dp1.start | 0 | Pressure difference between port_a1 and port_b1 [Pa] |
MassFlowRate | m2_flow.start | 0 | Mass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction) [kg/s] |
Pressure | dp2.start | 0 | Pressure difference between port_a2 and port_b2 [Pa] |
Density | rho_a1_inflow.start | 1.2 | Density of air flowing in from port_a1 [kg/m3] |
Density | rho_a2_inflow.start | 1.2 | Density of air flowing in from port_a2 [kg/m3] |
Geometry | |||
Length | wOpe | 0.9 | Width of opening [m] |
Length | hOpe | 2.1 | Height of opening [m] |
Length | hA | 2.7/2 | Height of reference pressure zone A [m] |
Length | hB | 2.7/2 | Height of reference pressure zone B [m] |
Initialization | |||
SpecificEnthalpy | h_outflow_a1_start | Medium1.h_default | Start value for enthalpy flowing out of port a1 [J/kg] |
SpecificEnthalpy | h_outflow_b1_start | Medium1.h_default | Start value for enthalpy flowing out of port b1 [J/kg] |
SpecificEnthalpy | h_outflow_a2_start | Medium2.h_default | Start value for enthalpy flowing out of port a2 [J/kg] |
SpecificEnthalpy | h_outflow_b2_start | Medium2.h_default | Start value for enthalpy flowing out of port b2 [J/kg] |
Advanced | |||
MassFlowRate | m1_flow_small | 1E-4*m1_flow_nominal | Small mass flow rate for regularization of zero flow [kg/s] |
MassFlowRate | m2_flow_small | 1E-4*m2_flow_nominal | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics | |||
Boolean | show_V_flow | false | = true, if volume flow rate at inflowing port is computed |
Boolean | show_T | false | = true, if actual temperature at port is computed (may lead to events) |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a1 | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_a2 | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
partial model TwoWayFlowElementBuoyancy "Flow resistance that uses the power law" extends Buildings.Airflow.Multizone.BaseClasses.TwoWayFlowElement; parameter Modelica.SIunits.Length wOpe=0.9 "|Geometry|Width of opening"; parameter Modelica.SIunits.Length hOpe=2.1 "|Geometry|Height of opening"; parameter Modelica.SIunits.Length hA=2.7/2 "|Geometry|Height of reference pressure zone A"; parameter Modelica.SIunits.Length hB=2.7/2 "|Geometry|Height of reference pressure zone B";end TwoWayFlowElementBuoyancy;
This is a partial model for computing the air exchange between volumes.
Models that extend this model need to provide an equation for
port_a1.m_flow
and port_a2.m_flow
.
Extends from Buildings.Fluid.Interfaces.PartialStaticFourPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Airflow.Multizone.BaseClasses.ErrorControl (Interface that defines parameters for error control).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium1 | PartialMedium | Medium 1 in the component | |
replaceable package Medium2 | PartialMedium | Medium 2 in the component | |
Boolean | forceErrorControlOnFlow | true | Flag to force error control on m_flow. Set to true if interested in flow rate |
Nominal condition | |||
MassFlowRate | m1_flow_nominal | 10/3600*1.2 | Nominal mass flow rate [kg/s] |
MassFlowRate | m2_flow_nominal | m1_flow_nominal | Nominal mass flow rate [kg/s] |
Initialization | |||
MassFlowRate | m1_flow.start | 0 | Mass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction) [kg/s] |
Pressure | dp1.start | 0 | Pressure difference between port_a1 and port_b1 [Pa] |
MassFlowRate | m2_flow.start | 0 | Mass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction) [kg/s] |
Pressure | dp2.start | 0 | Pressure difference between port_a2 and port_b2 [Pa] |
Assumptions | |||
Boolean | allowFlowReversal1 | false | = true to allow flow reversal in medium 1, false restricts to design direction (port_a -> port_b) |
Boolean | allowFlowReversal2 | false | = true to allow flow reversal in medium 2, false restricts to design direction (port_a -> port_b) |
Initialization | |||
SpecificEnthalpy | h_outflow_a1_start | Medium1.h_default | Start value for enthalpy flowing out of port a1 [J/kg] |
SpecificEnthalpy | h_outflow_b1_start | Medium1.h_default | Start value for enthalpy flowing out of port b1 [J/kg] |
SpecificEnthalpy | h_outflow_a2_start | Medium2.h_default | Start value for enthalpy flowing out of port a2 [J/kg] |
SpecificEnthalpy | h_outflow_b2_start | Medium2.h_default | Start value for enthalpy flowing out of port b2 [J/kg] |
Advanced | |||
MassFlowRate | m1_flow_small | 1E-4*m1_flow_nominal | Small mass flow rate for regularization of zero flow [kg/s] |
MassFlowRate | m2_flow_small | 1E-4*m2_flow_nominal | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics | |||
Boolean | show_V_flow | false | = true, if volume flow rate at inflowing port is computed |
Boolean | show_T | false | = true, if actual temperature at port is computed (may lead to events) |
Type | Name | Description |
---|---|---|
replaceable package Medium1 | Medium 1 in the component | |
replaceable package Medium2 | Medium 2 in the component | |
FluidPort_a | port_a1 | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_a2 | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
partial model ZonalFlow "Flow across zonal boundaries of a room" extends Buildings.Fluid.Interfaces.PartialStaticFourPortInterface( redeclare final package Medium1 = Medium, redeclare final package Medium2 = Medium, final allowFlowReversal1 = false, final allowFlowReversal2 = false, final m1_flow_nominal = 10/3600*1.2, final m2_flow_nominal = m1_flow_nominal); extends Buildings.Airflow.Multizone.BaseClasses.ErrorControl; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium; equation // Energy balance (no storage, no heat loss/gain) port_a1.h_outflow = inStream(port_b1.h_outflow); port_b1.h_outflow = inStream(port_a1.h_outflow); port_a2.h_outflow = inStream(port_b2.h_outflow); port_b2.h_outflow = inStream(port_a2.h_outflow); // Mass balance (no storage) port_a1.m_flow = -port_b1.m_flow; port_a2.m_flow = -port_b2.m_flow; port_a1.Xi_outflow = inStream(port_b1.Xi_outflow); port_b1.Xi_outflow = inStream(port_a1.Xi_outflow); port_a2.Xi_outflow = inStream(port_b2.Xi_outflow); port_b2.Xi_outflow = inStream(port_a2.Xi_outflow); // Transport of trace substances port_a1.C_outflow = inStream(port_b1.C_outflow); port_b1.C_outflow = inStream(port_a1.C_outflow); port_a2.C_outflow = inStream(port_b2.C_outflow); port_b2.C_outflow = inStream(port_a2.C_outflow);end ZonalFlow;
This is an interface that defines parameters used for error control.
Dymola does error control on state variables, such as temperature, pressure and
species concentration.
Flow variables such as m_flow
are typically not checked during the error control.
This can give large errors in flow variables, as long as the error on the volume's state variables
that are coupled to the flow variables is small.
Obtaining accurate flow variables can be achieved by imposing an error control
on the exchanged mass, which can be defined as
dm/dt = m_flow.By setting
enforceErrorControlOnFlow = true
, such an equation is imposed
by models that extend this class.
Type | Name | Default | Description |
---|---|---|---|
Boolean | forceErrorControlOnFlow | true | Flag to force error control on m_flow. Set to true if interested in flow rate |
model ErrorControl "Interface that defines parameters for error control" parameter Boolean forceErrorControlOnFlow = true "Flag to force error control on m_flow. Set to true if interested in flow rate";end ErrorControl;