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 read_restart_vectors(BoostInputArchiveType & ia) final;
97
98 void
99 write_restart_vectors(BoostOutputArchiveType & oa) const final;
100
101 void
102 initialize_pressure_on_boundary();
103
104 void
105 do_timestep_solve() final;
106
107 void
108 solve_steady_problem() final;
109
110 double
111 evaluate_residual();
112
113 void
114 momentum_step();
115
116 void
117 rhs_momentum(VectorType & rhs, VectorType const & transport_velocity);
118
119 void
120 pressure_step(VectorType & pressure_increment);
121
122 void
123 projection_step(VectorType const & pressure_increment);
124
125 void
126 evaluate_convective_term();
127
128 void
129 rhs_projection(VectorType & rhs, VectorType const & pressure_increment) const;
130
131 void
132 pressure_update(VectorType const & pressure_increment);
133
134 void
135 calculate_chi(double & chi) const;
136
137 void
138 rhs_pressure(VectorType & rhs) const;
139
140 void
141 prepare_vectors_for_next_timestep() final;
142
143 VectorType const &
144 get_velocity(unsigned int i /* t_{n-i} */) const final;
145
146 VectorType const &
147 get_pressure(unsigned int i /* t_{n-i} */) const final;
148
149 void
150 set_velocity(VectorType const & velocity, unsigned int const i /* t_{n-i} */) final;
151
152 void
153 set_pressure(VectorType const & pressure, unsigned int const i /* t_{n-i} */) final;
154
155 std::shared_ptr<Operator> pde_operator;
156
157 VectorType velocity_np;
158 std::vector<VectorType> velocity;
159
160 VectorType pressure_np;
161 std::vector<VectorType> pressure;
162
163 // incremental formulation of pressure-correction scheme
164 unsigned int order_pressure_extrapolation;
165
166 // time integrator constants: extrapolation scheme
167 ExtrapolationConstants extra_pressure_gradient;
168
169 // stores pressure Dirichlet boundary values at previous times
170 std::vector<VectorType> pressure_dbc;
171
172 // required for strongly-coupled partitioned FSI
173 VectorType pressure_increment_last_iter;
174 VectorType velocity_momentum_last_iter;
175 VectorType velocity_projection_last_iter;
176
177 // iteration counts
178 std::pair<
179 unsigned int /* calls */,
180 std::tuple<unsigned long long, unsigned long long> /* iteration counts {Newton, linear} */>
181 iterations_momentum;
182 std::pair<unsigned int /* calls */, unsigned long long /* iteration counts */>
183 iterations_pressure;
184 std::pair<unsigned int /* calls */, unsigned long long /* iteration counts */>
185 iterations_projection;
186};
187
188} // namespace IncNS
189} // namespace ExaDG
190
191
192#endif /* EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_TIME_INT_BDF_PRESSURE_CORRECTION_H_ \
193 */
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