OGS
WaterStateIAPWSIF97Region1.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 <spdlog/fmt/fmt.h>
7
8#include <string_view>
9
10#include "NumLib/Exceptions.h"
11
13{
16constexpr double maximum_pressure = 100e6;
17
21constexpr double maximum_temperature = 623.15;
22
37inline void checkStateInRange(double const pressure, double const temperature,
38 std::string_view const quantity)
39{
40 if ((pressure > maximum_pressure) || (temperature > maximum_temperature))
41 {
42 throw NumLib::AssemblyException(fmt::format(
43 "Pressure {:g} Pa and temperature {:g} K are out of the range of "
44 "the IAPWS-IF97 region 1 correlations, p <= {:g} Pa and T <= {:g} "
45 "K, for {}.",
47 quantity));
48 }
49}
50} // namespace MaterialPropertyLib::IAPWSIF97Region1
void checkStateInRange(double const pressure, double const temperature, std::string_view const quantity)