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

CHNS example : capillary rise and Jurin's law #1328

Merged
merged 23 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1b04b74
add jurins-law example into doc arhcitecture and begin writing
PierreLaurentinCS Oct 2, 2024
ab07902
finished the core of the example, added relevant figures to the direc…
PierreLaurentinCS Oct 3, 2024
551c426
edit further work section of the example
PierreLaurentinCS Oct 3, 2024
337f0c3
fix typo in .rst file
PierreLaurentinCS Oct 18, 2024
2ea7327
force add mesh and dummy file in outputs directory
PierreLaurentinCS Oct 18, 2024
bdc690d
add pointwise mesh file
PierreLaurentinCS Oct 18, 2024
18298f1
fix typos in the .rst file
PierreLaurentinCS Oct 18, 2024
75faf04
add little intro to the example
PierreLaurentinCS Oct 21, 2024
201ae1d
.prm indent in .rst file
PierreLaurentinCS Oct 21, 2024
c711a4d
fix typo that breaks CI
PierreLaurentinCS Oct 21, 2024
29d5dd8
fix OTHER typo that breaks CI
PierreLaurentinCS Oct 21, 2024
7a68098
removed unused figures and rework the pressure difference figure
PierreLaurentinCS Oct 24, 2024
15262fd
apply review comments
PierreLaurentinCS Oct 24, 2024
9e1fd2e
add precision on the wall position
PierreLaurentinCS Oct 25, 2024
39ad6a2
edit changelog
PierreLaurentinCS Oct 25, 2024
b907c8e
edit .svg for clarification
PierreLaurentinCS Oct 28, 2024
94821f8
apply first review comments
PierreLaurentinCS Nov 1, 2024
1649cad
modify .prm to take into account changes on BCs
PierreLaurentinCS Nov 1, 2024
7b94ade
Fix allocation
blaisb Nov 3, 2024
96d397c
Fix assembler to check if the face is a boundary
blaisb Nov 3, 2024
6105a55
finished applying review comments
PierreLaurentinCS Nov 4, 2024
0f6df09
add test for boundary conditions
PierreLaurentinCS Nov 4, 2024
316cd54
add application test for CHNS boundary conditions
PierreLaurentinCS Nov 4, 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
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to the Lethe project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [Master] - 2024-11-04

### Added

- MINOR Added capillary rise example to the documentation [#1328](https://github.com/chaos-polymtl/lethe/pull/1328)

## [Master] - 2024-11-03

### Fix
Expand Down Expand Up @@ -34,7 +40,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
- MAJOR Secondary equations (subequations) solved within the VOF auxiliary physics now go through a subequations interface similarly to how auxiliary physics go through the multiphysics interface. At the moment, only the implementation for the L2 projection of the phase fraction gradient has been refactored. Furthermore, only a linear equation solver has been implemented so far. [#1318](https://github.com/chaos-polymtl/lethe/pull/1318)

- MAJOR All scratch data objects now inherit from a base class, namely PhysicsScratchDataBase. In a similar manner, all base assemblers are now specialized types of the PhysicsAssemblerBase. [#1318](https://github.com/chaos-polymtl/lethe/pull/1318)

## [Master] - 2024-10-18

### Added
Expand Down
1 change: 1 addition & 0 deletions applications_tests/lethe-fluid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ file(COPY box.msh DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
file(COPY cylinder_manifold.msh DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
file(COPY lpbf_benchmark_mesh.msh DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
file(COPY cylinder_close_outlet.msh DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
file(COPY jurins-law-2d-mesh-dimensioned.msh DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")

file(COPY cavity_ht_average_velocity_initial_condition_files/restart.averagevelocities DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cavity_ht_average_velocity_as_initial_condition.${_build_type}/mpirun=1/")
file(COPY cavity_ht_average_velocity_initial_condition_files/restart.pvdhandler DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cavity_ht_average_velocity_as_initial_condition.${_build_type}/mpirun=1/")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Running on 1 MPI rank(s)...
Number of active cells: 2176
Number of degrees of freedom: 7008
Volume of triangulation: 34
Number of Cahn-Hilliard degrees of freedom: 4672
Number of active cells: 2560
Number of degrees of freedom: 8280
Volume of triangulation: 34
Number of Cahn-Hilliard degrees of freedom: 5520
Number of active cells: 3328
Number of degrees of freedom: 10800
Volume of triangulation: 34
Number of Cahn-Hilliard degrees of freedom: 7200

*******************************************************************************
Transient iteration: 1 Time: 0.0005 Time step: 0.0005 CFL: 0
*******************************************************************************

*******************************************************************************
Transient iteration: 2 Time: 0.001 Time step: 0.0005 CFL: 0.342862
*******************************************************************************
Number of active cells: 3886
Number of degrees of freedom: 12540
Volume of triangulation: 34
Number of Cahn-Hilliard degrees of freedom: 8360

*******************************************************************************
Transient iteration: 3 Time: 0.0015 Time step: 0.0005 CFL: 0.76523
*******************************************************************************
Number of active cells: 3907
Number of degrees of freedom: 12585
Volume of triangulation: 34
Number of Cahn-Hilliard degrees of freedom: 8390

*******************************************************************************
Transient iteration: 4 Time: 0.002 Time step: 0.0005 CFL: 0.761194
*******************************************************************************
Number of active cells: 3919
Number of degrees of freedom: 12642
Volume of triangulation: 34
Number of Cahn-Hilliard degrees of freedom: 8428
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-2024 The Lethe Authors
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later

# Listing of Parameters
# ---------------------

set dimension = 2

# Simulation and IO Control
#---------------------------------------------------

subsection simulation control
set method = bdf1
set output name = jurins-law-2d
set output frequency = 0
set time end = 2e-3
set time step = 5e-4
end

#---------------------------------------------------
# Multiphysics
#---------------------------------------------------

subsection multiphysics
set cahn hilliard = true
end

#---------------------------------------------------
# Dimensionality
#---------------------------------------------------

subsection dimensionality
set length = 0.001
end

#---------------------------------------------------
# Mesh
#---------------------------------------------------

subsection mesh
set type = gmsh
set file name = ../../jurins-law-2d-mesh-dimensioned.msh
set initial refinement = 2
end

#---------------------------------------------------
# Mesh Adaptation
#---------------------------------------------------

subsection mesh adaptation
set type = kelly
set variable = phase_cahn_hilliard
set fraction type = fraction
set max refinement level = 4
set min refinement level = 2
set frequency = 1
set fraction refinement = 0.99
set fraction coarsening = 0.01
set initial refinement steps = 2
end

#---------------------------------------------------
# Physical Properties
#---------------------------------------------------

subsection physical properties
set number of fluids = 2
subsection fluid 0
set kinematic viscosity = 8e-5
set density = 1
end
subsection fluid 1
set kinematic viscosity = 1e-4
set density = 2000
end
set number of material interactions = 1
subsection material interaction 0
subsection fluid-fluid interaction
set surface tension coefficient = 7.3e-2
set cahn hilliard mobility model = constant
set cahn hilliard mobility constant = 1e-7
end
end
end

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

subsection cahn hilliard
set potential smoothing coefficient = 0

subsection epsilon
set method = automatic
set verbosity = quiet
end
end

#---------------------------------------------------
# Boundary conditions Cahn-Hilliard
#---------------------------------------------------

subsection boundary conditions cahn hilliard
set number = 4
subsection bc 0
set id = 2
set type = angle_of_contact
set angle value = 50
end
subsection bc 1
set id = 3
set type = noflux
end
subsection bc 2
set id = 4
set type = noflux
end
subsection bc 3
set id = 5
set type = noflux
end
end

#---------------------------------------------------
# Boundary conditions
#---------------------------------------------------

subsection boundary conditions
set number = 4
subsection bc 0
set id = 2 # angle of contact
set type = slip
end
subsection bc 1
set id = 5 # walls
set type = slip
end
subsection bc 2
set id = 4 # upper surface
set type = none
end
subsection bc 3
set id = 3 # middle
set type = slip
end
end

#---------------------------------------------------
# Initial conditions
#---------------------------------------------------

subsection initial conditions
subsection cahn hilliard
set Function expression = tanh((y-4)/(1.41*2e-2));0
end
end

#---------------------------------------------------
# Source term
#---------------------------------------------------

subsection source term
subsection fluid dynamics
set Function expression = 0; -9810; 0
end
end

# --------------------------------------------------
# Non-Linear Solver Control
#---------------------------------------------------

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

# --------------------------------------------------
# Linear Solver Control
#---------------------------------------------------

subsection linear solver
subsection fluid dynamics
set verbosity = quiet
set max iters = 500
set relative residual = 1e-2
set minimum residual = 1e-3
set ilu preconditioner fill = 1
set max krylov vectors = 300
end
subsection cahn hilliard
set verbosity = quiet
set max iters = 500
set relative residual = 1e-2
set minimum residual = 1e-3
set ilu preconditioner fill = 1
set max krylov vectors = 300
end
end
Loading
Loading