69 ParameterHandler &prm)
71 prm.enter_subsection(
"mesh");
73 prm.add_parameter(
"gmsh file name", mesh_file_name,
"Path to the gmsh .msh file.");
74 prm.add_parameter(
"additional refinement 1",
75 n_additional_refinement_1,
76 "Additional refinement of box 1.");
77 prm.add_parameter(
"additional refinement 2",
78 n_additional_refinement_2,
79 "Additional refinement of box 1.");
80 prm.add_parameter(
"local refinement 1 bottom left",
81 local_refinement_1_bottom_left,
82 "Bottom left point of locally refined region.");
83 prm.add_parameter(
"local refinement 1 top right",
84 local_refinement_1_top_right,
85 "Bottom left point of locally refined region.");
86 prm.add_parameter(
"local refinement 2 bottom left",
87 local_refinement_2_bottom_left,
88 "Bottom left point of locally refined region.");
89 prm.add_parameter(
"local refinement 2 top right",
90 local_refinement_2_top_right,
91 "Bottom left point of locally refined region.");
93 prm.leave_subsection();
95 prm.enter_subsection(
"initial conditions");
97 prm.add_parameter(
"temperature", T_initial,
"Initial temperature.");
99 prm.add_parameter(
"interface y", y_interface,
"Initial y-position of the interface.");
101 prm.leave_subsection();
103 prm.enter_subsection(
"bc");
105 prm.add_parameter(
"inlet velocity", inlet_velocity,
"Gas inlet velocity in z-direction.");
107 prm.add_parameter(
"inlet temperature",
109 "Temperature at gas inlet and outlet.");
111 prm.add_parameter(
"outlet pressure", outlet_pressure,
"Outlet pressure.");
113 prm.leave_subsection();
115 return this->parameters.base.do_print_parameters;
124 AssertThrow(dim == 3, ExcMessage(
"SimulationSingleTrackMelt expects a 3D gmsh mesh."));
126 this->triangulation =
127 std::make_shared<parallel::distributed::Triangulation<dim>>(this->mpi_communicator);
132 if (!mesh_file_name.empty())
134 std::ifstream input_file(mesh_file_name);
139 grid_in.attach_triangulation(*this->triangulation);
141 grid_in.read_msh(input_file);
153 constexpr double mm_to_m = 1e-3;
155 const Point<dim> p1(-0.5 * mm_to_m,
159 const Point<dim> p2(0.5 * mm_to_m,
163 GridGenerator::hyper_rectangle(*this->triangulation, p1, p2);
181 const std::vector<types::boundary_id> wall_bcs = {2, 3, 4, 5, 6};
182 const std::vector<types::boundary_id> gas_slip_bcs = {7, 8, 9};
184 const types::boundary_id gas_outlet_bc = 10;
185 const types::boundary_id gas_inlet_bc = 11;
187 if constexpr (std::is_same_v<CaseClass, MeltPoolCase<dim, Number>>)
189 if (inlet_velocity > 0)
190 this->attach_boundary_condition(
191 {gas_inlet_bc, std::make_shared<Functions::ConstantFunction<dim>>(inlet_temperature)},
195 for (
const auto id : wall_bcs)
196 this->attach_boundary_condition(
id,
"no_slip",
"navier_stokes_u");
198 for (
const auto id : gas_slip_bcs)
199 this->attach_boundary_condition(
id,
"symmetry",
"navier_stokes_u");
201 this->attach_boundary_condition(
202 {gas_outlet_bc, std::make_shared<Functions::ConstantFunction<dim>>(outlet_pressure)},
206 this->attach_boundary_condition({gas_inlet_bc,
207 std::make_shared<GasInletVelocity<dim>>(inlet_velocity)},
212 this->triangulation->refine_global(this->parameters.base.global_refinements);
216 const auto refinement_region_1 =
217 dealii::BoundingBox<dim>({local_refinement_1_bottom_left, local_refinement_1_top_right});
219 for (
unsigned int j = 0; j < n_additional_refinement_1; ++j)
221 for (
auto &cell : this->triangulation->active_cell_iterators())
223 if (cell->is_locally_owned())
225 for (
unsigned int i = 0; i < cell->n_vertices(); ++i)
226 if (refinement_region_1.point_inside(cell->vertex(i)))
228 cell->set_refine_flag();
233 this->triangulation->execute_coarsening_and_refinement();
237 const auto refinement_region_2 =
238 dealii::BoundingBox<dim>({local_refinement_2_bottom_left, local_refinement_2_top_right});
240 for (
unsigned int j = 0; j < n_additional_refinement_2; ++j)
242 for (
auto &cell : this->triangulation->active_cell_iterators())
244 if (cell->is_locally_owned())
246 for (
unsigned int i = 0; i < cell->n_vertices(); ++i)
247 if (refinement_region_2.point_inside(cell->vertex(i)))
249 cell->set_refine_flag();
254 this->triangulation->execute_coarsening_and_refinement();
264 if constexpr (std::is_same_v<CaseClass, MeltPoolCase<dim, Number>>)
266 this->attach_initial_condition(std::make_shared<Functions::ZeroFunction<dim>>(dim),
272 if constexpr (std::is_same_v<CaseClass, Heat::HeatTransferCase<dim, Number>>)
274 "prescribed_signed_distance");
276 this->attach_initial_condition(std::make_shared<Functions::ConstantFunction<dim>>(T_initial),
double value(const Point< dim > &p, const unsigned int component=0) const override
Return the velocity value at a point for a selected component.
Definition single_track_melt.templates.hpp:31