Examples demonstrating the use of models in the SolarCollectors package
Information
This package contains example model demonstrating the use of models in
the SolarCollectors package.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
Concentrating
|
Example showing the use of Concentrating |
FlatPlate
|
Test model for FlatPlate |
FlatPlateShaCoeTrue
|
Test model for FlatPlate with use_shaCoe_in = true |
FlatPlateTotalArea
|
Example showing the use of TotalArea and nSeg |
FlatPlateWithTank
|
Example showing use of the flat plate solar collector in a complete solar thermal system |
Tubular
|
Example showing the use of Tubular |
Example showing the use of Concentrating
Information
This model demonstrates the implementation of
Buildings.Fluid.SolarCollectors.EN12975.
In it water is passed through the solar thermal collector while
being heated by the sun in the San Francisco, CA, USA climate.
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 Concentrating
extends Modelica.Icons.Example;
replaceable package Medium =
Buildings.Media.Water ;
Buildings.Fluid.SolarCollectors.EN12975 solCol(
redeclare package Medium =
Medium,
shaCoe=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
use_shaCoe_in=false,
per=
Buildings.Fluid.SolarCollectors.Data.Concentrating.C_VerificationModel(),
sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series,
rho=0.2,
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
nPanels=5,
nSeg=9,
azi=0.3,
til=0.5) ;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"))
;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium =
Medium,
use_p_in=false,
p(displayUnit="Pa") = 101325,
nPorts=1) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TOut(
redeclare package Medium =
Medium,
T_start(displayUnit="K"),
m_flow_nominal=solCol.m_flow_nominal) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TIn(
redeclare package Medium =
Medium, m_flow_nominal=solCol.m_flow_nominal) ;
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium =
Medium,
T=273.15 + 10,
nPorts=1,
use_p_in=true,
p(displayUnit="Pa")) ;
Modelica.Blocks.Sources.Sine sine(
f=3/86400,
offset=101325,
amplitude=-2*solCol.dp_nominal);
equation
connect(solCol.port_b,TOut. port_a);
connect(TOut.port_b,sin. ports[1]);
connect(TIn.port_b,solCol. port_a);
connect(weaDat.weaBus, solCol.weaBus);
connect(sine.y, sou.p_in);
connect(sou.ports[1], TIn.port_a);
end Concentrating;
Test model for FlatPlate
Information
This example demonstrates the implementation of
Buildings.Fluid.SolarCollectors.ASHRAE93
for a variable fluid flow rate and weather data from
San Francisco, CA, USA.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Modelica.Media.Incompressibl... | 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 =
Modelica.Media.Incompressible.Examples.Glycol47
;
Buildings.Fluid.SolarCollectors.ASHRAE93 solCol(
redeclare package Medium =
Medium,
shaCoe=0,
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,
nSeg=9,
azi=0.3,
til=0.5,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"))
;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium =
Medium,
p(displayUnit="bar") = 100000,
nPorts=1) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TOut(
redeclare package Medium =
Medium,
T_start(displayUnit="K"),
m_flow_nominal=solCol.m_flow_nominal) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TIn(
redeclare package Medium =
Medium, m_flow_nominal=solCol.m_flow_nominal) ;
Sources.Boundary_pT sou(
redeclare package Medium =
Medium,
T=273.15 + 10,
nPorts=1,
use_p_in=true) ;
Modelica.Blocks.Sources.Sine sine(
f=3/86400,
amplitude=-solCol.dp_nominal,
offset=1E5) ;
equation
connect(solCol.port_b, TOut.port_a);
connect(sou.ports[1], TIn.port_a);
connect(weaDat.weaBus, solCol.weaBus);
connect(TIn.port_b, solCol.port_a);
connect(TOut.port_b, sin.ports[1]);
connect(sine.y, sou.p_in);
end FlatPlate;
Test model for FlatPlate with use_shaCoe_in = true
Information
This example demonstrates the use of use_shaCoe_in
. Aside from
changed use of use_shaCoe_in
it is identical to
Buildings.Fluid.SolarCollectors.Examples.FlatPlate.
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 FlatPlateShaCoeTrue
extends Modelica.Icons.Example;
replaceable package Medium =
Buildings.Media.Water ;
Buildings.Fluid.SolarCollectors.ASHRAE93 solCol(
redeclare package Medium =
Medium,
shaCoe=0,
from_dp=true,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
use_shaCoe_in=true,
per=
Buildings.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_GuangdongFSPTY95(),
rho=0.2,
azi=0,
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
nPanels=5,
sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series,
nSeg=9,
til=0.5235987755983) ;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"))
;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium =
Medium,
use_p_in=false,
p(displayUnit="Pa") = 101325,
nPorts=1) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TOut(
redeclare package Medium =
Medium,
T_start(displayUnit="K"),
m_flow_nominal=solCol.m_flow_nominal) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TIn(
redeclare package Medium =
Medium, m_flow_nominal=solCol.m_flow_nominal) ;
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium =
Medium,
use_p_in=false,
nPorts=1,
T=273.15 + 10,
p(displayUnit="Pa") = 101325 + 5*solCol.per.dp_nominal)
;
Modelica.Blocks.Sources.Ramp shaCoe(
startTime=34040,
height=1,
duration=24193) ;
equation
connect(solCol.port_b, TOut.port_a);
connect(TOut.port_b, sin.ports[1]);
connect(TIn.port_b, solCol.port_a);
connect(sou.ports[1], TIn.port_a);
connect(shaCoe.y, solCol.shaCoe_in);
connect(weaDat.weaBus, solCol.weaBus);
end FlatPlateShaCoeTrue;
Example showing the use of TotalArea and nSeg
Information
This model uses TotalArea
instead of nPanels
to
define the system size. Aside from that change, this model is identical to
Buildings.Fluid.SolarCollectors.Examples.FlatPlate.
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 FlatPlateTotalArea
extends Modelica.Icons.Example;
replaceable package Medium =
Buildings.Media.Water ;
Buildings.Fluid.SolarCollectors.ASHRAE93 solCol(
redeclare package Medium =
Medium,
shaCoe=0,
from_dp=true,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
rho=0.2,
sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series,
per=
Buildings.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_SolahartKf(),
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
nPanels=10,
nSeg=9,
azi=0.3,
til=0.5) ;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"))
;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium =
Medium,
use_p_in=false,
p(displayUnit="Pa") = 101325,
nPorts=2) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TOut(
redeclare package Medium =
Medium,
T_start(displayUnit="K"),
m_flow_nominal=solCol.m_flow_nominal) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TIn(
redeclare package Medium =
Medium, m_flow_nominal=solCol.m_flow_nominal) ;
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium =
Medium,
T=273.15 + 10,
use_p_in=false,
nPorts=2,
p(displayUnit="Pa") = 101325 + solCol.dp_nominal) ;
Buildings.Fluid.SolarCollectors.ASHRAE93 solCol1(
redeclare package Medium =
Medium,
shaCoe=0,
from_dp=true,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
rho=0.2,
sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series,
per=
Buildings.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_SolahartKf(),
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
nPanels=10,
nSeg=27,
azi=0.3,
til=0.5) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TOut1(
redeclare package Medium =
Medium,
T_start(displayUnit="K"),
m_flow_nominal=solCol.m_flow_nominal) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TIn1(
redeclare package Medium =
Medium, m_flow_nominal=solCol.m_flow_nominal) ;
equation
connect(solCol.port_b, TOut.port_a);
connect(TOut.port_b, sin.ports[1]);
connect(TIn.port_b, solCol.port_a);
connect(sou.ports[1], TIn.port_a);
connect(weaDat.weaBus, solCol.weaBus);
connect(solCol1.port_b, TOut1.port_a);
connect(TIn1.port_b, solCol1.port_a);
connect(weaDat.weaBus, solCol1.weaBus);
connect(sou.ports[2], TIn1.port_a);
connect(TOut1.port_b, sin.ports[2]);
end FlatPlateTotalArea;
Example showing use of the flat plate solar collector in a complete solar thermal system
Information
This example shows how several different models can be combined to create
an entire solar water heating system. The
Buildings.Fluid.Storage.StratifiedEnhancedInternalHex (tan) model is
used to represent the tank filled with hot water. A loop, powered by a pump
(
Buildings.Fluid.Movers.FlowControlled_m_flow, pum), passes the water
through an expansion tank
(
Buildings.Fluid.Storage.ExpansionVessel, exp), a temperature sensor
(
Buildings.Fluid.Sensors.TemperatureTwoPort, TIn), the solar collector
(
Buildings.Fluid.SolarCollectors.ASHRAE93, solCol) and a second temperature
sensor
(
Buildings.Fluid.Sensors.TemperatureTwoPort, TOut) before re-entering the
tank.
The solar collector is connected to the weather model
(
Buildings.BoundaryConditions.WeatherData.ReaderTMY3, weaDat) which passes
information for the San Francisco, CA, USA climate. This information is used to
identify both the heat gain in the water from the sun and the heat loss to the
ambient conditions.
The flow rate through the pump is controlled by a solar pump controller model
(
Buildings.Fluid.SolarCollectors.Controls.SolarPumpController, pumCon) and a
gain model. The controller outputs a binary on (1) / off (0) signal. The on/off
signal is passed through the gain model, multiplying by 0.04, to represent a
flow rate of 0.04 kg/s when the pump is active.
The heat ports for the tank are connected to an ambient temperature of 20
degrees C representing the temperature of the room the tank is stored in.
bou1 (
Buildings.Fluid.Sources.MassFlowSource_T) provides a constant mass flow
rate for a hot water draw while bou
(
Buildings.Fluid.Sources.Boundary_pT) provides a boundary
condition for the outlet of the draw.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Water | Fluid in the storage tank |
replaceable package Medium_2 | Buildings.Media.Water | Fluid flowing through the collector |
Connectors
Type | Name | Description |
replaceable package Medium | Fluid in the storage tank |
replaceable package Medium_2 | Fluid flowing through the collector |
Modelica definition
model FlatPlateWithTank
extends Modelica.Icons.Example;
replaceable package Medium =
Buildings.Media.Water
;
replaceable package Medium_2 =
Buildings.Media.Water ;
Buildings.Fluid.SolarCollectors.ASHRAE93 solCol(
shaCoe=0,
redeclare package Medium =
Medium_2,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
rho=0.2,
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
nPanels=5,
sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series,
per=
Buildings.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_SolahartKf(),
nSeg=9,
azi=0.3,
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.Sensors.TemperatureTwoPort TOut(
T_start(displayUnit="K"),
m_flow_nominal=solCol.m_flow_nominal,
redeclare package Medium =
Medium_2) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TIn(m_flow_nominal=solCol.m_flow_nominal,
redeclare package Medium =
Medium_2) ;
Buildings.Fluid.Storage.StratifiedEnhancedInternalHex
tan(
nSeg=4,
redeclare package Medium =
Medium,
hTan=1.8,
m_flow_nominal=0.1,
VTan=1.5,
dIns=0.07,
redeclare package MediumHex =
Medium_2,
CHex=200,
dExtHex=0.01905,
hHex_a=0.9,
hHex_b=0.65,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
Q_flow_nominal=3000,
mHex_flow_nominal=3000/20/4200,
T_start=293.15,
TTan_nominal=293.15,
THex_nominal=323.15,
energyDynamicsHex=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Buildings.Fluid.SolarCollectors.Controls.SolarPumpController
pumCon(per=
Buildings.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_ThermaLiteHS20())
;
Buildings.HeatTransfer.Sources.FixedTemperature rooT(T=293.15)
;
Modelica.Blocks.Math.Gain gain(k=0.04) ;
Buildings.Fluid.Sources.Boundary_pT bou(
redeclare package Medium =
Medium, nPorts=1) ;
Buildings.Fluid.Sources.MassFlowSource_T bou1(
redeclare package Medium =
Medium,
use_m_flow_in=false,
nPorts=1,
m_flow=0.001,
T=288.15) ;
Buildings.Fluid.Movers.FlowControlled_m_flow pum(
redeclare package Medium =
Medium_2,
m_flow_nominal=0.1,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
;
Buildings.Fluid.Storage.ExpansionVessel exp(
redeclare package Medium =
Medium_2, V_start=0.1) ;
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TTan
;
equation
connect(solCol.port_b,TOut. port_a);
connect(TIn.port_b,solCol. port_a);
connect(weaDat.weaBus,solCol. weaBus);
connect(weaDat.weaBus, pumCon.weaBus);
connect(rooT.port, tan.heaPorTop);
connect(rooT.port, tan.heaPorSid);
connect(pumCon.y, gain.u);
connect(gain.y, pum.m_flow_in);
connect(pum.port_b, TIn.port_a);
connect(pum.port_a, exp.port_a);
connect(exp.port_a, tan.portHex_b);
connect(TOut.port_b, tan.portHex_a);
connect(bou.ports[1], tan.port_a);
connect(bou1.ports[1], tan.port_b);
connect(tan.heaPorVol[3], TTan.port);
connect(TTan.T, pumCon.TIn);
end FlatPlateWithTank;
Example showing the use of Tubular
Information
This example models a tubular solar thermal collector. It uses the
Buildings.Fluid.SolarCollectors.ASHRAE93 model and references
data in the
Buildings.Fluid.SolarCollectors.Data.Tubular package.
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 Tubular
extends Modelica.Icons.Example;
replaceable package Medium =
Buildings.Media.Water ;
Buildings.Fluid.SolarCollectors.ASHRAE93 solCol(
redeclare package Medium =
Medium,
shaCoe=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
use_shaCoe_in=false,
per=
Buildings.Fluid.SolarCollectors.Data.Tubular.T_AMKCollectraAGOWR20(),
nPanels=10,
sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Parallel,
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
rho=0.2,
nSeg=9,
azi=0.3,
til=0.5) ;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"))
;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium =
Medium,
use_p_in=false,
p(displayUnit="Pa") = 101325,
nPorts=1) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TOut(
redeclare package Medium =
Medium,
T_start(displayUnit="K"),
m_flow_nominal=solCol.m_flow_nominal) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TIn(
redeclare package Medium =
Medium, m_flow_nominal=solCol.m_flow_nominal) ;
Modelica.Blocks.Sources.Sine sine(
f=3/86400,
offset=101325,
amplitude=-0.1*solCol.dp_nominal);
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium =
Medium,
T=273.15 + 10,
nPorts=1,
use_p_in=true,
p(displayUnit="Pa")) ;
equation
connect(solCol.port_b,TOut. port_a);
connect(TOut.port_b,sin. ports[1]);
connect(TIn.port_b,solCol. port_a);
connect(weaDat.weaBus, solCol.weaBus);
connect(sine.y, sou.p_in);
connect(sou.ports[1], TIn.port_a);
end Tubular;