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

Cahn-Hilliard-Navier-Stokes #1013

Merged
merged 41 commits into from
Feb 9, 2024
Merged

Cahn-Hilliard-Navier-Stokes #1013

merged 41 commits into from
Feb 9, 2024

Conversation

PierreLaurentinCS
Copy link
Collaborator

@PierreLaurentinCS PierreLaurentinCS commented Feb 1, 2024

Description of the problem

  • The last implementation of the Cahn-Hilliard-Navier-Stokes coupled equations were incorrectly reproducing classical test cases such as the rising bubble or the Rayleigh-Taylor instability
  • The problem resided in the formulation of the Cahn-Hilliard equation and also major mistakes in the computation of physical properties in the coupling between Navier-Stokes and Cahn-Hilliard
  • The thought process which eventually led to a change in the initial set of equation led to other additions. Among them : chemical potential smoothing, phase filtering (clipping and tanh) and other minor modifications

Description of the solution

  • The Cahn-Hilliard equations were fixed and the use of mobility as physical property made it more readable and compact
  • The coefficients multiplying the energies (bulk and interface) now depend on two parameters : epsilon (proportional to the size of the cell) and lambda which itself depends on the size of the cell and surface tension

How Has This Been Tested?

  • All the former tests were fixed to account for the new assembly : mms2d and 3d, cahn-hilliard-navier-stokes coupling, time-dependant boundary condition
  • A new test was added to test the phase filtering
  • Many canonical tests were performed. This should be illustrated soon with examples.

Documentation

  • Nothing was changed in the documentation, this will be the work of another PR

Future changes

  • During the development a gls stabilization was successfully implemented but it was not kept in this version because of the new assembly. This will be added in a future PR.
  • The fixed angle of contact BC is not functional for extreme angles. New formulations will be tested in future PRs

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.

FIrst batch of comments. Could you please add within the example folder the CHN examples you have, even if they are not documented, this way we can start keeping track of them. At least static bubble and rising bubble.

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.

Great job @PierreLaurentinCS!!! It is nice to see everything coming together after so many months of hard work!!

I haven't finished my review. I'll look at the assemblers on Monday when I'll have the equations :)

Comment on lines +1493 to +1495
if (this->simulation_parameters.multiphysics.cahn_hilliard)
{
this->pcout << "L2 error pressure : "
<< std::setprecision(
simulation_control->get_log_precision())
<< error_pressure << std::endl;
}
Copy link
Collaborator

@AmishgaAlphonius AmishgaAlphonius Feb 2, 2024

Choose a reason for hiding this comment

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

Why is the pressure L2 error norm only displayed for CH?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought, since it was not implemented before that there was a specific reason for it, so I left it only for the Cahn-Hilliard simulations

Copy link
Contributor

Choose a reason for hiding this comment

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

The issue is that for the VOF solver the pressure is sometimes erratic (it will translate by a constant) so generally pressure in VOF is not a very portable variable. I'M not sure if it's a good idea to enable it in a test. We can try and if it is portable we will keep it, if no, we can remove it in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The problem is the same with CHNS, the pressure is correct up to a constant (but the pressure jump is the Laplace pressure jump). Agreed on the future removal if it's not portable enough, I'll keep it this way (compute pressure error for vof OR chns) for the moment

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.

Moar comments

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.

A little bit moar.

Comment on lines +1493 to +1495
if (this->simulation_parameters.multiphysics.cahn_hilliard)
{
this->pcout << "L2 error pressure : "
<< std::setprecision(
simulation_control->get_log_precision())
<< error_pressure << std::endl;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The issue is that for the VOF solver the pressure is sometimes erratic (it will translate by a constant) so generally pressure in VOF is not a very portable variable. I'M not sure if it's a good idea to enable it in a test. We can try and if it is portable we will keep it, if no, we can remove it in the future.

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.

Only some minor comments :)
Great work again!

@blaisb blaisb merged commit fbe87ab into master Feb 9, 2024
8 checks passed
@blaisb blaisb deleted the cahn_hilliard_navier_stokes branch February 9, 2024 03:28
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
Description of the problem
The last implementation of the Cahn-Hilliard-Navier-Stokes coupled equations were incorrectly reproducing classical test cases such as the rising bubble or the Rayleigh-Taylor instability
The problem resided in the formulation of the Cahn-Hilliard equation and also major mistakes in the computation of physical properties in the coupling between Navier-Stokes and Cahn-Hilliard
The thought process which eventually led to a change in the initial set of equation led to other additions. Among them : chemical potential smoothing, phase filtering (clipping and tanh) and other minor modifications

Description of the solution
The Cahn-Hilliard equations were fixed and the use of mobility as physical property made it more readable and compact
The coefficients multiplying the energies (bulk and interface) now depend on two parameters : epsilon (proportional to the size of the cell) and lambda which itself depends on the size of the cell and surface tension

How Has This Been Tested?
All the former tests were fixed to account for the new assembly : mms2d and 3d, cahn-hilliard-navier-stokes coupling, time-dependant boundary condition
A new test was added to test the phase filtering
Many canonical tests were performed. This should be illustrated soon with examples.

Documentation
Nothing was changed in the documentation, this will be the work of another PR

Future changes
During the development a gls stabilization was successfully implemented but it was not kept in this version because of the new assembly. This will be added in a future PR.
The fixed angle of contact BC is not functional for extreme angles. New formulations will be tested in future PRs

Former-commit-id: fbe87ab
blaisb pushed a commit that referenced this pull request Sep 30, 2024
Description of the problem
The last implementation of the Cahn-Hilliard-Navier-Stokes coupled equations were incorrectly reproducing classical test cases such as the rising bubble or the Rayleigh-Taylor instability
The problem resided in the formulation of the Cahn-Hilliard equation and also major mistakes in the computation of physical properties in the coupling between Navier-Stokes and Cahn-Hilliard
The thought process which eventually led to a change in the initial set of equation led to other additions. Among them : chemical potential smoothing, phase filtering (clipping and tanh) and other minor modifications

Description of the solution
The Cahn-Hilliard equations were fixed and the use of mobility as physical property made it more readable and compact
The coefficients multiplying the energies (bulk and interface) now depend on two parameters : epsilon (proportional to the size of the cell) and lambda which itself depends on the size of the cell and surface tension

How Has This Been Tested?
All the former tests were fixed to account for the new assembly : mms2d and 3d, cahn-hilliard-navier-stokes coupling, time-dependant boundary condition
A new test was added to test the phase filtering
Many canonical tests were performed. This should be illustrated soon with examples.

Documentation
Nothing was changed in the documentation, this will be the work of another PR

Future changes
During the development a gls stabilization was successfully implemented but it was not kept in this version because of the new assembly. This will be added in a future PR.
The fixed angle of contact BC is not functional for extreme angles. New formulations will be tested in future PRs

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

3 participants