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

Add VOF subequations interface and refactor VOF phase gradient projection #1318

Merged
merged 32 commits into from
Oct 27, 2024

Conversation

AmishgaAlphonius
Copy link
Collaborator

@AmishgaAlphonius AmishgaAlphonius commented Oct 14, 2024

Description

This PR adds an interface for secondary equations solved within the span of the VOF auxilliary physics. The interface is similar to the multiphysics interface for auxiliary physics. At the moment, only the L2 projection of the phase fraction gradient has been refactored through this interface and only a linear solver has been implemented.

A new base class for scratch data and assembler objects has also been added.

Testing

All tests have passed.
A new unit test has been added for the VOFSubequationsInterface.
Also tested with the rising bubble example.

Miscellaneous (will be removed when merged)

For non-linear equations, it is planned that the class inherits from the PhysicsSolver to go through the same mechanism.

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
  • The branch is rebased onto master
  • Code is indented with indent-all and .prm files (examples and tests) with prm-indent
  • If parameters are modified, the tests and the documentation of examples are up to date
  • Changelog (CHANGELOG.md) is up to date if the refactor affects the user experience or the codebase

Pull request related list:

  • No other PR is open related to this refactoring
  • 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 any future works is planed, an issue is opened
  • The PR description is cleaned and ready for merge

@AmishgaAlphonius AmishgaAlphonius added Ready for review Refactoring This PR is only refactoring or clean up labels Oct 14, 2024
@AmishgaAlphonius AmishgaAlphonius self-assigned this Oct 14, 2024
@AmishgaAlphonius AmishgaAlphonius added the Needs more reviewers This pull request needs more review before a merge is possible label Oct 14, 2024
@AmishgaAlphonius AmishgaAlphonius marked this pull request as ready for review October 14, 2024 19:26
@AmishgaAlphonius AmishgaAlphonius removed the Needs more reviewers This pull request needs more review before a merge is possible label Oct 15, 2024
@blaisb blaisb changed the title Refactor vof phase gradrient projection Refactor vof phase gradient projection Oct 15, 2024
Copy link
Collaborator

@oguevremont oguevremont left a comment

Choose a reason for hiding this comment

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

Looks good! not many comments

CHANGELOG.md Outdated Show resolved Hide resolved
include/solvers/physics_subequations_solver.h Outdated Show resolved Hide resolved
include/solvers/physics_subequations_solver.h Outdated Show resolved Hide resolved
include/solvers/physics_subequations_solver.h Outdated Show resolved Hide resolved
include/solvers/subequations_interface.h Outdated Show resolved Hide resolved
include/solvers/vof_scratch_data.h Outdated Show resolved Hide resolved
include/solvers/vof.h Outdated Show resolved Hide resolved
include/solvers/vof.h Outdated Show resolved Hide resolved
include/solvers/vof.h Outdated Show resolved Hide resolved
include/solvers/vof_phase_gradient_projection.h Outdated Show resolved Hide resolved
@AmishgaAlphonius
Copy link
Collaborator Author

Looks good! not many comments

Thanks a lot! I completely forgot to clean the includes after testing things out ^^'

@AmishgaAlphonius AmishgaAlphonius force-pushed the refactor-vof-phase-gradrient-projection branch from 5fa6496 to 23acab1 Compare October 16, 2024 15:05
@AmishgaAlphonius
Copy link
Collaborator Author

In my last commit, I also cleaned up some includes in VOF.

@AmishgaAlphonius AmishgaAlphonius force-pushed the refactor-vof-phase-gradrient-projection branch from 23acab1 to c863f32 Compare October 16, 2024 15:12
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.

Nice work, it is way cleaner!

Here are my first comments, I will have another look later :) In addition, I think there are a few briefs missing.

include/solvers/physics_subequations_solver.h Outdated Show resolved Hide resolved
include/solvers/physics_subequations_solver.h Outdated Show resolved Hide resolved
include/solvers/physics_subequations_solver.h Outdated Show resolved Hide resolved
include/solvers/subequations_interface.h Outdated Show resolved Hide resolved
include/solvers/subequations_interface.h Outdated Show resolved Hide resolved
source/solvers/vof.cc Outdated Show resolved Hide resolved
source/solvers/vof.cc Show resolved Hide resolved
source/solvers/vof_assemblers.cc Outdated Show resolved Hide resolved
for (unsigned int i = 0; i < n_dofs; ++i)
{
const auto phi_i = scratch_data.phi[q][i];
local_rhs(i) += phi_i * filtered_vof_phase_gradient * JxW;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess here I not sure anymore if we should use the filtered phase or only the phase, but it out of the scope of this PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we open an issue to re-investigate and document it?

source/solvers/vof_phase_gradient_projection.cc Outdated Show resolved Hide resolved
@AmishgaAlphonius AmishgaAlphonius added WIP When a PR is open but not ready for review and removed Ready for review labels Oct 17, 2024
@AmishgaAlphonius AmishgaAlphonius force-pushed the refactor-vof-phase-gradrient-projection branch from 95c0724 to d9189e8 Compare October 17, 2024 13:57
@AmishgaAlphonius AmishgaAlphonius added Enhancement New feature or request Ready for review and removed WIP When a PR is open but not ready for review labels Oct 18, 2024
@AmishgaAlphonius AmishgaAlphonius force-pushed the refactor-vof-phase-gradrient-projection branch from 70a90cf to 3b7eb42 Compare October 18, 2024 15:32
@AmishgaAlphonius AmishgaAlphonius changed the title Refactor vof phase gradient projection Add VOF subequations interface and refactor vof phase gradient projection Oct 18, 2024
@AmishgaAlphonius AmishgaAlphonius force-pushed the refactor-vof-phase-gradrient-projection branch from b61cc4e to 3d553a2 Compare October 18, 2024 20:12
@AmishgaAlphonius AmishgaAlphonius changed the title Add VOF subequations interface and refactor vof phase gradient projection Add VOF subequations interface and refactor VOF phase gradient projection Oct 22, 2024
@AmishgaAlphonius AmishgaAlphonius force-pushed the refactor-vof-phase-gradrient-projection branch from 3d553a2 to 0114c08 Compare October 22, 2024 18:00
include/solvers/physics_subequations_solver.h Show resolved Hide resolved
include/solvers/vof.h Show resolved Hide resolved
include/solvers/vof_assemblers.h Outdated Show resolved Hide resolved
@blaisb blaisb merged commit 9742cce into master Oct 27, 2024
11 checks passed
@blaisb blaisb deleted the refactor-vof-phase-gradrient-projection branch October 27, 2024 14:46
blaisb added a commit that referenced this pull request Nov 6, 2024
Description
Following PR #1318, this one refactors the curvature projection to be assembled and solved through the VOF subequations interface. Assembly of the matrix and right-hand side for both VOFSubequations (phase fraction gradient and curvature projection) are now done in the same loop without the WorkStream method, as they are pretty simple to assemble.

Testing
The unit test dedicated to the interface has been updated.
Visual inspection of data was done with the rising bubble case using paraview.

Co-authored-by: Bruno Blais <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Ready for review Rebased Refactoring This PR is only refactoring or clean up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants