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

Fix bdf extrapolation bug #1286

Merged
merged 12 commits into from
Sep 24, 2024
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
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-09-23

### Fixed

- MINOR In the [PR #994](https://github.com/chaos-polymtl/lethe/pull/994), BDF extrapolation of the velocity in the VOF auxiliary physics was moved to the scratch data. However, the implementation was bypassed by an if condition. This bug is fixed with this PR, and an application test was added to ensure that the feature remains intact with future implementations. [#1286](https://github.com/chaos-polymtl/lethe/pull/1286)

## [Master] - 2024-09-20

### Added
Expand Down
95 changes: 28 additions & 67 deletions applications_tests/lethe-fluid/heat_transfer_vof_lpbf_benchmark.prm
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ end
#---------------------------------------------------

subsection mesh
set type = gmsh

# GMSH file name
set file name = ../../lpbf_benchmark_mesh.msh

# Initial refinement of the mesh
set type = gmsh
set file name = ../../lpbf_benchmark_mesh.msh
set initial refinement = 3
end

Expand Down Expand Up @@ -117,16 +113,8 @@ end
#---------------------------------------------------

subsection initial conditions
set type = nodal
subsection uvwp
set Function expression = 0; 0; 0
end
subsection VOF
set Function expression = if (y<0.43 , 1, 0)
subsection projection step
set enable = false
set diffusion factor = 1
end
end
subsection temperature
set Function expression = 298
Expand Down Expand Up @@ -171,8 +159,6 @@ subsection physical properties
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 = phase change
set surface tension coefficient = 1.52
set reference state temperature = 1928
Expand All @@ -188,16 +174,13 @@ end
#---------------------------------------------------

subsection laser parameters
set enable = true
set type = gaussian_heat_flux_vof_interface
set concentration factor = 2
set power = 156e6 # M*L^2*T^-3
set absorptivity = 0.35
set penetration depth = 0.0
set beam radius = 0.07 # L
set start time = 0
set end time = 0.002
set beam orientation = y-
set enable = true
set power = 156e6 # M*L^2*T^-3
set absorptivity = 0.35
set penetration depth = 0.0
set beam radius = 0.07 # L
set end time = 0.002
set beam orientation = y-
subsection path
set Function expression = 0.3; 0.43
end
Expand All @@ -209,28 +192,20 @@ end

subsection VOF
subsection phase filtration
set type = tanh
set verbosity = quiet
set beta = 20
set type = tanh
end
subsection interface sharpening
set enable = true
set threshold = 0.5
set interface sharpness = 1.5
set frequency = 10
set type = adaptive
set threshold max deviation = 0.4
set max iterations = 50
set monitored fluid = fluid 1
set tolerance = 1e-7
set verbosity = quiet
end
subsection surface tension force
set enable = true
set phase fraction gradient diffusion factor = 4
set curvature diffusion factor = 1
set output auxiliary fields = true
set enable marangoni effect = true
set enable = true
set output auxiliary fields = true
set enable marangoni effect = true
end
end

Expand All @@ -245,9 +220,6 @@ subsection evaporation
set evaporation latent heat = 8.9e12
set molar mass = 4.58e-2
set boiling temperature = 3550

set evaporation coefficient = 0.82
set recoil pressure coefficient = 0.56
set ambient pressure = 101325e-3
set liquid density = 4420.0e-9
set universal gas constant = 8.314e6
Expand Down Expand Up @@ -291,38 +263,27 @@ end

subsection linear solver
subsection fluid dynamics
set verbosity = quiet
set method = gmres
set relative residual = 1e-3
set minimum residual = 1e-5
set preconditioner = ilu
set ilu preconditioner fill = 1
set ilu preconditioner absolute tolerance = 1e-12
set ilu preconditioner relative tolerance = 1.00
set verbosity = quiet
set minimum residual = 1e-5
set ilu preconditioner fill = 1
end
subsection heat transfer
set verbosity = quiet
set method = gmres
set relative residual = 1e-2
set minimum residual = 1e-1
set preconditioner = ilu
set ilu preconditioner fill = 1
set ilu preconditioner absolute tolerance = 1e-12
set ilu preconditioner relative tolerance = 1.00
set verbosity = quiet
set relative residual = 1e-2
set minimum residual = 1e-1
set ilu preconditioner fill = 1
end
subsection VOF
set verbosity = quiet
set method = gmres
set relative residual = 1e-3
set minimum residual = 1e-5
set preconditioner = ilu
set ilu preconditioner fill = 1
set ilu preconditioner absolute tolerance = 1e-12
set ilu preconditioner relative tolerance = 1.00
set verbosity = quiet
set minimum residual = 1e-5
set ilu preconditioner fill = 1
end
end

#---------------------------------------------------
# Restart
#---------------------------------------------------

subsection restart
set filename = restart
set restart = true
set restart = true
end
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ Temperature statistics on fluid :
VOF Mass Conservation
----------------------
time surface_fluid_0 mass_per_length_fluid_0 momentum-x_fluid_0 momentum-y_fluid_0 surface_fluid_1 mass_per_length_fluid_1 momentum-x_fluid_1 momentum-y_fluid_1 sharpening_threshold
6.0120e-06 1.0266e-01 1.8314e-10 1.6379e-11 1.5173e-13 2.5734e-01 1.1375e-06 9.1910e-12 1.1415e-10 5.0000e-01
6.0120e-06 1.0266e-01 1.8314e-10 1.6379e-11 1.5171e-13 2.5734e-01 1.1375e-06 9.1914e-12 1.1421e-10 5.0000e-01

*********************************************************************************
Transient iteration: 32 Time: 6.212e-06 Time step: 2e-07 CFL: 0.0023602
*********************************************************************************
Temperature statistics on fluid :
**********************************************************************************
Transient iteration: 32 Time: 6.212e-06 Time step: 2e-07 CFL: 0.00236028
**********************************************************************************
Temperature statistics on fluid :
Min : 298
Max : 2071.62
Average : 306.259
Expand All @@ -42,13 +42,13 @@ Temperature statistics on fluid :
----------------------
VOF Mass Conservation
----------------------
time surface_fluid_0 mass_per_length_fluid_0 momentum-x_fluid_0 momentum-y_fluid_0 surface_fluid_1 mass_per_length_fluid_1 momentum-x_fluid_1 momentum-y_fluid_1 sharpening_threshold
6.2120e-06 1.0266e-01 1.8314e-10 1.6362e-11 1.4320e-13 2.5734e-01 1.1375e-06 1.0181e-11 1.8352e-10 5.0000e-01
time surface_fluid_0 mass_per_length_fluid_0 momentum-x_fluid_0 momentum-y_fluid_0 surface_fluid_1 mass_per_length_fluid_1 momentum-x_fluid_1 momentum-y_fluid_1 sharpening_threshold
6.2120e-06 1.0266e-01 1.8314e-10 1.6362e-11 1.4312e-13 2.5734e-01 1.1375e-06 1.0182e-11 1.8370e-10 5.0000e-01

**********************************************************************************
Transient iteration: 33 Time: 6.412e-06 Time step: 2e-07 CFL: 0.00260532
Transient iteration: 33 Time: 6.412e-06 Time step: 2e-07 CFL: 0.00260547
**********************************************************************************
Temperature statistics on fluid :
Temperature statistics on fluid :
Min : 298
Max : 2098.95
Average : 306.498
Expand All @@ -57,13 +57,13 @@ Temperature statistics on fluid :
----------------------
VOF Mass Conservation
----------------------
time surface_fluid_0 mass_per_length_fluid_0 momentum-x_fluid_0 momentum-y_fluid_0 surface_fluid_1 mass_per_length_fluid_1 momentum-x_fluid_1 momentum-y_fluid_1 sharpening_threshold
6.4120e-06 1.0266e-01 1.8314e-10 1.6288e-11 1.3142e-13 2.5734e-01 1.1375e-06 1.0457e-11 2.6216e-10 5.0000e-01
time surface_fluid_0 mass_per_length_fluid_0 momentum-x_fluid_0 momentum-y_fluid_0 surface_fluid_1 mass_per_length_fluid_1 momentum-x_fluid_1 momentum-y_fluid_1 sharpening_threshold
6.4120e-06 1.0266e-01 1.8314e-10 1.6288e-11 1.3128e-13 2.5734e-01 1.1375e-06 1.0459e-11 2.6252e-10 5.0000e-01

*********************************************************************************
Transient iteration: 34 Time: 6.5e-06 Time step: 8.8e-08 CFL: 0.00271902
Transient iteration: 34 Time: 6.5e-06 Time step: 8.8e-08 CFL: 0.00271918
*********************************************************************************
Temperature statistics on fluid :
Temperature statistics on fluid :
Min : 298
Max : 2110.78
Average : 306.603
Expand All @@ -72,5 +72,5 @@ Temperature statistics on fluid :
----------------------
VOF Mass Conservation
----------------------
time surface_fluid_0 mass_per_length_fluid_0 momentum-x_fluid_0 momentum-y_fluid_0 surface_fluid_1 mass_per_length_fluid_1 momentum-x_fluid_1 momentum-y_fluid_1 sharpening_threshold
6.5000e-06 1.0266e-01 1.8314e-10 1.6208e-11 1.3455e-13 2.5734e-01 1.1375e-06 1.0018e-11 2.0102e-10 5.0000e-01
time surface_fluid_0 mass_per_length_fluid_0 momentum-x_fluid_0 momentum-y_fluid_0 surface_fluid_1 mass_per_length_fluid_1 momentum-x_fluid_1 momentum-y_fluid_1 sharpening_threshold
6.5000e-06 1.0266e-01 1.8314e-10 1.6208e-11 1.3445e-13 2.5734e-01 1.1375e-06 1.0019e-11 2.0129e-10 5.0000e-01
Loading
Loading