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 missing VOF term in the strong form of the residual #1149

Merged
merged 16 commits into from
May 29, 2024
Merged

Conversation

blaisb
Copy link
Contributor

@blaisb blaisb commented May 20, 2024

Description of the problem

  • There was a missing term in the strong form of the residual which is (mu_1 - mu_0) * (grad_u + grad_u^T) * grad_phase
  • This does not have significant consequences, but I think it is best to remain consistent

Description of the solution

  • Add missing term

How Has This Been Tested?

  • All test results barely change, but I had to update them nonetheless
  • It seems to help a little bit in terms of velocity divergence, but really not much to be honest.

@blaisb blaisb requested review from hepap and AmishgaAlphonius May 20, 2024 22:22
@@ -143,7 +157,7 @@ GLSNavierStokesVOFAssemblerCore<dim>::assemble_matrix(
const auto &phi_u_j = scratch_data.phi_u[q][j];
const auto &grad_phi_u_j = scratch_data.grad_phi_u[q][j];
const auto &div_phi_u_j = scratch_data.div_phi_u[q][j];
const auto &shear_rate_j = grad_phi_u_j + transpose(grad_phi_u_j);
const auto shear_rate_j = grad_phi_u_j + transpose(grad_phi_u_j);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should not have been a reference, so this was a bit weird.

@blaisb blaisb force-pushed the vof_viscous_term branch from 56cda57 to a54fac5 Compare May 20, 2024 22:50
@PierreLaurentinCS PierreLaurentinCS self-requested a review May 21, 2024 19:47
Copy link
Collaborator

@AmishgaAlphonius AmishgaAlphonius left a comment

Choose a reason for hiding this comment

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

Funny that it was not thought of before! I only found a small typo to fix :)

source/solvers/navier_stokes_vof_assemblers.cc Outdated Show resolved Hide resolved
source/solvers/navier_stokes_vof_assemblers.cc Outdated Show resolved Hide resolved
source/solvers/navier_stokes_vof_assemblers.cc Outdated Show resolved Hide resolved
source/solvers/navier_stokes_vof_assemblers.cc Outdated Show resolved Hide resolved
Copy link
Collaborator

@lpsaavedra lpsaavedra left a comment

Choose a reason for hiding this comment

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

I have only a small comment. These equations are not in the documentation, am I correct? I guess we should be writing these equations there soon in a "multiphysics coupling" section...

