Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
stabilization.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2022-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_stabilization_h
5#define lethe_stabilization_h
6
7#include <core/vector.h>
8
9#include <deal.II/base/utilities.h>
10
11#include <cmath>
12
13using namespace dealii;
14
15/**
16 * @brief Calculate the stabilization parameter for the Navier-Stokes equations
17 * in steady-state
18 * @return Value of the stabilization parameter - tau
19 *
20 * @param u_mag Magnitude of the velocity
21 * @param kinematic_viscosity Kinematic viscosity
22 * @param h Cell size; it should be calculated using the diameter of a sphere of
23 * equal volume to that of the cell.
24 */
25inline double
27 const double kinematic_viscosity,
28 const double h)
29{
30 return 1. / std::sqrt(Utilities::fixed_power<2>(2. * u_mag / h) +
31 9 * Utilities::fixed_power<2>(4 * kinematic_viscosity /
32 (h * h)));
33}
34
35/**
36 * @brief Calculate the stabilization parameter for the transient Navier-Stokes
37 * equations
38 *
39 * @param u_mag Magnitude of the velocity
40 * @param kinematic_viscosity Kinematic viscosity
41 * @param h Cell size; it should be calculated using the diameter of a sphere of
42 * equal volume to that of the cell.
43 * @param sdt Inverse of the time step (1/dt)
44 *
45 * @return Value of the stabilization parameter - tau
46 */
47
48inline double
50 const double kinematic_viscosity,
51 const double h,
52 const double sdt)
53{
54 return 1. / std::sqrt(Utilities::fixed_power<2>(sdt) +
55 Utilities::fixed_power<2>(2. * u_mag / h) +
56 9 * Utilities::fixed_power<2>(4 * kinematic_viscosity /
57 (h * h)));
58}
59
60/**
61 * @brief Implements a Moe a posteriori shock capturing method to keep the field bounded. This limiter is only used when DG advection is selected for the Tracer.
62 * The limiter is based on the implementation proposed by: Moe, Scott A.,
63 * James A. Rossmanith, and David C. Seal. "A simple and effective high-order
64 * shock-capturing limiter for discontinuous Galerkin methods." arXiv preprint
65 * arXiv:1507.03024 (2015). https://doi.org/10.48550/arXiv.1507.03024
66 *
67 * The implementation follows the main idea of the paper, but we hardcode the
68 * value of alpha in the article to 0. This is supposed to lead to a more
69 * diffusive limiter, but in all honesty, all of our tries have shown that
70 * this is already a not very dissipative limiter when using BDF time
71 * integrator.
72 *
73 * @param dof_handler The DoFHandler used in the scalar simulation. This DOFHandler must have only a single component (a scalar equation).
74 * @param locally_relevant_vector A solution vector that contains the locally_relevant solution. This vector is used to read the solution on the ghost cells and will be modified at the end.
75 * @param locally_owned_vector A solution vector that contains the locally_owned solution. This vector will be used to write the new limited solution.
76 */
77template <int dim>
78void
79moe_scalar_limiter(const DoFHandler<dim> &dof_handler,
80 GlobalVectorType &locally_relevant_vector,
81 GlobalVectorType &locally_owned_vector);
82#endif
void moe_scalar_limiter(const DoFHandler< dim > &dof_handler, GlobalVectorType &locally_relevant_vector, GlobalVectorType &locally_owned_vector)
Implements a Moe a posteriori shock capturing method to keep the field bounded. This limiter is only ...
double calculate_navier_stokes_gls_tau_transient(const double u_mag, const double kinematic_viscosity, const double h, const double sdt)
Calculate the stabilization parameter for the transient Navier-Stokes equations.
double calculate_navier_stokes_gls_tau_steady(const double u_mag, const double kinematic_viscosity, const double h)
Calculate the stabilization parameter for the Navier-Stokes equations in steady-state.
dealii::TrilinosWrappers::MPI::Vector GlobalVectorType
Definition vector.h:17