Buildings.Fluid.DXSystems.Heating.AirSource.Validation.BaseClasses
Baseclasses for validation models
Information
This package contains base classes that are used in the validation models.Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).
Package Content
Name | Description |
---|---|
PLRToPulse | Converts an input for part load ratio value into an enable signal |
SingleSpeedHeating | Baseclass for validation models for single speed DX heating coil |
Validation | Package with validation models for baseclasses |
Buildings.Fluid.DXSystems.Heating.AirSource.Validation.BaseClasses.PLRToPulse
Converts an input for part load ratio value into an enable signal
Information
This block calculates the time duration for which the DX coil needs to be kept enabled
based on the part-load ratio input signal uPLR
for the constant simulation
run period tPer
, and then generates an output enable signal
yEna
for that duration. Once the component has been kept enabled for
the calculated duration, the component is kept disabled until the start of the next period.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Real | tPer | 15*60 | Time period for PLR sampling |
Connectors
Type | Name | Description |
---|---|---|
input RealInput | uPLR | Part load ratio input |
output BooleanOutput | yEna | Component enable signal |
Modelica definition
block PLRToPulse
"Converts an input for part load ratio value into an enable signal"
parameter Real tPer = 15*60
"Time period for PLR sampling";
Buildings.Controls.OBC.CDL.Interfaces.RealInput uPLR
"Part load ratio input";
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEna
"Component enable signal";
protected
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(
final k=tPer)
"Calculate runtime from PLR signal";
Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler triSam
"Sample the part load ratio signal";
Buildings.Controls.OBC.CDL.Logical.Timer tim
"Check component runtime";
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(
final width=1e-6/tPer,
final period=tPer)
"Outputs true signals for 1e-6 second duration at required timestep interval";
Buildings.Controls.OBC.CDL.Reals.Less les
"Check if component runtime has exceeded required runtime from PLR";
Buildings.Controls.OBC.CDL.Logical.Latch lat
"Output a true signal from start of currrent time period, until the required
run-time is achieved";
Buildings.Controls.OBC.CDL.Logical.Pre pre1
"Pre block for looping back latch reset signal";
Buildings.Controls.OBC.CDL.Logical.And andRes
"Lets true signal pass only when latch is not being reset";
Buildings.Controls.OBC.CDL.Logical.Not notRes
"Check if the latch signal is being reset";
Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel(
final delayTime=1e-6)
"Delay the enable signal by 1e-6 seconds, which is also the duration for
which the pulse signal is held. Required when PLR input is zero";
equation
connect(triSam.y, gai.u);
connect(uPLR, triSam.u);
connect(gai.y, les.u1);
connect(tim.y, les.u2);
connect(lat.y, tim.u);
connect(les.y, pre1.u);
connect(pre1.y, lat.clr);
connect(booPul.y, andRes.u1);
connect(andRes.y, triSam.trigger);
connect(andRes.y, lat.u);
connect(notRes.y, andRes.u2);
connect(pre1.y, notRes.u);
connect(lat.y, truDel.u);
connect(truDel.y, yEna);
end PLRToPulse;
Buildings.Fluid.DXSystems.Heating.AirSource.Validation.BaseClasses.SingleSpeedHeating
Baseclass for validation models for single speed DX heating coil
Information
This is a baseclass component for the following validation models:
- Buildings.Fluid.DXSystems.Heating.AirSource.Validation.SingleSpeed_OnDemandResistiveDefrost
- Buildings.Fluid.DXSystems.Heating.AirSource.Validation.SingleSpeed_OnDemandReverseCycleDefrost
- Buildings.Fluid.DXSystems.Heating.AirSource.Validation.SingleSpeed_TimedResistiveDefrost
- Buildings.Fluid.DXSystems.Heating.AirSource.Validation.SingleSpeed_TimedReverseCycleDefrost
Parameters
Type | Name | Default | Description |
---|---|---|---|
SingleSpeedHeating | datCoi | Heating coil data record |
Modelica definition
model SingleSpeedHeating
"Baseclass for validation models for single speed DX heating coil"
package Medium = Buildings.Media.Air "Medium model";
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium = Medium,
final p(displayUnit="Pa") = 101325,
final nPorts=1,
final T=294.15)
"Sink";
Buildings.Fluid.DXSystems.Heating.AirSource.SingleSpeed sinSpeDX(
redeclare package Medium = Medium,
final dp_nominal=1141,
final datCoi=datCoi,
final T_start=datCoi.sta[1].nomVal.TEvaIn_nominal,
final from_dp=true,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final dTHys=1e-6) "Single speed DX heating coil";
Buildings.Utilities.IO.BCVTB.From_degC TEvaIn_K
"Converts degC to K";
Buildings.Utilities.IO.BCVTB.From_degC TConIn_K
"Converts degC to K";
Modelica.Blocks.Math.Mean TOutMea(
final f=1/3600)
"Mean of measured outlet air temperature";
Buildings.Utilities.IO.BCVTB.To_degC TOutDegC
"Convert measured outlet air temperature to deg C";
Modelica.Blocks.Sources.RealExpression TOut(
final y=sinSpeDX.vol.T)
"Measured temperature of outlet air";
Modelica.Blocks.Math.Mean XConOutMea(
final f=1/3600)
"Mean of measured outlet air humidity ratio per kg total air";
Modelica.Blocks.Sources.RealExpression XConOut(
final y=sum(sinSpeDX.vol.Xi))
"Measured humidity ratio of outlet air";
Modelica.Blocks.Math.Mean Q_flowMea(
final f=1/3600)
"Mean of cooling rate";
Modelica.Blocks.Math.Mean PMea(
final f=1/3600)
"Mean of power";
Buildings.Controls.OBC.CDL.Discrete.UnitDelay PEPlu(
final samplePeriod=3600)
"Total power consumption from EnergyPlus";
Buildings.Controls.OBC.CDL.Discrete.UnitDelay Q_flowEPlu(
final samplePeriod=3600)
"Heat transfer to airloop from EnergyPlus";
Buildings.Controls.OBC.CDL.Discrete.UnitDelay TOutEPlu(
final samplePeriod=3600)
"Outlet temperature from EnergyPlus";
Buildings.Controls.OBC.CDL.Discrete.UnitDelay XConOutEPlu(
final samplePeriod=3600)
"Outlet air humidity ratio from EnergyPlus";
Buildings.Utilities.Psychrometrics.ToTotalAir toTotAirOut
"Convert humidity ratio per kg dry air to humidity ratio per kg total air for outdoor air";
Buildings.Utilities.Psychrometrics.ToTotalAir toTotAirEPlu
"Convert humidity ratio per kg dry air from EnergyPlus to humidity ratio per kg total air";
Buildings.Controls.OBC.CDL.Discrete.UnitDelay PDefEPlu(
final samplePeriod=3600)
"Defrost power from EnergyPlus";
Buildings.Controls.OBC.CDL.Discrete.UnitDelay PCraEPlu(
final samplePeriod=3600)
"Cranckcase heater power from EnergyPlus";
Modelica.Blocks.Sources.CombiTimeTable datRea(
final tableOnFile=true,
final columns=2:18,
final tableName="EnergyPlus",
final smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments)
"Reader for EnergyPlus example results";
Buildings.Fluid.DXSystems.Heating.AirSource.Validation.BaseClasses.PLRToPulse
plrToPul(
final tPer=3600)
"Convert PLR signal to on-off signal";
Buildings.Fluid.Sources.MassFlowSource_T boundary(
redeclare package Medium = Medium,
final use_Xi_in=true,
final use_m_flow_in=true,
final use_T_in=true,
final nPorts=1)
"Mass flow source for coil inlet air";
Buildings.Utilities.Psychrometrics.ToTotalAir toTotAirIn
"Convert humidity ratio per kg dry air to humidity ratio per kg total air for coil inlet air";
parameter Buildings.Fluid.DXSystems.Heating.AirSource.Validation.Data.SingleSpeedHeating
datCoi
"Heating coil data record";
Buildings.Utilities.Psychrometrics.Phi_pTX phi
"Conversion to relative humidity";
Modelica.Blocks.Sources.Constant pAtm(final k=101325) "Atmospheric pressure";
equation
connect(sinSpeDX.port_b, sin.ports[1]);
connect(TEvaIn_K.Kelvin, sinSpeDX.TOut);
connect(TOut.y, TOutMea.u);
connect(TOutMea.y, TOutDegC.Kelvin);
connect(XConOut.y,XConOutMea. u);
connect(sinSpeDX.QSen_flow, Q_flowMea.u);
connect(toTotAirEPlu.XiTotalAir, XConOutEPlu.u);
connect(sinSpeDX.P, PMea.u);
connect(datRea.y[14], plrToPul.uPLR);
connect(plrToPul.yEna, sinSpeDX.on);
connect(datRea.y[1], TEvaIn_K.Celsius);
connect(datRea.y[9], toTotAirOut.XiDry);
connect(datRea.y[17], boundary.m_flow_in);
connect(TConIn_K.Kelvin, boundary.T_in);
connect(toTotAirIn.XiTotalAir, boundary.Xi_in[1]);
connect(datRea.y[5], TConIn_K.Celsius);
connect(datRea.y[6], toTotAirIn.XiDry);
connect(boundary.ports[1], sinSpeDX.port_a);
connect(datRea.y[7], TOutEPlu.u);
connect(datRea.y[8], toTotAirEPlu.XiDry);
connect(datRea.y[3], PEPlu.u);
connect(datRea.y[2], Q_flowEPlu.u);
connect(datRea.y[15], PDefEPlu.u);
connect(datRea.y[16], PCraEPlu.u);
connect(phi.X_w, toTotAirOut.XiTotalAir);
connect(TEvaIn_K.Kelvin, phi.T);
connect(pAtm.y, phi.p);
connect(sinSpeDX.phi, phi.phi);
end SingleSpeedHeating;