ExaDG
Loading...
Searching...
No Matches
operator_dual_splitting.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_DUAL_SPLITTING_H_
23#define EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATOR_DUAL_SPLITTING_H_
24
25// ExaDG
26#include <exadg/incompressible_navier_stokes/spatial_discretization/curl_compute.h>
27#include <exadg/incompressible_navier_stokes/spatial_discretization/operator_projection_methods.h>
28
29namespace ExaDG
30{
31namespace IncNS
32{
33template<int dim, typename Number = double>
34class OperatorDualSplitting : public OperatorProjectionMethods<dim, Number>
35{
36private:
38 typedef OperatorProjectionMethods<dim, Number> ProjectionBase;
39 typedef OperatorDualSplitting<dim, Number> This;
40
41 typedef typename Base::VectorType VectorType;
42
43 typedef typename Base::scalar scalar;
44 typedef typename Base::vector vector;
45 typedef typename Base::tensor tensor;
46
47 typedef typename Base::Range Range;
48
49 typedef typename Base::FaceIntegratorU FaceIntegratorU;
50 typedef typename Base::FaceIntegratorP FaceIntegratorP;
51
52public:
53 /*
54 * Constructor.
55 */
56 OperatorDualSplitting(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 ~OperatorDualSplitting();
69
70 /*
71 * Pressure Poisson equation.
72 */
73
74 // rhs pressure: velocity divergence
75 void
76 apply_velocity_divergence_term(VectorType & dst, VectorType const & src) const;
77
78 void
79 rhs_velocity_divergence_term_dirichlet_bc_from_dof_vector(VectorType & dst,
80 VectorType const & velocity) const;
81
82 // rhs pressure Poisson equation: velocity divergence term: body force term
83 void
84 rhs_ppe_div_term_body_forces_add(VectorType & dst, double const & time) const;
85
86 // rhs pressure Poisson equation: velocity divergence term: convective term
87 void
88 rhs_ppe_div_term_convective_term_add(VectorType & dst, VectorType const & src) const;
89
90 // rhs pressure Poisson equation: Neumann BC body force term
91 void
92 rhs_ppe_nbc_body_force_term_add(VectorType & dst, double const & time) const;
93
94 // rhs pressure Poisson equation: Neumann BC numerical time derivative term
95 void
96 rhs_ppe_nbc_numerical_time_derivative_add(VectorType & dst, VectorType const & src) const;
97
98 // rhs pressure Poisson equation: Neumann BC convective term
99 void
100 rhs_ppe_nbc_convective_add(VectorType & dst, VectorType const & src) const;
101
102 // rhs pressure Poisson equation: Neumann BC viscous term
103 void
104 rhs_ppe_nbc_viscous_add(VectorType & dst, VectorType const & src) const;
105
106 // rhs pressure Poisson equation: Neumann BC variable viscosity term
107 void
108 rhs_ppe_nbc_variable_viscosity_add(VectorType & rhs_ppe,
109 VectorType const & velocity,
110 VectorType const & viscosity);
111
112 void
113 rhs_ppe_laplace_add(VectorType & dst, double const & time) const;
114
115 unsigned int
116 solve_pressure(VectorType & dst, VectorType const & src, bool const update_preconditioner) const;
117
118 /*
119 * Viscous step.
120 */
121
122 void
123 apply_helmholtz_operator(VectorType & dst, VectorType const & src) const;
124
125
126 /*
127 * Fill a DoF vector with velocity Dirichlet values on Dirichlet boundaries.
128 *
129 * Note that this function only works as long as one uses a nodal dealii::FE_DGQ element with
130 * Gauss-Lobatto points. Otherwise, the quadrature formula used in this function does not match
131 * the nodes of the element, and the values injected by this function into the DoF vector are not
132 * the degrees of freedom of the underlying finite element space.
133 */
134 void
135 interpolate_velocity_dirichlet_bc(VectorType & dst, double const & time) const;
136
137private:
138 /*
139 * rhs pressure Poisson equation
140 */
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 // rhs PPE: velocity divergence term
159
160 // convective term
161 void
162 local_rhs_ppe_div_term_convective_term_boundary_face(
163 dealii::MatrixFree<dim, Number> const & matrix_free,
164 VectorType & dst,
165 VectorType const & src,
166 Range const & face_range) const;
167
168 // body force term
169 void
170 local_rhs_ppe_div_term_body_forces_boundary_face(
171 dealii::MatrixFree<dim, Number> const & matrix_free,
172 VectorType & dst,
173 VectorType const & src,
174 Range const & face_range) const;
175
176 // Neumann boundary condition term
177
178 // dg_u/dt with numerical time derivative
179 void
180 local_rhs_ppe_nbc_numerical_time_derivative_add_boundary_face(
181 dealii::MatrixFree<dim, Number> const & matrix_free,
182 VectorType & dst,
183 VectorType const & src,
184 Range const & face_range) const;
185
186 // body force term
187 void
188 local_rhs_ppe_nbc_body_force_term_add_boundary_face(
189 dealii::MatrixFree<dim, Number> const & matrix_free,
190 VectorType & dst,
191 VectorType const & src,
192 Range const & face_range) const;
193
194 // convective term
195 void
196 local_rhs_ppe_nbc_convective_add_boundary_face(
197 dealii::MatrixFree<dim, Number> const & matrix_free,
198 VectorType & dst,
199 VectorType const & src,
200 Range const & face_range) const;
201
202 // viscous term
203 void
204 local_rhs_ppe_nbc_viscous_add_boundary_face(dealii::MatrixFree<dim, Number> const & matrix_free,
205 VectorType & dst,
206 VectorType const & src,
207 Range const & face_range) const;
208
209 // viscous term from variable viscosity
210 void
211 local_rhs_ppe_nbc_variable_viscosity_add_boundary_face(
212 dealii::MatrixFree<dim, Number> const & matrix_free,
213 VectorType & dst,
214 VectorType const & src,
215 Range const & face_range) const;
216
217 void
218 local_interpolate_velocity_dirichlet_bc_boundary_face(
219 dealii::MatrixFree<dim, Number> const & matrix_free,
220 VectorType & dst,
221 VectorType const & src,
222 Range const & face_range) const;
223
224 // Pointer to vector holding the viscosity in the velocity scalar field.
225 VectorType const * viscosity = nullptr;
226};
227
228} // namespace IncNS
229} // namespace ExaDG
230
231#endif /* EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATOR_DUAL_SPLITTING_H_ \
232 */
Definition grid.h:40
Definition parameters.h:46
Definition spatial_operator_base.h:68
Definition grid.h:84
Definition driver.cpp:33
Definition boundary_descriptor.h:240
Definition field_functions.h:31