Skip to content

Cahn-Hilliard-Navier-Stokes #1013

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

Merged
merged 41 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0729966
new assembly is settled
PierreLaurentinCS Sep 20, 2023
a550e08
added smoothing term on potential
PierreLaurentinCS Oct 4, 2023
cf1022a
added potential smoothing parameter
PierreLaurentinCS Oct 6, 2023
b80cda8
indent
PierreLaurentinCS Oct 10, 2023
bcd8028
well height re-introduced
PierreLaurentinCS Oct 16, 2023
bdc2847
epsilon set as twice cell_size
PierreLaurentinCS Oct 16, 2023
096e240
return to the old assembly + added pressure computation for chns simu…
PierreLaurentinCS Oct 31, 2023
5844772
indent
PierreLaurentinCS Oct 31, 2023
01788a6
correctly added pressur error for chns simulations
PierreLaurentinCS Oct 31, 2023
01f7f7d
small modif + indent
PierreLaurentinCS Oct 31, 2023
516befa
remove relative diffusive flux
PierreLaurentinCS Nov 9, 2023
da14417
fixed viscosity, phase statistics, mobility parameter, implemented in…
PierreLaurentinCS Nov 17, 2023
958747e
relative diffusive flux + mobility
PierreLaurentinCS Nov 29, 2023
d4bcaae
relative diffusive flux correction
PierreLaurentinCS Nov 30, 2023
f370280
filtration, W: mobility constant to 1e-7
PierreLaurentinCS Dec 16, 2023
f9a53b8
temp commit
PierreLaurentinCS Dec 18, 2023
7a67f49
mobility works (mat. interac to 0 im prm!!)
PierreLaurentinCS Dec 18, 2023
5db2f8c
small modifs
PierreLaurentinCS Dec 19, 2023
85ef6b7
implementation of tanh filter (non functionnal)
PierreLaurentinCS Jan 5, 2024
1280959
modified stf term in chns assembly
PierreLaurentinCS Jan 9, 2024
9752743
rising bubble MVP
PierreLaurentinCS Jan 10, 2024
92784d0
cleanup starts from there
PierreLaurentinCS Jan 12, 2024
9d0f76b
cleaned tanh filter
PierreLaurentinCS Jan 12, 2024
13fa932
cleaned gls stabilization in ch assembler
PierreLaurentinCS Jan 12, 2024
e1c0ea2
cleaned spring constant, well height, and epsilon and applied necessa…
PierreLaurentinCS Jan 12, 2024
9d60b04
implementation of mobility as physical property 1
PierreLaurentinCS Jan 17, 2024
a01651c
fixed automatic epsilon scaling and added do-nothing filter
PierreLaurentinCS Jan 29, 2024
2d9711f
removed uncessary mobility parameters and unsued variables in chns as…
PierreLaurentinCS Jan 29, 2024
3dc1f01
added clip filter and added the correct epsilon term in the assemblers
PierreLaurentinCS Jan 29, 2024
98e0ba0
added tests for different chns filters
PierreLaurentinCS Jan 29, 2024
74c2f47
fixed angle of contact BC
PierreLaurentinCS Jan 30, 2024
d9e7040
indent
PierreLaurentinCS Jan 30, 2024
f30228f
fixed epsilon, fixed 2d,3dmms and coupling
PierreLaurentinCS Feb 1, 2024
f954c80
removed comments, fixed time-dependent ch BC
PierreLaurentinCS Feb 1, 2024
fb5aa4c
indent
PierreLaurentinCS Feb 1, 2024
69f69bf
fixed remaining warnings and unused features
PierreLaurentinCS Feb 1, 2024
9a83d17
removed unnecessary cahn_hilliard example folder
PierreLaurentinCS Feb 1, 2024
07c6485
apply part 1 of first batch of comments
PierreLaurentinCS Feb 5, 2024
b2b19ad
applied part 2 of first batch of review comments
PierreLaurentinCS Feb 6, 2024
94785c1
applied second batch of comments
PierreLaurentinCS Feb 6, 2024
7d1680f
applied second batch of comments
PierreLaurentinCS Feb 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,23 @@ Running on 1 MPI rank(s)...
Number of degrees of freedom: 3267
Volume of triangulation: 1
Number of Cahn-Hilliard degrees of freedom: 2178
-----------------
Phase statistics
-----------------
Min: -1
Max: 1
Average: 0.801589
Integral: 0.801589

*******************************************************************************
Transient iteration: 1 Time: 0.004 Time step: 0.004 CFL: 0
Transient iteration: 1 Time: 0.001 Time step: 0.001 CFL: 0
*******************************************************************************
-----------------
Phase statistics
-----------------
Min: -1.01454
Max: 1.00577
Average: 0.801589
Integral: 0.801589

**********************************************************************************
Transient iteration: 2 Time: 0.002 Time step: 0.001 CFL: 0.000742905
**********************************************************************************

*********************************************************************************
Transient iteration: 2 Time: 0.01 Time step: 0.006 CFL: 0.00704985
Transient iteration: 3 Time: 0.003 Time step: 0.001 CFL: 0.00094017
*********************************************************************************
-----------------
Phase statistics
-----------------
Min: -1.01314
Max: 1.00482
Average: 0.801589
Integral: 0.801589

