ExaDG
Loading...
Searching...
No Matches
operator_pressure_correction.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2021 by the ExaDG authors
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * ______________________________________________________________________
20 */
21
22#ifndef EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATOR_PRESSURE_CORRECTION_H_
23#define EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATOR_PRESSURE_CORRECTION_H_
24
25// ExaDG
26#include <exadg/incompressible_navier_stokes/spatial_discretization/operator_projection_methods.h>
27
28namespace ExaDG
29{
30namespace IncNS
31{
32template<int dim, typename Number = double>
33class OperatorPressureCorrection : public OperatorProjectionMethods<dim, Number>
34{
35private:
37 typedef OperatorProjectionMethods<dim, Number> ProjectionBase;
38 typedef OperatorPressureCorrection<dim, Number> This;
39
40 typedef typename Base::VectorType VectorType;
41
42 typedef typename Base::scalar scalar;
43 typedef typename Base::vector vector;
44 typedef typename Base::tensor tensor;
45
46 typedef typename Base::Range Range;
47
48 typedef typename Base::FaceIntegratorU FaceIntegratorU;
49 typedef typename Base::FaceIntegratorP FaceIntegratorP;
50
51public:
52 /*
53 * Constructor.
54 */
55 OperatorPressureCorrection(
56 std::shared_ptr<Grid<dim> const> grid,
57 std::shared_ptr<dealii::Mapping<dim> const> mapping,
58 std::shared_ptr<MultigridMappings<dim, Number>> const multigrid_mappings,
59 std::shared_ptr<BoundaryDescriptor<dim> const> boundary_descriptor,
60 std::shared_ptr<FieldFunctions<dim> const> field_functions,
61 Parameters const & parameters,
62 std::string const & field,
63 MPI_Comm const & mpi_comm);
64
65 /*
66 * Destructor.
67 */
68 virtual ~OperatorPressureCorrection();
69
70 /*
71 * Initializes the inverse pressure mass matrix operator needed for the pressure correction
72 * scheme, as well as the pressure mass operator needed in the ALE case only (where the mass
73 * operator may be evaluated at different times depending on the specific ALE formulation chosen).
74 */
75 void
77
78 void
79 update_after_grid_motion(bool const update_matrix_free) final;
80
81 /*
82 * This function evaluates the nonlinear residual of the steady Navier-Stokes equations (momentum
83 * equation and continuity equation).
84 */
85 void
86 evaluate_nonlinear_residual_steady(VectorType & dst_u,
87 VectorType & dst_p,
88 VectorType const & src_u,
89 VectorType const & src_p,
90 double const & time) const;
91
92 /*
93 * This function applies the linearized momentum operator and is used for throughput measurements.
94 */
95 void
96 apply_momentum_operator(VectorType & dst, VectorType const & src);
97
98 /*
99 * Projection step.
100 */
101
102 // rhs pressure gradient
103 void
104 rhs_pressure_gradient_term_dirichlet_bc_from_dof_vector(VectorType & dst,
105 VectorType const & pressure) const;
106
107 void
108 evaluate_pressure_gradient_term_dirichlet_bc_from_dof_vector(VectorType & dst,
109 VectorType const & src,
110 VectorType const & pressure) const;
111
112 /*
113 * Pressure update step.
114 */
115
116 // apply inverse pressure mass operator
117 void
118 apply_inverse_pressure_mass_operator(VectorType & dst, VectorType const & src) const;
119
120 /*
121 * pressure Poisson equation.
122 */
123 unsigned int
124 solve_pressure(VectorType & dst, VectorType const & src, bool const update_preconditioner) const;
125
126 void
127 rhs_ppe_laplace_add(VectorType & dst, double const & time) const;
128
129 void
130 rhs_ppe_laplace_add_dirichlet_bc_from_dof_vector(VectorType & dst, VectorType const & src) const;
131
132 void
133 interpolate_pressure_dirichlet_bc(VectorType & dst, double const & time) const;
134
135private:
136 /*
137 * Setup of inverse mass operator for pressure.
138 */
139 void
140 setup_inverse_mass_operator_pressure();
141
142 void
143 cell_loop_empty(dealii::MatrixFree<dim, Number> const &,
144 VectorType &,
145 VectorType const &,
146 Range const &) const
147 {
148 }
149
150 void
151 face_loop_empty(dealii::MatrixFree<dim, Number> const &,
152 VectorType &,
153 VectorType const &,
154 Range const &) const
155 {
156 }
157
158 void
159 local_interpolate_pressure_dirichlet_bc_boundary_face(
160 dealii::MatrixFree<dim, Number> const & matrix_free,
161 VectorType & dst,
162 VectorType const & src,
163 Range const & face_range) const;
164
165 InverseMassOperator<dim, 1, Number> inverse_mass_pressure;
166};
167
168} // namespace IncNS
169} // namespace ExaDG
170
171#endif /* EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATOR_PRESSURE_CORRECTION_H_ \
172 */
Definition grid.h:40
void setup_derived() final
Definition operator_pressure_correction.cpp:56
Definition parameters.h:46
Definition spatial_operator_base.h:68
Definition inverse_mass_operator.h:96
Definition grid.h:84
Definition driver.cpp:33
Definition boundary_descriptor.h:240
Definition field_functions.h:31