Buildings.ThermalZones.ReducedOrder.RC.BaseClasses

Package with base classes for ROM

Information

This packages contains base clases for ROM models.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.ExteriorWall ExteriorWall Exterior wall consisting of variable number of RC elements
Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.InteriorWall InteriorWall Interior wall consisting of variable number of RC elements
Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.ThermSplitter ThermSplitter A simple model which weights a given set of thermal inputs to calculate an average temperature and aggregated heat flow per output
Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.splitFacVal splitFacVal Share of vector entries at sum of vector for multiple vectors

Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.ExteriorWall Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.ExteriorWall

Exterior wall consisting of variable number of RC elements

Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.ExteriorWall

Information

ExteriorWall represents heat conduction and heat storage within walls. It links a variable number n of thermal resistances and capacities to a series connection. n thus defines the spatial discretization of thermal effects within the wall. All effects are considered as one-dimensional normal to the wall's surface. This model is thought for exterior wall elements that contribute to heat transfer to the outdoor. The RC-chain is defined via a vector of capacities CExt[n] and a vector of resistances RExt[n]. Resistances and capacities are connected alternately, starting with the first resistance RExt[1], from heat port_a to heat port_b. RExtRem is the resistance between the last capacity CExt[end] and the heat port_b.

image

Parameters

TypeNameDefaultDescription
Integern Number of RC-elements
Thermal mass
ThermalResistanceRExt[n] Vector of resistors, from port_a to port_b [K/W]
ThermalResistanceRExtRem Resistance of remaining resistor RExtRem between capacitor n and port_b [K/W]
HeatCapacityCExt[n] Vector of heat capacities, from port_a to port_b [J/K]
TemperatureT_start Initial temperature of capacities [K]

Connectors

TypeNameDescription
HeatPort_aport_ainterior port
HeatPort_bport_bexterior port

Modelica definition

model ExteriorWall "Exterior wall consisting of variable number of RC elements" parameter Integer n(min = 1) "Number of RC-elements"; parameter Modelica.Units.SI.ThermalResistance RExt[n](each min=Modelica.Constants.small) "Vector of resistors, from port_a to port_b"; parameter Modelica.Units.SI.ThermalResistance RExtRem(min=Modelica.Constants.small) "Resistance of remaining resistor RExtRem between capacitor n and port_b"; parameter Modelica.Units.SI.HeatCapacity CExt[n](each min=Modelica.Constants.small) "Vector of heat capacities, from port_a to port_b"; parameter Modelica.Units.SI.Temperature T_start "Initial temperature of capacities"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_a "interior port"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port_b "exterior port"; Modelica.Thermal.HeatTransfer.Components.HeatCapacitor thermCapExt[n]( final C=CExt, each T(start=T_start)) "vector of thermal capacitors"; protected Modelica.Thermal.HeatTransfer.Components.ThermalResistor thermResExt[n]( final R=RExt) "vector of thermal resistors connecting port_a and capacitors"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor thermResExtRem( final R=RExtRem) "single thermal resistor connecting least capacitor to port_b"; equation // Connecting inner elements thermResExt[i]--thermCapExt[i] to n groups for i in 1:n loop connect(thermResExt[i].port_b,thermCapExt[i].port); end for; // Connecting groups between each other thermCapExt[i] -- thermResExt[i+1] for i in 1:n-1 loop connect(thermCapExt[i].port,thermResExt[i+1].port_a); end for; // Connecting first RC element to port_a , // last RC-element to RExtRem and RExtRem to port_b connect(port_a,thermResExt[1].port_a); connect(thermCapExt[n].port,thermResExtRem.port_a); connect(thermResExtRem.port_b, port_b); end ExteriorWall;

Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.InteriorWall Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.InteriorWall

Interior wall consisting of variable number of RC elements

Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.InteriorWall

Information

InteriorWall represents heat storage within walls. It links a variable number n of thermal resistances and capacities to a series connection. n thus defines the spatial discretization of thermal effects within the wall. All effects are considered as one-dimensional normal to the wall's surface. This model is thought for interior wall elements that only serve as heat storage elements. The RC-chain is defined via a vector of capacities CInt[n] and a vector of resistances RInt[n]. Resistances and capacities are connected alternately, starting with the first resistance RInt[1], from heat port_a into the wall.

image

Parameters

TypeNameDefaultDescription
Integern Number of RC-elements
Thermal mass
ThermalResistanceRInt[n] Vector of resistors, from port to capacitor [K/W]
HeatCapacityCInt[n] Vector of heat capacitors, from port to center [J/K]
TemperatureT_start Initial temperature of capacities [K]

Connectors

TypeNameDescription
HeatPort_aport_ainterior port

Modelica definition

model InteriorWall "Interior wall consisting of variable number of RC elements" parameter Integer n(min = 1) "Number of RC-elements"; parameter Modelica.Units.SI.ThermalResistance RInt[n](each min=Modelica.Constants.small) "Vector of resistors, from port to capacitor"; parameter Modelica.Units.SI.HeatCapacity CInt[n](each min=Modelica.Constants.small) "Vector of heat capacitors, from port to center"; parameter Modelica.Units.SI.Temperature T_start "Initial temperature of capacities"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_a "interior port"; Modelica.Thermal.HeatTransfer.Components.HeatCapacitor thermCapInt[n]( final C=CInt, each T(start=T_start)) "vector of capacitors"; protected Modelica.Thermal.HeatTransfer.Components.ThermalResistor thermResInt[n]( final R=RInt) "vector of resistors connecting port and capacitors"; equation // Connecting inner elements thermResInt[i]--thermCapInt[i] to n groups for i in 1:n loop connect(thermResInt[i].port_b,thermCapInt[i].port); end for; // Connecting groups between each other thermCapInt[i] -- thermResInt[i+1] for i in 1:n-1 loop connect(thermCapInt[i].port,thermResInt[i+1].port_a); end for; // Connecting first RC element to port_a port_a--thermResInt[1] connect(port_a,thermResInt[1].port_a); end InteriorWall;

Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.ThermSplitter Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.ThermSplitter

A simple model which weights a given set of thermal inputs to calculate an average temperature and aggregated heat flow per output

Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.ThermSplitter

Information

This model is used to weight thermal ports (inputs) according to given split factors per output port.

The model needs the dimensions of the splitted therm ports (for input and output ports resp.) and the split factors, which are between 0 and 1. Each row of the split factor matrix gives the split factors for one output port. The number of columns need to align with the number of input ports.

Parameters

TypeNameDefaultDescription
IntegernOut Number of splitter outputs
IntegernIn Number of splitter inputs
RealsplitFactor[nOut, nIn]fill(1/nOut, nOut, nIn)Matrix of split factor for outputs (between 0 and 1 for each row)

Connectors

TypeNameDescription
HeatPort_aportIn[nIn]Single thermal input
HeatPort_aportOut[nOut]Set of thermal outputs

Modelica definition

model ThermSplitter "A simple model which weights a given set of thermal inputs to calculate an average temperature and aggregated heat flow per output" parameter Integer nOut "Number of splitter outputs"; parameter Integer nIn "Number of splitter inputs"; parameter Real splitFactor[nOut, nIn]= fill(1/nOut, nOut, nIn) "Matrix of split factor for outputs (between 0 and 1 for each row)"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a portIn[nIn] "Single thermal input"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a portOut[nOut] "Set of thermal outputs"; equation portOut.Q_flow = - portIn.Q_flow * transpose(splitFactor) "Connecting the output vector according to desired dimension"; portIn.T = portOut.T * splitFactor "Equivalent building temperature rerouted to SignalInput"; end ThermSplitter;

Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.splitFacVal Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.splitFacVal

Share of vector entries at sum of vector for multiple vectors

Information

Calculates the ratio of the surface areas of a wall to the total wall area, unless the area is zero. It subtracts the wall area AExt for first entry in AArray and AWin for second entry in AArray unless AArray[1] and/or AArray[2] are not zero. This is done separately for each orientation. Consequently, the function gives an nRow x nCol array back as output. Each row stands for one area in AArray and each column for one orientation in AExt and AWin. The function is used to calculate the split factors for Buildings.ThermalZones.ReducedOrder.RC.BaseClasses.ThermSplitter.

For internal gains, the calculation is:

SplitFaci = AArray[i] /ATot

whereby ATot is the sum of AArray. To perform this, AExt and AWin can just be set to vectors of zeros with length 1. For solar radiation through windows, the window and wall area with the same orientation as the incoming radiation should be subtracted as these areas cannot be hit by the radiation. This needs to be done separately for each orientation and for exterior walls and windows only, according to:

SplitFaci,k = (AArray[i] - AExt[k]) /(ATot - AExt[k] -AWin[k])

and

SplitFaci,k = (AArray[i] - AWin[k]) /(ATot - AExt[k] - AWin[k])

respectively. For all other walls, the equation is:

SplitFaci,k = AArray[i] /(ATot - AExt[k] - AWin[k])

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

TypeNameDefaultDescription
IntegernRow Number of rows
IntegernCol Number of columns
AreaAArray[:] Vector of areas [m2]
AreaAExt[nCol] Vector of exterior wall areas [m2]
AreaAWin[nCol] Vector of window areas [m2]

Outputs

TypeNameDescription
RealsplitFacValues[nRow, nCol]Split factor values for ThermSplitter

Modelica definition

function splitFacVal "Share of vector entries at sum of vector for multiple vectors" extends Modelica.Icons.Function; input Integer nRow "Number of rows"; input Integer nCol "Number of columns"; input Modelica.Units.SI.Area[:] AArray "Vector of areas"; input Modelica.Units.SI.Area[nCol] AExt "Vector of exterior wall areas"; input Modelica.Units.SI.Area[nCol] AWin "Vector of window areas"; output Real[nRow,nCol] splitFacValues "Split factor values for ThermSplitter"; protected Modelica.Units.SI.Area ATot=sum(AArray) "Total area"; Integer j=1 "Row counter"; Integer k=1 "Column counter"; Integer l=1 "AArray counter"; algorithm for A in AArray loop if A > 0 then k :=1; if l == 1 then for AWall in AExt loop splitFacValues[j,k] :=(A-AWall)/(ATot-AWall-AWin[k]); k := k + 1; end for; elseif l == 2 then for AWall in AExt loop splitFacValues[j,k] :=(A-AWin[k])/(ATot-AWall-AWin[k]); k := k + 1; end for; else for AWall in AExt loop splitFacValues[j,k] :=A/(ATot-AWall-AWin[k]); k := k + 1; end for; end if; j :=j + 1; end if; l :=l + 1; end for; end splitFacVal;