-
Notifications
You must be signed in to change notification settings - Fork 61
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
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 e475caf
WIP other strategy using directly face integrals
blaisb 911a202
WIP
blaisb b5c8f41
Crappy version that needs to be cleaned
blaisb e19b807
WIP getting better now need to fix BCS
blaisb 51125e6
Advection works just fine with tracer now
blaisb c8edd24
WIP Yo
blaisb f7d8f2d
WIP tracer diffusivity addition
blaisb 402f023
WIP smthing weird
blaisb ad06eb1
WIP more working version
blaisb 264f085
WIP
blaisb 2c7b2c2
Add a first tracer test with DG
blaisb 517534e
Add two more tests
blaisb aa0a78e
Add copy data correctly
blaisb 914d2bb
WIP
blaisb 8129001
Remove non-necessary elements from the scratch
blaisb ac0dd61
Indent and add beta from boundary conditions
blaisb 81085da
Starting to add interface for assemblers
blaisb dd02275
Add internal face assembler
blaisb 6cc8099
Refactor calculation of RHS
blaisb aad7ffb
WIP adding parameter yo
blaisb 7562d35
Linked parameters to assembly
oguevremont 75ca4ab
WIP move workers to assemblers
oguevremont 9d09525
Moved boundary assembly to assembler
oguevremont bf2fbb5
Fixed minor mistakes
oguevremont 3841f09
Fixed MPI bug
oguevremont af33f46
WIP Add comments
oguevremont 4347969
WIP Add comments
oguevremont 883da77
Removed the set time for the tracer BC in assemblers
oguevremont 91b7d1e
Took the assemblers out of the workers
oguevremont b11fc68
Added documentation for parameters
oguevremont 27c9319
Clean tests
oguevremont 5ac712d
Add pipe and sharp initial condition test
oguevremont 395f842
Add support for SharpIB with tracer
oguevremont f22b855
Remove useless reinitialization
blaisb be63014
Add new circular advection test case
blaisb 9cca51c
Update tests and remove the need for the SIPG cons
blaisb 983b566
Update last test after merge
blaisb 0ecddfc
WIP messy
blaisb 8d6219b
Things make more sense now
blaisb 798421e
Update test + SIPG definition now parameterless
blaisb 92b8636
Allow for DG0 by ensuring mapping is at least Q1
blaisb e18603b
WIP
blaisb add5010
Add a test with tracer dynamic mesh adapt
blaisb fcfac8e
Remove vector ADD and refactor routines
blaisb c2f5bd6
Begin refactoring of the assemblers
blaisb fc875de
Add test with residual value
blaisb f12143a
WIP refactoring of velocity and properties
blaisb 2c79214
Refactory boundary assembler
blaisb 31f56fe
Migrate RHS boundary worker
blaisb 7a89fc5
Finished refactoring of assemblers
blaisb 2a5a151
Refactored and generalized velocity calculation
blaisb ab59a14
Add license to new tests
blaisb dcacd4f
Clean documentation
blaisb 11dd8de
Fix stabilization documentation
blaisb 3336b87
Remove unused parameter
blaisb dc31767
Removed unused SIPG parameter
blaisb 314ec25
Remove comments that were not necessary
blaisb 5ca3553
Finish removal of unused parameter
blaisb 8d7694a
Add comment to clarify statement
blaisb a381f9e
Added more [in,out] statements
blaisb 8f8ed68
Fix comments for doxygen
blaisb da522f2
Fix comments
blaisb 53bd97d
Simplify assembly routines slightly
blaisb 7e7849a
Update include/solvers/tracer_scratch_data.h
blaisb 2ed4b40
Apply comments by Mikael
blaisb 9cf301b
Apply suggestions from code review
blaisb 89266bb
Fix tracer assemblers doxygen
blaisb 06fcb3b
Make scratch data const in all assemblers
blaisb d4bb320
Add changelog entry
blaisb fd76a27
Update source/solvers/tracer_assemblers.cc
blaisb 75b00f1
Update source/solvers/tracer_assemblers.cc
blaisb f4c20a4
Update source/solvers/tracer.cc
blaisb d1e92bb
Update include/solvers/tracer.h
blaisb e4001d3
Update include/solvers/tracer_scratch_data.h
blaisb 09d6a85
Apply suggestions from code review
blaisb 0608238
Indent
blaisb ba0d43a
Address comments by hepap
blaisb 6440c41
Fix variable name
blaisb 08ba096
Indent
blaisb f7725b5
Applied all of review comments
blaisb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
87 changes: 87 additions & 0 deletions
87
applications_tests/lethe-fluid/dg_tracer_advection_tanh.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,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
139
applications_tests/lethe-fluid/dg_tracer_advection_tanh.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,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 |
39 changes: 39 additions & 0 deletions
39
applications_tests/lethe-fluid/dg_tracer_circular_advection.mpirun=2.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,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 | ||
cells error_tracer | ||
64 3.548693e-03 - | ||
256 4.340470e-04 3.03 | ||
1024 2.772428e-05 3.97 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :)