Skip to content

Solar Panel

Represents a Solar Panel unit operation that calculates electrical power output from solar irradiation, panel area, efficiency, and the number of panels.

DWSIM.UnitOperations.UnitOperations.SolarPanel
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← CleanEnergyUnitOpBase ← SolarPanel

At a glance

Solar Panel in the example flowsheet

Port Index Connected in the example
Outlet, energy 0 PV-1 power

Example

This code runs on every build of this site, and the output below is what it printed.

fs = (Flowsheet.Create("SolarPanelExample")
      .WithCompound("Water")
      .WithPropertyPackage(PropertyPackages.SteamTables))

power = fs.AddEnergyStream("PV-1 power")

pv = (fs.AddSolarPanel("PV-1")
      .WithPanelAreaM2(1.95)                 # area of one panel
      .WithPanelCount(20)
      .WithPanelEfficiencyPercent(21.0)
      .WithSolarIrradiationKWPerM2(0.85))
pv.Object.CreateConnectors()                 # the canvas creates the ports on first draw
pv.ConnectEnergyProduct(power, 0)            # electric power leaves through port 0

# Use the irradiation set above instead of the flowsheet's global weather conditions
pv.Object.UseUserDefinedWeather = True

fs.AutoLayout()
fs.Solve()

print(f"Total area         = {1.95 * 20:.1f} m2")
print(f"Irradiation used   = {pv.ActualSolarIrradiationKWPerM2:.3f} kW/m2")
print(f"Generated power    = {pv.GeneratedPowerKW:.3f} kW")
print(f"Energy stream      = {power.Object.EnergyFlow:.3f} kW")

Output

Total area         = 39.0 m2
Irradiation used   = 0.850 kW/m2
Generated power    = 6.962 kW
Energy stream      = 6.962 kW

DWSIM 10.2.11.0, generated 2026-10-08.

Properties

IDs accepted by GetPropertyValue, SetPropertyValue, the sensitivity analysis, the optimizer, the Adjust block and dynamic events. Units are SI; pass another unit system to GetPropertyValue to get them converted.

ID Name Unit (SI) Input
Efficiency % yes
User-Defined Solar Irradiation kW/m2 yes
Actual Solar Irradiation kW/m2 result
Panel Area m2 yes
Number of Panels yes
Generated Power kW result

Learn more

API members

Public members declared by this class. Inherited members are documented on the base classes.

Constructors

SolarPanel(): Initializes a new default instance of the SolarPanel class.

Initializes a new default instance of the SolarPanel class.

public SolarPanel()
Public Sub New()

Properties

ActualSolarIrradiation_kW_m2: Gets or sets the actual (weather-adjusted) solar irradiation used in the calculation (kW/m²).

Gets or sets the actual (weather-adjusted) solar irradiation used in the calculation (kW/m²).

public double ActualSolarIrradiation_kW_m2 { get; set; }
Public Property ActualSolarIrradiation_kW_m2 As Double

EquipmentTypes: Gets the list of equipment sub-types (Monocrystalline, Polycrystalline, Thin Film).

Gets the list of equipment sub-types (Monocrystalline, Polycrystalline, Thin Film).

public override List<string> EquipmentTypes { get; }
Public Overrides ReadOnly Property EquipmentTypes As List(Of String)

GeneratedPower: Gets or sets the calculated generated electrical power (kW).

Gets or sets the calculated generated electrical power (kW).

public double GeneratedPower { get; set; }
Public Property GeneratedPower As Double

NumberOfPanels: Gets or sets the number of panels in the array.

Gets or sets the number of panels in the array.

public int NumberOfPanels { get; set; }
Public Property NumberOfPanels As Integer

PanelArea: Gets or sets the area of a single panel (m²).

Gets or sets the area of a single panel (m²).

public double PanelArea { get; set; }
Public Property PanelArea As Double

PanelEfficiency: Gets or sets the panel conversion efficiency (%).

Gets or sets the panel conversion efficiency (%).

public double PanelEfficiency { get; set; }
Public Property PanelEfficiency As Double

Prefix: Gets or sets the default name prefix for this unit operation.

Gets or sets the default name prefix for this unit operation.

public override string Prefix { get; set; }
Public Overrides Property Prefix As String

SolarIrradiation_kW_m2: Gets or sets the user-specified solar irradiation (kW/m²).

Gets or sets the user-specified solar irradiation (kW/m²).

public double SolarIrradiation_kW_m2 { get; set; }
Public Property SolarIrradiation_kW_m2 As Double

Methods

Calculate(object): Calculates the generated power from solar irradiation, panel area, efficiency, and count.

Calculates the generated power from solar irradiation, panel area, efficiency, and count.

Parameter Type Description
args Object
public override void Calculate(object args = null)
Public Overrides Sub Calculate(args As Object = Nothing)

CloneXML(): Creates a deep copy via XML serialization.

Creates a deep copy via XML serialization.

public override object CloneXML()
Public Overrides Function CloneXML() As Object

