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
16
17#include <memory>
18#include <tuple>
19
20namespace MeltPoolDG
21{
22 template <int dim, typename number, typename ObstacleType>
23 std::tuple<std::shared_ptr<CompressibleFlow::ExternalFlowForce<dim, number>>,
24 std::shared_ptr<CompressibleFlow::ExternalFlowForceJacobian<dim, number>>,
25 std::unique_ptr<ObstacleLoad<dim, number, ObstacleType>>>
30 const dealii::LinearAlgebra::distributed::Vector<number> &flow_solution,
31 const MatrixFreeContext<dim, number> flow_mf_context,
32 const std::shared_ptr<MatrixFreeCellBatchParticleCache<dim, number, ObstacleType>> &cell_cache =
33 nullptr)
34 {
35 std::shared_ptr<CompressibleFlow::ExternalFlowForce<dim, number>> fsi_fluid_force_residual;
36 std::shared_ptr<CompressibleFlow::ExternalFlowForceJacobian<dim, number>>
37 fsi_fluid_force_jacobian;
38 std::unique_ptr<ObstacleLoad<dim, number, ObstacleType>> fsi_obstacle_load;
39
40 switch (fsi_data.fsi_coupling_method)
41 {
42 case FSICouplingMethod::brinkman_penalization: {
43 fsi_fluid_force_residual =
44 std::make_shared<BrinkmanPenalizationResidualContribution<dim, number, ObstacleType>>(
45 fsi_data.brinkman_penalization_data, cell_cache);
46 fsi_fluid_force_jacobian =
47 std::make_shared<BrinkmanPenalizationJacobianContribution<dim, number, ObstacleType>>(
48 fsi_data.brinkman_penalization_data, cell_cache);
49 fsi_obstacle_load = std::make_unique<ObstacleLoad<dim, number, ObstacleType>>(
51 flow_solution, flow_mf_context, fsi_data.brinkman_penalization_data));
52 break;
53 }
54 case FSICouplingMethod::stokes_law: {
55 fsi_fluid_force_residual =
56 std::make_shared<StokesLawFluidForce<dim, number, ObstacleType>>(
57 flow_solution, obstacle_field, flow_mf_context, flow_material.dynamic_viscosity);
58 // TODO: The Stokes law coupling currently only works for explicit methods
59 fsi_fluid_force_jacobian =
60 std::make_shared<BrinkmanPenalizationJacobianContribution<dim, number, ObstacleType>>(
61 fsi_data.brinkman_penalization_data, cell_cache);
62 fsi_obstacle_load = std::make_unique<ObstacleLoad<dim, number, ObstacleType>>(
64 flow_solution, flow_mf_context, flow_material.dynamic_viscosity));
65 break;
66 }
67 default:
68 AssertThrow(false,
69 dealii::ExcMessage("The provided FSI coupling method is not supported."));
70 }
71
72 return {fsi_fluid_force_residual, fsi_fluid_force_jacobian, std::move(fsi_obstacle_load)};
73 }
74} // 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:26
Definition brinkman_penalization.hpp:25
Collection of material parameters for a specific fluid phase.
Definition material.hpp:119
number dynamic_viscosity
Definition material.hpp:152
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