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

Added DCDD from previous gradient #1293

Merged
merged 4 commits into from
Sep 26, 2024
Merged

Added DCDD from previous gradient #1293

merged 4 commits into from
Sep 26, 2024

Conversation

oguevremont
Copy link
Collaborator

@oguevremont oguevremont commented Sep 25, 2024

Description

Previously, the tracer physics used the current time tracer gradient to compute the DCDD stabilization. Using the previous time gradient instead allows to reduce the number of non-linear iterations while still converging to proper solutions.

Testing

All tests still pass.

Documentation

Not applicable.

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)
  • 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

@oguevremont oguevremont added Enhancement New feature or request WIP When a PR is open but not ready for review labels Sep 25, 2024
Comment on lines 46 to 50
// We use the previous concentration for the shock capture
const Tensor<1, dim> previous_tracer_gradient =
scratch_data.previous_tracer_gradients[q];

const double tracer_gradient_norm = previous_tracer_gradient.norm();
Copy link
Contributor

Choose a reason for hiding this comment

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

This should only be done when the simulation is transient

Comment on lines 174 to 180
const double vdcdd = (0.5 * h) * (velocity.norm() * velocity.norm()) *
pow(tracer_gradient.norm() * h, order);
pow(tracer_gradient_norm * h, order);

const double tolerance = 1e-12;
Tensor<1, dim> s = velocity / (velocity.norm() + tolerance);
Tensor<1, dim> r = tracer_gradient / (tracer_gradient.norm() + tolerance);
Tensor<1, dim> r =
previous_tracer_gradient / (tracer_gradient_norm + tolerance);
Copy link
Contributor

Choose a reason for hiding this comment

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

Again should only be done for transient simulations

@oguevremont oguevremont added Ready for review and removed WIP When a PR is open but not ready for review labels Sep 25, 2024
@oguevremont oguevremont requested a review from hepap September 25, 2024 23:52
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.

I don't have anything more to say for this PR :)

A more general comment for DCDD: we have it for VOF, HT and tracer, but the implementation is a bit different in each of them. Maybe in the future we can make it uniform :)

Copy link
Contributor

@blaisb blaisb left a comment

Choose a reason for hiding this comment

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

Great, that should be fine now.

@blaisb blaisb merged commit c2c8cfd into master Sep 26, 2024
11 checks passed
@blaisb blaisb deleted the tracer_explicit_dcdd branch September 26, 2024 19:00
blaisb pushed a commit that referenced this pull request Sep 27, 2024
Description
Previously, the tracer physics used the current time tracer gradient to compute the DCDD stabilization. Using the previous time gradient instead allows to reduce the number of non-linear iterations while still converging to proper solutions.

Testing
All tests still pass.

Documentation
Not applicable.

Former-commit-id: c2c8cfd
blaisb pushed a commit that referenced this pull request Sep 30, 2024
Description
Previously, the tracer physics used the current time tracer gradient to compute the DCDD stabilization. Using the previous time gradient instead allows to reduce the number of non-linear iterations while still converging to proper solutions.

Testing
All tests still pass.

Documentation
Not applicable.

Former-commit-id: c2c8cfd
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