Skip to content

Dg shock capture #1595

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

Merged
merged 28 commits into from
Jul 30, 2025
Merged

Dg shock capture #1595

merged 28 commits into from
Jul 30, 2025

Conversation

blaisb
Copy link
Contributor

@blaisb blaisb commented Jul 25, 2025

Description

The DG implementation of the tracer was not very adequate for pure advection if the DG order was larger than 0 (so DG Q1 and above). This is because we did not have any sort of limiter in place. This PR adds a Moe limiter (see documentation for reference) which is an a posteriori limiter that works quite well for scalar equations. It is not very invasive and not very expensive and I have managed to get very adequate results with it.

Testing

The DG advection test has been changed to use the limiter and I have added a new test with BDF2 which really requires the limiter to get adequate results.

Documentation

Since the limiter is generic for all scalar equations, I have documented it in the stabilization section where I believe it adequately belong.

Miscellaneous (will be removed when merged)

Checklist (will be removed when merged)

See this page for more information about the pull request process.

Code related list:

  • All in-code documentation related to this PR is up to date (Doxygen format)
  • Copyright headers are present and up to date
  • Lethe documentation is up to date
  • New feature has unit test(s) (preferred) or application test(s), and restart files are in the generator folder
  • The branch is rebased onto master
  • Changelog (CHANGELOG.md) is up to date
  • Code is indented with indent-all and .prm files (examples and tests) with prm-indent

Pull request related list:

  • Labels are applied
  • There are at least 2 reviewers (or 1 if small feature) excluding the responsible for the merge
  • If this PR closes an issue or is related to a project, it is linked in the "Projects" or "Development" section
  • If the fix is temporary, an issue is opened
  • The PR description is cleaned and ready for merge

@blaisb blaisb requested a review from voferreira July 25, 2025 15:53
@blaisb blaisb added Enhancement New feature or request Ready for review labels Jul 25, 2025
@blaisb blaisb force-pushed the dg_shock_capture branch from 805e1b3 to 9e8083f Compare July 25, 2025 15:54
@hepap hepap self-requested a review July 25, 2025 17:46
Copy link
Collaborator

@voferreira voferreira left a comment

Choose a reason for hiding this comment

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

No comments. Just looking forward to trying that out. Nice finding :)

@@ -35,6 +35,10 @@ subsection physical properties
end
end

subsection stabilization
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update copyright date (?)

Comment on lines +20 to +22
// We define the cutoff function from the Moe paper using a lambda function.
// It's a bit weird this cutoff function, but YOLO I guess. Why do we divide y
// by 1.1? I do not know, I believe it to be one of the mysteries of life.
Copy link
Collaborator

Choose a reason for hiding this comment

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

lol

Copy link
Collaborator

@hepap hepap left a comment

Choose a reason for hiding this comment

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

Only typos and questions :)

"scalar limiter",
"none",
Patterns::Selection("none|moe"),
"Type of scalar limiter. The limiters are only appropriate with the DG versions of the solvers and should only be used for advection-dominated problem.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know if we need to say that it's only available for the tracer here.

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'll implement it soon for the VOF equation, so I don't think it's required :)

Comment on lines +134 to +142
// 3. Calculate the value of the theta limiting using the max, min and
// mean values as well as the bounds.
const double max_value =
max_value_per_cells.at(cell->global_active_cell_index());
const double min_value =
min_value_per_cells.at(cell->global_active_cell_index());
const double mean_value =
mean_value_per_cells.at(cell->global_active_cell_index());
double y_max =
(upper_bound - mean_value) / ((max_value - mean_value) + 1e-16);
double y_min =
(lower_bound - mean_value) / ((min_value - mean_value) + 1e-16);
Copy link
Collaborator

Choose a reason for hiding this comment

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

So upper/lower bounds are from the neighbor values and min/max are from the cell values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes exactly. The max/min/avec are in the cell and the upper and lower bounds are from the neighbours

blaisb and others added 23 commits July 30, 2025 13:50
@blaisb blaisb force-pushed the dg_shock_capture branch from 2101d58 to c367f98 Compare July 30, 2025 17:51
@blaisb blaisb merged commit 28ab5fb into master Jul 30, 2025
7 checks passed
@blaisb blaisb deleted the dg_shock_capture branch July 30, 2025 19:08
etiennemarin pushed a commit that referenced this pull request Jul 30, 2025
Description
The DG implementation of the tracer was not very adequate for pure advection if the DG order was larger than 0 (so DG Q1 and above). This is because we did not have any sort of limiter in place. This PR adds a Moe limiter (see documentation for reference) which is an a posteriori limiter that works quite well for scalar equations. It is not very invasive and not very expensive and I have managed to get very adequate results with it.

Testing
The DG advection test has been changed to use the limiter and I have added a new test with BDF2 which really requires the limiter to get adequate results.

Documentation
Since the limiter is generic for all scalar equations, I have documented it in the stabilization section where I believe it adequately belong.

Co-authored-by: Victor Oliveira Ferreira <[email protected]>
Co-authored-by: hepap <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants