include/meltpooldg/fluid_structure_interaction/fluid_structure_interaction_factory.hpp Source File

Developer Documentation: include/meltpooldg/fluid_structure_interaction/fluid_structure_interaction_factory.hpp Source File
Developer Documentation
fluid_structure_interaction_factory.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include <deal.II/lac/la_parallel_vector.h>
5
15
16#include <memory>
17#include <tuple>
18
19namespace MeltPoolDG
20{
21 template <int dim, typename number, typename ObstacleType>
22 std::tuple<std::shared_ptr<CompressibleFlow::ExternalFlowForce<dim, number>>,
23 std::shared_ptr<CompressibleFlow::ExternalFlowForceJacobian<dim, number>>,
24 std::unique_ptr<ObstacleLoad<dim, number, ObstacleType>>>
29 const dealii::LinearAlgebra::distributed::Vector<number> &flow_solution,
30 const MatrixFreeContext<dim, number> flow_mf_context,
31 const std::shared_ptr<MatrixFreeCellBatchParticleCache<dim, number, ObstacleType>> &cell_cache =
32 nullptr)
33 {
34 std::shared_ptr<CompressibleFlow::ExternalFlowForce<dim, number>> fsi_fluid_force_residual;
35 std::shared_ptr<CompressibleFlow::ExternalFlowForceJacobian<dim, number>>
36 fsi_fluid_force_jacobian;
37 std::unique_ptr<ObstacleLoad<dim, number, ObstacleType>> fsi_obstacle_load;
38
39 switch (fsi_data.fsi_coupling_method)
40 {
41 case FSICouplingMethod::brinkman_penalization: {
42 fsi_fluid_force_residual =
43 std::make_shared<BrinkmanPenalizationResidualContribution<dim, number, ObstacleType>>(
44 fsi_data.brinkman_penalization_data, cell_cache);
45 fsi_fluid_force_jacobian =
46 std::make_shared<BrinkmanPenalizationJacobianContribution<dim, number, ObstacleType>>(
47 fsi_data.brinkman_penalization_data, cell_cache);
48 fsi_obstacle_load = std::make_unique<ObstacleLoad<dim, number, ObstacleType>>(
50 flow_solution, flow_mf_context, fsi_data.brinkman_penalization_data));
51 break;
52 }
53 case FSICouplingMethod::stokes_law: {
54 fsi_fluid_force_residual =
55 std::make_shared<StokesLawFluidForce<dim, number, ObstacleType>>(
56 flow_solution, obstacle_field, flow_mf_context, flow_material.dynamic_viscosity);
57 // TODO: The Stokes law coupling currently only works for explicit methods
58 fsi_fluid_force_jacobian =
59 std::make_shared<BrinkmanPenalizationJacobianContribution<dim, number, ObstacleType>>(
60 fsi_data.brinkman_penalization_data, cell_cache);
61 fsi_obstacle_load = std::make_unique<ObstacleLoad<dim, number, ObstacleType>>(
63 flow_solution, flow_mf_context, flow_material.dynamic_viscosity));
64 break;
65 }
66 default:
67 AssertThrow(false,
68 dealii::ExcMessage("The provided FSI coupling method is not supported."));
69 }
70
71 return {fsi_fluid_force_residual, fsi_fluid_force_jacobian, std::move(fsi_obstacle_load)};
72 }
73} // namespace MeltPoolDG
Definition cell_batch_particle_cache.hpp:20
Definition obstacle_field.hpp:32
Interface for a general preconditioner.
Definition boundary_condition_functions.hpp:17
std::tuple< std::shared_ptr< CompressibleFlow::ExternalFlowForce< dim, number > >, std::shared_ptr< CompressibleFlow::ExternalFlowForceJacobian< dim, number > >, std::unique_ptr< ObstacleLoad< dim, number, ObstacleType > > > setup_fluid_structure_interaction(const FluidStructureInteractionData< number > &fsi_data, ObstacleField< dim, number, ObstacleType > &obstacle_field, const CompressibleFlow::MaterialPhaseData< number > &flow_material, const dealii::LinearAlgebra::distributed::Vector< number > &flow_solution, const MatrixFreeContext< dim, number > flow_mf_context, const std::shared_ptr< MatrixFreeCellBatchParticleCache< dim, number, ObstacleType > > &cell_cache=nullptr)
Definition fluid_structure_interaction_factory.hpp:25
Definition brinkman_penalization.hpp:25
Collection of material parameters for a specific fluid phase.
Definition material.hpp:140
number dynamic_viscosity
Definition material.hpp:174
Definition fluid_structure_interaction_data.hpp:14
FSICouplingMethod fsi_coupling_method
Definition fluid_structure_interaction_data.hpp:15
BrinkmanPenalizationData< number > brinkman_penalization_data
Definition fluid_structure_interaction_data.hpp:17
Definition matrix_free_util.hpp:21