Skip to content

Actuator zone modifications and fixes - #118

Merged
joanibal merged 38 commits into
mdolab:masterfrom
anilyil:az_fix
Mar 26, 2021
Merged

joanibal merged 38 commits into
mdolab:masterfrom
anilyil:az_fix

Conversation

@anilyil

@anilyil anilyil commented Feb 7, 2021

Copy link
Copy Markdown
Contributor

Purpose

This PR adds the heat addition feature in the actuator region. Just like adding thrust equally among the actuator zone, we can now also specify an amount of heat power to be added to the flow. This BC variable is differentiated. There is an accompanying PR in baseclasses for the definition of the BC variable. See: mdolab/baseclasses#44

This also fixes a few more things:

  • Bug fix in the differentiation of the flow power integration
  • Added a few entries to the gitignore
  • Fixed a few docstrings in pyadflow
  • Fixed the indentation of the BC printout from Fortran level

I have also created several tests for the actuator zone. These are based on the initial efforts of @joanibal, so thank you Josh!

The tests include analysis, adjoint, and partial checks. I also added complex tests, and verified the adjoint sensitivities with the complex step. The complex tests will not run right now because they need fixes for the ANK solver. I am creating this PR right now so people can review the changes, and once the complex ANK is also fixed (will do it soon), then we can merge this PR.

Type of change

What types of change is it?
Select the appropriate type(s) that describe this PR

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

I added new real and complex tests. All tests pass for me locally.

Checklist

  • I have run flake8 and black to make sure the code adheres to PEP-8 and is consistently formatted
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@anilyil
anilyil requested a review from a team as a code owner February 7, 2021 19:44
@anilyil
anilyil marked this pull request as draft February 7, 2021 19:44
@anilyil

anilyil commented Feb 7, 2021

Copy link
Copy Markdown
Contributor Author

I have converted this to a draft because the complex tests won't pass until I fix the complex ANK. Other than that, please take a look and give me feedback on the changes, so we can merge this after the complex solvers are fixed.

@anilyil

anilyil commented Feb 7, 2021

Copy link
Copy Markdown
Contributor Author

I just remembered that I also need to add the files required for the tests to the inputfiles tarball. Can you help me with that step @nwu63 @eirikurj ?

@anilyil anilyil mentioned this pull request Feb 8, 2021
4 of 12 tasks
@anilyil anilyil mentioned this pull request Mar 11, 2021
2 of 12 tasks
@ewu63

ewu63 commented Mar 19, 2021

Copy link
Copy Markdown
Collaborator

A reminder for @anilyil to bump the minor version here and make a release after this is merged.

@anilyil
anilyil marked this pull request as ready for review March 20, 2021 07:52
@anilyil

anilyil commented Mar 20, 2021

Copy link
Copy Markdown
Contributor Author

This one is ready for review @joanibal @sseraj

@joanibal joanibal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nitpicks

Comment thread tests/reg_tests/test_actuator.py Outdated
# also add flowpower as an AZ function
CFDSolver.addFunction("flowpower", "actuator_region", name="flowpower_az")

def test_actuator_momentum_flux(self):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it tests both momentum and power we should change the test name

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think I meant by test momentum flux, is to test adding thrust terms, and checking if it has the correct effect on both momentum and energy fluxes through the boundaries (you can add thrust in the actuator zone and it both adds momentum to the flow, and does work on the flow)

I renamed the tests. Let me know if they are more clear.

Comment thread tests/reg_tests/test_actuator.py Resolved
Comment thread adflow/pyADflow.py Resolved
Comment thread adflow/pyADflow.py Resolved
Comment thread adflow/pyADflow.py Resolved
Comment thread adflow/pyADflow.py Resolved
Comment thread src/modules/actuatorRegionData.F90 Resolved
Comment thread src/bcdata/BCData.F90 Resolved
Comment thread src/solver/residuals.F90 Resolved
Comment thread src/solver/residuals.F90 Resolved
Comment thread tests/reg_tests/test_actuator.py Resolved
@anilyil anilyil mentioned this pull request Mar 24, 2021
@anilyil

anilyil commented Mar 24, 2021

Copy link
Copy Markdown
Contributor Author

thanks for the review @joanibal and @sseraj. I think I addressed all of your comments except Josh's comment at: #118 (comment) Once we figure out that test, this is good to go for me.

@anilyil
anilyil requested review from joanibal and sseraj March 24, 2021 11:25
@sseraj

sseraj commented Mar 24, 2021

Copy link
Copy Markdown
Collaborator

I think the only other thing is to bump the minor version

@anilyil

anilyil commented Mar 24, 2021

Copy link
Copy Markdown
Contributor Author

I will make the new release after this is merged right?

@sseraj

sseraj commented Mar 24, 2021

Copy link
Copy Markdown
Collaborator

I will make the new release after this is merged right?

Yes, that would be great.

@joanibal
joanibal merged commit 0a59d89 into mdolab:master Mar 26, 2021
@joanibal
joanibal deleted the az_fix branch March 26, 2021 14:52
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

Successfully merging this pull request may close these issues.

4 participants