Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradient unit test and evaluate method #15

Closed
ghost opened this issue Aug 14, 2019 · 2 comments
Closed

Gradient unit test and evaluate method #15

ghost opened this issue Aug 14, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 14, 2019

Hi,

I installed CCBlade and it seems to work when running the unittest without gradients (I also tried without creating an instance of CCBlade and CCAirfoil and it seem to work as expected).
But when running the unittest for gradients I get an error for almost all the cases (only showing the last one):

ERROR: test_dpitch3 (__main__.TestGradientsFreestreamArray)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_gradients.py", line 2135, in setUp
    = self.rotor.evaluate(self.Uinf, self.Omega, self.pitch, coefficient=False)
TypeError: evaluate() got an unexpected keyword argument 'coefficient'

----------------------------------------------------------------------

It seems like there might have been an API change from coefficient to coefficients. Adding the s solves that part of the problem.

But the unittest still dose not pass without errors. The last unittest error now looks like:

ERROR: test_dpitch3 (__main__.TestGradientsFreestreamArray)
----------------------------------------------------------------------
Traceback (most recent call last):
 File "test/test_gradients.py", line 2135, in setUp
   = self.rotor.evaluate(self.Uinf, self.Omega, self.pitch, coefficients=False)
ValueError: too many values to unpack (expected 6)

----------------------------------------------------------------------

And by looking into the code it seems like there has been made two changes to the return statement of the evaluate method since the unittest was made.

  1. The flap root bending moment has been added (M, CM)
  2. It returns both coefficients and real values when coefficients=True, opposed to returning only coefficients.

I guess that it is "just" a matter of adding M and CM to the output?
Is there a preferred behaviour for when coefficients=True?

@ptrbortolotti
Copy link
Contributor

Dear kenneth-loenbaek,
thanks for your message and for your interest in CCBlade.
You are right, the unit test got broken after changing the keyword coefficient to coefficients and adding the moment coefficient as an output. Our apologies for not fixing that.
The good news is that this piece of code is soon to be deprecated, as we have been working hard to make the development of wisdem complaint to a rigorous git workflow (https://www.atlassian.com/git/tutorials/comparing-workflows)
To do so, we are moving to a single repository, that you can find in the openmdao2 branch of https://github.com/WISDEM/WISDEM. The code here works and feel free to use it already today. In the next weeks and months we will implement a series of unit tests that each commit will have to successfully pass.
I hope this helps.
Best regards,
Pietro Bortolotti

@gbarter
Copy link
Member

gbarter commented May 3, 2020

This has been fixed thanks to @whophil !

@gbarter gbarter closed this as completed May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants