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

Implement temperature-dependant solid domain contraints in VOF #1048

Merged
merged 5 commits into from
Mar 5, 2024

Conversation

AmishgaAlphonius
Copy link
Collaborator

@AmishgaAlphonius AmishgaAlphonius commented Feb 29, 2024

Description of the problem

  • In phase change simulations, the solid domain was treated as a simple fluid with a higher viscosity (viscous penalization). It worked quite well, but it wasn't the most efficient way to compute fluid dynamics quantities. In order to improve calculation time and linear system conditioning, homogeneous constraints are imposed on velocity DOFs in a defined solid domain through a temperature range. Additionally, pressure DOFs in the same solid domain that are not connected to fluid cells are also imposed to homogeneous constraints. The temperature range is specified through a parameter subsection, namely constrain solid domain. Previously, the implementation was done for single-fluid simulations (Temperature-dependant solid domain constraints #1038), but simulations such as laser powder bed fusion (LPBF) meltpool ones require two fluids when modelling.

Description of the solution

  • This PR, implements the new temperature-dependent solid domain constraints for two-phase Volume of Fluid (VOF) simulations. To select cells on which the constraints are applied, we check if the filtered phase fraction at quadrature points in the cell are within a range of accepted values. This range of accepted values is defined with the phase fraction tolerance parameter. This parameter defines an absolute tolerance on filtered phase fraction.

How Has This Been Tested?

  • The new feature has been tested on the Melting Cavity example by modelling to parts of the domain with different fluids while keeping the same properties in both fluids.
  • An application test has been added to test this feature : applications_tests/lethe-fluid/heat_transfer_vof_phase_change_constrain_solid_domain.prm (.output)

Documentation

  • Documentation page was updated: (doc/source/parameters/cfd/constrain_solid_domain.rst).

Comments

  • The structure of constrain_solid_domain() changed a bit. More functions were added to avoid code line repetitions in constrain_solid_domain_vof().
  • Small corrections were made in other files.

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.

I think this is good. I'm not sure I'm a fan of the name constrain_solid_domain because this is confusing with the regular solid domain which is not based on temperature, maybe there could be a way to have a more explicit name?

@AmishgaAlphonius
Copy link
Collaborator Author

I think this is good. I'm not sure I'm a fan of the name constrain_solid_domain because this is confusing with the regular solid domain which is not based on temperature, maybe there could be a way to have a more explicit name?

I agree, would constrain_solid_domain_with_temperature be too long? Or how about constrain_solid_with_temperature or constrain_domain_with_temperature?

I personally think, constrain_solid_with_temperature is good.

@blaisb
Copy link
Contributor

blaisb commented Mar 3, 2024

I think this is good. I'm not sure I'm a fan of the name constrain_solid_domain because this is confusing with the regular solid domain which is not based on temperature, maybe there could be a way to have a more explicit name?

I agree, would constrain_solid_domain_with_temperature be too long? Or how about constrain_solid_with_temperature or constrain_domain_with_temperature?

I personally think, constrain_solid_with_temperature is good.

constrain_solid_with_temperature is good to me

@hepap
Copy link
Collaborator

hepap commented Mar 4, 2024

Or maybe constrain_stasis @AmishgaAlphonius @blaisb ?

@AmishgaAlphonius
Copy link
Collaborator Author

AmishgaAlphonius commented Mar 4, 2024

Or maybe constrain_stasis @AmishgaAlphonius @blaisb ?

I like it! I'll rename the subsection that way and call the specific function constrain_stasis_with_temperature, so if we eventually have other constraining parameters it still works! I'll leave all other reference to solid in the other smaller functions also, since we also apply a constraint on the pressure and most are used in establish_solid_domain also.

@AmishgaAlphonius AmishgaAlphonius force-pushed the solid-velocity-constraint-vof branch 2 times, most recently from ab44eac to 93daac0 Compare March 4, 2024 14:42
@AmishgaAlphonius AmishgaAlphonius force-pushed the solid-velocity-constraint-vof branch from 2b7b172 to 6f0317c Compare March 4, 2024 15:22
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.

Here are my comments :) 2 main things of thing to check, but nice work I can't wait to use it!

Comment on lines 19 to 26
Pressure drop: -0.366978 Pa
Total pressure drop: -0.366978 Pa

---------------
VOF Barycenter
---------------
time x_vof y_vof vx_vof vy_vof
0.100000 0.125000 0.058681 -0.000009 -0.000023
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you can add also the average velocity? I think the test is still good, but maybe velocity could be a good metric too.

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 tried it before, but the average velocity doesn't print anything .-.

@AmishgaAlphonius AmishgaAlphonius requested a review from hepap March 4, 2024 19:11
@blaisb blaisb merged commit 581ad84 into master Mar 5, 2024
8 checks passed
@blaisb blaisb deleted the solid-velocity-constraint-vof branch March 5, 2024 15:16
blaisb pushed a commit that referenced this pull request Mar 18, 2024
#1072)

Description of the problem
The recently implemented vof stasis constraint (Implement temperature-dependant solid domain contraints in VOF #1048) was not compatible with adaptive mesh refinements and checkpointing system. When refining the mesh or when restarting a simulation, the filtered phase fraction was reinitialized, but not filled with the appropriate values.

Description of the solution
The apply_phase_filter() function was added to post_mesh_adaptation() and read_checkpoint() functions.

How Has This Been Tested?
The stasis constraint was tested using the 2D LPBF benchmark :
with restart and mesh adaptation;
without restart and with mesh adaptation, and;
with restart and without mesh adaptation.
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
…-polymtl#1048)

Description of the problem
In phase change simulations, the solid domain was treated as a simple fluid with a higher viscosity (viscous penalization). It worked quite well, but it wasn't the most efficient way to compute fluid dynamics quantities. In order to improve calculation time and linear system conditioning, homogeneous constraints are imposed on velocity DOFs in a defined solid domain through a temperature range. Additionally, pressure DOFs in the same solid domain that are not connected to fluid cells are also imposed to homogeneous constraints. The temperature range is specified through a parameter subsection, namely constrain solid domain. Previously, the implementation was done for single-fluid simulations (Temperature-dependant solid domain constraints chaos-polymtl#1038), but simulations such as laser powder bed fusion (LPBF) meltpool ones require two fluids when modelling.
Description of the solution
This PR, implements the new temperature-dependent solid domain constraints for two-phase Volume of Fluid (VOF) simulations. To select cells on which the constraints are applied, we check if the filtered phase fraction at quadrature points in the cell are within a range of accepted values. This range of accepted values is defined with the phase fraction tolerance parameter. This parameter defines an absolute tolerance on filtered phase fraction.
How Has This Been Tested?
The new feature has been tested on the Melting Cavity example by modelling to parts of the domain with different fluids while keeping the same properties in both fluids.
An application test has been added to test this feature : applications_tests/lethe-fluid/heat_transfer_vof_phase_change_constrain_solid_domain.prm (.output)
Documentation
Documentation page was updated: (doc/source/parameters/cfd/constrain_solid_domain.rst).
Comments
The structure of constrain_solid_domain() changed a bit. More functions were added to avoid code line repetitions in constrain_solid_domain_vof().
Small corrections were made in other files.

Co-authored-by: hepap <[email protected]>
Co-authored-by: Bruno Blais <[email protected]>
Co-authored-by: Olivier Guévremont <[email protected]>
Former-commit-id: 581ad84
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
chaos-polymtl#1072)

Description of the problem
The recently implemented vof stasis constraint (Implement temperature-dependant solid domain contraints in VOF chaos-polymtl#1048) was not compatible with adaptive mesh refinements and checkpointing system. When refining the mesh or when restarting a simulation, the filtered phase fraction was reinitialized, but not filled with the appropriate values.

Description of the solution
The apply_phase_filter() function was added to post_mesh_adaptation() and read_checkpoint() functions.

How Has This Been Tested?
The stasis constraint was tested using the 2D LPBF benchmark :
with restart and mesh adaptation;
without restart and with mesh adaptation, and;
with restart and without mesh adaptation.

Former-commit-id: bb7cea3
blaisb added a commit that referenced this pull request Sep 30, 2024
Description of the problem
In phase change simulations, the solid domain was treated as a simple fluid with a higher viscosity (viscous penalization). It worked quite well, but it wasn't the most efficient way to compute fluid dynamics quantities. In order to improve calculation time and linear system conditioning, homogeneous constraints are imposed on velocity DOFs in a defined solid domain through a temperature range. Additionally, pressure DOFs in the same solid domain that are not connected to fluid cells are also imposed to homogeneous constraints. The temperature range is specified through a parameter subsection, namely constrain solid domain. Previously, the implementation was done for single-fluid simulations (Temperature-dependant solid domain constraints #1038), but simulations such as laser powder bed fusion (LPBF) meltpool ones require two fluids when modelling.
Description of the solution
This PR, implements the new temperature-dependent solid domain constraints for two-phase Volume of Fluid (VOF) simulations. To select cells on which the constraints are applied, we check if the filtered phase fraction at quadrature points in the cell are within a range of accepted values. This range of accepted values is defined with the phase fraction tolerance parameter. This parameter defines an absolute tolerance on filtered phase fraction.
How Has This Been Tested?
The new feature has been tested on the Melting Cavity example by modelling to parts of the domain with different fluids while keeping the same properties in both fluids.
An application test has been added to test this feature : applications_tests/lethe-fluid/heat_transfer_vof_phase_change_constrain_solid_domain.prm (.output)
Documentation
Documentation page was updated: (doc/source/parameters/cfd/constrain_solid_domain.rst).
Comments
The structure of constrain_solid_domain() changed a bit. More functions were added to avoid code line repetitions in constrain_solid_domain_vof().
Small corrections were made in other files.

Co-authored-by: hepap <[email protected]>
Co-authored-by: Bruno Blais <[email protected]>
Co-authored-by: Olivier Guévremont <[email protected]>
Former-commit-id: 581ad84
blaisb pushed a commit that referenced this pull request Sep 30, 2024
#1072)

Description of the problem
The recently implemented vof stasis constraint (Implement temperature-dependant solid domain contraints in VOF #1048) was not compatible with adaptive mesh refinements and checkpointing system. When refining the mesh or when restarting a simulation, the filtered phase fraction was reinitialized, but not filled with the appropriate values.

Description of the solution
The apply_phase_filter() function was added to post_mesh_adaptation() and read_checkpoint() functions.

How Has This Been Tested?
The stasis constraint was tested using the 2D LPBF benchmark :
with restart and mesh adaptation;
without restart and with mesh adaptation, and;
with restart and without mesh adaptation.

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

4 participants