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