forked from chaos-polymtl/lethe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CHNS Free Energy Postprocessing (chaos-polymtl#1095)
Description of the problem The Cahn-Hilliard equations are energy based equations for solving multiphase flows : the interface is the result of two energies in competition, bulk and interface energy. The system, which starts from a non-equilibrium state, lowers its total energy (bulk + interface) to reach equilibrium. In order to visualize this process I added the energy computation into the postprocessing section. Very minor : added the computation of the volume of each phases. Description of the solution New functions calculate_phase_energy() and write_phase_energy were implemented as well as new parameter entries in the postprocess subsection : compute phase energy (boolean) and phase energy name How Has This Been Tested? A new test was added : cahn_hilliard_navier_stokes_energy_postprocessing Documentation Postprocessing documentation was updated to include this new feature File modified : post_processing.rst
- Loading branch information
1 parent
79f3d07
commit 50d0ffe
Showing
9 changed files
with
411 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
applications_tests/lethe-fluid/cahn_hilliard_navier_stokes_energy_postprocessing.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
Running on 1 MPI rank(s)... | ||
Number of active cells: 64 | ||
Number of degrees of freedom: 243 | ||
Volume of triangulation: 4 | ||
Number of Cahn-Hilliard degrees of freedom: 162 | ||
----------------- | ||
Phase statistics | ||
----------------- | ||
Min: -0.994529 | ||
Max: 1 | ||
Average: 0.607051 | ||
Integral: 2.4282 | ||
Volume phase 0: 3.2141 | ||
Volume phase 1: 0.785898 | ||
------------- | ||
Phase energy | ||
------------- | ||
Bulk energy: 0.667619 | ||
Interface energy: 1.74433 | ||
Total energy: 2.41195 | ||
|
||
******************************************************************************* | ||
Transient iteration: 1 Time: 0.5 Time step: 0.5 CFL: 0 | ||
******************************************************************************* | ||
----------------- | ||
Phase statistics | ||
----------------- | ||
Min: -1.01453 | ||
Max: 1.00534 | ||
Average: 0.60706 | ||
Integral: 2.42824 | ||
Volume phase 0: 3.21412 | ||
Volume phase 1: 0.78588 | ||
------------- | ||
Phase energy | ||
------------- | ||
Bulk energy: 0.687751 | ||
Interface energy: 1.66703 | ||
Total energy: 2.35478 | ||
|
||
******************************************************************************* | ||
Transient iteration: 2 Time: 1 Time step: 0.5 CFL: 0.967317 | ||
******************************************************************************* | ||
----------------- | ||
Phase statistics | ||
----------------- | ||
Min: -0.891115 | ||
Max: 1.0132 | ||
Average: 0.61502 | ||
Integral: 2.46008 | ||
Volume phase 0: 3.23004 | ||
Volume phase 1: 0.76996 | ||
------------- | ||
Phase energy | ||
------------- | ||
Bulk energy: 1.08564 | ||
Interface energy: 1.19563 | ||
Total energy: 2.28127 |
127 changes: 127 additions & 0 deletions
127
applications_tests/lethe-fluid/cahn_hilliard_navier_stokes_energy_postprocessing.prm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
set dimension = 2 | ||
|
||
subsection simulation control | ||
set method = bdf1 | ||
set time end = 1 | ||
set time step = 0.5 | ||
set output name = out | ||
set output frequency = 0 | ||
end | ||
|
||
subsection initial conditions | ||
set type = L2projection | ||
subsection cahn hilliard | ||
set Function constants = nbr_refs=5 | ||
set Function expression = -tanh(sqrt(2*0.25)*(0.5 - sqrt(x*x+y*y))/(2^(-nbr_refs+1))); 0 | ||
end | ||
end | ||
|
||
subsection boundary conditions | ||
set number = 4 | ||
set time dependent = false | ||
subsection bc 0 | ||
set id = 0 | ||
set type = slip | ||
end | ||
subsection bc 1 | ||
set id = 1 | ||
set type = slip | ||
end | ||
subsection bc 2 | ||
set id = 2 | ||
set type = slip | ||
end | ||
subsection bc 3 | ||
set id = 3 | ||
set type = slip | ||
end | ||
end | ||
|
||
subsection boundary conditions cahn hilliard | ||
set number = 1 | ||
subsection bc 0 | ||
set id = 0 | ||
set type = dirichlet | ||
subsection phi | ||
set Function constants = nbr_refs=5 | ||
set Function expression = -tanh(sqrt(2*0.25)*(0.5 - sqrt(x*x+y*y))/(2^(-nbr_refs+1))) | ||
end | ||
end | ||
end | ||
|
||
subsection multiphysics | ||
set fluid dynamics = true | ||
set cahn hilliard = true | ||
end | ||
|
||
subsection cahn hilliard | ||
set potential smoothing coefficient = 0.0 | ||
|
||
subsection epsilon | ||
set method = automatic | ||
end | ||
end | ||
|
||
subsection physical properties | ||
set number of fluids = 2 | ||
subsection fluid 0 | ||
set density = 1000 | ||
set kinematic viscosity = 0.01 | ||
end | ||
subsection fluid 1 | ||
set density = 100 | ||
set kinematic viscosity = 0.01 | ||
end | ||
set number of material interactions = 1 | ||
subsection material interaction 0 | ||
set type = fluid-fluid | ||
subsection fluid-fluid interaction | ||
set first fluid id = 0 | ||
set second fluid id = 1 | ||
set surface tension model = constant | ||
set surface tension coefficient = 24.5 | ||
# Mobility Cahn-Hilliard | ||
set cahn hilliard mobility model = constant | ||
set cahn hilliard mobility constant = 1e-6 | ||
end | ||
end | ||
end | ||
|
||
subsection mesh | ||
set type = dealii | ||
set grid type = hyper_cube | ||
set grid arguments = -1 : 1 : true | ||
set initial refinement = 3 | ||
end | ||
|
||
subsection post-processing | ||
set verbosity = verbose | ||
set calculate phase statistics = true | ||
set phase statistics name = phase_statistics | ||
set calculate phase energy = true | ||
end | ||
|
||
subsection FEM | ||
set phase cahn hilliard order = 1 | ||
set potential cahn hilliard order = 1 | ||
set velocity order = 1 | ||
set pressure order = 1 | ||
end | ||
|
||
subsection non-linear solver | ||
subsection fluid dynamics | ||
set verbosity = quiet | ||
end | ||
subsection cahn hilliard | ||
set verbosity = quiet | ||
end | ||
end | ||
|
||
subsection linear solver | ||
subsection fluid dynamics | ||
set verbosity = quiet | ||
end | ||
subsection cahn hilliard | ||
set verbosity = quiet | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.