Collection of validation models
Information
This package contains validation models for the classes in
Buildings.Fluid.SolarCollectors.
Note that most validation models contain simple input data
which may not be realistic, but for which the correct
output can be obtained through an analytic solution.
The examples plot various outputs, which have been verified against these
solutions. These model outputs are stored as reference data and
used for continuous validation whenever models in the library change.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
EN12975NPanels
|
Validation model for collector according to EN12975 with different settings for nPanel |
EN12975_Series
|
Validation model for collector according to EN12975 with different panels in series |
ExtremeAmbientConditions
|
Validation model for to ensure that collectors do not freeze or boil |
FlatPlate
|
Validation model for FlatPlate |
FlatPlateNPanels
|
Validation model for flat plate collector with different settings for nPanel |
Validation model for collector according to EN12975 with different settings for nPanel
Information
This model validates the solar collector model
Buildings.Fluid.SolarCollectors.EN12975
for the case
where the number of panels is 1 for the instance solCol
and 10 for the instance solCol1
.
The instances difHeaGai
and difHeaLos
compare the heat gain and heat loss between the two models.
The output of these blocks should be zero, except for rounding errors.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water | Medium in the system |
Integer | nPanels | 10 | Number of panels |
C_VerificationModel | datSolCol | | |
Connectors
Type | Name | Description |
replaceable package Medium | Medium in the system |
Modelica definition
model EN12975NPanels
extends Modelica.Icons.Example;
replaceable package Medium =
Buildings.Media.Water ;
parameter Integer nPanels=10 ;
Buildings.Fluid.SolarCollectors.EN12975 solCol(
redeclare package Medium =
Medium,
per=datSolCol,
shaCoe=0,
azi=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
rho=0.2,
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
nPanels=1,
nSeg=30,
lat=0.6457718232379,
til=0.78539816339745)
;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"),
computeWetBulbTemperature=false)
;
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium =
Medium,
use_p_in=false,
p(displayUnit="Pa") = 101325,
nPorts=1) ;
Buildings.Fluid.Sources.MassFlowSource_T bou(
nPorts=1,
redeclare package Medium =
Medium,
use_m_flow_in=true,
use_T_in=false,
T=303.15) ;
Buildings.Fluid.SolarCollectors.EN12975 solCol1(
redeclare package Medium =
Medium,
per=datSolCol,
shaCoe=0,
azi=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
rho=0.2,
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
nSeg=30,
lat=0.6457718232379,
til=0.78539816339745,
nPanels=nPanels)
;
Buildings.Fluid.Sources.Boundary_pT sou1(
redeclare package Medium =
Medium,
use_p_in=false,
p(displayUnit="Pa") = 101325,
nPorts=1) ;
Buildings.Fluid.Sources.MassFlowSource_T bou1(
nPorts=1,
redeclare package Medium =
Medium,
use_m_flow_in=true,
use_T_in=false,
T=303.15) ;
Modelica.Blocks.Math.Gain gaiNPan(k=nPanels) ;
Modelica.Blocks.Sources.RealExpression difHeaGai(y=solCol.heaGai[30].Q_flow
- solCol1.heaGai[30].Q_flow/nPanels)
;
Modelica.Blocks.Sources.RealExpression difHeaLos(y=solCol.QLos[30].Q_flow -
solCol1.QLos[30].Q_flow/nPanels)
;
Modelica.Blocks.Sources.Constant m_flow_nominal(k=datSolCol.A*datSolCol.mperA_flow_nominal)
;
parameter Data.Concentrating.C_VerificationModel datSolCol;
equation
connect(weaDat.weaBus, solCol1.weaBus);
connect(bou1.ports[1], solCol1.port_a);
connect(sou1.ports[1], solCol1.port_b);
connect(gaiNPan.y, bou1.m_flow_in);
connect(solCol.port_a, bou.ports[1]);
connect(solCol.port_b, sou.ports[1]);
connect(solCol.weaBus, weaDat.weaBus);
connect(m_flow_nominal.y, bou.m_flow_in);
connect(gaiNPan.u, m_flow_nominal.y);
end EN12975NPanels;
Validation model for collector according to EN12975 with different panels in series
Information
This model validates the solar collector model
Buildings.Fluid.SolarCollectors.EN12975
for the case where one model has multiple panels in series,
versus the case where two models are in series, each having one panel.
The output of the block dT
must be zero, as both
cases must have the same outlet temperatures.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water | Medium in the system |
MassFlowRate | m_flow_nominal | solCol.datSolCol.A*solCol.da... | Nominal mass flow rate [kg/s] |
Connectors
Type | Name | Description |
replaceable package Medium | Medium in the system |
Modelica definition
model EN12975_Series
extends Modelica.Icons.Example;
replaceable package Medium =
Buildings.Media.Water ;
parameter Modelica.SIunits.MassFlowRate m_flow_nominal=
solCol.datSolCol.A*solCol.datSolCol.mperA_flow_nominal
;
model collector
extends Buildings.Fluid.SolarCollectors.EN12975(
redeclare final package Medium =
Buildings.Media.Water,
final show_T = true,
final per=datSolCol,
final shaCoe=0,
final azi=0,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final rho=0.2,
final nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
nPanels=1,
final lat=0.6457718232379,
final til=0.78539816339745,
final C=385*perPar.mDry,
final use_shaCoe_in=false,
final sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series);
parameter SolarCollectors.Data.GenericSolarCollector datSolCol(
final ATyp=Types.Area.Aperture,
A=4.302,
V=4.4/1000,
final dp_nominal = 100,
final mperA_flow_nominal=0.0241,
final y_intercept=0.720,
final IAMDiff=0.133,
final C1=2.8312,
final C2=0.00119,
final B0=0,
final B1=0,
mDry=484,
final slope=0,
final G_nominal = 1000,
final dT_nominal = 20) ;
end collector;
collector solCol(
nPanels=2,
nSeg=6)
;
collector solCol1(
nSeg=3,
nPanels=1)
;
collector solCol2(
nSeg=3,
nPanels=1) ;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"),
computeWetBulbTemperature=false)
;
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium =
Medium,
use_p_in=false,
p(displayUnit="Pa") = 101325,
nPorts=1) ;
Buildings.Fluid.Sources.MassFlowSource_T bou(
nPorts=1,
redeclare package Medium =
Medium,
use_T_in=false,
m_flow=m_flow_nominal,
T=303.15) ;
Buildings.Fluid.Sources.Boundary_pT sou1(
redeclare package Medium =
Medium,
use_p_in=false,
p(displayUnit="Pa") = 101325,
nPorts=1) ;
Buildings.Fluid.Sources.MassFlowSource_T bou1(
nPorts=1,
redeclare package Medium =
Medium,
use_T_in=false,
m_flow=m_flow_nominal,
T=303.15) ;
Sensors.TemperatureTwoPort senTem(
redeclare package Medium =
Medium,
tau=0,
m_flow_nominal=m_flow_nominal)
;
Sensors.TemperatureTwoPort senTem1(
redeclare package Medium =
Medium,
tau=0,
m_flow_nominal=m_flow_nominal)
;
Modelica.Blocks.Math.Add dT(
final k2=-1) ;
equation
connect(weaDat.weaBus, solCol1.weaBus);
connect(bou1.ports[1], solCol1.port_a);
connect(solCol.port_a, bou.ports[1]);
connect(solCol.weaBus, weaDat.weaBus);
connect(solCol2.port_a, solCol1.port_b);
connect(weaDat.weaBus, solCol2.weaBus);
connect(solCol.port_b, senTem.port_a);
connect(senTem.port_b, sou.ports[1]);
connect(sou1.ports[1], senTem1.port_b);
connect(senTem1.port_a, solCol2.port_b);
connect(dT.u1, senTem.T);
connect(senTem1.T, dT.u2);
end EN12975_Series;
Validation model for to ensure that collectors do not freeze or boil
Information
This model validates the correct implementation of the heat transfer
to the collector when ambient temperatures are very low or irradiation is very
large.
It applies a ramp boundary condition that reduces the ambient temperature
to -60°C to verify that the collector fluid temperature does not
drop below Medium.T_min
.
Afterwards, the solar irradiation is increased to overheat the collector.
If the fluid temperature approaches Medium.T_max
,
then the solar heat gain is reduced to zero.
Ensuring these bounds is important as otherwise, the collector model
would trigger an assertion and the simulation would stop.
The tested collector models are
Buildings.Fluid.SolarCollectors.ASHRAE93
and
Buildings.Fluid.SolarCollectors.EN12975.
Note that the medium has been declared
as Buildings.Media.Water(T_min=273.15, T_max=273.15+100)
to set the two bounds for the water temperature.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water (T_min... | Medium in the system |
Connectors
Type | Name | Description |
replaceable package Medium | Medium in the system |
Bus | weaBus | |
Modelica definition
model ExtremeAmbientConditions
extends Modelica.Icons.Example;
replaceable package Medium =
Buildings.Media.Water(T_min=273.15, T_max=273.15+100)
;
ASHRAE93 solAsh(
redeclare package Medium =
Medium,
shaCoe=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
rho=0.2,
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series,
per=
Buildings.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_GuangdongFSPTY95(),
nPanels=1,
lat=0.73097781993588,
azi=0.3,
til=0.5,
T_start=313.15) ;
EN12975 solEn(
redeclare package Medium =
Medium,
shaCoe=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
rho=0.2,
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series,
nPanels=1,
lat=0.73097781993588,
azi=0.3,
til=0.5,
per=
Buildings.Fluid.SolarCollectors.Data.Concentrating.C_VerificationModel(),
T_start=313.15) ;
Sources.MassFlowSource_T sou(
redeclare package Medium =
Medium,
nPorts=1,
m_flow=0) ;
Sources.Boundary_pT sou1(
redeclare package Medium =
Medium,
p(displayUnit="Pa"),
use_p_in=false,
nPorts=2) ;
Modelica.Blocks.Sources.Ramp TAmb(
offset=273.15 + 40,
height=-100,
duration=10*3600) ;
Modelica.Blocks.Sources.Ramp HSol(
duration=12*3600,
height=1000,
startTime=10*3600) ;
Sources.MassFlowSource_T sou2(
redeclare package Medium =
Medium,
nPorts=1,
m_flow=0) ;
BoundaryConditions.WeatherData.Bus weaBus;
Modelica.Blocks.Sources.Constant const(k=0) ;
Modelica.Blocks.Sources.Constant solTim(k=12*3600) ;
equation
connect(sou.ports[1], solAsh.port_a);
connect(sou2.ports[1], solEn.port_a);
connect(solAsh.port_b, sou1.ports[1]);
connect(solEn.port_b, sou1.ports[2]);
connect(weaBus, solAsh.weaBus);
connect(TAmb.y, weaBus.TDryBul);
connect(HSol.y, weaBus.HDifHor);
connect(HSol.y, weaBus.HGloHor);
connect(const.y, weaBus.solZen);
connect(const.y, weaBus.cloTim);
connect(solTim.y, weaBus.solTim);
connect(HSol.y, weaBus.HDirNor);
connect(solEn.weaBus, weaBus);
end ExtremeAmbientConditions;
Validation model for FlatPlate
Information
This model was used to validate the
Buildings.Fluid.SolarCollectors.ASHRAE93 solar collector model
against TRNSYS data. Data files are used to ensure that the
Buildings.Fluid.SolarCollectors.ASHRAE93 solar collector model and
the TRNSYS model use the same inlet and weather conditions. The
solar collector model must reference the
Buildings.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_TRNSYSValidation
data record when comparing model results to the stored TRNSYS results.
The solar collector temperature of the Modelica model has a spike
in the morning. At this time, there is solar irradiation on the collector
but no mass flow rate, which leads to an increase in temperature.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water | Medium in the system |
Connectors
Type | Name | Description |
replaceable package Medium | Medium in the system |
Modelica definition
model FlatPlate
extends Modelica.Icons.Example;
replaceable package Medium =
Buildings.Media.Water ;
Buildings.Fluid.SolarCollectors.ASHRAE93
solCol(
redeclare package Medium =
Medium,
shaCoe=0,
azi=0,
per=
Buildings.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_TRNSYSValidation(),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
rho=0.2,
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
nPanels=1,
nSeg=30,
lat=0.6457718232379,
til=0.78539816339745)
;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"),
computeWetBulbTemperature=false)
;
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium =
Medium,
use_p_in=false,
p(displayUnit="Pa") = 101325,
nPorts=1) ;
Buildings.Fluid.Sources.MassFlowSource_T bou(
nPorts=1,
redeclare package Medium =
Medium,
use_m_flow_in=true,
use_T_in=true)
;
Modelica.Blocks.Sources.CombiTimeTable datRea(
tableOnFile=true,
tableName="TRNSYS",
columns=2:5,
fileName=
Modelica.Utilities.Files.loadResource(
"modelica://Buildings/Fluid/SolarCollectors/Examples/ValidationData/TRNSYSAnnualData.txt"),
smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments)
;
Modelica.Blocks.Math.Add add
;
Modelica.Blocks.Sources.Constant const(k=273.15)
;
equation
connect(weaDat.weaBus, solCol.weaBus);
connect(bou.ports[1], solCol.port_a);
connect(const.y, add.u2);
connect(add.y, bou.T_in);
connect(datRea.y[1], add.u1);
connect(datRea.y[4], bou.m_flow_in);
connect(sou.ports[1], solCol.port_b);
end FlatPlate;
Validation model for flat plate collector with different settings for nPanel
Information
This model validates the solar collector model
Buildings.Fluid.SolarCollectors.ASHRAE93
for the case
where the number of panels is 1 for the instance solCol
and 10 for the instance solCol1
.
The instances difHeaGai
and difHeaLos
compare the heat gain and heat loss between the two models.
The output of these blocks should be zero, except for rounding errors.
Extends from Buildings.Fluid.SolarCollectors.Validation.FlatPlate (Validation model for FlatPlate).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Water | Medium in the system |
Integer | nPanels | 10 | Number of panels |
Modelica definition
model FlatPlateNPanels
extends Buildings.Fluid.SolarCollectors.Validation.FlatPlate;
parameter Integer nPanels = 10 ;
Buildings.Fluid.SolarCollectors.ASHRAE93
solCol1(
redeclare package Medium =
Medium,
shaCoe=0,
azi=0,
per=
Buildings.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_TRNSYSValidation(),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
rho=0.2,
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
nSeg=30,
lat=0.6457718232379,
til=0.78539816339745,
nPanels=nPanels)
;
Buildings.Fluid.Sources.Boundary_pT sou1(
redeclare package Medium =
Medium,
use_p_in=false,
p(displayUnit="Pa") = 101325,
nPorts=1) ;
Buildings.Fluid.Sources.MassFlowSource_T bou1(
nPorts=1,
redeclare package Medium =
Medium,
use_m_flow_in=true,
use_T_in=true)
;
Modelica.Blocks.Math.Gain gaiNPan(k=nPanels) ;
Modelica.Blocks.Sources.RealExpression difHeaGai(
y=solCol.heaGai[30].Q_flow - solCol1.heaGai[30].Q_flow/nPanels)
;
Modelica.Blocks.Sources.RealExpression difHeaLos(
y=solCol.QLos[30].Q_flow - solCol1.QLos[30].Q_flow/nPanels)
;
equation
connect(weaDat.weaBus, solCol1.weaBus);
connect(bou1.ports[1], solCol1.port_a);
connect(add.y, bou1.T_in);
connect(sou1.ports[1], solCol1.port_b);
connect(gaiNPan.y, bou1.m_flow_in);
connect(gaiNPan.u, datRea.y[4]);
end FlatPlateNPanels;
Information
Extends from Buildings.Fluid.SolarCollectors.EN12975 (Model of a concentrating solar collector).
Parameters
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium in the component |
Integer | nSeg | 3 | Number of segments used to discretize the collector model |
Angle | lat | 0.6457718232379 | Latitude [rad] |
Angle | azi | 0 | Surface azimuth (0 for south-facing; -90 degree for east-facing; +90 degree for west facing [rad] |
Angle | til | 0.78539816339745 | Surface tilt (0 for horizontally mounted collector) [rad] |
Real | rho | 0.2 | Ground reflectance |
HeatCapacity | C | 385*perPar.mDry | Heat capacity of solar collector without fluid (default: cp_copper*mDry*nPanels) [J/K] |
GenericSolarCollector | per | datSolCol | Performance data |
GenericSolarCollector | datSolCol | datSolCol(final ATyp=Types.A... | Performance data |
Shading |
Boolean | use_shaCoe_in | false | Enables an input connector for shaCoe |
Real | shaCoe | 0 | Shading coefficient. 0.0: no shading, 1.0: full shading |
Area declarations |
NumberSelection | nColType | Buildings.Fluid.SolarCollect... | Selection of area specification format |
Integer | nPanels | 1 | Desired number of panels in the simulation |
Area | totalArea | 0 | Total area of panels in the simulation [m2] |
Configuration declarations |
SystemConfiguration | sysConfig | Buildings.Fluid.SolarCollect... | Selection of system configuration |
Dynamics |
Equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Dynamics | massDynamics | energyDynamics | Type of mass balance: dynamic (3 initialization options) or steady state |
Real | mSenFac | 1 | Factor for scaling the sensible thermal mass of the volume |
Initialization |
AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
Temperature | T_start | Medium.T_default | Start value of temperature [K] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
ExtraProperty | C_nominal[Medium.nC] | fill(1E-2, Medium.nC) | Nominal value of trace substances. (Set to typical order of magnitude.) |
Flow resistance |
Boolean | computeFlowResistance | true | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Assumptions |
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
Advanced |
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics |
Boolean | show_T | true | = true, if actual temperature at port is computed |
Connectors
Type | Name | Description |
replaceable package Medium | Medium in the component |
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
input RealInput | shaCoe_in | Shading coefficient |
Bus | weaBus | Weather data bus |
Modelica definition
model collector
extends Buildings.Fluid.SolarCollectors.EN12975(
redeclare final package Medium =
Buildings.Media.Water,
final show_T = true,
final per=datSolCol,
final shaCoe=0,
final azi=0,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final rho=0.2,
final nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
nPanels=1,
final lat=0.6457718232379,
final til=0.78539816339745,
final C=385*perPar.mDry,
final use_shaCoe_in=false,
final sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series);
parameter SolarCollectors.Data.GenericSolarCollector datSolCol(
final ATyp=Types.Area.Aperture,
A=4.302,
V=4.4/1000,
final dp_nominal = 100,
final mperA_flow_nominal=0.0241,
final y_intercept=0.720,
final IAMDiff=0.133,
final C1=2.8312,
final C2=0.00119,
final B0=0,
final B1=0,
mDry=484,
final slope=0,
final G_nominal = 1000,
final dT_nominal = 20) ;
end collector;