Heat parametric optimization

hey guys hope u are fine!

i am trying to write a coad that input surface and divide this surface by u and v number then create panal according to solar heat gain … so i thought in 2 diffrent ways :
1st to cteate mesh with the desired u &v number then deconstruct it and calculate diffrence between normal of each polygon and the sun vector .

2nd to run a ladybug simulation then use the output of solar gain to scal the panal opening

so if u know where to find a similar difinition i will really appreciate it as i have a collage project deadline soon.
thank u in advance.