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 INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_TIME_INT_BDF_PRESSURE_CORRECTION_H_
23#define INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_TIME_INT_BDF_PRESSURE_CORRECTION_H_
24
25#include <exadg/incompressible_navier_stokes/time_integration/time_int_bdf.h>
26
27namespace ExaDG
28{
29namespace IncNS
30{
31// forward declarations
32template<int dim, typename Number>
33class OperatorPressureCorrection;
34
35template<int dim, typename Number>
36class TimeIntBDFPressureCorrection : public TimeIntBDF<dim, Number>
37{
38private:
40
41 typedef typename Base::VectorType VectorType;
42
44
45public:
46 TimeIntBDFPressureCorrection(std::shared_ptr<Operator> operator_in,
47 std::shared_ptr<HelpersALE<dim, Number> const> helpers_ale_in,
48 std::shared_ptr<PostProcessorInterface<Number>> postprocessor_in,
49 Parameters const & param_in,
50 MPI_Comm const & mpi_comm_in,
51 bool const is_test_in);
52
54 {
55 }
56
57 void
58 postprocessing_stability_analysis();
59
60 void
61 print_iterations() const final;
62
63 VectorType const &
64 get_velocity() const final;
65
66 VectorType const &
67 get_velocity_np() const final;
68
69 VectorType const &
70 get_pressure() const final;
71
72 VectorType const &
73 get_pressure_np() const final;
74
75private:
76 void
77 allocate_vectors() final;
78
79 void
80 setup_derived() final;
81
82 void
83 update_time_integrator_constants() final;
84
85 void
86 initialize_current_solution() final;
87
88 void
89 initialize_former_multistep_dof_vectors() final;
90
91 void
92 read_restart_vectors(boost::archive::binary_iarchive & ia) final;
93
94 void
95 write_restart_vectors(boost::archive::binary_oarchive & oa) const final;
96
97 void
98 initialize_pressure_on_boundary();
99
100 void
101 do_timestep_solve() final;
102
103 void
104 solve_steady_problem() final;
105
106 double
107 evaluate_residual();
108
109 void
110 momentum_step();
111
112 void
113 rhs_momentum(VectorType & rhs);
114
115 void
116 pressure_step(VectorType & pressure_increment);
117
118 void
119 projection_step(VectorType const & pressure_increment);
120
121 void
122 evaluate_convective_term();
123
124 void
125 rhs_projection(VectorType & rhs, VectorType const & pressure_increment) const;
126
127 void
128 pressure_update(VectorType const & pressure_increment);
129
130 void
131 calculate_chi(double & chi) const;
132
133 void
134 rhs_pressure(VectorType & rhs) const;
135
136 void
137 prepare_vectors_for_next_timestep() final;
138
139 VectorType const &
140 get_velocity(unsigned int i /* t_{n-i} */) const final;
141
142 VectorType const &
143 get_pressure(unsigned int i /* t_{n-i} */) const final;
144
145 void
146 set_velocity(VectorType const & velocity, unsigned int const i /* t_{n-i} */) final;
147
148 void
149 set_pressure(VectorType const & pressure, unsigned int const i /* t_{n-i} */) final;
150
151 std::shared_ptr<Operator> pde_operator;
152
153 VectorType velocity_np;
154 std::vector<VectorType> velocity;
155
156 VectorType pressure_np;
157 std::vector<VectorType> pressure;
158
159 // incremental formulation of pressure-correction scheme
160 unsigned int order_pressure_extrapolation;
161
162 // time integrator constants: extrapolation scheme
163 ExtrapolationConstants extra_pressure_gradient;
164
165 // stores pressure Dirichlet boundary values at previous times
166 std::vector<VectorType> pressure_dbc;
167
168 // required for strongly-coupled partitioned FSI
169 VectorType pressure_increment_last_iter;
170 VectorType velocity_momentum_last_iter;
171 VectorType velocity_projection_last_iter;
172
173 // iteration counts
174 std::pair<
175 unsigned int /* calls */,
176 std::tuple<unsigned long long, unsigned long long> /* iteration counts {Newton, linear} */>
177 iterations_momentum;
178 std::pair<unsigned int /* calls */, unsigned long long /* iteration counts */>
179 iterations_pressure;
180 std::pair<unsigned int /* calls */, unsigned long long /* iteration counts */>
181 iterations_projection;
182};
183
184} // namespace IncNS
185} // namespace ExaDG
186
187
188#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_TIME_INTEGRATION_TIME_INT_BDF_PRESSURE_CORRECTION_H_ \
189 */
Definition extrapolation_constants.h:37
Definition lambda_functions_ale.h:40
Definition operator_pressure_correction.h:84
Definition parameters.h:46
Definition postprocessor_interface.h:34
Definition time_int_bdf_pressure_correction.h:37
Definition time_int_bdf.h:46
Definition driver.cpp:33