Merge pull request #2048 from joakim-hove/thp-uda

Thp uda
This commit is contained in:
Joakim Hove 2020-10-27 18:26:59 +01:00 committed by GitHub
commit 404e2b095e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -16,6 +16,8 @@
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <fmt/format.h>
#include <iostream>
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
@ -71,8 +73,10 @@ UDAValue UDAValue::serializeObject()
void UDAValue::assert_numeric() const {
std::string msg = "Internal error: The support for use of UDQ/UDA is not complete in opm/flow. The string: '" + this->string_value + "' must be numeric";
this->assert_numeric(msg);
if (!this->numeric_value) {
std::string msg = fmt::format("Internal error: The support for use of UDQ/UDA is not complete in opm/flow. The string: '{}' must be numeric", this->string_value);
this->assert_numeric(msg);
}
}

View File

@ -176,7 +176,7 @@ void Well::WellProductionProperties::handleWCONPROD(const std::optional<VFPProdT
if( !record.getItem( cmode.first ).defaultApplied( 0 ) ) {
// a zero value THP limit will not be handled as a THP limit
if (cmode.first == "THP" && this->THPTarget.zero())
if (cmode.first == "THP" && this->THPTarget.is<double>() && this->THPTarget.zero())
continue;
this->addProductionControl( cmode.second );