@@ -90,12 +94,22 @@ GLSNavierStokesVOFAssemblerCore<dim>::assemble_matrix(
calculate_navier_stokes_gls_tau_transient(
u_mag, viscosity_for_stabilization_vector[q] / density_eq, h, sdt);

// Void fraction gradient for strong residual
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Void fraction gradient for strong residual
// Filtered phase fraction gradient for strong residual

@@ -243,6 +256,10 @@ GLSNavierStokesVOFAssemblerCore<dim>::assemble_rhs(
const Tensor<1, dim> pressure_gradient =
scratch_data.pressure_gradients[q];

// Void fraction gradient for strong residual
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Void fraction gradient for strong residual
// Filtered phase fraction gradient for strong residual

@@ -909,12 +932,22 @@ GLSNavierStokesVOFAssemblerNonNewtonianCore<dim>::assemble_matrix(
calculate_navier_stokes_gls_tau_transient(
u_mag, viscosity_for_stabilization_vector[q] / density_eq, h, sdt);

// Void fraction gradient for strong residual
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Void fraction gradient for strong residual
// Filtered phase fraction gradient for strong residual

@@ -1107,12 +1140,22 @@ GLSNavierStokesVOFAssemblerNonNewtonianCore<dim>::assemble_rhs(
u_mag, viscosity_for_stabilization_vector[q] / density_eq, h, sdt);


// Void fraction gradient for strong residual
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Void fraction gradient for strong residual
// Filtered phase fraction gradient for strong residual

Copy link
Collaborator

@PierreLaurentinCS PierreLaurentinCS left a comment

Choose a reason for hiding this comment

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

Nothing to say, everything is clean, but I'd like this question answered before merging :
Why don't we add the term also in the strong jacobian ?

time x_vof y_vof vx_vof vy_vof
1.000000 0.513510 0.638807 0.449408 -0.013436
time x_vof y_vof vx_vof vy_vof
1.000000 0.512900 0.576332 0.363353 0.013339
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe it's because this test case is weird, but the differences are more significant 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.

Yeah I was wondering this also. I'm not exactly sure what's up. I'll double check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that test is weird as fuck, I'm not surpirsed the results changed that much, the test has not real physical meaning it's just there to see if the boundary change in time. No alarm to be had.

@blaisb
Copy link
Contributor Author

blaisb commented May 22, 2024

Nothing to say, everything is clean, but I'd like this question answered before merging : Why don't we add the term also in the strong jacobian ?

Good question. The strong Jacobian term is very expensive to calculate since it has the full hessian. I checked many cases and it never really affects convergence, so for now we can neglect it i think.

@blaisb blaisb merged commit 8e1ec70 into master May 29, 2024
8 checks passed
@blaisb blaisb deleted the vof_viscous_term branch May 29, 2024 17:17
@hepap hepap mentioned this pull request Jun 26, 2024
11 tasks
blaisb pushed a commit that referenced this pull request Jul 4, 2024
Description
The term associated with the viscosity jump in the strong residual for the NS-VOF assembler added in PR Add missing VOF term in the strong form of the residual #1149 led to a ill-posed formulation in phase change cases where the solid is represented by a highly viscous fluid. Hence, we don't consider this term in the current formulation.
There was no appropriate application test for lpbf/phase change with vof cases that could have allowed us to identify this ill-posed formulation prior to the merge of PR Add missing VOF term in the strong form of the residual #1149.
The LPBF benchmark example prm files were almost up to date, but did not exactly matched the one we used to generate the benchmark results. The mesh files were missing from the repo.

Solution
This PR removes the term associated with the viscosity jump.
A new test is now included to avoid future mistake in lpbf/phase change with vof cases.
LPBF benchmark example prm files were modified and are now up to date with the current working version. The mesh files are now available in the repo.

Testing
The new test simulate the lpbf benchmark case using the extra-extra-coarse mesh. Temperature statistics and mass conservation monitoring are the outputted metrics (to track both the change in HT and NS-VOF solvers).
Other NS-VOF tests were updated, and results for those tests returned to their previous values (or almost with small differences).
Documentation
No modification in the documentation.

Co-authored-by: Amishga Alphonius <[email protected]>
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
…l#1149)

Description of the problem
There was a missing term in the strong form of the residual which is (mu_1 - mu_0) * (grad_u + grad_u^T) * grad_phase
This does not have significant consequences, but I think it is best to remain consistent
Description of the solution
Add missing term
How Has This Been Tested?
All test results barely change, but I had to update them nonetheless
It seems to help a little bit in terms of velocity divergence, but really not much to be honest.

Co-authored-by: Amishga Alphonius <[email protected]>
Former-commit-id: 8e1ec70
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
Description
The term associated with the viscosity jump in the strong residual for the NS-VOF assembler added in PR Add missing VOF term in the strong form of the residual chaos-polymtl#1149 led to a ill-posed formulation in phase change cases where the solid is represented by a highly viscous fluid. Hence, we don't consider this term in the current formulation.
There was no appropriate application test for lpbf/phase change with vof cases that could have allowed us to identify this ill-posed formulation prior to the merge of PR Add missing VOF term in the strong form of the residual chaos-polymtl#1149.
The LPBF benchmark example prm files were almost up to date, but did not exactly matched the one we used to generate the benchmark results. The mesh files were missing from the repo.

Solution
This PR removes the term associated with the viscosity jump.
A new test is now included to avoid future mistake in lpbf/phase change with vof cases.
LPBF benchmark example prm files were modified and are now up to date with the current working version. The mesh files are now available in the repo.

Testing
The new test simulate the lpbf benchmark case using the extra-extra-coarse mesh. Temperature statistics and mass conservation monitoring are the outputted metrics (to track both the change in HT and NS-VOF solvers).
Other NS-VOF tests were updated, and results for those tests returned to their previous values (or almost with small differences).
Documentation
No modification in the documentation.

Co-authored-by: Amishga Alphonius <[email protected]>
Former-commit-id: b1ec9c1
blaisb added a commit that referenced this pull request Sep 30, 2024
Description of the problem
There was a missing term in the strong form of the residual which is (mu_1 - mu_0) * (grad_u + grad_u^T) * grad_phase
This does not have significant consequences, but I think it is best to remain consistent
Description of the solution
Add missing term
How Has This Been Tested?
All test results barely change, but I had to update them nonetheless
It seems to help a little bit in terms of velocity divergence, but really not much to be honest.

Co-authored-by: Amishga Alphonius <[email protected]>
Former-commit-id: 8e1ec70
blaisb pushed a commit that referenced this pull request Sep 30, 2024
Description
The term associated with the viscosity jump in the strong residual for the NS-VOF assembler added in PR Add missing VOF term in the strong form of the residual #1149 led to a ill-posed formulation in phase change cases where the solid is represented by a highly viscous fluid. Hence, we don't consider this term in the current formulation.
There was no appropriate application test for lpbf/phase change with vof cases that could have allowed us to identify this ill-posed formulation prior to the merge of PR Add missing VOF term in the strong form of the residual #1149.
The LPBF benchmark example prm files were almost up to date, but did not exactly matched the one we used to generate the benchmark results. The mesh files were missing from the repo.

Solution
This PR removes the term associated with the viscosity jump.
A new test is now included to avoid future mistake in lpbf/phase change with vof cases.
LPBF benchmark example prm files were modified and are now up to date with the current working version. The mesh files are now available in the repo.

Testing
The new test simulate the lpbf benchmark case using the extra-extra-coarse mesh. Temperature statistics and mass conservation monitoring are the outputted metrics (to track both the change in HT and NS-VOF solvers).
Other NS-VOF tests were updated, and results for those tests returned to their previous values (or almost with small differences).
Documentation
No modification in the documentation.

Co-authored-by: Amishga Alphonius <[email protected]>
Former-commit-id: b1ec9c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants