26 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters)
28 DBUG(
"Create PorousMediaProperties.");
30 auto const& porous_medium_configs =
34 std::vector<std::unique_ptr<MaterialLib::PorousMedium::Permeability>>
35 intrinsic_permeability_models;
36 std::vector<std::unique_ptr<MaterialLib::PorousMedium::Porosity>>
38 std::vector<std::unique_ptr<MaterialLib::PorousMedium::Storage>>
41 std::vector<int> mat_ids;
42 for (
auto const& porous_medium_config :
44 porous_medium_configs.getConfigSubtreeList(
"porous_medium"))
48 mat_ids.push_back(
id);
50 auto const& porosity_config =
52 porous_medium_config.getConfigSubtree(
"porosity");
53 porosity_models.emplace_back(
54 MaterialLib::PorousMedium::createPorosityModel(porosity_config,
59 auto const& permeability_config =
61 porous_medium_config.getConfigSubtree(
"permeability");
62 intrinsic_permeability_models.emplace_back(
64 permeability_config, parameters));
67 auto const& storage_config =
69 porous_medium_config.getConfigSubtree(
"storage");
70 storage_models.emplace_back(
71 MaterialLib::PorousMedium::createStorageModel(storage_config));
78 auto const material_ids = materialIDs(mesh);
79 int const max_material_id =
82 : *std::max_element(begin(*material_ids), end(*material_ids));
84 if (!material_ids && mat_ids.size() > 1)
87 "More than one porous medium definition (namely {}) is present in "
88 "the project file, but no MaterialIDs are present in the bulk "
93 if (max_material_id >
static_cast<int>(mat_ids.size() - 1))
96 "The maximum value of MaterialIDs in mesh is {:d}. As the "
97 "given number of porous media definitions in the project file is "
98 "{:d}, the maximum value of MaterialIDs in mesh must be {:d} "
99 "(index starts with zero).",
100 max_material_id, mat_ids.size(), max_material_id - 1);
103 if (max_material_id <
static_cast<int>(mat_ids.size() - 1))
105 "There are {:d} porous medium definitions in the project file but "
106 "only {:d} different values in the MaterialIDs vector/data_array "
108 mat_ids.size(), max_material_id - 1);
110 if (mat_ids.back() !=
static_cast<int>(mat_ids.size()) - 1)
113 "The ids in the porous media definitions in the project file have "
114 "to be sequential, starting with the id zero.");
118 std::move(intrinsic_permeability_models),
119 std::move(storage_models), material_ids};