8#include <control/time/base.hpp>
113 template<
typename DT_>
209 XASSERT(config_section !=
nullptr);
211 auto num_steps_p = config_section->
query(
"num_steps");
212 XASSERTM(num_steps_p.second,
"TimeDiscretization section is missing the mandatory num_steps entry!");
217 auto p_extrapolation_p = config_section->
query(
"p_extrapolation_steps");
219 "TimeDiscretization section is missing the mandatory p_extrapolation_steps entry!");
225 auto use_rotational_form_p = config_section->
query(
"use_rotational_form");
226 XASSERTM(use_rotational_form_p.second,
227 "TimeDiscretization section is missing the mandatory use_rotational_form entry!");
228 XASSERTM(std::stoi(use_rotational_form_p.first) == 0 || std::stoi(use_rotational_form_p.first) == 1,
229 "use_rotational has to be set to 0 or 1");
233 auto delta_t_p = config_section->
query(
"delta_t");
234 XASSERTM(delta_t_p.second,
"TimeDiscretization section is missing the mandatory delta_t entry!");
239 auto ale_p = config_section->
query(
"ALE");
241 "TimeDiscretization section is missing the mandatory ALE entry!");
245 auto convection_p = config_section->
query(
"convection");
247 "TimeDiscretization section is missing the mandatory convection entry!");
251 auto viscous_p = config_section->
query(
"viscous");
253 "TimeDiscretization section is missing the mandatory viscous entry!");
371 if(num_steps ==
Index(1))
402 else if(num_steps ==
Index(2))
451 if(p_extrapolation_steps ==
Index(1))
455 else if(p_extrapolation_steps ==
Index(2))
462 XABORTM(
"Invalid number of pressure extrapolation steps: "+
stringify(p_extrapolation_steps));
#define XABORTM(msg)
Abortion macro definition with custom message.
#define XASSERT(expr)
Assertion macro definition.
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Set of coefficients for operator splitting time discretizations based on BDF(q)
std::vector< DataType > coeff_rhs_v_phi
k coeffcients for the auxillary variable phi enforcing the weak-divergence free condition
DT_ DataType
The floating point precision.
DataType _delta_t
The time step size.
DataType coeff_rhs_v_2
Coefficient for the reaction term depending on u[k-2].
std::vector< DataType > coeff_rhs_v_1
Index get_p_extrapolation_steps()
Returns the current number of pressure extrapolation steps.
Index get_num_steps()
Returns the current number of steps.
virtual ~NvsBdfQ()
Virtual destructor.
Index _num_steps
The k in BDF(k), has to be 1 or 2.
DataType coeff_rhs_proj_D_v
Coefficient for the div(u) term for the projection step.
TermHandling visc_handling
How to handle the viscous term.
void set_coeffs(const Index num_steps, const Index p_extrapolation_steps)
Sets the coefficients.
std::vector< DataType > coeff_extrapolation_p
coefficients for extrapolating the pressure from previous time steps
Index _p_extrapolation_steps_startup
Same in the startup phase.
Index _num_steps_startup
If k > 1, the methods performs this many steps as BDF(1) before switching to BDF(k)
bool is_rotational()
Are we using the rotational form?
const DataType _reynolds
The Reynolds number.
Index _p_extrapolation_steps
How many backward steps should be taken for extrapolating the pressure.
void finish_startup()
Finishes the startup phase.
bool _use_rotational_form
Shall we use the rotational form of the operator splitting?
bool _startup
Are we still in the startup phase?
bool _use_deformation
Shall we use the deformation tensor based bilinear form for the momentum equation?
TermHandling conv_handling
How to handle the convection term.
TermHandling ale_handling
How to handle the ALE term.
DataType coeff_rhs_phi
Coefficient the auxillary Poisson problem.
DataType coeff_rhs_v_p
Coefficient for the pressure gradient for the rhs of the momentum equation.
DataType coeff_rhs_f
Coefficient for the rhs for the momentum equation.
std::vector< DataType > coeff_lhs_v
NvsBdfQ(PropertyMap *config_section, const DataType reynolds, const bool use_deformation, const bool startup)
Constructor using a PropertyMap.
Index get_max_num_steps()
Returns the maximum number of steps.
DataType delta_t()
Returns the time step size.
Index get_max_p_extrapolation_steps()
Returns the maximum number of pressure extrapolation steps.
A class organizing a tree of key-value pairs.
std::pair< String, bool > query(String key_path) const
Queries a value by its key path.
TermHandling
For determining if a term is handled explicitly or implicitly.
T_ min(T_ a, T_ b)
Returns the minimum of two values.
T_ max(T_ a, T_ b)
Returns the maximum of two values.
String stringify(const T_ &item)
Converts an item into a String.
std::uint64_t Index
Index data type.