/** * \file * * \copyright * Copyright (c) 2012-2023, 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 #include #include "MaterialLib/MPL/Medium.h" #include "MaterialLib/MPL/Properties/RelativePermeability/RelPermLiakopoulos.h" #include "TestMPL.h" #include "Tests/TestTools.h" TEST(MaterialPropertyLib, RelPermLiakopoulos) { std::stringstream m_beg; std::stringstream m_end; m_beg << "\n"; m_beg << "\n"; m_beg << "\n"; m_beg << " \n"; m_beg << " saturation\n"; m_beg << " Constant\n"; // constant saturation value will be inserted here... m_end << " \n"; m_end << " \n"; m_end << " relative_permeability\n"; m_end << " RelPermLiakopoulos\n"; m_end << " \n"; m_end << "\n"; m_end << "\n"; std::array ref_saturation = {0.00, 0.10, 0.15, 0.20, 0.25, 0.30, 0.40, 0.50, 0.60, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 1.00, 1.05}; std::array ref_k_rel_L = { 0.0000000000E+00, 0.0000000000E+00, 0.0000000000E+00, 0.0000000000E+00, 0.0000000000E+00, 0.0000000000E+00, 0.0000000000E+00, 0.0000000000E+00, 1.2693364888E-01, 3.4747560139E-01, 4.5742795233E-01, 5.6711275277E-01, 6.7646274501E-01, 7.8536411514E-01, 8.9357837782E-01, 1.0000000000E+00, 1.0000000000E+00}; std::array ref_dk_rel_L_ds_L = { 2.2276817495E+00, 2.2276817495E+00, 2.2276817495E+00, 2.2276817495E+00, 2.2259427960E+00, 2.2240853238E+00, 2.2199407746E+00, 2.2150487817E+00, 2.2090761349E+00, 2.2013998128E+00, 2.1965486778E+00, 2.1906259146E+00, 2.1830137051E+00, 2.1723297907E+00, 2.1541864761E+00, 0.0000000000E+00, 0.0000000000E+00}; for (size_t idx = 0; idx < ref_saturation.size(); idx++) { std::stringstream m_sat; m_sat << " " << ref_saturation[idx] << "\n"; std::stringstream m; m << m_beg.str() << m_sat.str() << m_end.str(); auto const& medium = Tests::createTestMaterial(m.str()); MaterialPropertyLib::VariableArray variable_array; ParameterLib::SpatialPosition const pos; double const time = std::numeric_limits::quiet_NaN(); double const dt = std::numeric_limits::quiet_NaN(); auto k_rel = medium ->property( MaterialPropertyLib::PropertyType::relative_permeability) .template value(variable_array, pos, time, dt); auto dk_rel_ds_L = medium ->property( MaterialPropertyLib::PropertyType::relative_permeability) .template dValue( variable_array, MaterialPropertyLib::Variable::liquid_saturation, pos, time, dt); ASSERT_NEAR(k_rel, ref_k_rel_L[idx], 1.0e-10); ASSERT_NEAR(dk_rel_ds_L, ref_dk_rel_L_ds_L[idx], 1.0e-10); } }