LBL logo

Buildings.Fluid.SolarCollectors.Examples

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

NameDescription
Buildings.Fluid.SolarCollectors.Examples.Concentrating Concentrating Example showing the use of Concentrating
Buildings.Fluid.SolarCollectors.Examples.FlatPlate FlatPlate Test model for FlatPlate
Buildings.Fluid.SolarCollectors.Examples.FlatPlateShaCoeTrue FlatPlateShaCoeTrue Test model for FlatPlate with use_shaCoe_in = true
Buildings.Fluid.SolarCollectors.Examples.FlatPlateTotalArea FlatPlateTotalArea Example showing the use of TotalArea and nSeg
Buildings.Fluid.SolarCollectors.Examples.FlatPlateValidation FlatPlateValidation Validation model for FlatPlate
Buildings.Fluid.SolarCollectors.Examples.FlatPlateWithTank FlatPlateWithTank Example showing use of the flat plate solar collector in a complete solar thermal system
Buildings.Fluid.SolarCollectors.Examples.Tubular Tubular Example showing the use of Tubular

Buildings.Fluid.SolarCollectors.Examples.Concentrating Buildings.Fluid.SolarCollectors.Examples.Concentrating

Example showing the use of Concentrating

Buildings.Fluid.SolarCollectors.Examples.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

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp...Medium in the system

Connectors

TypeNameDescription
replaceable package MediumMedium in the system

Modelica definition

model Concentrating "Example showing the use of Concentrating"
  extends Modelica.Icons.Example;
  replaceable package Medium = Buildings.Media.ConstantPropertyLiquidWater 
    "Medium in the system";
  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,
    lat=0.73097781993588,
    azi=0.3,
    til=0.5) "Concentrating solar collector model";

  Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
    "modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos") 
    "Weather data input file";
  Buildings.Fluid.Sources.Boundary_pT sin(
    redeclare package Medium = Medium,
    use_p_in=false,
    p(displayUnit="Pa") = 101325,
    nPorts=1) "Inlet for fluid flow";
  inner Modelica.Fluid.System system(p_ambient=101325);
  Buildings.Fluid.Sensors.TemperatureTwoPort TOut(
    redeclare package Medium = Medium,
    T_start(displayUnit="K"),
    m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
  Buildings.Fluid.Sensors.TemperatureTwoPort TIn(redeclare package Medium =
    Medium, m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
  Buildings.Fluid.Sources.Boundary_pT sou(
    redeclare package Medium = Medium,
    T=273.15 + 10,
    nPorts=1,
    use_p_in=true,
    p(displayUnit="Pa")) "Inlet for water flow";
  Modelica.Blocks.Sources.Sine sine(
    freqHz=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;

Buildings.Fluid.SolarCollectors.Examples.FlatPlate Buildings.Fluid.SolarCollectors.Examples.FlatPlate

Test model for FlatPlate

Buildings.Fluid.SolarCollectors.Examples.FlatPlate

Information

This example demonstrates the implementation of Buildings.Fluid.SolarCollectors.ASHRAE93. In it water is passed through a flat plate 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

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp...Medium in the system

Connectors

TypeNameDescription
replaceable package MediumMedium in the system

Modelica definition

model FlatPlate "Test model for FlatPlate"
  extends Modelica.Icons.Example;
  replaceable package Medium = Buildings.Media.ConstantPropertyLiquidWater 
    "Medium in the system";

  Buildings.Fluid.SolarCollectors.ASHRAE93          solCol(
    redeclare package Medium = Medium,
    shaCoe=0,
    from_dp=true,
    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,
    nSeg=9,
    lat=0.73097781993588,
    azi=0.3,
    til=0.5) "Flat plate solar collector model";

  Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
    "modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos") 
    "Weather data input file";
  Buildings.Fluid.Sources.Boundary_pT sin(
    redeclare package Medium = Medium,
    nPorts=1,
    p(displayUnit="bar") = 100000) "Outlet for water flow";
  inner Modelica.Fluid.System system(p_ambient=101325);
  Buildings.Fluid.Sensors.TemperatureTwoPort TOut(
    redeclare package Medium = Medium,
    T_start(displayUnit="K"),
    m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
  Buildings.Fluid.Sensors.TemperatureTwoPort TIn(redeclare package Medium =
    Medium, m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
  Buildings.Fluid.Sources.Boundary_pT sou(
    redeclare package Medium = Medium,
    T=273.15 + 10,
    nPorts=1,
    use_p_in=true,
    p(displayUnit="Pa")) "Inlet for water flow";
  Modelica.Blocks.Sources.Sine sine(
    freqHz=3/86400,
    offset=100000,
    amplitude=-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(sou.ports[1], TIn.port_a);
  connect(weaDat.weaBus, solCol.weaBus);
  connect(sine.y, sou.p_in);
end FlatPlate;

Buildings.Fluid.SolarCollectors.Examples.FlatPlateShaCoeTrue Buildings.Fluid.SolarCollectors.Examples.FlatPlateShaCoeTrue

Test model for FlatPlate with use_shaCoe_in = true

Buildings.Fluid.SolarCollectors.Examples.FlatPlateShaCoeTrue

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

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp...Medium in the system

Connectors

TypeNameDescription
replaceable package MediumMedium in the system

Modelica definition

model FlatPlateShaCoeTrue 
  "Test model for FlatPlate with use_shaCoe_in = true"
  extends Modelica.Icons.Example;
  replaceable package Medium = Buildings.Media.ConstantPropertyLiquidWater 
    "Medium in the system";
  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,
    lat=0.65938539140346,
    til=0.5235987755983) "Flat plate solar collector with 3 segments";

  Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
    "modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos") 
    "Weather data input file";
  Buildings.Fluid.Sources.Boundary_pT sin(
    redeclare package Medium = Medium,
    use_p_in=false,
    p(displayUnit="Pa") = 101325,
    nPorts=1) "Outlet for water flow";
  inner Modelica.Fluid.System system(p_ambient=101325);
  Buildings.Fluid.Sensors.TemperatureTwoPort TOut(
    redeclare package Medium = Medium,
    T_start(displayUnit="K"),
    m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
  Buildings.Fluid.Sensors.TemperatureTwoPort TIn(redeclare package Medium =
    Medium, m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
  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) 
    "Inlet for water flow";
  Modelica.Blocks.Sources.Ramp shaCoe(
    startTime=34040,
    height=1,
    duration=24193) "Varying shading coefficient";
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;

Buildings.Fluid.SolarCollectors.Examples.FlatPlateTotalArea Buildings.Fluid.SolarCollectors.Examples.FlatPlateTotalArea

Example showing the use of TotalArea and nSeg

Buildings.Fluid.SolarCollectors.Examples.FlatPlateTotalArea

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

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp...Medium in the system

Connectors

TypeNameDescription
replaceable package MediumMedium in the system

Modelica definition

model FlatPlateTotalArea 
  "Example showing the use of TotalArea and nSeg"
  extends Modelica.Icons.Example;
  replaceable package Medium = Buildings.Media.ConstantPropertyLiquidWater 
    "Medium in the system";

  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,
    lat=0.73097781993588,
    azi=0.3,
    til=0.5) "Flat plate solar collector model";

  Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
    "modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos") 
    "Weather data input file";
  Buildings.Fluid.Sources.Boundary_pT sin(
    redeclare package Medium = Medium,
    use_p_in=false,
    p(displayUnit="Pa") = 101325,
    nPorts=2) "Outlet for water flow";
  inner Modelica.Fluid.System system(p_ambient=101325);
  Buildings.Fluid.Sensors.TemperatureTwoPort TOut(
    redeclare package Medium = Medium,
    T_start(displayUnit="K"),
    m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
  Buildings.Fluid.Sensors.TemperatureTwoPort TIn(redeclare package Medium =
    Medium, m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
  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) "Inlet for water flow";

  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,
    lat=0.73097781993588,
    azi=0.3,
    til=0.5) "Flat plate solar collector model";
  Buildings.Fluid.Sensors.TemperatureTwoPort TOut1(
    redeclare package Medium = Medium,
    T_start(displayUnit="K"),
    m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
  Buildings.Fluid.Sensors.TemperatureTwoPort TIn1(
    redeclare package Medium =
    Medium, m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
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;

Buildings.Fluid.SolarCollectors.Examples.FlatPlateValidation Buildings.Fluid.SolarCollectors.Examples.FlatPlateValidation

Validation model for FlatPlate

Buildings.Fluid.SolarCollectors.Examples.FlatPlateValidation

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.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp...Medium in the system

Connectors

TypeNameDescription
replaceable package MediumMedium in the system

Modelica definition

model FlatPlateValidation "Validation model for FlatPlate"
  extends Modelica.Icons.Example;
  replaceable package Medium = Buildings.Media.ConstantPropertyLiquidWater 
    "Medium in the system";
  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) 
    "Flat plate solar collector model, has been modified for validation purposes";

  Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
    "modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos") 
    "Weather data file reader";
  Buildings.Fluid.Sources.Boundary_pT sou(
    redeclare package Medium = Medium,
    use_p_in=false,
    p(displayUnit="Pa") = 101325,
    nPorts=1) "Outlet for water flow";
  inner Modelica.Fluid.System system(p_ambient=101325);
  Buildings.Fluid.Sources.MassFlowSource_T bou(
    nPorts=1,
    redeclare package Medium = Medium,
    use_m_flow_in=true,
    use_T_in=true) 
    "Inlet for water flow, at a prescribed flow rate and temperature";
  Modelica.Blocks.Sources.CombiTimeTable datRea(
    tableOnFile=true,
    tableName="TRNSYS",
    columns=2:5,
    fileName=ModelicaServices.ExternalReferences.loadResource(
       "modelica://Buildings/Fluid/SolarCollectors/Examples/ValidationData/TRNSYSAnnualData.txt")) 
    "Data reader with inlet conditions from TRNSYS";

  Modelica.Blocks.Math.Add add 
    "Converts TRNSYS data from degree Celsius to Kelving";
  Modelica.Blocks.Sources.Constant const(k=273.15) 
    "Used to convert TRNSYS data from degree Celsius to Kelving";

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 FlatPlateValidation;

Buildings.Fluid.SolarCollectors.Examples.FlatPlateWithTank Buildings.Fluid.SolarCollectors.Examples.FlatPlateWithTank

Example showing use of the flat plate solar collector in a complete solar thermal system

Buildings.Fluid.SolarCollectors.Examples.FlatPlateWithTank

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.FlowMachine_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

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp...Fluid in the storage tank
replaceable package Medium_2Buildings.Media.ConstantProp...Fluid flowing through the collector

Connectors

TypeNameDescription
replaceable package MediumFluid in the storage tank
replaceable package Medium_2Fluid flowing through the collector

Modelica definition

model FlatPlateWithTank 
  "Example showing use of the flat plate solar collector in a complete solar thermal system"
  extends Modelica.Icons.Example;
  replaceable package Medium = Buildings.Media.ConstantPropertyLiquidWater 
    "Fluid in the storage tank";
  replaceable package Medium_2 =
      Buildings.Media.ConstantPropertyLiquidWater 
    "Fluid flowing through the collector";

  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,
    lat=0.73097781993588,
    azi=0.3,
    til=0.78539816339745) "Flat plate solar collector model";

  Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
    "modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos",
    computeWetBulbTemperature=false) "Weather data file reader";
  inner Modelica.Fluid.System system(p_ambient=101325);
  Buildings.Fluid.Sensors.TemperatureTwoPort TOut(
    T_start(displayUnit="K"),
    m_flow_nominal=solCol.m_flow_nominal,
    redeclare package Medium = Medium_2) "Temperature sensor";
  Buildings.Fluid.Sensors.TemperatureTwoPort TIn(m_flow_nominal=solCol.m_flow_nominal,
    redeclare package Medium = Medium_2) "Temperature sensor";
  Buildings.Fluid.Storage.StratifiedEnhancedInternalHex
   tan(
    nSeg=4,
    redeclare package Medium = Medium,
    hTan=1,
    m_flow_nominal=0.1,
    VTan=1.5,
    dIns=0.07,
    redeclare package MediumHex = Medium_2,
    CHex=200,
    dExtHex=0.01905,
    hexTopHeight=0.9,
    hexBotHeight=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) "Storage tank model";
  Buildings.Fluid.SolarCollectors.Controls.SolarPumpController
    pumCon(per=Buildings.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_ThermaLiteHS20()) 
    "Pump controller";
  Buildings.HeatTransfer.Sources.FixedTemperature rooT(T=293.15) 
    "Room temperature";
  Modelica.Blocks.Math.Gain gain(k=0.04) "Flow rate of the system in kg/s";
  Buildings.Fluid.Sources.Boundary_pT bou(redeclare package Medium =
    Medium, nPorts=1) "Outlet for hot water draw";
  Buildings.Fluid.Sources.MassFlowSource_T bou1(
    redeclare package Medium = Medium,
    use_m_flow_in=false,
    nPorts=1,
    m_flow=0.001,
    T=288.15) "Inlet and flow rate for hot water draw";
  Buildings.Fluid.Movers.FlowMachine_m_flow pum(redeclare package Medium =
    Medium_2, m_flow_nominal=0.1) "Pump forcing circulation through the system";
  Buildings.Fluid.Storage.ExpansionVessel exp(redeclare package Medium =
    Medium_2, VTot=0.1,
    energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) 
    "Expansion tank in the system";
  Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TTan 
    "Temperature in the tank water that surrounds the heat exchanger";
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.port_b1);
  connect(TOut.port_b, tan.port_a1);
  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;

Buildings.Fluid.SolarCollectors.Examples.Tubular Buildings.Fluid.SolarCollectors.Examples.Tubular

Example showing the use of Tubular

Buildings.Fluid.SolarCollectors.Examples.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

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.ConstantProp...Medium in the system

Connectors

TypeNameDescription
replaceable package MediumMedium in the system

Modelica definition

model Tubular "Example showing the use of Tubular"
  extends Modelica.Icons.Example;
  replaceable package Medium = Buildings.Media.ConstantPropertyLiquidWater 
    "Medium in the system";
  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,
    lat=0.73097781993588,
    azi=0.3,
    til=0.5) "Tubular solar collector model";

  Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
    "modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos") 
    "Weather data input file";
  Buildings.Fluid.Sources.Boundary_pT sin(
    redeclare package Medium = Medium,
    use_p_in=false,
    p(displayUnit="Pa") = 101325,
    nPorts=1) "Inlet for fluid flow";
  inner Modelica.Fluid.System system(p_ambient=101325);
  Buildings.Fluid.Sensors.TemperatureTwoPort TOut(
    redeclare package Medium = Medium,
    T_start(displayUnit="K"),
    m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
  Buildings.Fluid.Sensors.TemperatureTwoPort TIn(redeclare package Medium =
    Medium, m_flow_nominal=solCol.m_flow_nominal) "Temperature sensor";
  Modelica.Blocks.Sources.Sine sine(
    freqHz=3/86400,
    offset=101325,
    amplitude=-1.5*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")) "Inlet for water flow";
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;

Automatically generated Wed Feb 12 08:17:00 2014.