Calculation of Perez model

  • Mustafa
  • Topic Author
More
26 May 2022 12:09 - 26 May 2022 23:03 #11000 by Mustafa
Calculation of Perez model was created by Mustafa
I was looking into Perez model as implemented in SSC in cmod_pvwattsv0.cpp and comparing it to the technical handbook.

According to the module and other resources, the airmass should be

Attachment eq-am0.png not found



where b is the incidence angle.

Somehow in  this line  the equation for airmass is:
AIRMASS = 1.0 / (CZ + 0.15 * pow(93.9 - ZENITH, -1.253) );

and CZ in  this line  is:
CZ = cos(zen);

where zen is the sun's zenith in radiations and ZENITH the sun's zenith in degrees.

Shouldn't the equation for airmass replace CZ with cos(inc)? or am I missing something?


Thanks in advance.

Best,
Mustafa Alotbah
Attachments:
Last edit: 26 May 2022 23:03 by Paul Gilman.

Please Log in or Create an account to join the conversation.

  • Paul Gilman
More
26 May 2022 23:18 #11001 by Paul Gilman
Replied by Paul Gilman on topic Calculation of Perez model
Hi Mustafa,

Your observation is correct, but pvwattsv0 is a very outdated version of PVWatts.

The relevant code for the Perez model that is used by pvwattsv1 and later versions is here: github.com/NREL/ssc/blob/cd1b0110e43826d98fbe52bfac4f4f56f9d7afcc/shared/lib_irradproc.cpp#L2000

As of SAM 2021.12.02, SAM's implementation of PVWatts uses pvwattsv8.

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

  • Mustafa
  • Topic Author
More
27 May 2022 09:29 #11003 by Mustafa
Replied by Mustafa on topic Calculation of Perez model
Hi Paul,

Thank you, I figured that out after I had published the post, but even in lib_irradproc.cpp this line  defines the airmass, which I think has the same issue, it uses CZ (Cos Zenith) instead of COSINC which is only defined afterwards.


Best regards,
Mustafa.

Please Log in or Create an account to join the conversation.

  • Mustafa
  • Topic Author
More
27 May 2022 11:24 - 27 May 2022 22:02 #11005 by Mustafa
Replied by Mustafa on topic Calculation of Perez model
Hi Paul,

another thing,  in this line  B is calculated as 
B = D * F1 * ZC / ZH;

ZC being "a" in the handbook and ZH assumed to be "b", however, this does not seem to be correct, according to the handbook:

Attachment eq1.png not found



which is B in the code, and b is defined as 

Attachment eq2.png not found



while, ZH is the maxiumum of 85 degrees and CZ again, instead of ZC/COSINC, check these lines out: 

1967  CZ = cos(zen);
1968  ZH = (CZ > 0.0871557) ? CZ : 0.0871557;  /* Maximum of 85 deg */



Best regards,
Mustafa
Attachments:
Last edit: 27 May 2022 22:02 by Paul Gilman.

Please Log in or Create an account to join the conversation.

  • Paul Gilman
More
27 May 2022 22:24 #11009 by Paul Gilman
Replied by Paul Gilman on topic Calculation of Perez model
Hi Mustafa,

ZC is defined here based on cos(inc): github.com/NREL/ssc/blob/cd1b0110e43826d98fbe52bfac4f4f56f9d7afcc/shared/lib_irradproc.cpp#L2000

CZ is different, and is part of a modification to the Perez model that treats diffuse irradiance as isotropic when the zenith angle not between 0 and 87.5 degrees.

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

Moderators: Paul Gilman
Powered by Kunena Forum