modelDC_Example

Example of a simple district heating grid of active producer and direct consumer

Extends from dhcSim.DHC.Networks.BaseClasses.BaseGrid (Base class for grid module).

Parameters

TypeNameDefaultDescription
IntegernLev (from LumpedMultiVolumeDeclarations)2Number of grid levels
Medium.SpecificEnthalpyh_start (from LumpedMultiVolumeDeclarations)Medium.specificEnthalpy(state = Medium.setState_pTX(p = p_start, T = T_start, X = X_start))
IntegernMix (from BaseGrid)Number of mixing connection points
IntegernPip (from BaseGrid)Number of pipes
Modelica.SIunits.PressurepAbs (from BaseGrid)p_start[1]Absolute pressure level of grid in pressure point
IntegernSeg (from BaseGrid)fill(1, nPip)Number of volume segments
Modelica.SIunits.Lengthdiameter (from BaseGrid)fill(0.1, nPip, nLev)Pipe diameter
Modelica.SIunits.Lengthlength (from BaseGrid)fill(10, nPip)Length of the pipe
Modelica.SIunits.Velocityv_nominal_pip (from BaseGrid)fill(2, nPip, nLev)Velocity at m_flow_nominal (used to compute default diameter)
Modelica.SIunits.PressureDifferencedp_fixed_nominal_pip (from BaseGrid)zeros(nPip, nLev)Additional nominal pressure drop of pipes
Modelica.SIunits.Lengthroughness (from BaseGrid)2.5e-5Absolute roughness of pipe, with a default for a smooth steel pipe (dummy if use_roughness = false)
Modelica.SIunits.PressureDifferencedp_nominal_pip (from BaseGrid)fill(10, nPip, nLev)Pressure difference
Modelica.SIunits.MassFlowRatem_flow_nominal_pip (from BaseGrid)fill(1, nPip, nLev)Pressure difference
Integer[nMix]MixNPrt (from BaseGrid)ones(nMix)Number of connection ports for each mixing volume
Modelica.SIunits.MassFlowRatem_flow_nominal_conPoi (from BaseGrid)1Nominal mass flow rate for connection points
Modelica.SIunits.Timetau (from BaseGrid)10Time constant at nominal flow for dynamic energy and momentum balance
IntegernPro1Number of producer
IntegernCon5Number of consumer
StringfileNameConfill(gp("modelica://dhcSim/Resources/LoadProf/default/consumerNom.txt"), nCon)
Dynamics › Equations
Modelica.Fluid.Types.DynamicsenergyDynamics (from LumpedMultiVolumeDeclarations)Modelica.Fluid.Types.Dynamics.DynamicFreeInitialType of energy balance: dynamic (3 initialization options) or steady state
Modelica.Fluid.Types.DynamicsmassDynamics (from LumpedMultiVolumeDeclarations)energyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
Modelica.Fluid.Types.DynamicssubstanceDynamics (from LumpedMultiVolumeDeclarations)energyDynamicsType of independent mass fraction balance: dynamic (3 initialization options) or steady state
Modelica.Fluid.Types.DynamicstraceDynamics (from LumpedMultiVolumeDeclarations)energyDynamicsType of trace substance balance: dynamic (3 initialization options) or steady state
Initialization
Modelica.SIunits.AbsolutePressurep_start (from LumpedMultiVolumeDeclarations)fill(Medium.p_default, nLev)Start value of pressure
Modelica.SIunits.TemperatureT_start (from LumpedMultiVolumeDeclarations)fill(Medium.T_default, nLev)Start value of temperature
Medium.MassFractionX_start (from LumpedMultiVolumeDeclarations)fill(Medium.X_default, nLev)Start value of mass fractions m_i/m
Medium.ExtraPropertyC_start (from LumpedMultiVolumeDeclarations)fill(0, nLev, Medium.nC)Start value of trace substances
Medium.ExtraPropertyC_nominal (from LumpedMultiVolumeDeclarations)fill(1E-2, nLev, Medium.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Dynamics
RealmSenFac (from LumpedMultiVolumeDeclarations)1Factor for scaling the sensible thermal mass of the volume
Pressure drop
dhcSim.DHC.Submodules.TwoPortModules.Pipe.Types.dpTypesdpType (from BaseGrid)dhcSim.DHC.Submodules.TwoPortModules.Pipe.Types.dpTypes.dp_nominalDefine pressure drop calculation
Assumptions
BooleanallowFlowReversal (from BaseGrid)true= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Advanced
Medium.MassFlowRatem_flow_small_pip (from BaseGrid)1E-4.*abs(m_flow_nominal_pip)Small mass flow rate for regularization of zero flow
Advanced › Diagnostics
Booleanshow_T (from BaseGrid)false= true, if actual temperature at port is computed
Flow resistance
RealReC (from BaseGrid)4000Reynolds number where transition to turbulent starts
Booleanfrom_dp (from BaseGrid)false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance (from BaseGrid)false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM (from BaseGrid)0.1Fraction of nominal flow rate where flow transitions to laminar
Heat losses
Modelica.SIunits.LengthdisPip (from BaseGrid)10Fictive pipe distance, used to calculate fictive Resistance
Modelica.SIunits.LengthuniWidth (from BaseGrid)1Universal width
Initialization › Heat losses
Modelica.SIunits.TemperatureT_surf_a_start (from BaseGrid)293.15Initial temperature at surf_a, used if steadyStateInitial = false
Modelica.SIunits.TemperatureT_surf_b_start (from BaseGrid)283.15Initial temperature at surf_b, used if steadyStateInitial = false

Components

TypeNameDefaultDescription
Buildings.Fluid.Storage.ExpansionVesselexpansionVessel (from BaseGrid)
dhcSim.Fluid.Delays.MultipleDelaysmix (from BaseGrid)
dhcSim.DHC.Submodules.MultiPortModules.Pipe.AdiabatePipepipe (from BaseGrid)
dhcSim.DHC.Submodules.MultiPortModules.DistrictCooling.Producer.DC_ActiveDirectProducerpro
dhcSim.DHC.Submodules.MultiPortModules.DistrictCooling.Consumer.DC_DirectConsumercon
Modelica.Blocks.Sources.RealExpressionrealExpression1