diff --git a/MaterialLib/MPL/CreateProperty.cpp b/MaterialLib/MPL/CreateProperty.cpp index 7f754fe95ba528a245a478a4c5feb7256c3a8bb0..40f9d59442c66d5d4be1236e2b40b931dd0aac8d 100644 --- a/MaterialLib/MPL/CreateProperty.cpp +++ b/MaterialLib/MPL/CreateProperty.cpp @@ -18,6 +18,7 @@ #include "BaseLib/ConfigTree.h" #include "Properties/CreateProperties.h" + #include "Properties/Properties.h" #include "Component.h" diff --git a/MaterialLib/MPL/Properties/CreateProperties.h b/MaterialLib/MPL/Properties/CreateProperties.h index 160408503fa0ddafaf007d94ec333a0dba18e730..646a6e2213ab21729599674913def917a1b292cb 100644 --- a/MaterialLib/MPL/Properties/CreateProperties.h +++ b/MaterialLib/MPL/Properties/CreateProperties.h @@ -16,4 +16,5 @@ #include "CreateExponentialProperty.h" #include "CreateIdealGasLaw.h" #include "CreateLinearProperty.h" -#include "CreateParameterProperty.h" \ No newline at end of file +#include "CreateParameterProperty.h" +#include "CreateSaturationBrooksCorey.h" \ No newline at end of file diff --git a/MaterialLib/MPL/Properties/CreateSaturationBrooksCorey.cpp b/MaterialLib/MPL/Properties/CreateSaturationBrooksCorey.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3bfcf096c69599d4b9924783a01e71ff294f8015 --- /dev/null +++ b/MaterialLib/MPL/Properties/CreateSaturationBrooksCorey.cpp @@ -0,0 +1,42 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#include "BaseLib/ConfigTree.h" +#include "SaturationBrooksCorey.h" + +namespace MaterialPropertyLib +{ +std::unique_ptr<SaturationBrooksCorey> createSaturationBrooksCorey( + BaseLib::ConfigTree const& config) +{ + // check is reading the parameter, not peeking it... + //! \ogs_file_param{prj__media__medium__properties__property__SaturationBrooksCorey} + config.checkConfigParameter("type", "SaturationBrooksCorey"); + + DBUG("Create SaturationBrooksCorey medium property"); + + auto const residual_liquid_saturation = + //! \ogs_file_param{prj__media__medium__properties__property__SaturationBrooksCorey__residual_liquid_saturation} + config.getConfigParameter<double>("residual_liquid_saturation"); + auto const residual_gas_saturation = + //! \ogs_file_param{prj__media__medium__properties__property__SaturationBrooksCorey__residual_gas_saturation} + config.getConfigParameter<double>("residual_gas_saturation"); + auto const exponent = + //! \ogs_file_param{prj__media__medium__properties__property__SaturationBrooksCorey__lambda} + config.getConfigParameter<double>("lambda"); + auto const entry_pressure = + //! \ogs_file_param{prj__media__medium__properties__property__SaturationBrooksCorey__entry_pressure} + config.getConfigParameter<double>("entry_pressure"); + + return std::make_unique<SaturationBrooksCorey>(residual_liquid_saturation, + residual_gas_saturation, + exponent, entry_pressure); +} +} // namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/Properties/CreateSaturationBrooksCorey.h b/MaterialLib/MPL/Properties/CreateSaturationBrooksCorey.h new file mode 100644 index 0000000000000000000000000000000000000000..42a8286b8d54914bfc7f9ba8012820cee7134156 --- /dev/null +++ b/MaterialLib/MPL/Properties/CreateSaturationBrooksCorey.h @@ -0,0 +1,27 @@ +/** + * \file + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#pragma once + +namespace BaseLib +{ +class ConfigTree; +} + +namespace MaterialPropertyLib +{ +class SaturationBrooksCorey; +} + +namespace MaterialPropertyLib +{ +std::unique_ptr<SaturationBrooksCorey> createSaturationBrooksCorey( + BaseLib::ConfigTree const& config); +} // namespace MaterialPropertyLib diff --git a/MaterialLib/MPL/Properties/SaturationBrooksCorey.h b/MaterialLib/MPL/Properties/SaturationBrooksCorey.h index 59a67e4bf14cab37b64b83d6d0f30a28b233a410..2ee2c3c2c1d6cc1ec4efe543c905c16783cfff0a 100644 --- a/MaterialLib/MPL/Properties/SaturationBrooksCorey.h +++ b/MaterialLib/MPL/Properties/SaturationBrooksCorey.h @@ -14,7 +14,6 @@ #pragma once #include <limits> -#include "BaseLib/ConfigTree.h" #include "MaterialLib/MPL/Property.h" namespace MaterialPropertyLib @@ -70,35 +69,4 @@ public: ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/) const override; }; - -inline std::unique_ptr<SaturationBrooksCorey> createSaturationBrooksCorey( - BaseLib::ConfigTree const& config) -{ - // check is reading the parameter, not peeking it... - //! \ogs_file_param{prj__media__medium__properties__property__SaturationBrooksCorey} - // config.checkConfigParameter("type", "SaturationBrooksCorey"); - DBUG("Create SaturationBrooksCorey medium property"); - - auto const residual_liquid_saturation = - //! \ogs_file_param{prj__media__medium__properties__property__SaturationBrooksCorey__residual_liquid_saturation} - config.getConfigParameter<double>("residual_liquid_saturation"); - auto const residual_gas_saturation = - //! \ogs_file_param{prj__media__medium__properties__property__SaturationBrooksCorey__residual_gas_saturation} - config.getConfigParameter<double>("residual_gas_saturation"); - auto const exponent = - //! \ogs_file_param{prj__media__medium__properties__property__SaturationBrooksCorey__lambda} - config.getConfigParameter<double>("lambda"); - auto const entry_pressure = - //! \ogs_file_param{prj__media__medium__properties__property__SaturationBrooksCorey__entry_pressure} - config.getConfigParameter<double>("entry_pressure"); - if (entry_pressure < 0.) - { - OGS_FATAL("Paramater 'entry_pressure' must be positive."); - } - - return std::make_unique<SaturationBrooksCorey>(residual_liquid_saturation, - residual_gas_saturation, - exponent, entry_pressure); -} - } // namespace MaterialPropertyLib