Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue1451 add pvt model #1458

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ partial model PartialHumansExample "Base class with bounday conditions for human
Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heatFlowSensorRad annotation (Placement(transformation(extent={{18,-16},{34,0}})));
Modelica.Blocks.Math.MultiSum sumQ_flows(nu=2) annotation (Placement(transformation(extent={{34,-70},{46,-58}})));
replaceable AixLib.BoundaryConditions.InternalGains.Humans.BaseClasses.PartialHuman humanIntGains(roomArea=20) constrainedby AixLib.BoundaryConditions.InternalGains.Humans.BaseClasses.PartialHuman(roomArea=20) annotation (__Dymola_choicesAllMatching=true, Placement(transformation(extent={{-16,-12},{10,14}})));
Modelica.Blocks.Interfaces.RealOutput HeatOut(quantity = "Power", unit = "W") annotation(
Modelica.Blocks.Interfaces.RealOutput HeatOut(quantity = "Power", unit = "W") annotation (
Placement(visible = true, iconTransformation(extent = {{80, -80}, {100, -60}}, rotation = 0)));
equation
connect(sine.y,varTempRoom. T) annotation(Line(points={{-82.6,24},{-92,24},{-92,52},{-86,52}}, color = {0, 0, 127}));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
within AixLib.DataBase.PhotovoltaicThermal;
record PhotovoltaicThermalBaseDataDefinition
"Base Data Definition for photovoltaic thermal collectors"
extends Modelica.Icons.Record;
parameter Modelica.Units.SI.Efficiency etaThe_zero(max=1)
"Conversion factor/Efficiency at Q = 0 for thermal efficiency";
parameter Real c1The(unit = "W/(m.m.K)")
"Loss coefficient c1 for thermal efficiency";
parameter Real c2The(unit = "W/(m.m.K.K)")
"Loss coefficient c2 for thermal efficiency";
parameter Modelica.Units.SI.Efficiency etaEle_zero(max=1)
"Conversion factor/Efficiency at Q = 0 for electrical efficiency";
parameter Real mEle(unit = "W/(m.m.K)")
"Gradient of electrical efficiency linear approximation";
annotation(Documentation(revisions="<html><ul>
<li>
<i>January 23, 2024</i> by Philipp Schmitz and Fabian Wuellhorst:<br/>
First implementation. This is for
<a href=\"https://github.com/RWTH-EBC/AixLib/issues/1451\">
issue 1451</a>.
</li>
</ul>
</html>", info="<html>
<h4>
Overview
</h4>
<p>
This record extends the solar thermal collectors records and
adds efficieny curves for the electrical part to enable a
model of a photovoltaic thermal collector
</p>
<h4>
References
</h4>
<p>
Record is used in model <a href=
\"modelica://AixLib.Fluid.Solar.Thermal.PhotovoltaicThermal\">AixLib.Fluid.Solar.Thermal.PhotovoltaicThermal</a>.
</p>
</html>"));
end PhotovoltaicThermalBaseDataDefinition;
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
within AixLib.DataBase.PhotovoltaicThermal;
record ThermalGlazedWithLowEmissionCoating
"Glazed PVT Collector with low emission coating"
extends PhotovoltaicThermalBaseDataDefinition(
etaEle_zero=0.1117,
mEle=0.5131,
etaThe_zero=0.667506427,
c1The=3.8674,
c2The=2.56E-02);
annotation(Documentation(info="<html><h4>
Overview
</h4>
<p>
Derived from the simulated results of a glazed PVT Collector with
low-emission coating from this <a href=
\"https://www.researchgate.net/publication/327882787_Thermal_management_of_PVT_collectors_development_and_modelling_of_highly_efficient_glazed_flat_plate_PVT_collectors_with_low_emissivity_coatings_and_overheating_protection\">
thesis</a> p.43 Figure 3.12.
</p>
<h4>
References
</h4>
<p>
Record is used in model <a href=
\"modelica://AixLib.Fluid.Solar.Thermal.PhotovoltaicThermal\">AixLib.Fluid.Solar.Thermal.PhotovoltaicThermal</a>.
</p>
<p>
September 2023, Philipp Schmitz, Fabian Wüllhorst
</p>
<ul>
<li>implemented
</li>
</ul>
</html>", revisions="<html><ul>
<li>
<i>January 23, 2024</i> by Philipp Schmitz and Fabian Wuellhorst:<br/>
First implementation. This is for
<a href=\"https://github.com/RWTH-EBC/AixLib/issues/1451\">
issue 1451</a>.
</li>
</ul>
</html>"));
end ThermalGlazedWithLowEmissionCoating;
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
within AixLib.DataBase.PhotovoltaicThermal;
record ThermalGlazedWithoutLowEmissionCoating
"Glazed PVT Collector without low emission coating"
extends PhotovoltaicThermalBaseDataDefinition(
etaEle_zero=0.1154,
mEle=0.5474,
etaThe_zero=0.628175311,
c1The=6.0867,
c2The=2.59E-02);
annotation(Documentation(info="<html><h4>
Overview
</h4>
<p>
Derived from the simulated results of a glazed PVT Collector without
low-emission coating from this <a href=
\"https://www.researchgate.net/publication/327882787_Thermal_management_of_PVT_collectors_development_and_modelling_of_highly_efficient_glazed_flat_plate_PVT_collectors_with_low_emissivity_coatings_and_overheating_protection\">
thesis</a> p.43 Figure 3.12.
</p>
<h4>
References
</h4>
<p>
Record is used in model <a href=
\"modelica://AixLib.Fluid.Solar.Thermal.PhotovoltaicThermal\">AixLib.Fluid.Solar.Thermal.PhotovoltaicThermal</a>.
</p>
<p>
September 2023, Philipp Schmitz, Fabian Wüllhorst
</p>
<ul>
<li>implemented
</li>
</ul>
</html>", revisions="<html><ul>
<li>
<i>January 23, 2024</i> by Philipp Schmitz and Fabian Wuellhorst:<br/>
First implementation. This is for
<a href=\"https://github.com/RWTH-EBC/AixLib/issues/1451\">
issue 1451</a>.
</li>
</ul>
</html>"));
end ThermalGlazedWithoutLowEmissionCoating;
41 changes: 41 additions & 0 deletions AixLib/DataBase/PhotovoltaicThermal/Unglazed.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
within AixLib.DataBase.PhotovoltaicThermal;
record Unglazed "Unglazed PVT collector"
extends PhotovoltaicThermalBaseDataDefinition(
etaEle_zero=0.1052,
mEle=0.3848,
etaThe_zero=0.672045005,
c1The=20.6360,
c2The=6.17E-04);
annotation(Documentation(info="<html><h4>
Overview
</h4>
<p>
Derived from the simulated results of a glazed PVT Collector without
low-emission coating from this <a href=
\"https://www.researchgate.net/publication/327882787_Thermal_management_of_PVT_collectors_development_and_modelling_of_highly_efficient_glazed_flat_plate_PVT_collectors_with_low_emissivity_coatings_and_overheating_protection\">
thesis</a> p.43 Figure 3.12.
</p>
<h4>
References
</h4>
<p>
Record is used in model <a href=
\"modelica://AixLib.Fluid.Solar.Thermal.PhotovoltaicThermal\">AixLib.Fluid.Solar.Thermal.PhotovoltaicThermal</a>.
</p>
<p>
September 2023, Philipp Schmitz, Fabian Wüllhorst
</p>
<ul>
<li>implemented
</li>
</ul>
</html>", revisions="<html><ul>
<li>
<i>January 23, 2024</i> by Philipp Schmitz and Fabian Wuellhorst:<br/>
First implementation. This is for
<a href=\"https://github.com/RWTH-EBC/AixLib/issues/1451\">
issue 1451</a>.
</li>
</ul>
</html>"));
end Unglazed;
4 changes: 4 additions & 0 deletions AixLib/DataBase/PhotovoltaicThermal/package.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
within AixLib.DataBase;
package PhotovoltaicThermal "Properties for efficiency of photovoltaic thermal modules"
extends Modelica.Icons.Package;
end PhotovoltaicThermal;
4 changes: 4 additions & 0 deletions AixLib/DataBase/PhotovoltaicThermal/package.order
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PhotovoltaicThermalBaseDataDefinition
ThermalGlazedWithLowEmissionCoating
ThermalGlazedWithoutLowEmissionCoating
Unglazed
2 changes: 1 addition & 1 deletion AixLib/DataBase/SolarThermal/ConcentratingCollector.mo
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ record ConcentratingCollector "Properties of a CRC collector"
</h4>
<p>
Record is used in model <a href=
\"AixLib.Fluid.Solar.Thermal.SolarThermal\">AAixLib.Fluid.Solar.Thermal.SolarThermal</a>.
\"AixLib.Fluid.Solar.Thermal.SolarThermal\">AixLib.Fluid.Solar.Thermal.SolarThermal</a>.
</p>
<p>
October 2013, Marcus Fuchs
Expand Down
1 change: 1 addition & 0 deletions AixLib/DataBase/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHP
Chiller
HeatPump
Media
PhotovoltaicThermal
Pipes
Pools
Profiles
Expand Down
18 changes: 11 additions & 7 deletions AixLib/Fluid/BoilerCHP/BaseClasses/PartialHeatGenerator.mo
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ partial model PartialHeatGenerator "Partial model for heat generators"
annotation (Dialog(tab="Advanced", group="Pressure drop"));
parameter Real a "Coefficient of old approach from model Modelica.Fluid.Fittings.GenericResistances.VolumeFlowRate. Recalculated to dp_nominal based on IBPSA approach."
annotation (Dialog(tab="Advanced", group="Pressure drop"));
parameter Modelica.Units.SI.Density rho_default=Medium.density_pTX(
Medium.p_default,
Medium.T_default,
Medium.X_default) "Density used for parameterization of pressure curve"
annotation (Dialog(tab="Advanced", group="Pressure drop"));
parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
"Type of energy balance: dynamic (3 initialization options) or steady state"
annotation (Dialog(tab="Dynamics"));
Sensors.TemperatureTwoPort senTCold(
redeclare final package Medium = Medium,
final tau=tau,
Expand Down Expand Up @@ -83,6 +91,7 @@ partial model PartialHeatGenerator "Partial model for heat generators"
origin={-60,-50})));
MixingVolumes.MixingVolume vol(
redeclare final package Medium = Medium,
final energyDynamics=energyDynamics,
final m_flow_nominal=m_flow_nominal,
final m_flow_small=m_flow_small,
final allowFlowReversal=allowFlowReversal,
Expand All @@ -99,21 +108,16 @@ partial model PartialHeatGenerator "Partial model for heat generators"
final dp_nominal=dp_nominal)
"Pressure drop"
annotation (Placement(transformation(extent={{-20,-90},{0,-70}})));
parameter Modelica.Units.SI.Density rho_default=Medium.density_pTX(
Medium.p_default,
Medium.T_default,
Medium.X_default) "Density used for parameterization of pressure curve"
annotation (Dialog(tab="Advanced", group="Pressure drop"));

equation
connect(port_a, senTCold.port_a) annotation (Line(points={{-100,0},{-90,0},{-90,
-80},{-80,-80}}, color={0,127,255},
thickness=1));
connect(senTCold.port_b, vol.ports[1])
annotation (Line(points={{-60,-80},{-42,-80}}, color={0,127,255},
annotation (Line(points={{-60,-80},{-41,-80}}, color={0,127,255},
thickness=1));
connect(vol.ports[2], pressureDrop.port_a) annotation (Line(
points={{-38,-80},{-38,-80},{-20,-80}},
points={{-39,-80},{-39,-80},{-20,-80}},
color={0,127,255},
thickness=1));
connect(senMasFlo.port_b, port_b) annotation (Line(points={{80,-80},{90,-80},{
Expand Down
6 changes: 1 addition & 5 deletions AixLib/Fluid/BoilerCHP/Boiler.mo
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
within AixLib.Fluid.BoilerCHP;
model Boiler "Boiler with internal and external control"
extends AixLib.Fluid.BoilerCHP.BaseClasses.PartialHeatGenerator(a=paramBoiler.pressureDrop,
vol(energyDynamics=energyDynamics,
V=paramBoiler.volume));
vol(V=paramBoiler.volume));

parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition
paramBoiler
Expand Down Expand Up @@ -38,9 +37,6 @@ model Boiler "Boiler with internal and external control"
parameter Real FA=0.2 "Increment for increased set temperature"
annotation(Dialog(tab="External Control"));

parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
"Type of energy balance: dynamic (3 initialization options) or steady state"
annotation (Dialog(tab="Dynamics"));
Modelica.Blocks.Interfaces.BooleanInput isOn
"Switches Controler on and off"
annotation (Placement(transformation(extent={{-20,-20},{20,20}},
Expand Down
3 changes: 1 addition & 2 deletions AixLib/Fluid/BoilerCHP/BoilerNoControl.mo
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
within AixLib.Fluid.BoilerCHP;
model BoilerNoControl "Boiler model with physics only"
extends AixLib.Fluid.BoilerCHP.BaseClasses.PartialHeatGenerator(a=paramBoiler.pressureDrop,
vol(energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final V=V));
vol(final V=V));

parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition
paramBoiler "Parameters for Boiler" annotation (Dialog(tab="General", group=
Expand Down
1 change: 0 additions & 1 deletion AixLib/Fluid/BoilerCHP/CHPNoControl.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
model CHPNoControl
"Table based CHP model without an internal controller"
extends AixLib.Fluid.BoilerCHP.BaseClasses.PartialHeatGenerator(a=1e10, vol(
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
massDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial,
V=param.vol[1]));

Expand Down
1 change: 1 addition & 0 deletions AixLib/Fluid/BoilerCHP/Examples/BoilerNoControlSystem.mo
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ model BoilerNoControlSystem
BoilerNoControl boilerNoControl(
redeclare package Medium = Medium,
m_flow_nominal=0.2,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
paramBoiler=DataBase.Boiler.General.Boiler_Vitogas200F_18kW())
annotation (Placement(transformation(extent={{-24,-14},{2,14}})));
Modelica.Blocks.Sources.Ramp ramp1(
Expand Down
1 change: 1 addition & 0 deletions AixLib/Fluid/BoilerCHP/Examples/BoilerSystem.mo
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ model BoilerSystem "Example that illustrates use of boiler model"
redeclare package Medium =
AixLib.Media.Specialized.Water.TemperatureDependentDensity,
m_flow_nominal=0.03,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
redeclare model ExtControl =
BaseClasses.Controllers.ExternalControlNightDayHC,
declination=1.2,
Expand Down
1 change: 1 addition & 0 deletions AixLib/Fluid/BoilerCHP/Examples/CHPSystem.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ model CHPSystem "Example that illustrates use of CHP model"
redeclare package Medium =
Media.Specialized.Water.TemperatureDependentDensity,
m_flow_nominal=0.02,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
TSetIn=true,
minCapacity=20,
delayTime=300,
Expand Down
1 change: 1 addition & 0 deletions AixLib/Fluid/BoilerCHP/Examples/CHPSystemNoControl.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ model CHPSystemNoControl "Example that illustrates use of CHPNoControl model"
combinedHeatPower(
redeclare package Medium = Medium,
m_flow_nominal=0.02,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
param=DataBase.CHP.CHPDataSimple.CHP_FMB_65_GSK()) "CHP"
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
Modelica.Fluid.Sources.MassFlowSource_T source(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ model HeatGeneratorNoControllSystem "Example that illustrates use of heat genera
redeclare package Medium =
Media.Specialized.Water.TemperatureDependentDensity, m_flow_nominal=
0.03,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
V=0.002,
coeffPresLoss=1e10)
"Heat generator without control"
Expand Down
59 changes: 59 additions & 0 deletions AixLib/Fluid/Solar/Thermal/BaseClasses/ElectricalEfficiency.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
within AixLib.Fluid.Solar.Thermal.BaseClasses;
model ElectricalEfficiency
"simplified calculation for the electrical efficiency of a photovoltaic thermal collector"
parameter Modelica.Units.SI.Efficiency eta_zero(max=1)
"Conversion factor/Efficiency at Q = 0";
parameter Real m(unit = "W/(m.m.K)") "Gradient of linear approximation";
Modelica.Units.SI.Efficiency eta(max=eta_zero)
"Efficiency of electricity generation of pvt collector";
Modelica.Blocks.Interfaces.RealInput TAir(
quantity="ThermodynamicTemperature",
unit="K",
displayUnit="degC") "Air temperature" annotation (Placement(transformation(
extent={{-20,-20},{20,20}},
rotation=270,
origin={-50,120})));
Modelica.Blocks.Interfaces.RealInput G(quantity="Irradiance", unit="W/m2")
"Global solar irradiation in W/m2" annotation (Placement(transformation(
extent={{-20,-20},{20,20}},
rotation=270,
origin={10,120})));
Modelica.Blocks.Interfaces.RealInput TCol(
quantity="ThermodynamicTemperature",
unit="K",
displayUnit="degC") "Collector temperature" annotation (Placement(
transformation(
extent={{-20,-20},{20,20}},
rotation=90,
origin={-50,-120})));
Modelica.Blocks.Interfaces.RealOutput PEle(quantity="ElectricPower", unit="W/m2")
"Useful electric power output from solar collector in W/m2"
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
protected
Modelica.Units.SI.TemperatureDifference dT
"Temperature difference between collector and air in K";
equation
dT = TCol - TAir;
eta = max(0,
min(eta_zero,
eta_zero - m*dT/max(G,
Modelica.Constants.eps)));
PEle = G*eta;
annotation (Documentation(info="<html>
<p>
Simplified Model for the electrical efficiency of a photovoltaic thermal collector.
Inputs are outdoor air temperature, fluid temperature and solar irradiation.
Based on these values and the collector properties from database, this model
calculates the electrical power output of the collector. We assume that the
fluid temperature is equal to the collector temperature.
</p>
</html>", revisions="<html><ul>
<li>
<i>January 23, 2024</i> by Philipp Schmitz and Fabian Wuellhorst:<br/>
First implementation. This is for
<a href=\"https://github.com/RWTH-EBC/AixLib/issues/1451\">
issue 1451</a>.
</li>
</ul>
</html>"));
end ElectricalEfficiency;