- Posts: 6
Calculation of Perez model
- mustafa_alotbah
- Topic Author
Less
More
26 May 2022 06:09 - 26 May 2022 17:03 #11000
by mustafa_alotbah
Calculation of Perez model was created by mustafa_alotbah
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
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
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 17:03 by pgilman.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
26 May 2022 17:18 #11001
by pgilman
Replied by pgilman 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.
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_alotbah
- Topic Author
Less
More
- Posts: 6
27 May 2022 03:29 #11003
by mustafa_alotbah
Replied by mustafa_alotbah 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.
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_alotbah
- Topic Author
Less
More
- Posts: 6
27 May 2022 05:24 - 27 May 2022 16:02 #11005
by mustafa_alotbah
Replied by mustafa_alotbah 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:
which is B in the code, and b is defined as
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
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 16:02 by pgilman.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
27 May 2022 16:24 #11009
by pgilman
Replied by pgilman 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.
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: pgilman