LBL logo

Buildings.Fluid.UsersGuide

User's Guide

Information

The package Buildings.Fluid consists of models for pressure driven mass flow rate and for heat and moisture exchange in fluid flow networks.

The models have the same interface as models of the package Modelica.Fluid, but have in general a simpler set of parameters that may be better suited if the models are used in early design of building systems. For example, in addition to the detailed pipe model from Modelica.Fluid, this package also contains models for which a user has to specify the mass flow and pressure drop at a nominal flow rate, which is typically more readily available prior to the detailed HVAC system design.

Port variables

Component models of this package have fluid ports, which are a subclass of Modelica.Fluid.Interfaces.FluidPort. Fluid ports declare the variables listed in the table below.

Variable Description
m_flow Mass flow rate .
The convention is that m_flow ≥ 0 if at this port, mass flows into the component.
p Absolute total pressure p.
The absolute total pressure is the sum of the static pressure and the dynamic pressure. As the total pressure is used in the connector, components do not need to specify the area of the port or the velocity at the port. This convention is consistent with the Modelica Standard Library. Note that component models typically simplify the pressure balance by not taking into account the static pressure that is caused by the height of the medium column, i.e., the term Δp = Δh ρ g, where Δh is the height of the medium column, ρ is the mass density and g = 9.81 m/s2 is the gravity acceleration, is ignored.
h_outflow Specific enthalpy h of the outflowing fluid, i.e., assuming ṁ < 0.
The specific enthalpy in the fluid port always carries the value of the enthalpy that the medium would have if it was leaving the component. Users who need to access the actual enthalpy for the given flow direction can do so using the sensor Buildings.Fluid.Sensors.SpecificEnthalpyTwoPort.
Xi_outflow[Medium.nXi] Independent mixture mass fractions mi/m close to the connection point, i.e., assuming ṁ < 0.
The independent mixture mass fraction in the fluid port always carries the value that the medium would have if it was leaving the component. Users who need to access the actual value for the given flow direction can do so using the sensor Buildings.Fluid.Sensors.MassFractionTwoPort. Note that this variable is only present for fluids that are a mixture of different substances such as moist air. For water, this variable is automatically removed when a model is translated.
C_outflow[Medium.nC] Trace substances ci/m close to the connection point, i.e., assuming ṁ < 0.
The trace substances in the fluid port always carries the value that the medium would have if it was leaving the component. Users who need to access the actual value for the given flow direction can do so using the sensor Buildings.Fluid.Sensors.TraceSubstancesTwoPort. Note that this variable is only present for fluids that declare a trace substance such as CO2. See for example Buildings.Fluid.Sensors.Examples.TraceSubstances.

Computation of flow resistance

Most component models compute pressure drop as a function of flow rate. If their pressure drop at the nominal conditions is set to zero, for example by setting the parameter value dp_nominal=0, then the equation for the pressure drop is removed from the model. This allows, for example, to model a heating and a cooling coil in series, and lump their pressure drops into a single element, thereby reducing the dimension of the nonlinear system of equations.

The flow resistance is computed as

k = ṁ ⁄ √ Δp  

where is the mass flow rate and Δp is the pressure drop. For |ṁ| < δ0, where δ is equal to the parameter deltaM and 0 is the mass flow rate at the nominal operating point, as set by the parameter m_flow_nominal, the equation is linearized. The pressure drop is computed as a function of mass flow rate instead of volume flow rate as this often leads to fewer equations. Otherwise, the pressure drop would depend on the density and hence on temperature.

The flow coefficient k is typically computed based on nominal values for the mass flow rate and the pressure drop, i.e., k = ṁ0 ⁄ √ Δp0   . This functional form has been used as in building HVAC systems, a more exact computation of the pressure drop would require detailed knowledge of the duct or pipe dimensions and the flow bends and junctions. This information is often not available during early design. However, if a more detailed pressure drop calculation is required, then models from Modelica.Fluid can be used in conjunction with models from the Buildings library.

In actuators such as valves and air dampers, k is a function of the control signal.

Computation of mass and energy balance

Most models have parameters massDynamics and energyDynamics that allow using a dynamic or a steady-state equation for the mass and energy balance. The table below shows the different settings and how they affect the mass and energy balance equations. For the mass balance, the following configurations can be selected:

Parameter Initialization problem
If density depends on pressure
Initialization problem
If density is independent of pressure
Equation used during time integration
DynamicsFreeInitial Unspecified Unspecified dm(t)/dt = ∑ ṁ(t)
FixedInitial p(0)=p0 Unspecified dm(t)/dt = ∑ ṁ(t)
SteadyStateInitial dp(0)/dt Unspecified dm(t)/dt = ∑ ṁ(t)
SteadyState Unspecified Unspecified 0 = ∑ ṁ(t)

