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 new scaling parameters for the Cahn-Hilliard model #1274

Merged
merged 6 commits into from
Sep 20, 2024

Conversation

PierreLaurentinCS
Copy link
Collaborator

@PierreLaurentinCS PierreLaurentinCS commented Sep 5, 2024

Description

With new models come new parameters that need to be dimensionalised adequately when changing the units in the "Dimensionality" section of the parameter file.
With the Cahn-Hilliard model, it was the mobility coefficient, the interface thickness and the surface tension.
Three new scalings were added at first, for those three parameters. Since surface tension is also used in VOF model, a fourth scaling parameter was added for the surface tension gradient for completion.

There was a mistake in the scaling of thermal expansion which was corrected.

Testing

No testing because it would imply coding an output for the physical properties which is unnecessary.It works fine.

Documentation

No new documentation

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
  • 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
  • The PR description is cleaned and ready for merge

@PierreLaurentinCS PierreLaurentinCS added Enhancement New feature or request Needs more reviewers This pull request needs more review before a merge is possible labels Sep 6, 2024
@PierreLaurentinCS PierreLaurentinCS added Ready for review and removed Needs more reviewers This pull request needs more review before a merge is possible labels Sep 9, 2024
@@ -353,7 +353,8 @@ namespace Parameters
void
declare_parameters(ParameterHandler &prm);
void
parse_parameters(ParameterHandler &prm);
parse_parameters(ParameterHandler &prm,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know it was not there initially, but you could add the briefs

{
surface_tension_coefficient = prm.get_double("surface tension coefficient");
T_0 = prm.get_double("reference state temperature");
surface_tension_coefficient *= dimensions.surface_tension_scaling;
T_0 = prm.get_double("reference state temperature");
Copy link
Collaborator

Choose a reason for hiding this comment

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

T_0 should be scale also I think

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why aren't the dimensions multiplied in the same line?

Comment on lines 1346 to 1356
surface_tension_parameters.parse_parameters(prm, dimensions);
}
else if (op == "linear")
{
surface_tension_model = SurfaceTensionModel::linear;
surface_tension_parameters.parse_parameters(prm);
surface_tension_parameters.parse_parameters(prm, dimensions);
}
else if (op == "phase change")
{
surface_tension_model = SurfaceTensionModel::phase_change;
surface_tension_parameters.parse_parameters(prm);
surface_tension_parameters.parse_parameters(prm, dimensions);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we just call the parse_parameters once after the if/else ifs/else? Same for CH

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. Is this PR missing any point on the checklist? If not, I have nothing to add.

{
surface_tension_coefficient = prm.get_double("surface tension coefficient");
T_0 = prm.get_double("reference state temperature");
surface_tension_coefficient *= dimensions.surface_tension_scaling;
T_0 = prm.get_double("reference state temperature");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why aren't the dimensions multiplied in the same line?

@hepap
Copy link
Collaborator

hepap commented Sep 20, 2024

@PierreLaurentinCS can you update the change log?

@hepap hepap merged commit 46511be into master Sep 20, 2024
11 checks passed
@hepap hepap deleted the chns-dimensionality branch September 20, 2024 16:50
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
…#1274)

Description

With new models come new parameters that need to be dimensionalised adequately when changing the units in the "Dimensionality" section of the parameter file. With the Cahn-Hilliard model, it was the mobility coefficient, the interface thickness and the surface tension. Three new scalings were added at first, for those three parameters. Since surface tension is also used in VOF model, a fourth scaling parameter was added for the surface tension gradient for completion.

There was a mistake in the scaling of thermal expansion which was corrected.

Testing

No testing because it would imply coding an output for the physical properties which is unnecessary. It works fine.


Former-commit-id: 46511be
blaisb pushed a commit that referenced this pull request Sep 30, 2024
Description

With new models come new parameters that need to be dimensionalised adequately when changing the units in the "Dimensionality" section of the parameter file. With the Cahn-Hilliard model, it was the mobility coefficient, the interface thickness and the surface tension. Three new scalings were added at first, for those three parameters. Since surface tension is also used in VOF model, a fourth scaling parameter was added for the surface tension gradient for completion.

There was a mistake in the scaling of thermal expansion which was corrected.

Testing

No testing because it would imply coding an output for the physical properties which is unnecessary. It works fine.


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