Buildings.Obsolete.Fluid.FixedResistances

Package with models for fixed flow resistances

Information

This package contains component models for fixed flow resistances.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Obsolete.Fluid.FixedResistances.PlugFlowPipe PlugFlowPipe Pipe model using spatialDistribution for temperature delay
Buildings.Obsolete.Fluid.FixedResistances.BaseClasses BaseClasses  

Buildings.Obsolete.Fluid.FixedResistances.PlugFlowPipe Buildings.Obsolete.Fluid.FixedResistances.PlugFlowPipe

Pipe model using spatialDistribution for temperature delay

Buildings.Obsolete.Fluid.FixedResistances.PlugFlowPipe

Information

Pipe with heat loss using the time delay based heat losses and transport of the fluid using a plug flow model, applicable for simulation of long pipes such as in district heating and cooling systems.

This model takes into account transport delay along the pipe length idealized as a plug flow. The model also includes thermal inertia of the pipe wall.

Implementation

Heat losses are implemented by Buildings.Fluid.FixedResistances.BaseClasses.PlugFlowHeatLoss at each end of the pipe (see Buildings.Obsolete.Fluid.FixedResistances.BaseClasses.PlugFlowCore). Depending on the flow direction, the temperature difference due to heat losses is subtracted at the right fluid port.

The pressure drop is implemented using Buildings.Fluid.FixedResistances.HydraulicDiameter.

The thermal capacity of the pipe wall is implemented as a mixing volume of the fluid in the pipe, of which the thermal capacity is equal to that of the pipe wall material. In addition, this mixing volume allows the hydraulic separation of subsequent pipes. Thanks to the vectorized implementation of the (design) outlet port, splits and junctions of pipes can be handled in a numerically efficient way.
This mixing volume is not present in the PlugFlowCore model, which can be used in cases where mixing volumes at pipe junctions need to be added manually.

Assumptions

References

Full details on the model implementation and experimental validation can be found in:

van der Heijde, B., Fuchs, M., Ribas Tugores, C., Schweiger, G., Sartor, K., Basciotti, D., Müller, D., Nytsch-Geusen, C., Wetter, M. and Helsen, L. (2017).
Dynamic equation-based thermo-hydraulic pipe model for district heating and cooling systems.
Energy Conversion and Management, vol. 151, p. 158-169. doi: 10.1016/j.enconman.2017.08.072.

Extends from Buildings.Obsolete.BaseClasses.ObsoleteModel (Icon for classes that are obsolete and will be removed in later versions), Buildings.Fluid.Interfaces.PartialTwoPortVector (Partial component with two ports, one of which being vectorized).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
RealReC4000Reynolds number where transition to turbulence starts
Realfac1Factor to take into account flow resistance of bends etc., fac=dp_nominal/dpStraightPipe_nominal
Material
Lengthdhsqrt(4*m_flow_nominal/rho_de...Hydraulic diameter (assuming a round cross section area) [m]
Heightroughness2.5e-5Average height of surface asperities (default: smooth steel pipe) [m]
Lengthlength Pipe length [m]
SpecificHeatCapacitycPip2300Specific heat of pipe wall material. 2300 for PE, 500 for steel [J/(kg.K)]
DensityrhoPip930Density of pipe wall material. 930 for PE, 8000 for steel [kg/m3]
Lengththickness0.0035Pipe wall thickness [m]
Nominal condition
Velocityv_nominal1.5Velocity at m_flow_nominal (used to compute default value for hydraulic diameter dh) [m/s]
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Thermal resistance
LengthdIns Thickness of pipe insulation, used to compute R [m]
ThermalConductivitykIns Heat conductivity of pipe insulation, used to compute R [W/(m.K)]
RealR1/(kIns*2*Modelica.Constants...Thermal resistance per unit length from fluid to boundary temperature [(m.K)/W]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Initialization
TemperatureT_start_inMedium.T_defaultInitialization temperature at pipe inlet [K]
TemperatureT_start_outT_start_inInitialization temperature at pipe outlet [K]
BooleaninitDelayfalseInitialize delay for a constant mass flow rate if true, otherwise start from 0
MassFlowRatem_flow_start0Initial value of mass flow rate through pipe [kg/s]

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to ports_b)
FluidPorts_bports_b[nPorts]Fluid connectors b (positive design flow direction is from port_a to ports_b)
HeatPort_aheatPortHeat transfer to or from surroundings (heat loss from pipe results in a positive heat flow)

Modelica definition

model PlugFlowPipe "Pipe model using spatialDistribution for temperature delay" extends Buildings.Obsolete.BaseClasses.ObsoleteModel; extends Buildings.Fluid.Interfaces.PartialTwoPortVector; constant Boolean homotopyInitialization = true "= true, use homotopy method"; parameter Boolean from_dp=false "= true, use m_flow = f(dp) else dp = f(m_flow)"; parameter Modelica.Units.SI.Length dh=sqrt(4*m_flow_nominal/rho_default/ v_nominal/Modelica.Constants.pi) "Hydraulic diameter (assuming a round cross section area)"; parameter Modelica.Units.SI.Velocity v_nominal=1.5 "Velocity at m_flow_nominal (used to compute default value for hydraulic diameter dh)"; parameter Real ReC=4000 "Reynolds number where transition to turbulence starts"; parameter Modelica.Units.SI.Height roughness=2.5e-5 "Average height of surface asperities (default: smooth steel pipe)"; parameter Modelica.Units.SI.Length length "Pipe length"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal "Nominal mass flow rate"; parameter Modelica.Units.SI.MassFlowRate m_flow_small=1E-4*abs(m_flow_nominal) "Small mass flow rate for regularization of zero flow"; parameter Modelica.Units.SI.Length dIns "Thickness of pipe insulation, used to compute R"; parameter Modelica.Units.SI.ThermalConductivity kIns "Heat conductivity of pipe insulation, used to compute R"; parameter Modelica.Units.SI.SpecificHeatCapacity cPip=2300 "Specific heat of pipe wall material. 2300 for PE, 500 for steel"; parameter Modelica.Units.SI.Density rhoPip(displayUnit="kg/m3") = 930 "Density of pipe wall material. 930 for PE, 8000 for steel"; parameter Modelica.Units.SI.Length thickness=0.0035 "Pipe wall thickness"; parameter Modelica.Units.SI.Temperature T_start_in(start=Medium.T_default) = Medium.T_default "Initialization temperature at pipe inlet"; parameter Modelica.Units.SI.Temperature T_start_out(start=Medium.T_default) = T_start_in "Initialization temperature at pipe outlet"; parameter Boolean initDelay = false "Initialize delay for a constant mass flow rate if true, otherwise start from 0"; parameter Modelica.Units.SI.MassFlowRate m_flow_start=0 "Initial value of mass flow rate through pipe"; parameter Real R(unit="(m.K)/W")=1/(kIns*2*Modelica.Constants.pi/ Modelica.Math.log((dh/2 + thickness + dIns)/(dh/2 + thickness))) "Thermal resistance per unit length from fluid to boundary temperature"; parameter Real fac=1 "Factor to take into account flow resistance of bends etc., fac=dp_nominal/dpStraightPipe_nominal"; parameter Boolean linearized = false "= true, use linear relation between m_flow and dp for any flow rate"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort "Heat transfer to or from surroundings (heat loss from pipe results in a positive heat flow)"; Buildings.Obsolete.Fluid.FixedResistances.BaseClasses.PlugFlowCore cor( redeclare final package Medium = Medium, final dh=dh, final v_nominal=v_nominal, final length=length, final C=C, final R=R, final m_flow_small=m_flow_small, final m_flow_nominal=m_flow_nominal, final T_start_in=T_start_in, final T_start_out=T_start_out, final m_flow_start=m_flow_start, final initDelay=initDelay, final from_dp=from_dp, final fac=fac, final ReC=ReC, final thickness=thickness, final roughness=roughness, final allowFlowReversal=allowFlowReversal, final homotopyInitialization=homotopyInitialization, final linearized=linearized) "Describing the pipe behavior"; // In the volume, below, we scale down V and use // mSenFac. Otherwise, for air, we would get very large volumes // which affect the delay of water vapor and contaminants. // See also Buildings.Fluid.FixedResistances.Validation.PlugFlowPipes.TransportWaterAir // for why mSenFac is 10 and not 1000, as this gives more reasonable // temperature step response Buildings.Fluid.MixingVolumes.MixingVolume vol( redeclare final package Medium = Medium, final m_flow_nominal=m_flow_nominal, final V=if rho_default > 500 then VEqu else VEqu/1000, final nPorts=nPorts + 1, final T_start=T_start_out, final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, final mSenFac=if rho_default > 500 then 1 else 10) "Control volume connected to ports_b. Represents equivalent pipe wall thermal capacity."; protected parameter Modelica.Units.SI.HeatCapacity CPip=length*((dh + 2*thickness)^2 - dh^2)*Modelica.Constants.pi/4*cPip*rhoPip "Heat capacity of pipe wall"; final parameter Modelica.Units.SI.Volume VEqu=CPip/(rho_default*cp_default) "Equivalent water volume to represent pipe wall thermal inertia"; parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( T=Medium.T_default, p=Medium.p_default, X=Medium.X_default) "Default medium state"; parameter Modelica.Units.SI.SpecificHeatCapacity cp_default= Medium.specificHeatCapacityCp(state=sta_default) "Heat capacity of medium"; parameter Real C(unit="J/(K.m)")= rho_default*Modelica.Constants.pi*(dh/2)^2*cp_default "Thermal capacity per unit length of water in pipe"; parameter Modelica.Units.SI.Density rho_default=Medium.density_pTX( p=Medium.p_default, T=Medium.T_default, X=Medium.X_default) "Default density (e.g., rho_liquidWater = 995, rho_air = 1.2)"; initial equation assert(homotopyInitialization, "In " + getInstanceName() + ": The constant homotopyInitialization has been modified from its default value. This constant will be removed in future releases.", level = AssertionLevel.warning); equation for i in 1:nPorts loop connect(vol.ports[i + 1], ports_b[i]); end for; connect(cor.heatPort, heatPort); connect(cor.port_b, vol.ports[1]); connect(cor.port_a, port_a); end PlugFlowPipe;