OGS
WellboreCompensateNeumannBoundaryCondition.cpp
Go to the documentation of this file.
1
12
14#include "ParameterLib/Utils.h"
15
16namespace ProcessLib
17{
18std::unique_ptr<WellboreCompensateNeumannBoundaryCondition>
20 BaseLib::ConfigTree const& config, MeshLib::Mesh const& bc_mesh,
21 NumLib::LocalToGlobalIndexMap const& dof_table, int const variable_id,
22 int const component_id, unsigned const integration_order,
23 unsigned const shapefunction_order, unsigned const global_dim,
24 std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media)
25{
26 DBUG("Constructing WellboreCompensateNeumann BC from config.");
28 config.checkConfigParameter("type", "WellboreCompensateNeumann");
29 if (dof_table.getNumberOfVariables() != 3)
30 {
32 "WellboreCompensateNeumann BC only implemented for the "
33 "WellboreSimulator processes.");
34 }
35 assert(variable_id == 0 || variable_id == 1 || variable_id == 2);
36
37 if (bc_mesh.getDimension() + 1 != global_dim)
38 {
40 "The dimension ({:d}) of the given boundary mesh '{:s}' is not by "
41 "one "
42 "lower than the bulk dimension ({:d}).",
43 bc_mesh.getDimension(), bc_mesh.getName(), global_dim);
44 }
45
46 auto const pressure_coefficient =
48 config.getConfigParameter<double>("coefficient_pressure");
49
50 auto const velocity_coefficient =
52 config.getConfigParameter<double>("coefficient_velocity");
53
54 auto const enthalpy_coefficient =
56 config.getConfigParameter<double>("coefficient_enthalpy");
57
58 auto const pressure_id = 0;
59 auto const velocity_id = 1;
60 auto const enthalpy_id = 2;
61
62 std::vector<MeshLib::Node*> const& bc_nodes = bc_mesh.getNodes();
63 MeshLib::MeshSubset bc_mesh_subset(bc_mesh, bc_nodes);
64 auto dof_table_boundary_pressure = dof_table.deriveBoundaryConstrainedMap(
65 pressure_id, {component_id}, std::move(bc_mesh_subset));
66 auto dof_table_boundary_velocity = dof_table.deriveBoundaryConstrainedMap(
67 velocity_id, {component_id}, std::move(bc_mesh_subset));
68 auto dof_table_boundary_enthalpy = dof_table.deriveBoundaryConstrainedMap(
69 enthalpy_id, {component_id}, std::move(bc_mesh_subset));
70
71 //
72 // maybe the boundary mesh needs material ids
74 media, bc_mesh);
75
76 return std::make_unique<WellboreCompensateNeumannBoundaryCondition>(
77 integration_order, shapefunction_order, dof_table, variable_id,
78 component_id, global_dim, bc_mesh,
80 pressure_coefficient, velocity_coefficient, enthalpy_coefficient,
81 std::move(dof_table_boundary_pressure),
82 std::move(dof_table_boundary_velocity),
83 std::move(dof_table_boundary_enthalpy), std::move(media_map)});
84}
85
86} // namespace ProcessLib
#define OGS_FATAL(...)
Definition Error.h:26
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
T getConfigParameter(std::string const &param) const
void checkConfigParameter(std::string const &param, std::string_view const value) const
A subset of nodes on a single mesh.
Definition MeshSubset.h:26
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition Mesh.h:106
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:88
const std::string getName() const
Get name of the mesh.
Definition Mesh.h:103
std::unique_ptr< LocalToGlobalIndexMap > deriveBoundaryConstrainedMap(int const variable_id, std::vector< int > const &component_ids, MeshLib::MeshSubset &&new_mesh_subset) const
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
std::unique_ptr< WellboreCompensateNeumannBoundaryCondition > createWellboreCompensateNeumannBoundaryCondition(BaseLib::ConfigTree const &config, MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table, int const variable_id, int const component_id, unsigned const integration_order, unsigned const shapefunction_order, unsigned const global_dim, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)