From d954dfde6227612b4e76c0a86ac138801c62fd4e Mon Sep 17 00:00:00 2001 From: Bruno Blais Date: Thu, 12 Sep 2024 21:43:21 -0400 Subject: [PATCH] Add a first tracer test with DG --- .../dg_tracer_advection_tanh.output | 87 ++++++++ .../lethe-fluid/dg_tracer_advection_tanh.prm | 198 ++++++++++++++++++ 2 files changed, 285 insertions(+) create mode 100644 applications_tests/lethe-fluid/dg_tracer_advection_tanh.output create mode 100644 applications_tests/lethe-fluid/dg_tracer_advection_tanh.prm diff --git a/applications_tests/lethe-fluid/dg_tracer_advection_tanh.output b/applications_tests/lethe-fluid/dg_tracer_advection_tanh.output new file mode 100644 index 0000000000..b7aa2552b9 --- /dev/null +++ b/applications_tests/lethe-fluid/dg_tracer_advection_tanh.output @@ -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.00334962 + +******************************************************************************* +Transient iteration: 2 Time: 0.04 Time step: 0.02 CFL: 0.567185 +******************************************************************************* +L2 error velocity : 5.55112e-17 +L2 error tracer : 0.00685486 + +******************************************************************************* +Transient iteration: 3 Time: 0.06 Time step: 0.02 CFL: 0.567185 +******************************************************************************* +L2 error velocity : 5.55112e-17 +L2 error tracer : 0.00988011 + +******************************************************************************* +Transient iteration: 4 Time: 0.08 Time step: 0.02 CFL: 0.567185 +******************************************************************************* +L2 error velocity : 5.55112e-17 +L2 error tracer : 0.0137154 + +******************************************************************************* +Transient iteration: 5 Time: 0.1 Time step: 0.02 CFL: 0.567185 +******************************************************************************* +L2 error velocity : 5.55112e-17 +L2 error tracer : 0.0164935 + +******************************************************************************* +Transient iteration: 6 Time: 0.12 Time step: 0.02 CFL: 0.567185 +******************************************************************************* +L2 error velocity : 5.55112e-17 +L2 error tracer : 0.0193332 + +******************************************************************************* +Transient iteration: 7 Time: 0.14 Time step: 0.02 CFL: 0.567185 +******************************************************************************* +L2 error velocity : 5.55112e-17 +L2 error tracer : 0.0227292 + +******************************************************************************* +Transient iteration: 8 Time: 0.16 Time step: 0.02 CFL: 0.567185 +******************************************************************************* +L2 error velocity : 5.55112e-17 +L2 error tracer : 0.0248777 + +******************************************************************************* +Transient iteration: 9 Time: 0.18 Time step: 0.02 CFL: 0.567185 +******************************************************************************* +L2 error velocity : 5.55112e-17 +L2 error tracer : 0.0276809 + +******************************************************************************* +Transient iteration: 10 Time: 0.2 Time step: 0.02 CFL: 0.567185 +******************************************************************************* +L2 error velocity : 5.55112e-17 +L2 error tracer : 0.0305589 + 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.349625e-03 + 1024 6.854865e-03 + 1024 9.880108e-03 + 1024 1.371541e-02 + 1024 1.649349e-02 + 1024 1.933325e-02 + 1024 2.272922e-02 + 1024 2.487775e-02 + 1024 2.768088e-02 + 1024 3.055888e-02 diff --git a/applications_tests/lethe-fluid/dg_tracer_advection_tanh.prm b/applications_tests/lethe-fluid/dg_tracer_advection_tanh.prm new file mode 100644 index 0000000000..78bedf4754 --- /dev/null +++ b/applications_tests/lethe-fluid/dg_tracer_advection_tanh.prm @@ -0,0 +1,198 @@ +# Listing of Parameters +#---------------------- + +set dimension = 2 + +#--------------------------------------------------- +# Simulation Control +#--------------------------------------------------- + +subsection simulation control + set method = bdf1 + set number mesh adapt = 0 + set time end = 0.2 + set time step = 0.02 + set output name = stab_tracer + set output frequency = 0 +end + +#--------------------------------------------------- +# FEM +#--------------------------------------------------- + +subsection FEM + set velocity order = 1 + set pressure order = 1 + set tracer order = 1 + set tracer uses dg = true +end + +#--------------------------------------------------- +# Timer +#--------------------------------------------------- + +subsection timer + set type = none # +end + +#--------------------------------------------------- +# Initial condition +#--------------------------------------------------- + +subsection initial conditions + set type = nodal + subsection uvwp + set Function expression = 1; 0; 0 + end + subsection tracer + set Function expression = tanh(25-50*x) #if (x<=0.5,1,0) + end +end + +#--------------------------------------------------- +# Physical Properties +#--------------------------------------------------- + +subsection physical properties + set number of fluids = 1 + subsection fluid 0 + set tracer diffusivity = 0 + end +end + +#--------------------------------------------------- +# Mesh +#--------------------------------------------------- + +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 + +#--------------------------------------------------- +# Multiphysics +#--------------------------------------------------- + +subsection multiphysics + set tracer = true +end + +#--------------------------------------------------- +# Mesh Adaptation Control +#--------------------------------------------------- + +subsection mesh adaptation + set type = none +end + +#--------------------------------------------------- +# Analytical Solution +#--------------------------------------------------- + +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 + +#--------------------------------------------------- +# Boundary Conditions +#--------------------------------------------------- + +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 + + +#--------------------------------------------------- +# Non-Linear Solver Control +#--------------------------------------------------- + +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 + +#--------------------------------------------------- +# Linear Solver Control +#--------------------------------------------------- + +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