ExaDG
Loading...
Searching...
No Matches
time_int_bdf_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_TIME_INTEGRATION_TIME_INT_BDF_DUAL_SPLITTING_H_
23#define EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_TIME_INT_BDF_DUAL_SPLITTING_H_
24
25// ExaDG
26#include <exadg/incompressible_navier_stokes/time_integration/time_int_bdf.h>
27
28namespace ExaDG
29{
30namespace IncNS
31{
32// forward declarations
33template<int dim, typename Number>
35
36template<int dim, typename Number>
37class TimeIntBDFDualSplitting : public TimeIntBDF<dim, Number>
38{
39private:
40 using BoostInputArchiveType = TimeIntBase::BoostInputArchiveType;
41 using BoostOutputArchiveType = TimeIntBase::BoostOutputArchiveType;
42
43 typedef TimeIntBDF<dim, Number> Base;
44
45 typedef typename Base::VectorType VectorType;
46
48
49public:
50 TimeIntBDFDualSplitting(std::shared_ptr<Operator> operator_in,
51 std::shared_ptr<HelpersALE<dim, Number> const> helpers_ale_in,
52 std::shared_ptr<PostProcessorInterface<Number>> postprocessor_in,
53 Parameters const & param_in,
54 MPI_Comm const & mpi_comm_in,
55 bool const is_test_in);
56
57 virtual ~TimeIntBDFDualSplitting()
58 {
59 }
60
61 void
62 postprocessing_stability_analysis();
63
64 void
65 print_iterations() const final;
66
67 VectorType const &
68 get_velocity() const final;
69
70 VectorType const &
71 get_velocity_np() const final;
72
73 VectorType const &
74 get_pressure() const final;
75
76 VectorType const &
77 get_pressure_np() const final;
78
79private:
80 void
81 allocate_vectors() final;
82
83 void
84 setup_derived() final;
85
86 void
87 read_restart_vectors(BoostInputArchiveType & ia) final;
88
89 void
90 write_restart_vectors(BoostOutputArchiveType & oa) const final;
91
92 void
93 do_timestep_solve() final;
94
95 void
96 prepare_vectors_for_next_timestep() final;
97
98 void
99 convective_step();
100
101 void
102 evaluate_convective_term();
103
104 void
105 update_time_integrator_constants() final;
106
107 void
108 initialize_current_solution() final;
109
110 void
111 initialize_former_multistep_dof_vectors() final;
112
113 void
114 initialize_velocity_dbc();
115
116 void
117 pressure_step();
118
119 void
120 rhs_pressure(VectorType & rhs) const;
121
122 void
123 projection_step();
124
125 void
126 rhs_projection(VectorType & rhs) const;
127
128 void
129 penalty_step();
130
131 void
132 viscous_step();
133
134 void
135 rhs_viscous(VectorType & rhs,
136 VectorType const & velocity_mass_operator,
137 VectorType const & transport_velocity) const;
138
139 void
140 solve_steady_problem() final;
141
142 double
143 evaluate_residual();
144
145 VectorType const &
146 get_velocity(unsigned int i /* t_{n-i} */) const final;
147
148 VectorType const &
149 get_pressure(unsigned int i /* t_{n-i} */) const final;
150
151 void
152 set_velocity(VectorType const & velocity, unsigned int const i /* t_{n-i} */) final;
153
154 void
155 set_pressure(VectorType const & pressure, unsigned int const i /* t_{n-i} */) final;
156
157 std::shared_ptr<Operator> pde_operator;
158
159 std::vector<VectorType> velocity;
160
161 VectorType velocity_np;
162
163 std::vector<VectorType> pressure;
164
165 VectorType pressure_np;
166
167 std::vector<VectorType> velocity_dbc;
168 VectorType velocity_dbc_np;
169
170 // required for strongly-coupled partitioned FSI
171 VectorType pressure_last_iter;
172 VectorType velocity_projection_last_iter;
173 VectorType velocity_viscous_last_iter;
174
175 // iteration counts
176 std::pair<unsigned int /* calls */, unsigned long long /* iteration counts */>
177 iterations_pressure;
178 std::pair<unsigned int /* calls */, unsigned long long /* iteration counts */>
179 iterations_projection;
180 std::pair<
181 unsigned int /* calls */,
182 std::tuple<unsigned long long, unsigned long long> /* iteration counts {Newton, linear} */>
183 iterations_viscous;
184
185 std::pair<unsigned int /* calls */, unsigned long long /* iteration counts */> iterations_penalty;
186 std::pair<unsigned int /* calls */, unsigned long long /* iteration counts */> iterations_mass;
187
188 // time integrator constants: extrapolation scheme
189 ExtrapolationConstants extra_pressure_nbc;
190};
191
192} // namespace IncNS
193} // namespace ExaDG
194
195#endif /* EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_TIME_INT_BDF_DUAL_SPLITTING_H_ \
196 */
Definition extrapolation_constants.h:37
Definition lambda_functions_ale.h:40
Definition operator_dual_splitting.h:35
Definition parameters.h:46
Definition postprocessor_interface.h:37
Definition driver.cpp:33