Merge pull request #1327 from akva2/add_and_move_tests

Add and move tests
This commit is contained in:
Atgeirr Flø Rasmussen 2017-11-13 13:22:06 +01:00 committed by GitHub
commit bbdeedc512
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 24 deletions

View File

@ -165,24 +165,31 @@ add_test_compareECLFiles(CASENAME spe9group
ABS_TOL ${abs_tol}
REL_TOL ${rel_tol})
# TODO: move to flow
add_test_compareECLFiles(CASENAME msw_2d_h
FILENAME 2D_H__
SIMULATOR flow_multisegment
SIMULATOR flow
ABS_TOL ${abs_tol}
REL_TOL ${rel_tol})
REL_TOL ${coarse_rel_tol}
TEST_ARGS use_multisegment_well=true)
# TODO: add flow
add_test_compareECLFiles(CASENAME polymer_simple2D
FILENAME 2D_THREEPHASE_POLY_HETER
SIMULATOR flow_polymer
add_test_compareECLFiles(CASENAME msw_3d_hfa
FILENAME 3D_MSW
SIMULATOR flow
ABS_TOL ${abs_tol}
REL_TOL ${rel_tol})
REL_TOL ${rel_tol}
TEST_ARGS use_multisegment_well=true)
foreach(SIM flow flow_polymer)
add_test_compareECLFiles(CASENAME polymer_simple2D
FILENAME 2D_THREEPHASE_POLY_HETER
SIMULATOR ${SIM}
ABS_TOL ${abs_tol}
REL_TOL ${coarse_rel_tol})
endforeach()
# TODO: move to flow
add_test_compareECLFiles(CASENAME spe5
FILENAME SPE5CASE1
SIMULATOR flow_solvent
SIMULATOR flow
ABS_TOL ${abs_tol}
REL_TOL ${coarse_rel_tol}
TEST_ARGS max_iter=13)
@ -226,21 +233,23 @@ if(MPI_FOUND)
# Different tolerances for these tests
set(abs_tol_parallel 0.02)
set(rel_tol_parallel 1e-5)
set(coarse_rel_tol_parallel 1e-2)
add_test_compare_parallel_simulation(CASENAME spe1
FILENAME SPE1CASE2
SIMULATOR flow
ABS_TOL ${abs_tol_parallel}
REL_TOL ${rel_tol_parallel})
add_test_compare_parallel_simulation(CASENAME spe9
FILENAME SPE9_CP_SHORT
SIMULATOR flow
ABS_TOL ${abs_tol_parallel}
REL_TOL ${rel_tol_parallel})
# TODO: add flow
add_test_compare_parallel_simulation(CASENAME spe3
FILENAME SPE3CASE1
SIMULATOR flow_mpi
SIMULATOR flow
ABS_TOL ${abs_tol_parallel}
REL_TOL ${rel_tol_parallel})
REL_TOL ${coarse_rel_tol_parallel})
endif()

View File

@ -298,10 +298,10 @@ namespace Opm
if (injection.injectorType == WellInjector::GAS) {
double solvent_fraction = well_ecl_->getSolventFraction(current_step_);
return solvent_fraction;
} else {
// Not a gas injection well => no solvent.
return 0.0;
}
assert(false);
return 0.0;
}
@ -323,10 +323,10 @@ namespace Opm
if (injection.injectorType == WellInjector::WATER) {
const double polymer_injection_concentration = polymer.m_polymerConcentration;
return polymer_injection_concentration;
} else {
// Not a water injection well => no polymer.
return 0.0;
}
assert(false); // TODO: find a more logical way to handle this situation
return 0.0;
}

View File

@ -12,6 +12,7 @@ copyToReferenceDir () {
DST_DIR=$2;
STEM=$3;
FILETYPES=${@:4};
mkdir -p $DST_DIR
for filetype in $FILETYPES; do
cp "$WORKSPACE/$SRC_DIR$STEM.$filetype" $DST_DIR
@ -19,7 +20,7 @@ copyToReferenceDir () {
}
tests=${@:2}
test -z "$tests" && tests="spe11 spe12 spe12p spe3 spe5 spe9 norne_init msw_2d_h polymer2d spe9group"
test -z "$tests" && tests="spe11 spe12 spe12p spe3 spe5 spe9 norne_init msw_2d_h msw_3d_hfa polymer2d spe9group"
if grep -q -i "norne " <<< $ghprbCommentBody
then
if test -d $WORKSPACE/deps/opm-data/norne/flow
@ -73,12 +74,21 @@ for test_name in ${tests}; do
if grep -q "msw_2d_h" <<< $test_name
then
copyToReferenceDir \
$configuration/build-opm-simulators/tests/results/flow_multisegment+msw_2d_h/ \
$OPM_DATA_ROOT/msw_2d_h/opm-simulation-reference/flow_multisegment \
$configuration/build-opm-simulators/tests/results/flow+msw_2d_h/ \
$OPM_DATA_ROOT/msw_2d_h/opm-simulation-reference/flow \
2D_H__ \
EGRID INIT SMSPEC UNRST UNSMRY
fi
if grep -q "msw_3d_hfa" <<< $test_name
then
copyToReferenceDir \
$configuration/build-opm-simulators/tests/results/flow+msw_3d_hfa/ \
$OPM_DATA_ROOT/msw_3d_hfa/opm-simulation-reference/flow \
3D_MSW \
EGRID INIT SMSPEC UNRST UNSMRY
fi
if grep -q "polymer2d" <<< $test_name
then
copyToReferenceDir \
@ -86,6 +96,12 @@ for test_name in ${tests}; do
$OPM_DATA_ROOT/polymer_simple2D/opm-simulation-reference/flow_polymer \
2D_THREEPHASE_POLY_HETER \
EGRID INIT SMSPEC UNRST UNSMRY
copyToReferenceDir \
$configuration/build-opm-simulators/tests/results/flow+polymer_simple2D/ \
$OPM_DATA_ROOT/polymer_simple2D/opm-simulation-reference/flow \
2D_THREEPHASE_POLY_HETER \
EGRID INIT SMSPEC UNRST UNSMRY
fi
if grep -q "spe3" <<< $test_name
@ -106,8 +122,8 @@ for test_name in ${tests}; do
if grep -q "spe5" <<< $test_name
then
copyToReferenceDir \
$configuration/build-opm-simulators/tests/results/flow_solvent+spe5/ \
$OPM_DATA_ROOT/spe5/opm-simulation-reference/flow_solvent \
$configuration/build-opm-simulators/tests/results/flow+spe5/ \
$OPM_DATA_ROOT/spe5/opm-simulation-reference/flow \
SPE5CASE1 \
EGRID INIT SMSPEC UNRST UNSMRY
fi
@ -207,6 +223,13 @@ then
git checkout -b $BRANCH_NAME origin/master
fi
# Add potential new files
untracked=`git status | sed '1,/Untracked files/d' | tail -n +3 | head -n -2`
if [ -n "$untracked" ]
then
git add $untracked
fi
if [ -z "$REASON" ]
then
git commit -a -t /tmp/cmsg