ExaDG
Loading...
Searching...
No Matches
time_int_bdf_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_TIME_INTEGRATION_TIME_INT_BDF_PRESSURE_CORRECTION_H_
23#define EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_TIME_INT_BDF_PRESSURE_CORRECTION_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 TimeIntBDFPressureCorrection : 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 TimeIntBDFPressureCorrection(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 ~TimeIntBDFPressureCorrection()
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 update_time_integrator_constants() final;
88
89 void
90 initialize_current_solution() final;
91
92 void
93 initialize_former_multistep_dof_vectors() final;
94
95 void
96 get_vectors_serialization(std::vector<VectorType const *> & vectors_velocity,
97 std::vector<VectorType const *> & vectors_pressure) const final;
98
99 void
100 set_vectors_deserialization(std::vector<VectorType> const & vectors_velocity,
101 std::vector<VectorType> const & vectors_pressure) final;
102
103 void
104 update_after_deserialization() final;
105
106 void
107 initialize_pressure_on_boundary();
108
109 void
110 do_timestep_solve() final;
111
112 void
113 solve_steady_problem() final;
114
115 double
116 evaluate_residual();
117
118 void
119 momentum_step();
120
121 void
122 rhs_momentum(VectorType & rhs, VectorType const & transport_velocity);
123
124 void
125 pressure_step(VectorType & pressure_increment);
126
127 void
128 projection_step(VectorType const & pressure_increment);
129
130 void
131 evaluate_convective_term();
132
133 void
134 rhs_projection(VectorType & rhs, VectorType const & pressure_increment) const;
135
136 void
137 pressure_update(VectorType const & pressure_increment);
138
139 void
140 calculate_chi(double & chi) const;
141
142 void
143 rhs_pressure(VectorType & rhs) const;
144
145 void
146 prepare_vectors_for_next_timestep() final;
147
148 VectorType const &
149 get_velocity(unsigned int i /* t_{n-i} */) const final;
150
151 VectorType const &
152 get_pressure(unsigned int i /* t_{n-i} */) const final;
153
154 void
155 set_velocity(VectorType const & velocity, unsigned int const i /* t_{n-i} */) final;
156
157 void
158 set_pressure(VectorType const & pressure, unsigned int const i /* t_{n-i} */) final;
159
160 std::shared_ptr<Operator> pde_operator;
161
162 VectorType velocity_np;
163 std::vector<VectorType> velocity;
164
165 VectorType pressure_np;
166 std::vector<VectorType> pressure;
167
168 // incremental formulation of pressure-correction scheme
169 unsigned int order_pressure_extrapolation;
170
171 // time integrator constants: extrapolation scheme
172 ExtrapolationConstants extra_pressure_gradient;
173
174 // stores pressure Dirichlet boundary values at previous times
175 std::vector<VectorType> pressure_dbc;
176
177 // required for strongly-coupled partitioned FSI
178 VectorType pressure_increment_last_iter;
179 VectorType velocity_momentum_last_iter;
180 VectorType velocity_projection_last_iter;
181
182 // iteration counts
183 std::pair<
184 unsigned int /* calls */,
185 std::tuple<unsigned long long, unsigned long long> /* iteration counts {Newton, linear} */>
186 iterations_momentum;
187 std::pair<unsigned int /* calls */, unsigned long long /* iteration counts */>
188 iterations_pressure;
189 std::pair<unsigned int /* calls */, unsigned long long /* iteration counts */>
190 iterations_projection;
191};
192
193} // namespace IncNS
194} // namespace ExaDG
195
196
197#endif /* EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_TIME_INT_BDF_PRESSURE_CORRECTION_H_ \
198 */
Definition extrapolation_constants.h:37
Definition lambda_functions_ale.h:40
Definition operator_pressure_correction.h:34
Definition parameters.h:46
Definition postprocessor_interface.h:37
Definition driver.cpp:33