7#include <deal.II/base/parameter_handler.h>
8#include <deal.II/base/parsed_function.h>
9#include <deal.II/base/patterns.h>
19 <<
"Fluid dynamics boundary id: " << arg1
20 <<
" has already been declared as a boundary condition");
27 ParameterHandler &prm,
28 const types::boundary_id default_boundary_id)
33 "Type of boundary condition.",
37 prm.declare_entry(
"id",
38 Utilities::to_string(default_boundary_id, 2),
39 Patterns::List(Patterns::Integer()),
40 "Mesh id for boundary conditions.");
46 "Mesh id for periodic face matching. Default entry is -1 to ensure that the periodic id is set by the user");
48 prm.declare_entry(
"periodic direction",
51 "Direction for periodic boundary condition");
57 prm.enter_subsection(
"u");
58 temporary_fluid_dynamics_functions.
u.declare_parameters(prm);
59 prm.leave_subsection();
61 prm.enter_subsection(
"v");
62 temporary_fluid_dynamics_functions.
v.declare_parameters(prm);
63 prm.leave_subsection();
65 prm.enter_subsection(
"w");
66 temporary_fluid_dynamics_functions.
w.declare_parameters(prm);
67 prm.leave_subsection();
69 prm.enter_subsection(
"p");
70 temporary_fluid_dynamics_functions.
p.declare_parameters(prm);
71 prm.leave_subsection();
82 prm.enter_subsection(
"traction fn");
83 temporary_fluid_dynamics_functions.
traction_fn.declare_parameters(prm,
85 prm.leave_subsection();
88 prm.enter_subsection(
"center of rotation");
89 prm.declare_entry(
"x",
"0", Patterns::Double(),
"X COR");
90 prm.declare_entry(
"y",
"0", Patterns::Double(),
"Y COR");
91 prm.declare_entry(
"z",
"0", Patterns::Double(),
"Z COR");
92 prm.leave_subsection();
98 "Penalty parameter for weak boundary condition imposed through Nitsche's method or outlets");
101 "boundary layer thickness",
104 "Thickness of the boundary layer used to calculate the penalty parameter for partial slip boundary condition in tangent direction imposed through Nitsche's method or outlets");
110 ParameterHandler &prm,
113 prm.enter_subsection(
"boundary conditions");
115 prm.declare_entry(
"number",
118 "Number of boundary conditions");
123 "Bool to define if the boundary condition is time dependent");
126 "fix pressure constant",
129 "Bool to define if zero pressure is used as a constraint one node");
133 prm.enter_subsection(
"bc " + std::to_string(n));
137 prm.leave_subsection();
140 prm.leave_subsection();
148 std::vector<types::boundary_id> boundary_ids =
153 boundary_ids.size() > 0,
155 "A boundary id has not been set for one of the fluid dynamics boundary conditions. Please ensure that the id is set for every boundary condition."));
158 for (
const auto boundary_id : boundary_ids)
160 AssertThrow(this->
type.find(boundary_id) == this->type.end(),
161 NavierStokesBoundaryDuplicated(boundary_id));
167 std::make_shared<NavierStokesBoundaryFunctions<dim>>();
169 prm.enter_subsection(
"u");
171 prm.leave_subsection();
173 prm.enter_subsection(
"v");
175 prm.leave_subsection();
177 prm.enter_subsection(
"w");
179 prm.leave_subsection();
181 prm.enter_subsection(
"p");
183 prm.leave_subsection();
185 prm.enter_subsection(
"traction fn");
187 prm.leave_subsection();
189 prm.enter_subsection(
"center of rotation");
198 prm.leave_subsection();
206 this->
type[boundary_id] = boundary_type;
209 types::boundary_id periodic_boundary_id =
210 prm.get_integer(
"periodic id");
216 this->
type[periodic_boundary_id] =
221 .neighbor_id = periodic_boundary_id,
222 .direction =
static_cast<unsigned int>(
223 prm.get_integer(
"periodic direction"))};
230 std::make_shared<NavierStokesBoundaryFunctions<dim>>();
232 prm.enter_subsection(
"u");
235 prm.leave_subsection();
237 prm.enter_subsection(
"v");
240 prm.leave_subsection();
242 prm.enter_subsection(
"w");
245 prm.leave_subsection();
247 prm.enter_subsection(
"traction fn");
249 ->traction_fn.parse_parameters(prm);
250 prm.leave_subsection();
252 prm.enter_subsection(
"p");
255 prm.leave_subsection();
257 prm.enter_subsection(
"center of rotation");
259 ->center_of_rotation[0] = prm.get_double(
"x");
261 ->center_of_rotation[1] = prm.get_double(
"y");
265 ->center_of_rotation[2] = prm.get_double(
"z");
266 prm.leave_subsection();
268 this->
beta[boundary_id] = prm.get_double(
"beta");
270 prm.get_double(
"boundary layer thickness");
278 prm.enter_subsection(
"boundary conditions");
286 prm.enter_subsection(
"bc " + std::to_string(n));
290 prm.leave_subsection();
293 prm.leave_subsection();
303 const Point<dim> &point,
304 const unsigned int component)
const
306 Assert(component < this->n_components,
307 ExcIndexRange(component, 0, this->n_components));
311 return u->value(point);
315 return v->value(point);
319 return w->value(point);
327 const Point<dim> &point,
328 const unsigned int component)
const
330 if (std::cmp_equal(component, dim))
332 return p->value(point);
Parameters::PeriodicBoundaries periodic_boundaries
std::map< types::boundary_id, FluidDynamicsBoundaryType > type
unsigned int number_of_boundary_conditions
This class manages the boundary conditions forhe fluid dynamics solver It introduces the boundary fun...
void parse_boundary(ParameterHandler &prm)
Parse the information for one fluid dynamics boundary condition.
std::map< types::boundary_id, double > beta
bool fix_pressure_constant
Fix pressure constant using a node.
void declare_default_entry(ParameterHandler &prm, types::boundary_id default_boundary_id)
Declare the default parameters for one fluid dynamics boundary condition.
std::map< types::boundary_id, std::shared_ptr< NavierStokesBoundaryFunctions< dim > > > navier_stokes_functions
void parse_parameters(ParameterHandler &prm)
Parse the fluid dynamics boundary conditions.
void declare_parameters(ParameterHandler &prm, unsigned int number_of_boundary_conditions)
Declare the fluid dynamics boundary conditions.
std::map< types::boundary_id, double > boundary_layer_thickness
This class manages the functions associated with function-type boundary conditions of the Navier-Stok...
Functions::ParsedFunction< dim > traction_fn
Functions::ParsedFunction< dim > u
Functions::ParsedFunction< dim > p
Pressure.
Functions::ParsedFunction< dim > v
Functions::ParsedFunction< dim > w
This class implements a pressure boundary condition for the Navier-Stokes equations.
Functions::ParsedFunction< dim > * p
double value(const Point< dim > &point, unsigned int component) const override
Calculates the value of a Function-type fluid dynamics equations.
This class implements a boundary conditions for the fluid dynamics solver where the velocity componen...
Functions::ParsedFunction< dim > * w
double value(const Point< dim > &point, const unsigned int component) const override
Calculates the value of a Function-type fluid dynamics equations.
Functions::ParsedFunction< dim > * u
Functions::ParsedFunction< dim > * v
std::vector< T > convert_string_to_vector(const ParameterHandler &prm, const std::string &entry_string)
Return the vector of size N of entry @entry_string. If the entry is specified in the ....
EnumType string_to_enum(const std::string &name)
Return the enumerator whose identifier is name, e.g. to parse the value of a parameter entry into its...
void declare_enum_entry(ParameterHandler &prm, const std::string &entry_name, const EnumType default_value, const std::string &description, const DeprecatedEnumNames< EnumType > &deprecated_names={}, const std::vector< EnumType > &allowed_values={})
Declare a parameter entry whose value is an enumerator. The default value, the accepted values and th...
DeclException1(NavierStokesBoundaryDuplicated, types::boundary_id,<< "Fluid dynamics boundary id: "<< arg1<< " has already been declared as a boundary condition")
FluidDynamicsBoundaryType
const DeprecatedEnumNames< FluidDynamicsBoundaryType > deprecated_fluid_dynamics_boundary_type_names
const std::vector< FluidDynamicsBoundaryType > fluid_dynamics_boundary_types