add regression test for flow_polymer

This commit is contained in:
Arne Morten Kvarving 2017-05-16 11:49:40 +02:00
parent 56597a9238
commit 09cbcee62c
3 changed files with 23 additions and 7 deletions

View File

@ -22,10 +22,15 @@ set(BASE_RESULT_PATH ${PROJECT_BINARY_DIR}/tests/results)
# - This test class compares output from a simulation to reference files.
macro (add_test_compareECLFiles casename filename simulator abs_tol rel_tol prefix dirprefix)
if(${ARGC} GREATER 7)
set(DIR ${ARGN})
set(DIR ${ARGV7})
else()
set(DIR ${casename})
endif()
if(${ARGC} GREATER 8)
set(TEST_ARGS ${OPM_DATA_ROOT}/${DIR}/${ARGV1} deckfilename=${OPM_DATA_ROOT}/${DIR}/${filename})
else()
set(TEST_ARGS ${OPM_DATA_ROOT}/${DIR}/${filename})
endif()
set(RESULT_PATH ${BASE_RESULT_PATH}${dirprefix}/${simulator}+${casename})
opm_add_test(${prefix}_${simulator}+${filename} NO_COMPILE
EXE_NAME ${simulator}
@ -35,7 +40,7 @@ macro (add_test_compareECLFiles casename filename simulator abs_tol rel_tol pref
${abs_tol} ${rel_tol}
${COMPARE_SUMMARY_COMMAND}
${COMPARE_ECL_COMMAND}
TEST_ARGS ${OPM_DATA_ROOT}/${DIR}/${filename}.DATA )
TEST_ARGS ${TEST_ARGS})
endmacro (add_test_compareECLFiles)
###########################################################################
@ -108,6 +113,7 @@ add_test_compareECLFiles(spe3 SPE3CASE1 flow_legacy ${abs_tol} ${rel_tol} compar
add_test_compareECLFiles(spe9 SPE9_CP_SHORT flow_ebos ${abs_tol} ${rel_tol} compareECLFiles "")
add_test_compareECLFiles(spe9 SPE9_CP_SHORT flow_legacy ${abs_tol} ${rel_tol} compareECLFiles "")
add_test_compareECLFiles(msw_2d_h 2D_H__ flow_multisegment ${abs_tol} ${rel_tol} compareECLFiles "")
add_test_compareECLFiles(polymer_simple2D 2D_THREEPHASE_POLY_HETER flow_polymer ${abs_tol} ${rel_tol} compareECLFiles "" polymer_simple2D run.param)
# Restart tests
opm_set_test_driver(${PROJECT_SOURCE_DIR}/tests/run-restart-regressionTest.sh "")

View File

@ -4,15 +4,15 @@ pushd .
cd deps/opm-data
# Run the simple2D polymer case
cd polymer_test_suite/simple2D
cd polymer_simple2D
$WORKSPACE/$configuration/build-opm-simulators/bin/flow_polymer run.param
test $? -eq 0 || exit 1
cd ../..
cd ..
# Compare OPM with eclipse reference
compareECL=$WORKSPACE/$configuration/install/bin/compareECL
reffile=polymer_test_suite/simple2D/eclipse-simulation/2D_THREEPHASE_POLY_HETER
opmfile=polymer_test_suite/simple2D/opm-simulation/2D_THREEPHASE_POLY_HETER
reffile=polymer_simple2D/eclipse-simulation/2D_THREEPHASE_POLY_HETER
opmfile=polymer_simple2D/opm-simulation-reference/flow_polymer/2D_THREEPHASE_POLY_HETER
$compareECL $reffile $opmfile 1.0 0.004 -k SGAS
test $? -eq 0 || exit 1
$compareECL $reffile $opmfile 1.0 0.004 -k SWAT

View File

@ -19,7 +19,7 @@ copyToReferenceDir () {
}
tests=${@:2}
test -z "$tests" && tests="spe11 spe12 spe12p spe3 spe9 norne_init msw_2d_h"
test -z "$tests" && tests="spe11 spe12 spe12p spe3 spe9 norne_init msw_2d_h polymer2d"
if grep -q -i "norne " <<< $ghprbCommentBody
then
if test -d $WORKSPACE/deps/opm-data/norne/flow
@ -79,6 +79,15 @@ for test_name in ${tests}; do
EGRID INIT SMSPEC UNRST UNSMRY
fi
if grep -q "polymer2d" <<< $test_name
then
copyToReferenceDir \
$configuration/build-opm-simulators/tests/results/flow_polymer+polymer_simple2D/ \
$OPM_DATA_ROOT/polymer_simple2D/opm-simulation-reference/flow_polymer \
2D_THREEPHASE_POLY_HETER \
EGRID INIT SMSPEC UNRST UNSMRY
fi
if grep -q "spe3" <<< $test_name
then
copyToReferenceDir \
@ -151,6 +160,7 @@ then
git status | grep "SPE1CASE2_2P" && tests="$tests spe1-2p"
git status | grep "SPE9_CP" && tests="$tests spe9"
git status | grep "2D_H__" && tests="$tests msw_2d_h"
git status | grep "2D_THREEPHASE_POLY_HETER" && tests="$tests simple2d"
git status | grep "NORNE_ATW2013.INIT" && tests="$tests norne_init"
git status | grep "NORNE_ATW2013.UNSMRY" && tests="$tests norne_full"
popd > /dev/null