6#include <spdlog/fmt/fmt.h>
27 std::string_view
const param_role)
29 double const v = param(t, pos)[0];
30 if (!std::isfinite(v) || v <= 0.0)
33 "BHE {:s} ('{}') is non-finite or non-positive (value={:g}) at "
35 param_role, param.
name, v, pos);
43 double const distance,
44 std::string_view
const equation,
45 std::string_view
const cause)
48 "BHE geometry invalid at {} ({:s}): D={:g}, d0={:g}, distance={:g}. "
50 pos, equation, D, d0, distance, cause);
55 if (!std::isfinite(arg) || arg <= 1.0)
57 OGS_FATAL(
"{:s} -> acosh argument = {:g} (must be finite and > 1).",
63 double const min_diameter,
65 std::string_view
const context)
67 if (!(D > min_diameter) || !std::isfinite(D / min_diameter))
70 "BHE geometry invalid at {} ({:s}): borehole diameter "
71 "D={:g} must strictly exceed the minimum diameter {:g} required by "
73 pos, context, D, min_diameter);
78 double const pipe_outside_area,
81 double const grout_area = borehole_area_fraction - pipe_outside_area;
85 "Non-positive grout cross-sectional area at {}. "
86 "Borehole diameter is too small for the pipe dimensions.",
93 std::string_view
const context)
99 if (std::abs(d_inlet - d_outlet) >
100 1e-12 * std::max(std::abs(d_inlet), std::abs(d_outlet)))
103 "{:s}: inlet and outlet pipe outside diameters differ "
104 "(inlet={:g}, outlet={:g}). U-type BHE thermal resistance formulas "
105 "assume a single pipe diameter; inlet and outlet may differ only "
106 "in wall thermal conductivity.",
107 context, d_inlet, d_outlet);
122 ¶m) !=
nullptr ||
127 "BHE {:s} '{}' uses a time-varying parameter type, but borehole "
128 "geometry properties are sampled once at t=0 and are physically "
129 "time-invariant. Use ConstantParameter, MeshElementParameter, or "
130 "a spatial-only FunctionParameter.",
136 "BHE {:s} '{}' reports time-dependence. This is expected for a "
137 "FunctionParameter, whose time-dependence flag is set even for a "
138 "purely spatial expression, so a spatial-only expression is fine. "
139 "Only the value at t=0 is used; ensure the expression does not "
140 "actually depend on time.",
147 "BHE parameter '{}' must not be a MeshNodeParameter. "
148 "Use MeshElementParameter for spatially varying BHE properties.",
155 "BHE {:s} '{}' must be scalar (1 component), got {:d} components.",
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
void checkAcoshArg(double const arg, std::string_view const context)
double sampleStrictPositive(ParameterLib::Parameter< double > const ¶m, double const t, ParameterLib::SpatialPosition const &pos, std::string_view const param_role)
void validateScalarTimeInvariantBHEParameter(ParameterLib::Parameter< double > const ¶m, std::string_view const role)
void checkBoreholeVsPipeDiameter(double const D, double const min_diameter, ParameterLib::SpatialPosition const &pos, std::string_view const context)
std::string uTypeGeometryContext(ParameterLib::SpatialPosition const &pos, double const D, double const d0, double const distance, std::string_view const equation, std::string_view const cause)
double checkedGroutArea(double const borehole_area_fraction, double const pipe_outside_area, ParameterLib::SpatialPosition const &pos)
void checkEqualPipeOutsideDiameters(Pipe const &inlet, Pipe const &outlet, std::string_view const context)
A parameter represented by a mesh property vector.
virtual bool isTimeDependent() const =0
virtual int getNumberOfGlobalComponents() const =0
double outsideDiameter() const