Skip to content

Issue1575 add pv model#1766

Open
LauraMaier wants to merge 205 commits intomasterfrom
issue1575_addPVModel
Open

Issue1575 add pv model#1766
LauraMaier wants to merge 205 commits intomasterfrom
issue1575_addPVModel

Conversation

@LauraMaier
Copy link
Contributor

This closes #1575

We added a new PV model to the IBPSA library.
The model has the following characteristics:

  • The model is based on two different approaches for the I-V- characteristic: a single- and two-diode approach.
  • We included three modeling approaches to calculate the cell temperature depending on the PV mounting: open rack, close-to-ground, and in-contact-with-ground
  • The model was validated using measurement data from a rooftop PV system in Berlin, Germany. Further information can be found here: http://www.solar-rooftop.de

LauraMaier and others added 30 commits June 13, 2022 12:12
@LauraMaier LauraMaier requested a review from mwetter October 16, 2025 10:37
@LauraMaier
Copy link
Contributor Author

@mwetter: I do not understand why the CI fails for IBPSA.Electrical.DC.Sources.Validation.PVSingleDiodeRooftopBuildingValidation since the "Simulate and Plot" script works fine on my desktop.

@JayHuLBL
Copy link
Contributor

@LauraMaier Running the model IBPSA.Electrical.DC.Sources.Examples.PVSingleDiode with Dymola (2025x) GUI, I see following error:

Screenshot 2025-10-16 at 11 19 44 AM

@mwetter
Copy link
Contributor

mwetter commented Oct 20, 2025

@LauraMaier
IBPSA.Electrical.BaseClasses.PV.PVElectricalSingleDiodeMPP
lines 71 ff needs no regularization because k is a constant and TCel is always larger than zero.

In the same file, the expressions

  RSh/RSh0 = 1/max(absRadRat, Modelica.Constants.eps);

  // Simplified power correlations at MPP using Lambert W function (Batzelis et al., 2016)

  IMP = max(0,IPh*(1 - 1/w) - a*(w - 1)/max(Modelica.Constants.eps, RSh));

can be rewritten without regularization. The problem in the original formulation is that RSh is computed with guard against division by zero, and then IMP uses this in the denominator. Eliminating RSh avoid direct use without this guard. If RSh is indeed needed as an output, then we can add it back in, but for now I commented it.

I added these changes in 8421baa80 together with some other changes further down in that file, but now I am stuck: If IPh0 could be a parameter, then I can easily proceed, otherwise it gets more elaborated. Given the names and comments of IPh0, IS0, ... w0, I think the can all be parameter expressions, but I don't understand the model use sufficiently. Can you make them parameters and if so, do a commit to make the change?

Also, please correct the unit error that @JayHuLBL pointed out so the regression tests run and we can make sure that we don't introduce an error when making these changes.

@LauraMaier
Copy link
Contributor Author

@LauraMaier Running the model IBPSA.Electrical.DC.Sources.Examples.PVSingleDiode with Dymola (2025x) GUI, I see following error:

Screenshot 2025-10-16 at 11 19 44 AM

Thanks for comment. Adressed @JayHuLBL's comment in commit aee2cfc

@LauraMaier
Copy link
Contributor Author

@LauraMaier IBPSA.Electrical.BaseClasses.PV.PVElectricalSingleDiodeMPP lines 71 ff needs no regularization because k is a constant and TCel is always larger than zero.

In the same file, the expressions

  RSh/RSh0 = 1/max(absRadRat, Modelica.Constants.eps);

  // Simplified power correlations at MPP using Lambert W function (Batzelis et al., 2016)

  IMP = max(0,IPh*(1 - 1/w) - a*(w - 1)/max(Modelica.Constants.eps, RSh));

can be rewritten without regularization. The problem in the original formulation is that RSh is computed with guard against division by zero, and then IMP uses this in the denominator. Eliminating RSh avoid direct use without this guard. If RSh is indeed needed as an output, then we can add it back in, but for now I commented it.

I added these changes in 8421baa80 together with some other changes further down in that file, but now I am stuck: If IPh0 could be a parameter, then I can easily proceed, otherwise it gets more elaborated. Given the names and comments of IPh0, IS0, ... w0, I think the can all be parameter expressions, but I don't understand the model use sufficiently. Can you make them parameters and if so, do a commit to make the change?

Also, please correct the unit error that @JayHuLBL pointed out so the regression tests run and we can make sure that we don't introduce an error when making these changes.

Thanks for your support, @mwetter.
You are right. I redeclared the former variables "_0" to parameters in e89ebf9

@LauraMaier
Copy link
Contributor Author

@mwetter and @JayHuLBL : Again, models look fine with Dymola 2023. I cannot update to the latest Dymola version since I am no longer employed at the university. Can you maybe share the error log since I cannot find it in the CI and cannot reproduce it locally since everything runs smoothly here. Thanks for the support!

@JayHuLBL
Copy link
Contributor

@mwetter and @JayHuLBL : Again, models look fine with Dymola 2023. I cannot update to the latest Dymola version since I am no longer employed at the university. Can you maybe share the error log since I cannot find it in the CI and cannot reproduce it locally since everything runs smoothly here. Thanks for the support!

I will test it and let you know if there is any problem.

@JayHuLBL
Copy link
Contributor

@LauraMaier All the models can run successfully with Dymola 2025x. I have run the unit test and pushed the reference data.

@LauraMaier
Copy link
Contributor Author

@LauraMaier All the models can run successfully with Dymola 2025x. I have run the unit test and pushed the reference data.

@JayHuLBL : Many thanks for your valuable support. I added some minor adjustment for OM compatibility.
@mwetter : From my side, the models are ready. Please feel free to review whenever suitable. I don't know when I will be available since I am an maternity leave and the EDD is in 9 days from now ;-) but I will try to get back to it as soon as possible.

Copy link
Contributor

@JayHuLBL JayHuLBL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LauraMaier I did some changes to modify the format and appearance of the models. Also:

  • IBPSA.Electrical.BaseClasses.PV.PVThermalEmpMountContactToGround is not used by any class. Do we need it?
  • IBPSA.Electrical.BaseClasses.PV.PVThermalEmpMountOpenRack is not used by any class. Do we need it?
  • In IBPSA.Electrical.BaseClasses.PV.BaseClasses.PartialPVOptical, how is the input tilSet being used? Although the base class PV.BaseClasses.PartialPVOptical is used by IBPSA.Electrical.BaseClasses.PV.PVOpticalAbsRat and IBPSA.Electrical.BaseClasses.PV.PartialPVSystem, I don’t see tilSet being needed.
  • Has the imageResources/Images/Electrical/AC/OnePhase/Storage/Examples/SOCs.png been used anywhere? Otherwise, it should be deleted.

@LauraMaier
Copy link
Contributor Author

LauraMaier commented Dec 9, 2025

Thank you so much, @JayHuLBL !

  • Regarding the unused models IBPSA.Electrical.BaseClasses.PV.PVThermalEmpMountContactToGround and IBPSA.Electrical.BaseClasses.PV.PVThermalEmpMountOpenRack: these are empirical models based on literature which are documented in the main model. Depending on the mounting situation, you have to select a different thermal model. The selection is based on the tilt and described accordingly. In my opinion, we should leave them in the model so that other users can adapt the PV model to their mounting situation.

  • The situation with tilSet is a comparable one. It is an option that if users want to have an adaptable tilt (like a motorized PV cell following the sun), the models offers the opportunity. I extended the documentation to explain the use of it.

  • Good catch, thanks. I deleted the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add simplified PV system model based on 5p analytical modeling approach

5 participants