********************************************************************************
Transient iteration: 3 Time: 0.02 Time step: 0.01 CFL: 0.0139298
********************************************************************************
-----------------
Phase statistics
-----------------
Min: -1.00767
Max: 1.00366
Average: 0.801589
Integral: 0.801589

********************************************************************************
Transient iteration: 4 Time: 0.03 Time step: 0.01 CFL: 0.0229055
********************************************************************************
-----------------
Phase statistics
-----------------
Min: -1.01001
Max: 1.00324
Average: 0.801589
Integral: 0.801589

********************************************************************************
Transient iteration: 5 Time: 0.04 Time step: 0.01 CFL: 0.0214444
********************************************************************************
-----------------
Phase statistics
-----------------
Min: -1.00819
Max: 1.00303
Average: 0.801589
Integral: 0.801589
*********************************************************************************
Transient iteration: 4 Time: 0.004 Time step: 0.001 CFL: 0.00111133
*********************************************************************************

********************************************************************************
Transient iteration: 6 Time: 0.05 Time step: 0.01 CFL: 0.0202958
********************************************************************************
-----------------
Phase statistics
-----------------
Min: -1.00512
Max: 1.0029
Average: 0.801589
Integral: 0.801589
*********************************************************************************
Transient iteration: 5 Time: 0.005 Time step: 0.001 CFL: 0.00123393
*********************************************************************************
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ set dimension = 2
#---------------------------------------------------

subsection simulation control
set method = bdf2
set method = bdf1
set output name = cahn_hilliard_navier_stokes
set output frequency = 0
set time end = 0.05
set time step = 0.01
set time end = 0.005
set time step = 0.001
end

#---------------------------------------------------
Expand All @@ -23,28 +23,6 @@ subsection multiphysics
set cahn hilliard = true
end

#---------------------------------------------------
# Cahn-Hilliard order
#---------------------------------------------------

subsection FEM
set phase cahn hilliard order = 1
set potential cahn hilliard order = 1
set velocity order = 1
set pressure order = 1
end

#---------------------------------------------------
# Post-processing
#---------------------------------------------------

subsection post-processing
set verbosity = verbose
# Cahn-Hilliard statistics
set calculate phase statistics = true
set phase statistics name = phase_statistics
end

#---------------------------------------------------
# Mesh
#---------------------------------------------------
Expand All @@ -61,12 +39,7 @@ end
#---------------------------------------------------

subsection cahn hilliard
set well height = 0.5

subsection epsilon
set method = automatic
set value = 1
end
set potential smoothing coefficient = 0.5
end

#---------------------------------------------------
Expand All @@ -76,12 +49,12 @@ end
subsection boundary conditions cahn hilliard
set number = 2
subsection bc 0
set id = 2
set id = 0
set type = angle_of_contact
set angle value = 135
set angle value = 110
end
subsection bc 1
set id = 1
set id = 2
set type = free_angle
end
end
Expand Down Expand Up @@ -115,10 +88,8 @@ end
#---------------------------------------------------

subsection initial conditions
set type = nodal

subsection cahn hilliard
set Function expression = -tanh((0.25 - ((x-0.5)^2 + y^2)^(1/2))/(sqrt(2)*0.02)) ; 0
set Function expression = if( x*x + y*y <0.3*0.3,-1,1);0
end
end

Expand All @@ -130,18 +101,9 @@ subsection physical properties
set number of fluids = 2
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

# Surface tension
set surface tension model = constant
set surface tension coefficient = 1

# Mobility Cahn-Hilliard
set cahn hilliard mobility model = quartic
set cahn hilliard mobility constant = 1
set cahn hilliard mobility constant = 1e-2
end
end
end
Expand All @@ -152,14 +114,10 @@ end

subsection non-linear solver
subsection fluid dynamics
set tolerance = 1e-8
set max iterations = 20
set verbosity = quiet
set verbosity = quiet
end
subsection cahn hilliard
set tolerance = 1e-8
set max iterations = 20
set verbosity = quiet
set verbosity = quiet
end
end

Expand All @@ -169,27 +127,9 @@ end

subsection linear solver
subsection fluid dynamics
set verbosity = quiet
set method = gmres
set max iters = 2000
set relative residual = 1e-3
set minimum residual = 1e-10
set preconditioner = ilu
set ilu preconditioner fill = 3
set ilu preconditioner absolute tolerance = 1e-12
set ilu preconditioner relative tolerance = 1.00
set max krylov vectors = 2000
set verbosity = quiet
end
subsection cahn hilliard
set verbosity = quiet
set method = gmres
set max iters = 2000
set relative residual = 1e-3
set minimum residual = 1e-10
set preconditioner = ilu
set ilu preconditioner fill = 3
set ilu preconditioner absolute tolerance = 1e-12
set ilu preconditioner relative tolerance = 1.00
set max krylov vectors = 2000
set verbosity = quiet
end
end
Loading