where m(t) is the mass of the control volume, ṁ(t) is the mass flow rate, p is the pressure and p0 is the initial pressure, which is a parameter. Unspecified means that no equation is declared for p(0). In this situation, there can be two cases:

  1. If a system model sets the pressure, such as if the volume is connected to a model that sets the pressure, e.g., Buildings.Fluid.Sources.FixedBoundary, then due to the connection between the models, the pressure of the volume is the same as the pressure of the model for the boundary condition.
  2. If a system model does not set the pressure, then the pressure starts at the value set by p(start=Medium.p_default), where Medium is the medium model.

Similarly, for the energy balance, the following configurations can be selected:

Parameter Initialization problem Equation used during time integration
DynamicsFreeInitial Unspecified dU(t)/dt = ∑ ṁ(t)   h(t) + Q̇(t)
FixedInitial T(0)=T0 dU(t)/dt = ∑ ṁ(t)   h(t) + Q̇(t)
SteadyStateInitial dT(0)/dt=0 dU(t)/dt = ∑ ṁ(t)   h(t) + Q̇(t)
SteadyState Unspecified 0 = ∑ ṁ(t)   h(t) + Q̇(t)

where U(t) is the internal energy of the control volume, h(t) is the enthalpy carried by the medium and Q̇(t) is the heat flow rate that is added to the medium through the heat port. Unspecified means that no equation is declared for T(0). In this situation, there can be two cases:

  1. If a system model sets the temperature, such as if the heat port of the volume is connected to a fixed temperature, then T(0) of the volume would be equal to the temperature connected to this port.
  2. If a system model does not set the temperature, then the temperature starts at the value T(start=Medium.T_default), where Medium is the medium model

In most models, the size of volume is configured using the parameter tau. This parameter is equal to the time constant that the volume has if the mass flow rate is at its nominal value, as set by the parameter m_flow_nominal. Using the time constant, as opposed to the actual fluid volume, allows in many cases an easier parametrization, since the volume is automatically enlarged if the nominal mass flow rate is increased. This allows an easy adjustment of the component size. The actual size of the control volume is then set as

V = ṁ0 τ/ρ0

where 0 is the nominal mass flow rate, τ is the time constant, and ρ0 is the mass density at the nominal condition.

Nominal values

Most components have a parameters for the nominal operating conditions. These parameters have names that end in _nominal and they should be set to the values that the component typically have if they are run at full load or design conditions. Depending on the model, these parameters are used differently, and the respective model documentation or code should be consulted for details. However, the table below shows typical use of parameters in various model to help the user understand how they are used.

Parameter Model Functionality
m_flow_nominal
dp_nominal
Flow resistance models These parameter may be used to define a point on the flow rate versus pressure drop curve. For other mass flow rates, the pressure drop is typically adjusted using similarity laws. See Buildings.Fluid.FixedResistances.FixedResistanceDpM.
m_flow_nominal
m_flow_small
Sensors
Volumes
Heat exchangers
Chillers
Some of these models set m_flow_small=1E-4*abs(m_flow_nominal) as the default value. Then, m_flow_small is used to regularize, or replace, equations when the mass flow rate is smaller than m_flow_small in magnitude. This is needed to improve the numerical properties of the model. The error in the results is for typical applications negligible, because at flow rates below 0.01% from the design flow rate, most model assumptions are not applicable anyways, and the HVAC system is not operated in this region. However, because Modelica simulates in the continuous-time domain, such small flow rates can occur, and therefore models are implemented in such a way that they are numerically well-behaved for zero or near-zero flow rates.
tau
m_flow_nominal
Sensors
Volumes
Heat exchangers
Chillers
Because Modelica simulates in the continuous-time domain, dynamic models are in general numerically more efficient than steady-state models. However, dynamic models require product data that are generally not published by manufacturers. Examples include the volume of fluid that is contained in a device, and the weight of heat exchangers. In addition, other effects such as transport delays in pipes and heat exchangers of a chiller are generally unknown and require detailed geometry that is typically not available during the design stage.
To circumvent this problem, many models take as a parameter the time constant tau and lump all its thermal mass into a fluid volume. The time constant tau can be understood as the time constant that one would observe if the input to the component has a step change, and the mass flow rate of the component is equal to m_flow_nominal. Using these two values and the fluid density rho, components adjust their fluid volume V=m_flow_nominal tau/rho because having such a volume gives the specified time response. For most components, engineering experience can be used to estimate a reasonable value for tau, and where generally applicable values can be used, components already set a default value for tau. See for example Buildings.Fluid.HeatExchangers.WetCoilDiscretized.

Implementation

The models are implemented using base classes from Buildings.Fluid.Interfaces and from Modelica.Fluid.Interfaces. This allows models to be fully compatible with Modelica.Fluid, and it allows the implementation of component models that reuse base classes for heat transfer, mass transfer and flow resistance.

Extends from Modelica.Icons.Information (Icon for general information packages).


http://simulationresearch.lbl.gov/modelica