OGS
BoreholeGeometry.cpp
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#include "BoreholeGeometry.h"
5
8#include "BaseLib/Error.h"
10
11namespace ProcessLib
12{
13namespace HeatTransportBHE
14{
15namespace BHE
16{
18 BaseLib::ConfigTree const& config,
19 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>& parameters)
20{
21 const auto borehole_length =
23 config.getConfigParameter<double>("length");
24 if (borehole_length <= 0)
25 {
26 OGS_FATAL("Borehole length must be positive, got {:g}.",
27 borehole_length);
28 }
29
30 auto const diameter_parameter_or_value =
32 config.getConfigParameter<std::string>("diameter");
33 auto const& diameter_parameter =
35 diameter_parameter_or_value, parameters, "borehole_diameter",
36 "borehole_diameter");
37
38 // Borehole diameter is physically time-invariant (fixed at drilling).
39 // Reject time-varying / mesh-node / non-scalar parameter types; warn for
40 // FunctionParameter (which may be spatial-only).
42 "borehole_diameter");
43
44 return {borehole_length, diameter_parameter};
45}
46} // namespace BHE
47} // namespace HeatTransportBHE
48} // namespace ProcessLib
#define OGS_FATAL(...)
Definition Error.h:10
T getConfigParameter(std::string const &param) const
Parameter< double > & getNamedOrCreateInlineParameter(std::string const &parameter_or_value, std::vector< std::unique_ptr< ParameterBase > > &parameters, std::string const &property_name, std::string const &inline_suffix)
void validateScalarTimeInvariantBHEParameter(ParameterLib::Parameter< double > const &param, std::string_view const role)
BoreholeGeometry createBoreholeGeometry(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters)