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

Linear Euler 2D Model #69

Merged
merged 38 commits into from
Nov 12, 2024
Merged

Linear Euler 2D Model #69

merged 38 commits into from
Nov 12, 2024

Conversation

fluidnumerics-joe
Copy link
Member

@fluidnumerics-joe fluidnumerics-joe commented Nov 8, 2024

This PR adds the linear Euler 2D model with a few examples included.

Documentation has been updated to

  • define the linear euler 2-D model in the Models section
  • describe each of the tutorials for plane wave propagation with and without reflection and spherical sound wave with reflection

The Linear Euler 2D model includes full gpu acceleration for no-normal-flow and radiation boundary conditions. Prescribed boundary conditions are still run on the CPU so that users can define prescribed boundaries by overriding the hbc2d_prescribed (pure function) type bound procedure; we have provided the necessary memcpy's between host and device to ensure correctness.

There is an optional boolean in the SELF_Model class called prescribed_bcs_enabled that can be set to false in a model object to explicitly disable prescribed boundary conditions if requested. In simulations where time dependent prescribed boundaries are not used, this helps avoid superfluous memcpy's between host and device. This has been documented in the Linear Euler 2-D model documentation.

This PR also brings in a correctness bug fix related to multi-variable vector divergence.

This allows us to more easily enforce a fixed number of variables for a
model, which removes room for error in writing a program that uses a
model defined in SELF. Further, it removes the need to rewrite an Init
procedure for each new model.
Still need to add GPU accelerated kernels for built in boundary
conditions, like no-normal-flow and radiation.

Documentation for the model is also needed
Example updated for low io frequency
I ended up swapping in our hand-written kernels, rather than using the
blas interfaces. This is much faster for our problems, but it does limit
the polynomial degree to 15 for 2-D and 7 for 3-D when running on GPUs.
The caveat here is that, to support prescribed boundary conditions, we
do need to leveraged the `hbc2d_prescribed` boundary condition to make
it easy to set time dependent prescribed boundaries.
CI is failing due to long runs
This was used for previous debugging and is not needed
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 97.50000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/SELF_LinearEuler2D_t.f90 98.18% 1 Missing ⚠️
src/cpu/SELF_LinearEuler2D.f90 0.00% 1 Missing ⚠️
src/gpu/SELF_LinearEuler2D.f90 95.65% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@fluidnumerics-joe
Copy link
Member Author

@garrettbyrd - This one's ready for your review.

Copy link
Collaborator

@garrettbyrd garrettbyrd left a comment

Choose a reason for hiding this comment

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

Pretty much looks good besides suggestions. You may want to look over the documentation for the 2DEuler spherical soundwave to make sure it is as thorough as you want. Also mentioned in a private message but I could use a brief rundown on how SetNumberOfVariables operates for when previously nVar > 1 since the subroutine in SELF_Model.f90 just sets it to 1.

docs/Models/linear-euler-2d-model.md Outdated Show resolved Hide resolved
docs/Models/linear-euler-2d-model.md Outdated Show resolved Hide resolved
docs/Models/linear-euler-2d-model.md Outdated Show resolved Hide resolved
docs/Tutorials/LinearEuler2D/PlaneWavePropagation.md Outdated Show resolved Hide resolved
docs/Tutorials/LinearEuler2D/PlaneWaveReflection.md Outdated Show resolved Hide resolved
docs/Tutorials/LinearEuler2D/PlaneWaveReflection.md Outdated Show resolved Hide resolved
docs/Tutorials/LinearEuler2D/SphericalSoundWave.md Outdated Show resolved Hide resolved
docs/Tutorials/LinearEuler2D/SphericalSoundWave.md Outdated Show resolved Hide resolved
@fluidnumerics-joe
Copy link
Member Author

When SetNumberOfVariables is overridden in a child class (like in LinearEuler2D_t) the number of variables for the model takes its value from the child class. This makes it possible to not have to redefine the entire Init method when we need to enforce a fixed number of variables for a model.

fluidnumerics-joe and others added 10 commits November 8, 2024 19:09
Co-authored-by: Garrett Byrd <garrett@fluidnumerics.com>
Co-authored-by: Garrett Byrd <garrett@fluidnumerics.com>
Co-authored-by: Garrett Byrd <garrett@fluidnumerics.com>
Co-authored-by: Garrett Byrd <garrett@fluidnumerics.com>
Co-authored-by: Garrett Byrd <garrett@fluidnumerics.com>
Co-authored-by: Garrett Byrd <garrett@fluidnumerics.com>
Co-authored-by: Garrett Byrd <garrett@fluidnumerics.com>
Co-authored-by: Garrett Byrd <garrett@fluidnumerics.com>
Co-authored-by: Garrett Byrd <garrett@fluidnumerics.com>
@fluidnumerics-joe fluidnumerics-joe merged commit 3a6344f into main Nov 12, 2024
11 checks passed
@fluidnumerics-joe fluidnumerics-joe deleted the models/euler branch November 12, 2024 11:33
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.

2 participants