diff --git a/IBPSA/Electrical/BaseClasses/PVSystem/PartialPVSystem.mo b/IBPSA/Electrical/BaseClasses/PVSystem/PartialPVSystem.mo new file mode 100644 index 0000000000..809b810b33 --- /dev/null +++ b/IBPSA/Electrical/BaseClasses/PVSystem/PartialPVSystem.mo @@ -0,0 +1,144 @@ +within IBPSA.Electrical.BaseClasses.PVSystem; +partial model PartialPVSystem "Base PV model with internal or external MPP tracking" + + extends IBPSA.Electrical.BaseClasses.PVSystem.BaseClasses.Icons.partialPVIcon; + + replaceable model ElectricalModel = + IBPSA.Electrical.BaseClasses.PVSystem.BaseClasses.PartialPVElectrical + "Model with electrical characteristics"; + + replaceable model ThermalModel = + IBPSA.Electrical.BaseClasses.PVSystem.BaseClasses.PartialPVThermal + "Model with thermal characteristics"; + + replaceable model OpticalModel = + IBPSA.Electrical.BaseClasses.PVSystem.BaseClasses.PartialPVOptical + "Model with optical characteristics" + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); + + replaceable parameter IBPSA.Electrical.DataBase.PVSimpleBaseDataDefinition data + constrainedby IBPSA.Electrical.DataBase.PVSimpleBaseDataDefinition + "PV Panel data definition" + annotation (choicesAllMatching); + + parameter Boolean use_MPP_in = false + "If true then MPP via real interface else internal automatic MPP tracking" + annotation(Dialog(tab="Advanced"), Evaluate=true, HideResult=true); + + parameter Boolean use_Til_in = false + "If true then tilt via real interface else parameter" + annotation(Dialog(tab="Advanced"), Evaluate=true, HideResult=true); + + parameter Modelica.Units.SI.Angle til if not use_Til_in + "Prescribed tilt angle (used if til=Parameter)" annotation(Dialog(enable=not use_Til_in, tab="Advanced")); + + parameter Boolean use_Azi_in = false + "If true then azimuth angle is controlled via real interface else parameter" + annotation(Dialog(tab="Advanced"), Evaluate=true, HideResult=true); + + parameter Modelica.Units.SI.Angle azi if not use_Azi_in + "Prescribed azimuth angle (used if azi=Parameter)" + annotation(Dialog(enable=not use_Azi_in, tab="Advanced")); + + parameter Boolean use_Sha_in = false + "If true then shading is real interface else neglected" + annotation(Dialog(tab="Advanced"), Evaluate=true, HideResult=true); + + parameter Boolean use_age_in = false + "If true then ageing is real interface else parameter" + annotation(Dialog(tab="Advanced"), Evaluate=true, HideResult=true); + + parameter Real ageing if not use_age_in + "Prescribed ageing factor [0,1] (used if ageig=Parameter)" annotation(Dialog(enable=not use_age_in, tab="Advanced")); + + parameter Boolean use_heat_port = false + "If true then heat port is enables as interface" + annotation(Dialog(tab="Advanced"), Evaluate=true, HideResult=true); + + Modelica.Blocks.Interfaces.RealInput HGloHor "Horizontal global irradiation" + annotation (Placement(transformation(extent={{-110,80},{-88,102}}), + iconTransformation(extent={{-110,80},{-88,102}}))); + Modelica.Blocks.Interfaces.RealInput TDryBul "Ambient dry bulb temperature" + annotation (Placement(transformation(extent={{-110,52},{-88,74}}), + iconTransformation(extent={{-110,52},{-88,74}}))); + Modelica.Blocks.Interfaces.RealInput vWinSpe "Wind speed" annotation ( + Placement(transformation(extent={{-110,26},{-88,48}}), iconTransformation( + extent={{-110,26},{-88,48}}))); + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort if use_heat_port + "Heat port for connection with e.g. building facade or mass" + annotation (Placement(transformation(extent={{-10,-110},{10,-90}}))); + + //Conditional connectors + Modelica.Blocks.Interfaces.RealInput MPPTrackingSet if use_MPP_in + "Conditional input for MPP tracking" annotation (Placement(transformation( + extent={{-110,-2},{-88,20}}), iconTransformation(extent={{-110,-2},{-88, + 20}}))); + Modelica.Blocks.Interfaces.RealInput tilSet if use_Til_in + "Conditional input for tilt angle control" annotation (Placement( + transformation(extent={{-110,-24},{-88,-2}}), iconTransformation( + extent={{-110,-24},{-88,-2}}))); + Modelica.Blocks.Interfaces.RealInput aziSet if use_Azi_in + "Conditional input for azimuth angle control" annotation (Placement( + transformation(extent={{-110,-50},{-88,-28}}), iconTransformation( + extent={{-110,-50},{-88,-28}}))); + Modelica.Blocks.Interfaces.RealInput shadingSet if use_Sha_in + "Conditional input for shading [0,1]" annotation (Placement(transformation( + extent={{-110,-76},{-88,-54}}), iconTransformation(extent={{-106,-72}, + {-88,-54}}))); + + Modelica.Blocks.Interfaces.RealInput ageingSet if use_age_in + "Conditional input for ageing [0,1]" annotation (Placement(transformation( + extent={{-110,-104},{-88,-82}}), iconTransformation(extent={{-106,-72}, + {-88,-54}}))); + + Modelica.Blocks.Interfaces.RealOutput DCPower "DC Power output" + annotation (Placement(transformation(extent={{94,-10},{114,10}}))); +protected + Modelica.Blocks.Interfaces.RealInput MPP_in_internal + "Needed to connect to conditional MPP tracking connector"; + + parameter Real MPP = 1 "Dummy MPP parameter"; + + Modelica.Blocks.Interfaces.RealInput Til_in_internal + "Needed to connect to conditional tilt connector"; + + Modelica.Blocks.Interfaces.RealInput Azi_in_internal + "Needed to connect to conditional azimuth connector"; + + Modelica.Blocks.Interfaces.RealInput Sha_in_internal + "Needed to connect to conditional shading connector"; + + Modelica.Blocks.Interfaces.RealInput Age_in_internal + "Needed to connect to conditional ageing connector"; + + parameter Real Sha = 1 "Dummy Shading parameter"; + +equation + connect(MPPTrackingSet, MPP_in_internal); + connect(tilSet, Til_in_internal); + connect(aziSet, Azi_in_internal); + connect(shadingSet, Sha_in_internal); + connect(ageingSet, Age_in_internal); + + if not use_MPP_in then + MPP_in_internal = MPP; + end if; + + if not use_Til_in then + Til_in_internal = til; + end if; + + if not use_Azi_in then + Azi_in_internal = azi; + end if; + + if not use_Sha_in then + Sha_in_internal = Sha; + end if; + + if not use_age_in then + Age_in_internal = ageing; + end if; + +end PartialPVSystem; diff --git a/IBPSA/Electrical/Examples/PVSystemSingleDiode.mo b/IBPSA/Electrical/Examples/PVSystemSingleDiode.mo new file mode 100644 index 0000000000..5308cebe67 --- /dev/null +++ b/IBPSA/Electrical/Examples/PVSystemSingleDiode.mo @@ -0,0 +1,45 @@ +within IBPSA.Electrical.Examples; +model PVSystemSingleDiode + extends Modelica.Icons.Example; + PVSystem.PVSystemSingleDiode pVSystemSingleDiode( + til=0.5235987755983, + azi=0, + ageing=1) annotation (Placement(transformation(extent={{-8,-4},{28,20}}))); + BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam= + "D:/05_Offline/modelica-ibpsa/IBPSA/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos") + annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); + BoundaryConditions.WeatherData.Bus weaBus1 + "Weather data bus" + annotation (Placement(transformation(extent={{-58,40},{-38,60}}))); +equation + connect(weaDat.weaBus, weaBus1) annotation (Line( + points={{-60,50},{-48,50}}, + color={255,204,51}, + thickness=0.5)); + connect(weaBus1.HGloHor, pVSystemSingleDiode.HGloHor) annotation (Line( + points={{-48,50},{-36,50},{-36,22},{-7.82,22},{-7.82,18.92}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(weaBus1.TDryBul, pVSystemSingleDiode.TDryBul) annotation (Line( + points={{-48,50},{-42,50},{-42,15.56},{-7.82,15.56}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(weaBus1.winSpe, pVSystemSingleDiode.vWinSpe) annotation (Line( + points={{-48,50},{-48,12.44},{-7.82,12.44}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PVSystemSingleDiode; diff --git a/IBPSA/Electrical/Examples/package.order b/IBPSA/Electrical/Examples/package.order index e69de29bb2..484dcc0794 100644 --- a/IBPSA/Electrical/Examples/package.order +++ b/IBPSA/Electrical/Examples/package.order @@ -0,0 +1 @@ +PVSystemSingleDiode diff --git a/IBPSA/Electrical/PVSystem/PVSystemSingleDiode.mo b/IBPSA/Electrical/PVSystem/PVSystemSingleDiode.mo new file mode 100644 index 0000000000..496d3e0fab --- /dev/null +++ b/IBPSA/Electrical/PVSystem/PVSystemSingleDiode.mo @@ -0,0 +1,6 @@ +within IBPSA.Electrical.PVSystem; +model PVSystemSingleDiode "Photovoltaic module model based on single diode approach" + extends IBPSA.Electrical.BaseClasses.PVSystem.PartialPVSystem; + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PVSystemSingleDiode; diff --git a/IBPSA/Electrical/PVSystem/package.mo b/IBPSA/Electrical/PVSystem/package.mo new file mode 100644 index 0000000000..59416cfc39 --- /dev/null +++ b/IBPSA/Electrical/PVSystem/package.mo @@ -0,0 +1,4 @@ +within IBPSA.Electrical; +package PVSystem + +end PVSystem; diff --git a/IBPSA/Electrical/PVSystem/package.order b/IBPSA/Electrical/PVSystem/package.order new file mode 100644 index 0000000000..484dcc0794 --- /dev/null +++ b/IBPSA/Electrical/PVSystem/package.order @@ -0,0 +1 @@ +PVSystemSingleDiode diff --git a/IBPSA/Electrical/package.mo b/IBPSA/Electrical/package.mo index 3b153dc860..c39c13adf6 100644 --- a/IBPSA/Electrical/package.mo +++ b/IBPSA/Electrical/package.mo @@ -2,7 +2,8 @@ within IBPSA; package Electrical "Package with models for electrical systems and components" extends Modelica.Icons.Package; -annotation (Icon(graphics={Line(points={{6,82},{-60,0},{12,0},{-24,-62},{-36, - -56},{-28,-90},{2,-76},{-8,-70},{52,20},{52,20},{-14,20},{40,82},{6, - 82}}, color={0,0,0})})); +annotation (Icon(graphics={Line(points={{8,84},{-58,2},{18,2},{-22,-60},{-36, + -52},{-26,-88},{10,-76},{-6,-68},{60,20},{48,20},{-18,20},{36,84},{ + 8,84}}, + color={0,0,0})})); end Electrical; diff --git a/IBPSA/Electrical/package.order b/IBPSA/Electrical/package.order index d52e329d94..31f903d8b0 100644 --- a/IBPSA/Electrical/package.order +++ b/IBPSA/Electrical/package.order @@ -1,4 +1,5 @@ DataBase +PVSystem BaseClasses Examples Validation