OGS
CheckThermoOsmosisProperties.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <map>
7#include <memory>
8
9#include "BaseLib/Error.h"
13
14namespace ProcessLib
15{
25 MaterialPropertyLib::Medium const& medium)
26{
27 auto const solid_phase =
28 getOptionalPhase(medium, MaterialPropertyLib::PhaseName::Solid);
29 if (solid_phase)
30 {
31 // thermal_osmosis_coefficient used to live on the solid phase;
32 // thermal_osmosis_permeability never did, but a project file
33 // hand-migrated from the former can put it there just as easily.
34 for (auto const property_type :
37 {
38 if (solid_phase->hasProperty(property_type))
39 {
41 "{:s} is defined on the solid phase of {:s}, but is read "
42 "from the medium. Move the property from the solid phase "
43 "to the medium, or use "
44 "scripts/dev/move_thermal_osmosis.py to migrate the "
45 "project file.",
47 medium.description());
48 }
49 }
50 }
51
52 if (medium.hasProperty(
54 medium.hasProperty(
56 {
58 "Thermo-osmosis permeability and coefficient cannot be defined at "
59 "the same time in {:s}.",
60 medium.description());
61 }
62}
63
67 std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media)
68{
69 for (auto const& m : media)
70 {
72 }
73}
74} // namespace ProcessLib
#define OGS_FATAL(...)
Definition Error.h:10
bool hasProperty(PropertyType const &p) const
Definition Medium.cpp:65
std::string description() const
Short description of the medium.
Definition Medium.cpp:75
static const std::array< std::string, PropertyType::number_of_properties > property_enum_to_string
void checkThermoOsmosisProperties(MaterialPropertyLib::Medium const &medium)