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

Add Discontinuous Galerkin capabilities to the Tracer auxiliary physics #1320

Merged
merged 81 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
a90af03
Some play around with DG
blaisb Sep 9, 2024
e475caf
WIP other strategy using directly face integrals
blaisb Sep 10, 2024
911a202
WIP
blaisb Sep 10, 2024
b5c8f41
Crappy version that needs to be cleaned
blaisb Sep 10, 2024
e19b807
WIP getting better now need to fix BCS
blaisb Sep 11, 2024
51125e6
Advection works just fine with tracer now
blaisb Sep 11, 2024
c8edd24
WIP Yo
blaisb Sep 11, 2024
f7d8f2d
WIP tracer diffusivity addition
blaisb Sep 11, 2024
402f023
WIP smthing weird
blaisb Sep 12, 2024
ad06eb1
WIP more working version
blaisb Sep 12, 2024
264f085
WIP
blaisb Sep 12, 2024
2c7b2c2
Add a first tracer test with DG
blaisb Sep 13, 2024
517534e
Add two more tests
blaisb Sep 13, 2024
aa0a78e
Add copy data correctly
blaisb Sep 13, 2024
914d2bb
WIP
blaisb Sep 13, 2024
8129001
Remove non-necessary elements from the scratch
blaisb Sep 13, 2024
ac0dd61
Indent and add beta from boundary conditions
blaisb Sep 13, 2024
81085da
Starting to add interface for assemblers
blaisb Sep 13, 2024
dd02275
Add internal face assembler
blaisb Sep 13, 2024
6cc8099
Refactor calculation of RHS
blaisb Sep 13, 2024
aad7ffb
WIP adding parameter yo
blaisb Sep 13, 2024
7562d35
Linked parameters to assembly
oguevremont Sep 18, 2024
75ca4ab
WIP move workers to assemblers
oguevremont Sep 18, 2024
9d09525
Moved boundary assembly to assembler
oguevremont Sep 18, 2024
bf2fbb5
Fixed minor mistakes
oguevremont Sep 18, 2024
3841f09
Fixed MPI bug
oguevremont Sep 18, 2024
af33f46
WIP Add comments
oguevremont Sep 23, 2024
4347969
WIP Add comments
oguevremont Sep 23, 2024
883da77
Removed the set time for the tracer BC in assemblers
oguevremont Sep 23, 2024
91b7d1e
Took the assemblers out of the workers
oguevremont Sep 23, 2024
b11fc68
Added documentation for parameters
oguevremont Sep 23, 2024
27c9319
Clean tests
oguevremont Sep 24, 2024
5ac712d
Add pipe and sharp initial condition test
oguevremont Sep 24, 2024
395f842
Add support for SharpIB with tracer
oguevremont Sep 24, 2024
f22b855
Remove useless reinitialization
blaisb Sep 24, 2024
be63014
Add new circular advection test case
blaisb Sep 24, 2024
9cca51c
Update tests and remove the need for the SIPG cons
blaisb Sep 25, 2024
983b566
Update last test after merge
blaisb Sep 25, 2024
0ecddfc
WIP messy
blaisb Sep 25, 2024
8d6219b
Things make more sense now
blaisb Sep 25, 2024
798421e
Update test + SIPG definition now parameterless
blaisb Sep 25, 2024
92b8636
Allow for DG0 by ensuring mapping is at least Q1
blaisb Sep 26, 2024
e18603b
WIP
blaisb Oct 1, 2024
add5010
Add a test with tracer dynamic mesh adapt
blaisb Oct 1, 2024
fcfac8e
Remove vector ADD and refactor routines
blaisb Oct 14, 2024
c2f5bd6
Begin refactoring of the assemblers
blaisb Oct 14, 2024
fc875de
Add test with residual value
blaisb Oct 14, 2024
f12143a
WIP refactoring of velocity and properties
blaisb Oct 14, 2024
2c79214
Refactory boundary assembler
blaisb Oct 14, 2024
31f56fe
Migrate RHS boundary worker
blaisb Oct 14, 2024
7a89fc5
Finished refactoring of assemblers
blaisb Oct 14, 2024
2a5a151
Refactored and generalized velocity calculation
blaisb Oct 14, 2024
ab59a14
Add license to new tests
blaisb Oct 14, 2024
dcacd4f
Clean documentation
blaisb Oct 14, 2024
11dd8de
Fix stabilization documentation
blaisb Oct 14, 2024
3336b87
Remove unused parameter
blaisb Oct 14, 2024
dc31767
Removed unused SIPG parameter
blaisb Oct 14, 2024
314ec25
Remove comments that were not necessary
blaisb Oct 14, 2024
5ca3553
Finish removal of unused parameter
blaisb Oct 14, 2024
8d7694a
Add comment to clarify statement
blaisb Oct 14, 2024
a381f9e
Added more [in,out] statements
blaisb Oct 14, 2024
8f8ed68
Fix comments for doxygen
blaisb Oct 14, 2024
da522f2
Fix comments
blaisb Oct 14, 2024
53bd97d
Simplify assembly routines slightly
blaisb Oct 14, 2024
7e7849a
Update include/solvers/tracer_scratch_data.h
blaisb Oct 15, 2024
2ed4b40
Apply comments by Mikael
blaisb Oct 15, 2024
9cf301b
Apply suggestions from code review
blaisb Oct 16, 2024
89266bb
Fix tracer assemblers doxygen
blaisb Oct 16, 2024
06fcb3b
Make scratch data const in all assemblers
blaisb Oct 16, 2024
d4bb320
Add changelog entry
blaisb Oct 16, 2024
fd76a27
Update source/solvers/tracer_assemblers.cc
blaisb Oct 16, 2024
75b00f1
Update source/solvers/tracer_assemblers.cc
blaisb Oct 16, 2024
f4c20a4
Update source/solvers/tracer.cc
blaisb Oct 16, 2024
d1e92bb
Update include/solvers/tracer.h
blaisb Oct 16, 2024
e4001d3
Update include/solvers/tracer_scratch_data.h
blaisb Oct 16, 2024
09d6a85
Apply suggestions from code review
blaisb Oct 16, 2024
0608238
Indent
blaisb Oct 16, 2024
ba0d43a
Address comments by hepap
blaisb Oct 16, 2024
6440c41
Fix variable name
blaisb Oct 16, 2024
08ba096
Indent
blaisb Oct 16, 2024
f7725b5
Applied all of review comments
blaisb Oct 19, 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
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

- MINOR Change default coarse grid solver to a direct solver for the geometric multigrid preconditioner in the matrix application. [#1322](https://github.com/chaos-polymtl/lethe/pull/1322)

## [Master] - 2024-10-16

### Fixed

- MINOR Added missing flag to update quadrature points for the FEFaceValues of the tracer physics. [#1323](https://github.com/chaos-polymtl/lethe/pull/1323)

### Added

- MAJOR Tracer physics can now be solved by using a discontinuous Galerkin method instead of a continuous Galerkin method. [#1320](https://github.com/chaos-polymtl/lethe/pull/1320)

## [Master] - 2024-10-15

Expand Down
87 changes: 87 additions & 0 deletions applications_tests/lethe-fluid/dg_tracer_advection_tanh.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
Running on 1 MPI rank(s)...
Number of active cells: 1024
Number of degrees of freedom: 3267
Volume of triangulation: 1
Number of tracer degrees of freedom: 4096

*******************************************************************************
Transient iteration: 1 Time: 0.02 Time step: 0.02 CFL: 0.567185
*******************************************************************************
L2 error velocity : 5.55112e-17
L2 error tracer : 0.00365901

*******************************************************************************
Transient iteration: 2 Time: 0.04 Time step: 0.02 CFL: 0.567185
*******************************************************************************
L2 error velocity : 5.55112e-17
L2 error tracer : 0.00705464

*******************************************************************************
Transient iteration: 3 Time: 0.06 Time step: 0.02 CFL: 0.567185
*******************************************************************************
L2 error velocity : 5.55112e-17
L2 error tracer : 0.0100805

*******************************************************************************
Transient iteration: 4 Time: 0.08 Time step: 0.02 CFL: 0.567185
*******************************************************************************
L2 error velocity : 5.55112e-17
L2 error tracer : 0.0139666

*******************************************************************************
Transient iteration: 5 Time: 0.1 Time step: 0.02 CFL: 0.567185
*******************************************************************************
L2 error velocity : 5.55112e-17
L2 error tracer : 0.0167514

*******************************************************************************
Transient iteration: 6 Time: 0.12 Time step: 0.02 CFL: 0.567185
*******************************************************************************
L2 error velocity : 5.55112e-17
L2 error tracer : 0.0196117

*******************************************************************************
Transient iteration: 7 Time: 0.14 Time step: 0.02 CFL: 0.567185
*******************************************************************************
L2 error velocity : 5.55112e-17
L2 error tracer : 0.0230336

*******************************************************************************
Transient iteration: 8 Time: 0.16 Time step: 0.02 CFL: 0.567185
*******************************************************************************
L2 error velocity : 5.55112e-17
L2 error tracer : 0.0251808

*******************************************************************************
Transient iteration: 9 Time: 0.18 Time step: 0.02 CFL: 0.567185
*******************************************************************************
L2 error velocity : 5.55112e-17
L2 error tracer : 0.0279955

*******************************************************************************
Transient iteration: 10 Time: 0.2 Time step: 0.02 CFL: 0.567185
*******************************************************************************
L2 error velocity : 5.55112e-17
L2 error tracer : 0.0308831
time error_velocity
0.0200 5.551115e-17
0.0400 5.551115e-17
0.0600 5.551115e-17
0.0800 5.551115e-17
0.1000 5.551115e-17
0.1200 5.551115e-17
0.1400 5.551115e-17
0.1600 5.551115e-17
0.1800 5.551115e-17
0.2000 5.551115e-17
cells error_tracer
1024 3.659011e-03
1024 7.054635e-03
1024 1.008047e-02
1024 1.396659e-02
1024 1.675139e-02
1024 1.961169e-02
1024 2.303355e-02
1024 2.518081e-02
1024 2.799553e-02
1024 3.088313e-02
139 changes: 139 additions & 0 deletions applications_tests/lethe-fluid/dg_tracer_advection_tanh.prm
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# SPDX-FileCopyrightText: Copyright (c) 2022-2023 The Lethe Authors
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later

set dimension = 2

subsection simulation control
set method = bdf1
set time end = 0.2
set time step = 0.02
set output name = stab_tracer
set output frequency = 0
end

subsection FEM
set velocity order = 1
set pressure order = 1
set tracer order = 1
set tracer uses dg = true
end

subsection initial conditions
set type = nodal
subsection uvwp
set Function expression = 1; 0; 0
end
subsection tracer
set Function expression = tanh(25-50*x)
end
end

subsection physical properties
set number of fluids = 1
subsection fluid 0
set tracer diffusivity = 0
end
end

subsection mesh
set type = dealii
set grid type = subdivided_hyper_rectangle
set grid arguments = 1, 1 : 0, 0 : 1, 1.0 : true
set initial refinement = 5
end

subsection multiphysics
set tracer = true
end

subsection analytical solution
set enable = true
set verbosity = verbose
subsection uvwp
set Function expression = 1 ; 0 ; 0
end
subsection tracer
set Function expression = tanh(25-50*x+50*t)
end
end

subsection boundary conditions
set number = 3
subsection bc 0
set id = 0
set type = function
subsection u
set Function expression = 1
end
end
subsection bc 1
set id = 2
set type = slip
end
subsection bc 2
set id = 3
set type = slip
end
end

subsection boundary conditions tracer
set number = 4
subsection bc 0
set id = 0
set type = dirichlet
subsection dirichlet
set Function expression = 1
end
end
subsection bc 1
set id = 1
set type = outlet
end
subsection bc 2
set id = 2
set type = outlet
end
subsection bc 3
set id = 3
set type = outlet
end
end

subsection non-linear solver
subsection tracer
set verbosity = quiet
set tolerance = 1e-9
set max iterations = 1
end
subsection fluid dynamics
set verbosity = quiet
set tolerance = 1e-9
set max iterations = 1
end
end

subsection linear solver
subsection fluid dynamics
set verbosity = quiet
set method = gmres
set max iters = 100
set relative residual = 1e-13
set minimum residual = 1e-14
set preconditioner = ilu
set ilu preconditioner fill = 0
set ilu preconditioner absolute tolerance = 1e-14
set ilu preconditioner relative tolerance = 1.00
end
subsection tracer
set verbosity = quiet
set method = gmres
set max iters = 300
set max krylov vectors = 300
set relative residual = 1e-9
set minimum residual = 1e-9
set preconditioner = ilu
set ilu preconditioner fill = 0
set ilu preconditioner absolute tolerance = 1e-14
set ilu preconditioner relative tolerance = 1.00
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Running on 2 MPI rank(s)...
Number of active cells: 64
Number of degrees of freedom: 243
Volume of triangulation: 1
Number of tracer degrees of freedom: 256

*****************************
Steady iteration: 1/3
*****************************
L2 error velocity : 1.63299
L2 error tracer : 0.00354869

*****************************
Steady iteration: 2/3
*****************************
Number of active cells: 256
Number of degrees of freedom: 867
Volume of triangulation: 1
Number of tracer degrees of freedom: 1024
L2 error velocity : 1.63299
L2 error tracer : 0.000434047

*****************************
Steady iteration: 3/3
*****************************
Number of active cells: 1024
Number of degrees of freedom: 3267
Volume of triangulation: 1
Number of tracer degrees of freedom: 4096
L2 error velocity : 1.63299
L2 error tracer : 2.77243e-05
cells error_velocity error_pressure
64 1.632993e+00 - 0.000000e+00 -
256 1.632993e+00 0.00 0.000000e+00 nan
1024 1.632993e+00 0.00 0.000000e+00 nan
Comment on lines +34 to +35
Copy link
Collaborator

Choose a reason for hiding this comment

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

I get why there are nans, but I think it looks kinda weird :o

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does, but I guess that's life :)

cells error_tracer
64 3.548693e-03 -
256 4.340470e-04 3.03
1024 2.772428e-05 3.97
Loading
Loading