ExaDG
Loading...
Searching...
No Matches
operator_consistent_splitting.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2025 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_CONSISTENT_SPLITTING_H_
23#define EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATOR_CONSISTENT_SPLITTING_H_
24
25// base class
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 OperatorConsistentSplitting : public OperatorProjectionMethods<dim, Number>
35{
36private:
38 typedef OperatorProjectionMethods<dim, Number> ProjectionBase;
39 typedef OperatorConsistentSplitting<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 OperatorConsistentSplitting(
57 std::shared_ptr<Grid<dim> const> grid,
58 std::shared_ptr<dealii::Mapping<dim> const> mapping,
59 std::shared_ptr<MultigridMappings<dim, Number>> const multigrid_mappings,
60 std::shared_ptr<BoundaryDescriptor<dim> const> boundary_descriptor,
61 std::shared_ptr<FieldFunctions<dim> const> field_functions,
62 Parameters const & parameters,
63 std::string const & field,
64 MPI_Comm const & mpi_comm);
65
66 /*
67 * Destructor.
68 */
69 virtual ~OperatorConsistentSplitting();
70
71 /*
72 * Pressure Poisson equation.
73 */
74 // Leray projection
75 void
76 apply_velocity_divergence_term(VectorType & dst, VectorType const & src) const;
77
78 // rhs pressure: divergence of convective term
79 void
80 apply_convective_divergence_term(VectorType & dst, VectorType const & src) 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: Neumann BC viscous term and numerical time derivative term
87 void
88 rhs_ppe_nbc_add(VectorType & dst,
89 VectorType const & src,
90 double const & time,
91 Number const gamma_dt) const;
92
93 /*
94 * Viscous step.
95 */
96 void
97 apply_helmholtz_operator(VectorType & dst, VectorType const & src) const;
98
99private:
100 /*
101 * rhs pressure Poisson equation
102 */
103
104 void
105 cell_loop_empty(dealii::MatrixFree<dim, Number> const &,
106 VectorType &,
107 VectorType const &,
108 Range const &) const
109 {
110 }
111
112 void
113 face_loop_empty(dealii::MatrixFree<dim, Number> const &,
114 VectorType &,
115 VectorType const &,
116 Range const &) const
117 {
118 }
119
120 /*
121 * Right hand side of the PPE
122 */
123 // The bdf constant for the time derivative divded by the timestep size
124 mutable Number gamma0_dt;
125
126 // body force term
127 void
128 local_rhs_ppe_div_term_body_forces_cell(dealii::MatrixFree<dim, Number> const & matrix_free,
129 VectorType & dst,
130 VectorType const & src,
131 Range const & cell_range) const;
132
133 void
134 local_rhs_ppe_div_term_body_forces_inner_face(dealii::MatrixFree<dim, Number> const & matrix_free,
135 VectorType & dst,
136 VectorType const & src,
137 Range const & face_range) const;
138
139 void
140 local_rhs_ppe_div_term_body_forces_boundary_face(
141 dealii::MatrixFree<dim, Number> const & matrix_free,
142 VectorType & dst,
143 VectorType const & src,
144 Range const & face_range) const;
145
146 // divergence of convective term
147 void
148 local_rhs_ppe_div_term_convective_cell(dealii::MatrixFree<dim, Number> const & matrix_free,
149 VectorType & dst,
150 VectorType const & src,
151 Range const & cell_range) const;
152
153 void
154 local_rhs_ppe_div_term_convective_inner_face(dealii::MatrixFree<dim, Number> const & matrix_free,
155 VectorType & dst,
156 VectorType const & src,
157 Range const & face_range) const;
158
159 void
160 local_rhs_ppe_div_term_convective_boundary_face(
161 dealii::MatrixFree<dim, Number> const & matrix_free,
162 VectorType & dst,
163 VectorType const & src,
164 Range const & face_range) const;
165
166
167 /*
168 * Neumann boundary condition term
169 */
170 // viscous term and Numerical time derivative of the Dirichlet data dg_u/dt using suitable BDF
171 void
172 local_rhs_ppe_nbc_add_boundary_face(dealii::MatrixFree<dim, Number> const & data,
173 VectorType & dst,
174 VectorType const & src,
175 Range const & face_range) const;
176};
177
178} // namespace IncNS
179} // namespace ExaDG
180
181#endif /* EXADG_INCOMPRESSIBLE_NAVIER_STOKES_SPATIAL_DISCRETIZATION_OPERATOR_CONSISTENT_SPLITTING_H_ \
182 */
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