CloseEditForm(): Closes and disposes the editing form.

Closes and disposes the editing form.

public override void CloseEditForm()
Public Overrides Sub CloseEditForm()

CreateConnectors(): Creates the graphic connector definitions (energy outlet) on the flowsheet.

Creates the graphic connector definitions (energy outlet) on the flowsheet.

public override void CreateConnectors()
Public Overrides Sub CreateConnectors()

CreateDimensionsList(): Creates the dimensions list (Area, Efficiency) for this solar panel.

Creates the dimensions list (Area, Efficiency) for this solar panel.

public override void CreateDimensionsList()
Public Overrides Sub CreateDimensionsList()

DisplayEditForm(): Opens or activates the editing form.

Opens or activates the editing form.

public override void DisplayEditForm()
Public Overrides Sub DisplayEditForm()

Draw(object): Draws the solar panel icon on the given SkiaSharp canvas.

Draws the solar panel icon on the given SkiaSharp canvas.

Parameter Type Description
g Object
public override void Draw(object g)
Public Overrides Sub Draw(g As Object)

GetDisplayDescription(): Returns the display description for this unit operation.

Returns the display description for this unit operation.

public override string GetDisplayDescription()
Public Overrides Function GetDisplayDescription() As String

GetDisplayName(): Returns the display name for this unit operation.

Returns the display name for this unit operation.

public override string GetDisplayName()
Public Overrides Function GetDisplayName() As String

GetIconBitmapBytes(): Returns the icon bitmap as a byte array.

Returns the icon bitmap as a byte array.

public override byte[] GetIconBitmapBytes()
Public Overrides Function GetIconBitmapBytes() As Byte()

GetProperties(PropertyType): Returns an array of property identifiers for the specified property type.

Returns an array of property identifiers for the specified property type.

Parameter Type Description
proptype PropertyType
public override string[] GetProperties(PropertyType proptype)
Public Overrides Function GetProperties(proptype As PropertyType) As String()

GetPropertyUnit(string, IUnitsOfMeasure): Returns the unit string for the specified property.

Returns the unit string for the specified property.

Parameter Type Description
prop String
su IUnitsOfMeasure
public override string GetPropertyUnit(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyUnit(prop As String, su As IUnitsOfMeasure = Nothing) As String

GetPropertyValue(string, IUnitsOfMeasure): Returns the value of the specified property.

Returns the value of the specified property.

Parameter Type Description
prop String
su IUnitsOfMeasure
public override object GetPropertyValue(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyValue(prop As String, su As IUnitsOfMeasure = Nothing) As Object

GetReport(IUnitsOfMeasure, CultureInfo, string): Generates a plain-text report of the solar panel results.

Generates a plain-text report of the solar panel results.

Parameter Type Description
su IUnitsOfMeasure
ci CultureInfo
nf String
public override string GetReport(IUnitsOfMeasure su, CultureInfo ci, string nf)
Public Overrides Function GetReport(su As IUnitsOfMeasure, ci As CultureInfo, nf As String) As String

LoadData(List<XElement>): Restores the solar panel state from XML.

Restores the solar panel state from XML.

Parameter Type Description
data List<XElement>
public override bool LoadData(List<XElement> data)
Public Overrides Function LoadData(data As List(Of XElement)) As Boolean

PopulateEditorPanel(object): Populates the cross-platform editor panel with controls for this solar panel.

Populates the cross-platform editor panel with controls for this solar panel.

Parameter Type Description
ctner Object
public override void PopulateEditorPanel(object ctner)
Public Overrides Sub PopulateEditorPanel(ctner As Object)

ReturnInstance(string): Creates and returns a new instance for deserialization.

Creates and returns a new instance for deserialization.

Parameter Type Description
typename String
public override object ReturnInstance(string typename)
Public Overrides Function ReturnInstance(typename As String) As Object

SaveData(): Serializes the solar panel state to XML.

Serializes the solar panel state to XML.

public override List<XElement> SaveData()
Public Overrides Function SaveData() As List(Of XElement)

SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of the specified property.

Sets the value of the specified property.

Parameter Type Description
prop String
propval Object
su IUnitsOfMeasure
public override bool SetPropertyValue(string prop, object propval, IUnitsOfMeasure su = null)
Public Overrides Function SetPropertyValue(prop As String, propval As Object, su As IUnitsOfMeasure = Nothing) As Boolean

UpdateDimensionsList(): Updates the dimension values from the current panel properties.

Updates the dimension values from the current panel properties.

public override void UpdateDimensionsList()
Public Overrides Sub UpdateDimensionsList()

UpdateEditForm(): Refreshes the editing form with updated data.

Refreshes the editing form with updated data.

public override void UpdateEditForm()
Public Overrides Sub UpdateEditForm()

Fields

f: The classic (WinForms) editor window open for this unit operation, if any.

The classic (WinForms) editor window open for this unit operation, if any. Not saved with the flowsheet.

public object f
Public f As Object