Skip to content

Runtime BC control for both cc and fc variables#1516

Merged
chongchonghe merged 30 commits into
developmentfrom
chong/BC/quokka-bc-v2
Dec 25, 2025
Merged

Runtime BC control for both cc and fc variables#1516
chongchonghe merged 30 commits into
developmentfrom
chong/BC/quokka-bc-v2

Conversation

@chongchonghe

Copy link
Copy Markdown
Contributor

Description

Now, we define boundary conditions with a single runtime parameter. This overrides geometry.is_periodic = 1 1 1. No need for BCs_cc in the problem creator.

quokka.bc = periodic periodic reflecting

Checklist

Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an x inside the square brackets [ ] in the Markdown source below:

  • I have added a description (see above).
  • I have added a link to any related issues (if applicable; see above).
  • I have read the Contributing Guide.
  • I have added tests for any new physics that this PR adds to the code.
  • (For quokka-astro org members) I have manually triggered the GPU tests with the magic comment /azp run.

@chongchonghe

Copy link
Copy Markdown
Contributor Author

@BenWibking I'll wait for your comments before refactoring all the problems to use this new design, which requires some python scripting.

@BenWibking

Copy link
Copy Markdown
Collaborator

This is a nice clean-up. Can it also set BCs_fc?

@chongchonghe

Copy link
Copy Markdown
Contributor Author

This is a nice clean-up. Can it also set BCs_fc?

Not yet, but it's trivial to extend it to support that. Then, there will be a quokka.BC_fc

@BenWibking

Copy link
Copy Markdown
Collaborator

This is a nice clean-up. Can it also set BCs_fc?

Not yet, but it's trivial to extend it to support that. Then, there will be a quokka.BC_fc

I think it would be better to set both with the same parameter. Is there a case where you think that wouldn't be possible?

@chongchonghe

Copy link
Copy Markdown
Contributor Author

This is a nice clean-up. Can it also set BCs_fc?

Not yet, but it's trivial to extend it to support that. Then, there will be a quokka.BC_fc

I think it would be better to set both with the same parameter. Is there a case where you think that wouldn't be possible?

That will be even simpler. I don't know if MHD B.C. will always be the same as hydro. If yes, then we should use the same parameter.

What about reflecting BC for fc variables? All current MHD tests use periodic or Dirichlet BC, but I think we want to support reflecting BC as well, right? Do we have to handle odd/even reflection, or is it always even reflection since we only have one variable (magnetic field) for each dimension?

@BenWibking

Copy link
Copy Markdown
Collaborator

This is a nice clean-up. Can it also set BCs_fc?

Not yet, but it's trivial to extend it to support that. Then, there will be a quokka.BC_fc

I think it would be better to set both with the same parameter. Is there a case where you think that wouldn't be possible?

That will be even simpler. I don't know if MHD B.C. will always be the same as hydro. If yes, then we should use the same parameter.

What about reflecting BC for fc variables? All current MHD tests use periodic or Dirichlet BC, but I think we want to support reflecting BC as well, right? Do we have to handle odd/even reflection, or is it always even reflection since we only have one variable (magnetic field) for each dimension?

You can do reflecting BCs for magnetic fields, but you have to handle the parity in a special way. The normal component should be even, and the transverse components should be odd.

@chongchonghe chongchonghe changed the title Chong/bc/quokka bc v2 Runtime boundary condition control Dec 16, 2025
@chongchonghe chongchonghe changed the title Runtime boundary condition control Runtime BC control for both cc and fc variables Dec 16, 2025
@chongchonghe

Copy link
Copy Markdown
Contributor Author

You can do reflecting BCs for magnetic fields, but you have to handle the parity in a special way. The normal component should be even, and the transverse components should be odd.

@BenWibking I'll leave this for a future PR. In this PR, I assume 'reflecting' for cc = 'reflect_even' for fc, just like what you did in all the MHD particle tests.

@chongchonghe chongchonghe marked this pull request as ready for review December 16, 2025 13:25
@chongchonghe

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@chongchonghe

Copy link
Copy Markdown
Contributor Author

@BenWibking This is ready for review.

@chongchonghe

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@chongchonghe

Copy link
Copy Markdown
Contributor Author

@BenWibking This is ready.

Comment thread inputs/BinaryOrbitAMR.in
Comment thread inputs/radhydro_shell_regression.in
Comment thread src/main.cpp
Comment thread src/main.cpp
Comment thread src/main.cpp
Comment thread src/main.cpp

@markkrumholz markkrumholz 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.

Just left some minor cleanup comments.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Dec 24, 2025
@markkrumholz

Copy link
Copy Markdown
Collaborator

Looks like this will need to be updated to the base branch to pass the rocm-diskgalaxy-container test. Also, there's still a SonarCloud failure that will block merging.

@chongchonghe

Copy link
Copy Markdown
Contributor Author

Also, there's still a SonarCloud failure that will block merging.

The SonarCloud warnings are optional and we can ignore it. I think unless we can control the rules of SonarCloud, we should not make it mandatory. We had discussions in #1529

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@chongchonghe chongchonghe added this pull request to the merge queue Dec 25, 2025
Merged via the queue into development with commit ececf5a Dec 25, 2025
45 of 46 checks passed
@chongchonghe chongchonghe deleted the chong/BC/quokka-bc-v2 branch December 26, 2025 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants