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

Aero-acoustics from analytical CFD solutions or an analytical expression of the source term #659

Merged
merged 13 commits into from
May 28, 2024

Conversation

jh66637
Copy link
Contributor

@jh66637 jh66637 commented May 9, 2024

The co-rotating vortex test case is quite nice to benchmark different coupling algorithms for aero-acoustics since an analytical CFD solution is known in addition to an analytical solution for the acoustics in the far field. Additionally, it is possible to derive an analytical expression of the aero-acoustic source term.

We have used this procedure successfully to gain insight into the advantages and disadvantages of different coupling strategies.

This PR introduces two methods to compute the acoustic propagation from analytical solutions.

  • Given analytical CFD pressure and velocity, simply interpolate the solution onto the CFD grid and compute the acoustic as usual. For this interpolation, I introduced an AnalyticalTimeIntegrator. This way, we do not have to check at numerous places if the analytical solution should be used instead of a computed one.
  • In case we know the expression of the source term we also know the analytical CFD solution. To be able to compute realistic time step sizes via the CFL condition, we make use of the AnalyticalTimeIntegrator in this case as well. However, the source term is now computed from the analytical function of the source term instead of the analytical CFD solution.

In my opinion, this PR is a prerequisite for some follow-up PRs that introduce different volume coupling algorithms.

@nfehn
Copy link
Member

nfehn commented May 14, 2024

I looked at the code and I think the "time integrator" suggested here is an elegant way to achieve what you need here.

As detailed in the comments, I see some points of discussion regarding the usage of lambda functions and the design/naming of parameters.

@jh66637
Copy link
Contributor Author

jh66637 commented May 14, 2024

@nfehn Thank you for the review. I adjusted the code. Introducing a version of value that does not take time and thus can work on const Function will be introduced in a separate PR. Please let me know what you think about the rest of the changes :)

Comment on lines 994 to 995
velocity.zero_out_ghost_values();
pressure.zero_out_ghost_values();
Copy link
Member

Choose a reason for hiding this comment

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

It is not clear to me why we have these lines of code here, while we do not have them e.g. in the function prescribe_initial_conditions() above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will move the line to the analytical time integrator:)

Copy link
Member

Choose a reason for hiding this comment

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

I am fine with this. I think a comment explaining why we have/need these lines of code would help me to better understand the code (e.g.: what would happen if one forgot to write these lines of code? segmentation-fault or performance penalty or ...?).

We can also do this as a follow-up so that we can merge the present PR soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dealii::VT::interpolate() simply throws an exception with zeroed out ghost values. During time stepping the vectors are not zeroed out though, so we have to care about that ourselves.

@nfehn
Copy link
Member

nfehn commented May 27, 2024

@jh66637 Many thanks for your updates (and sorry for my late response, I was on holidays ...). I like the changes. I have one more comment regarding code duplication.

@nfehn nfehn added multiphysics time integration time integration schemes labels May 27, 2024
@nfehn nfehn merged commit 328afcc into exadg:master May 28, 2024
4 checks passed
@jh66637 jh66637 mentioned this pull request May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multiphysics time integration time integration schemes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants