Merge pull request #5802 from lisajulia/feature/ms-wells-fix-restart

Feature/ms wells fix restart file error
This commit is contained in:
Bård Skaflestad authored and GitHub committed 2024-12-17 09:47:00 +01:00
commit 79d2747cfa
4 files changed
+14 -32

No files matched your search

+2 -16
View File
@@ -194,7 +194,7 @@ endfunction()
# - This test class compares the output from a parallel simulation # - This test class compares the output from a parallel simulation
# to the output from the serial instance of the same model. # to the output from the serial instance of the same model.
function(add_test_compare_parallel_simulation) function(add_test_compare_parallel_simulation)
set(oneValueArgs CASENAME FILENAME SIMULATOR ABS_TOL REL_TOL DIR MPI_PROCS ONLY_SMRY) set(oneValueArgs CASENAME FILENAME SIMULATOR ABS_TOL REL_TOL DIR MPI_PROCS)
set(multiValueArgs TEST_ARGS) set(multiValueArgs TEST_ARGS)
cmake_parse_arguments(PARAM "$" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) cmake_parse_arguments(PARAM "$" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
@@ -211,21 +211,7 @@ function(add_test_compare_parallel_simulation)
set(RESULT_PATH ${BASE_RESULT_PATH}/parallel/${PARAM_SIMULATOR}+${PARAM_CASENAME}) set(RESULT_PATH ${BASE_RESULT_PATH}/parallel/${PARAM_SIMULATOR}+${PARAM_CASENAME})
set(TEST_ARGS ${OPM_TESTS_ROOT}/${PARAM_DIR}/${PARAM_FILENAME} ${PARAM_TEST_ARGS}) set(TEST_ARGS ${OPM_TESTS_ROOT}/${PARAM_DIR}/${PARAM_FILENAME} ${PARAM_TEST_ARGS})
# Handle ONLY_SMRY flag (defaults to 0 if not provided) set(DRIVER_ARGS -i ${OPM_TESTS_ROOT}/${PARAM_DIR}
if(PARAM_ONLY_SMRY)
if(${PARAM_ONLY_SMRY} EQUAL 1)
set(DRIVER_ARGS -s)
elseif(${PARAM_ONLY_SMRY} EQUAL 0)
set(DRIVER_ARGS "")
else()
message(FATAL_ERROR "ONLY_SMRY must be either 0 or 1.")
endif()
else()
set(DRIVER_ARGS "")
endif()
set(DRIVER_ARGS ${DRIVER_ARGS}
-i ${OPM_TESTS_ROOT}/${PARAM_DIR}
-r ${RESULT_PATH} -r ${RESULT_PATH}
-b ${PROJECT_BINARY_DIR}/bin -b ${PROJECT_BINARY_DIR}/bin
-f ${PARAM_FILENAME} -f ${PARAM_FILENAME}
@@ -1892,6 +1892,11 @@ namespace Opm
} }
} }
} }
// Accumulate dissolved gas and vaporized oil flow rates across all ranks sharing this well.
{
const auto& comm = this->parallel_well_info_.communication();
comm.sum(ws.phase_mixing_rates.data(), ws.phase_mixing_rates.size());
}
if (this->parallel_well_info_.communication().size() > 1) { if (this->parallel_well_info_.communication().size() > 1) {
// accumulate resWell_ and duneD_ in parallel to get effects of all perforations (might be distributed) // accumulate resWell_ and duneD_ in parallel to get effects of all perforations (might be distributed)
-2
View File
@@ -41,7 +41,6 @@ add_test_compare_parallel_simulation(CASENAME msw-simple
FILENAME MSW-SIMPLE # this file contains one Multisegment well without branches that is distributed across several processes FILENAME MSW-SIMPLE # this file contains one Multisegment well without branches that is distributed across several processes
DIR msw DIR msw
SIMULATOR flow_distribute_z SIMULATOR flow_distribute_z
ONLY_SMRY 1
ABS_TOL 1e4 # the absolute tolerance is pretty high here, yet in this case, we are only interested in the relative tolerance ABS_TOL 1e4 # the absolute tolerance is pretty high here, yet in this case, we are only interested in the relative tolerance
REL_TOL 1e-5 REL_TOL 1e-5
MPI_PROCS 4 MPI_PROCS 4
@@ -51,7 +50,6 @@ add_test_compare_parallel_simulation(CASENAME msw-3d
FILENAME MSW-3D # this file contains one Multisegment well with branches that is distributed across several processes FILENAME MSW-3D # this file contains one Multisegment well with branches that is distributed across several processes
DIR msw DIR msw
SIMULATOR flow_distribute_z SIMULATOR flow_distribute_z
ONLY_SMRY 1
ABS_TOL 1e4 # the absolute tolerance is pretty high here, yet in this case, we are only interested in the relative tolerance ABS_TOL 1e4 # the absolute tolerance is pretty high here, yet in this case, we are only interested in the relative tolerance
REL_TOL 1e-4 REL_TOL 1e-4
MPI_PROCS 4 MPI_PROCS 4
+7 -14
View File
@@ -18,15 +18,13 @@ then
echo -e "\t\t -e <filename> Simulator binary to use" echo -e "\t\t -e <filename> Simulator binary to use"
echo -e "\tOptional options:" echo -e "\tOptional options:"
echo -e "\t\t -n <procs> Number of MPI processes to use" echo -e "\t\t -n <procs> Number of MPI processes to use"
echo -e "\t\t -s If given, compare only the SMRY file and skip comparison of the UNRST file."
exit 1 exit 1
fi fi
MPI_PROCS=4 MPI_PROCS=4
OPTIND=1 OPTIND=1
ONLY_SUMMARY=false
while getopts "i:r:b:f:a:t:c:e:n:s" OPT while getopts "i:r:b:f:a:t:c:e:n:" OPT
do do
case "${OPT}" in case "${OPT}" in
i) INPUT_DATA_PATH=${OPTARG} ;; i) INPUT_DATA_PATH=${OPTARG} ;;
@@ -38,7 +36,6 @@ do
c) COMPARE_ECL_COMMAND=${OPTARG} ;; c) COMPARE_ECL_COMMAND=${OPTARG} ;;
e) EXE_NAME=${OPTARG} ;; e) EXE_NAME=${OPTARG} ;;
n) MPI_PROCS=${OPTARG} ;; n) MPI_PROCS=${OPTARG} ;;
s) ONLY_SUMMARY=true ;;
esac esac
done done
shift $(($OPTIND-1)) shift $(($OPTIND-1))
@@ -65,16 +62,12 @@ then
${COMPARE_ECL_COMMAND} -t SMRY -a -R ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/mpi/${FILENAME} ${ABS_TOL} ${REL_TOL} ${COMPARE_ECL_COMMAND} -t SMRY -a -R ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/mpi/${FILENAME} ${ABS_TOL} ${REL_TOL}
fi fi
if [ "$ONLY_SUMMARY" = false ]; then echo "=== Executing comparison for restart file ==="
echo "=== Executing comparison for restart file ===" ${COMPARE_ECL_COMMAND} -l -t UNRST ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/mpi/${FILENAME} ${ABS_TOL} ${REL_TOL}
${COMPARE_ECL_COMMAND} -l -t UNRST ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/mpi/${FILENAME} ${ABS_TOL} ${REL_TOL} if [ $? -ne 0 ]
if [ $? -ne 0 ] then
then ecode=1
ecode=1 ${COMPARE_ECL_COMMAND} -a -l -t UNRST ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/mpi/${FILENAME} ${ABS_TOL} ${REL_TOL}
${COMPARE_ECL_COMMAND} -a -l -t UNRST ${RESULT_PATH}/${FILENAME} ${RESULT_PATH}/mpi/${FILENAME} ${ABS_TOL} ${REL_TOL}
fi
else
echo "=== Skipping comparison for restart file due to -s flag ==="
fi fi
exit $ecode exit $ecode