GianlucaA Posted July 2, 2014 Posted July 2, 2014 Hi WAsP users!I'm currently working with WAsP11 scripting. My license is not a standard one ( no developer licence) .I would like to create a script that allows me to access the heatflux calculation parameters (and change them) in a generalized wind climate object, recalculate the wind atlas and store/export wind results.The step has to be repeat more than once for multiple heatflux values and on several climates.In this particular case study, the parent object that contains the climate is a reference site one. The operation is of course possible via gui succesfully; I'm trying to make it automatic accessing the objects parameters, but a straight forward note regarding climate object is found nor under the "IRererenceSite" object description , neither under the "IWaspSite" object description.Does someone have any idea about it? Thanks in advance. Gianluca
GianlucaA Posted July 2, 2014 Posted July 2, 2014 PN: Sorry, I meant to be that my license is a standard one
Morten Posted July 2, 2014 Posted July 2, 2014 Hi Gianluca,This must be one of the parameters sometimes displayed in the 'generalized wind climate report' if it differs from its default value. So I opened 'C:\Program Files (x86)\Wasp\Internal scripts\WAsP\WAsP 11 standard scripts.zip' and extracted the file called 'Generalised wind climate report (HTML).was9'. The section starting at line 92 of that file has a code for displaying non-default model parameters. Here you see objects called Set Configuration = Project.AsIRveaConfigurable.ConfigurationSet Parameter = Configuration.ParameterByIndex(ParameterIndex)and the parameter object has a description, value, and default value. I am guessing that ParameterIndex refers to the numbers listed in the WAsP help file section 'Technical reference| WAsP Parameters| WAsP Parameters'. I am not sure whether these parameters only have read-only access from a script, but maybe you can test that for yourself. Actually, I am not much of a WAsP scripter, but I will watch this post and alert the programmers if you ask for help. With best regards,Morten
GianlucaA Posted July 4, 2014 Posted July 4, 2014 Hi Morten,Thanks for the reply and thanks a lot for the hint: It drove me to solve half a very important part of the issues! Now I can access the configuration parameters, but the ones I need they are on line 127-133 (maybe we have different versions of the codes)Set Configuration = ReportingAssistant.TypeCaster.CastMemberToRveaConfigurable(Atlas).Configuration....Set Parameter = Configuration.ParameterByID("PROFILEMODEL")I can modify the parameters I access (in my case: heatflux parameters) and I find them modified in the workspace, as property of the parent object (in my case the reference). So I can for example update manually the calculations (via gui) and I see changes in the predicted wind climate.Now the new problem is that if I set parameters inside a cycle (eg: "for" statement) and I update the calculations in each cycle (".DoAllPossibleCalculations(True)") my output main results (variables in "PredictedWindClimate") they do not update themselves as expected, or sometimes they just do it for the first iteration, but not systematically. I worked around until export results also addressing to the example "Turbine site vertical profile (Excel).was9", where a similar approach has been usedHere and example of my output resultsStep HOL V A K E 1 -100 7.469337 8.400805 2.685547 383.21542 -75 7.33301 8.252588 2.634766 367.23643 -50 7.33301 8.252588 2.634766 367.23644 -25 7.33301 8.252588 2.634766 367.23645 0 7.33301 8.252588 2.634766 367.23646 25 7.33301 8.252588 2.634766 367.23647 50 7.33301 8.252588 2.634766 367.23648 75 7.33301 8.252588 2.634766 367.23649 100 7.33301 8.252588 2.634766 367.2364I'm starting guessing that I address to the wrong class, or I typecast in the wrong way.Any suggestion?Regards and thanks again for the supportGianluca
Morten Posted July 7, 2014 Posted July 7, 2014 Hi Gianluca,Good to hear that you are making progress. I don't know enough to help you with the new problem, but one of the expert has promised to post a hint.Best regards,Morten
GianlucaA Posted July 7, 2014 Posted July 7, 2014 Hi Morten,I was updating the post in the same moment I received your feedback ;) .I overcome the issue: I wasn't updating the typecasting of the configuration inside cycle, and so I was always pointing to the first configuration parameters read outside the cycle. Basically I was cycling without effects ....Here some feedabck results. With a for cycle I changed the heatflux offset parameter and calculated my reference for each stepStep HOL Vt At Kt1 -80 6.347 7.153 2.4982 -81 6.348 7.154 2.4983 -82 6.349 7.156 2.4984 -83 6.350 7.157 2.4985 -84 6.351 7.158 2.4986 -85 6.352 7.159 2.4987 -86 6.353 7.160 2.4988 -87 6.354 7.161 2.4989 -88 6.355 7.162 2.49810 -89 6.356 7.163 2.50211 -90 6.357 7.164 2.50212 -91 6.358 7.165 2.50213 -92 6.359 7.166 2.50214 -93 6.360 7.168 2.50215 -94 6.361 7.169 2.50216 -95 6.362 7.170 2.50217 -96 6.363 7.171 2.50218 -97 6.364 7.172 2.50219 -98 6.365 7.173 2.50220 -99 6.366 7.174 2.50621 -100 6.367 7.175 2.50222 -101 6.368 7.176 2.50623 -102 6.368 7.177 2.50624 -103 6.369 7.178 2.50625 -104 6.370 7.179 2.50626 -105 6.371 7.181 2.50627 -106 6.372 7.182 2.50628 -107 6.373 7.183 2.50629 -108 6.374 7.184 2.50630 -109 6.375 7.185 2.50631 -110 6.376 7.186 2.510Seems to be exactly what I wanted ;) Thanks again for the precious hints! G.
Morten Posted July 7, 2014 Posted July 7, 2014 Hi GianLuca,Nice work! I am already speculating whether our university students could do similar sensitivity studies by scripts, e.g. as part of their master theses.Cheers,Morten
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now