Jump to content

Script fails for more than two wind farms


Recommended Posts

Dear all,

I have a workspace with three identical projects, each consisting of a 'Terrain analysis (IBZ)', a 'wind farm' and a GWC (plus some notes). I also have a script, which iterates through the projects and calculates the respective windfarm using the DoAllPossibleCalculations method.


The weird thing is that the wind farm calculation works well for the first two projects, but fails for the third (and all further) wind farms. More specifically it fails to calculate the wake losses and net AEP, while the free AEP is calculated for each turbine and the wind farm.


By default, each wind farm is calculated by issuing WindFarm.AsICalculatingHierarchyMember.DoAllPossibleCalculations(False). This works as expected for the first two projects/wind farms. However, in the third project nothing happens. I then check the properties of WindFarm.AsICalculatingHierarchyMember.CalculationByType(ectWakeLosses). In the third wind farm I find that:
.Status = 3 (i.e. echmsResultsDirtyCanRecalculate)
.AreResultsDirty = True
.CanCalculate = True
.AreThereResults = False

However, when I then run the WindFarm.AsICalculatingHierarchyMember.CalculationByType(ectWakeLosses).Calculate method immediately after checking these variables, still nothing happens, and the variables keep the same values a as before.


I have no clue what happens here and how to resolve that. As I said, the three projects/windfarms are identical (checked this by exporting the projects to w.p files and compared the resulting Inventory.xml files, which differ only in the ID strings and the references to the .tmp files). Why does the WindFarm refuse to calculate in the third project?


I also checked to put all three farms inside of one project, but the result is the same, so I suppose that this issue is related to the wind farm calculation method.


Any suggestion is welcome. Thanks in advance!
Link to comment
Hi again,


I did some more research and discovered that it's not the calculation itself that's causing the problem. The problematic step actually is when after the calculation I also write the respective Project to a file using Project.AsIRveaPreservableObject.PreserveToFile. This method appears to work well for the first three times it is called, but then fails for whatever reason. After that failure, wake calculations fail for all subsequently evaluated projects.


Is there any in-depth documentation about the WAsP scriptig environment and what happens when we save parts of the workspace? The latest info I have is from a post by Duncan in May 2011...


Thanks
Link to comment
  • 11 months later...
Just to close this topic: it turned out that there was a bug in the PreserveToFile function, which has been fixed by the developers in WAsP version 11.6.0018 and all newer releases. Thanks again for the great support!
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...