From c74702a7edec099633af8737d1621e47792dae6b Mon Sep 17 00:00:00 2001 From: Arnaud DUDES <155963334+arng40@users.noreply.github.com> Date: Tue, 2 Jul 2024 22:56:23 +0200 Subject: [PATCH 1/5] Umpire logs refactor - table output + adding percentages (#3052) --- src/coreComponents/common/CMakeLists.txt | 4 + src/coreComponents/common/MemoryInfos.cpp | 68 ++++++++++++++ src/coreComponents/common/MemoryInfos.hpp | 72 +++++++++++++++ .../common/initializeEnvironment.cpp | 91 ++++++++++++++----- 4 files changed, 214 insertions(+), 21 deletions(-) create mode 100644 src/coreComponents/common/MemoryInfos.cpp create mode 100644 src/coreComponents/common/MemoryInfos.hpp diff --git a/src/coreComponents/common/CMakeLists.txt b/src/coreComponents/common/CMakeLists.txt index 5600a8fae85..1d829c19f2d 100644 --- a/src/coreComponents/common/CMakeLists.txt +++ b/src/coreComponents/common/CMakeLists.txt @@ -10,6 +10,7 @@ set( common_headers Format.hpp GEOS_RAJA_Interface.hpp GeosxMacros.hpp + MemoryInfos.hpp Logger.hpp MpiWrapper.hpp Path.hpp @@ -40,6 +41,7 @@ endif( ) set( common_sources BufferAllocator.cpp DataTypes.cpp + MemoryInfos.cpp Logger.cpp MpiWrapper.cpp Path.cpp @@ -93,6 +95,8 @@ if( ENABLE_CALIPER ) endif() endif() +set( dependencyList ${dependencyList} fileIO codingUtilities ) + blt_add_library( NAME common SOURCES ${common_sources} HEADERS ${common_headers} diff --git a/src/coreComponents/common/MemoryInfos.cpp b/src/coreComponents/common/MemoryInfos.cpp new file mode 100644 index 00000000000..98b0093c82f --- /dev/null +++ b/src/coreComponents/common/MemoryInfos.cpp @@ -0,0 +1,68 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-LiCense-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +#include "MemoryInfos.hpp" + +namespace geos +{ +MemoryInfos::MemoryInfos( umpire::MemoryResourceTraits::resource_type resourceType ): + m_totalMemory( 0 ), + m_availableMemory( 0 ), + m_physicalMemoryHandled( 1 ) +{ + switch( resourceType ) + { + case umpire::MemoryResourceTraits::resource_type::host: + case umpire::MemoryResourceTraits::resource_type::pinned: + #if defined( _SC_PHYS_PAGES ) && defined( _SC_PAGESIZE ) + m_totalMemory = sysconf( _SC_PHYS_PAGES ) * sysconf( _SC_PAGESIZE ); + m_availableMemory = sysconf( _SC_AVPHYS_PAGES ) * sysconf( _SC_PAGESIZE ); + #else + GEOS_WARNING( "Unknown device physical memory size getter for this compiler." ); + m_physicalMemoryHandled = 0; + #endif + break; + case umpire::MemoryResourceTraits::resource_type::device: + case umpire::MemoryResourceTraits::resource_type::device_const: + case umpire::MemoryResourceTraits::resource_type::um: + #if defined( GEOS_USE_CUDA ) + cudaMemGetInfo( &m_availableMemory, &m_totalMemory ); + #else + GEOS_WARNING( "Unknown device physical memory size getter for this compiler." ); + m_physicalMemoryHandled = 0; + #endif + break; + default: + GEOS_WARNING( "Physical memory lookup not implemented" ); + m_physicalMemoryHandled = 0; + break; + } +} + +size_t MemoryInfos::getTotalMemory() const +{ + return m_totalMemory; +} + +size_t MemoryInfos::getAvailableMemory() const +{ + return m_availableMemory; +} + +bool MemoryInfos::isPhysicalMemoryHandled() const +{ + return m_physicalMemoryHandled; +} + +} diff --git a/src/coreComponents/common/MemoryInfos.hpp b/src/coreComponents/common/MemoryInfos.hpp new file mode 100644 index 00000000000..b2a22431d09 --- /dev/null +++ b/src/coreComponents/common/MemoryInfos.hpp @@ -0,0 +1,72 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-LiCense-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +#ifndef GEOS_COMMON_MemoryInfos_HPP_ +#define GEOS_COMMON_MemoryInfos_HPP_ + +#include "umpire/util/MemoryResourceTraits.hpp" +#include "common/Logger.hpp" +#include +#include +#if defined( GEOS_USE_CUDA ) +#include +#endif + +namespace geos +{ + +/** + * @class MemoryInfos + * @brief Class to fetch and store memory information for different resource types. + */ +class MemoryInfos +{ +public: + + /** + * @brief Constructor for MemoryInfos. + * @param resourceType The type of memory resource. + */ + MemoryInfos( umpire::MemoryResourceTraits::resource_type resourceType ); + + /** + * @brief Get the total memory available for the resource type. + * @return Total memory in bytes. + */ + size_t getTotalMemory() const; + + /** + * @brief Get the available memory for the resource type. + * @return Available memory in bytes. + */ + size_t getAvailableMemory() const; + + /** + * @brief Check if physical memory is handled. + * @return True if physical memory is handled, false otherwise. + */ + bool isPhysicalMemoryHandled() const; +private: + + ///total memory available. + size_t m_totalMemory; + ///Available memory. + size_t m_availableMemory; + ///Flag indicating if physical memory is handled. + bool m_physicalMemoryHandled; +}; + +} + +#endif diff --git a/src/coreComponents/common/initializeEnvironment.cpp b/src/coreComponents/common/initializeEnvironment.cpp index 356b4c112f0..a86cbf15af9 100644 --- a/src/coreComponents/common/initializeEnvironment.cpp +++ b/src/coreComponents/common/initializeEnvironment.cpp @@ -17,9 +17,18 @@ #include "TimingMacros.hpp" #include "Path.hpp" #include "LvArray/src/system.hpp" - +#include "fileIO/Table/TableLayout.hpp" +#include "fileIO/Table/TableData.hpp" +#include "fileIO/Table/TableFormatter.hpp" +#include "common/LifoStorageCommon.hpp" +#include "common/MemoryInfos.hpp" +#include // TPL includes #include +#include +#include +#include "umpire/util/MemoryResourceTraits.hpp" +#include "umpire/util/Platform.hpp" #if defined( GEOSX_USE_CALIPER ) #include @@ -46,13 +55,11 @@ #if defined( GEOS_USE_HIP ) #include #endif - #include namespace geos { - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void setupLogger() { @@ -248,7 +255,9 @@ void finalizeCaliper() static void addUmpireHighWaterMarks() { umpire::ResourceManager & rm = umpire::ResourceManager::getInstance(); - + integer size; + MPI_Comm_size( MPI_COMM_WORLD, &size ); + size_t nbRank = (std::size_t)size; // Get a list of all the allocators and sort it so that it's in the same order on each rank. std::vector< string > allocatorNames = rm.getAllocatorNames(); std::sort( allocatorNames.begin(), allocatorNames.end() ); @@ -264,9 +273,9 @@ static void addUmpireHighWaterMarks() } // Loop over the allocators. - constexpr int MAX_NAME_LENGTH = 100; - char allocatorNameBuffer[ MAX_NAME_LENGTH + 1 ]; - char allocatorNameMinCharsBuffer[ MAX_NAME_LENGTH + 1 ]; + unsigned MAX_NAME_LENGTH = 100; + + TableData tableData; for( string const & allocatorName : allocatorNames ) { // Skip umpire internal allocators. @@ -274,33 +283,74 @@ static void addUmpireHighWaterMarks() continue; GEOS_ERROR_IF_GT( allocatorName.size(), MAX_NAME_LENGTH ); + string allocatorNameFixedSize = allocatorName; + allocatorNameFixedSize.resize( MAX_NAME_LENGTH, '\0' ); + string allocatorNameMinChars = string( MAX_NAME_LENGTH, '\0' ); - memset( allocatorNameBuffer, '\0', sizeof( allocatorNameBuffer ) ); - memcpy( allocatorNameBuffer, allocatorName.data(), allocatorName.size() ); + // Make sure that each rank is looking at the same allocator. + MpiWrapper::allReduce( allocatorNameFixedSize.c_str(), &allocatorNameMinChars.front(), MAX_NAME_LENGTH, MPI_MIN, MPI_COMM_GEOSX ); + if( allocatorNameFixedSize != allocatorNameMinChars ) + { + GEOS_WARNING( "Not all ranks have an allocator named " << allocatorNameFixedSize << ", cannot compute high water mark." ); + continue; + } - memset( allocatorNameMinCharsBuffer, '\0', sizeof( allocatorNameMinCharsBuffer ) ); + umpire::Allocator allocator = rm.getAllocator( allocatorName ); + umpire::strategy::AllocationStrategy const * allocationStrategy = allocator.getAllocationStrategy(); + umpire::MemoryResourceTraits const traits = allocationStrategy->getTraits(); + umpire::MemoryResourceTraits::resource_type resourceType = traits.resource; + MemoryInfos const memInfos( resourceType ); - // Make sure that each rank is looking at the same allocator. - MpiWrapper::allReduce( allocatorNameBuffer, allocatorNameMinCharsBuffer, MAX_NAME_LENGTH, MPI_MIN, MPI_COMM_GEOSX ); - if( strcmp( allocatorNameBuffer, allocatorNameMinCharsBuffer ) != 0 ) + if( !memInfos.isPhysicalMemoryHandled() ) { - GEOS_WARNING( "Not all ranks have an allocator named " << allocatorNameBuffer << ", cannot compute high water mark." ); continue; } // Get the total number of bytes allocated with this allocator across ranks. // This is a little redundant since - std::size_t const mark = rm.getAllocator( allocatorName ).getHighWatermark(); - std::size_t const totalMark = MpiWrapper::sum( mark ); + std::size_t const mark = allocator.getHighWatermark(); + std::size_t const minMark = MpiWrapper::min( mark ); std::size_t const maxMark = MpiWrapper::max( mark ); - GEOS_LOG_RANK_0( "Umpire " << std::setw( 15 ) << allocatorName << " sum across ranks: " << - std::setw( 9 ) << LvArray::system::calculateSize( totalMark ) ); - GEOS_LOG_RANK_0( "Umpire " << std::setw( 15 ) << allocatorName << " rank max: " << - std::setw( 9 ) << LvArray::system::calculateSize( maxMark ) ); + std::size_t const sumMark = MpiWrapper::sum( mark ); + + string percentage; + if( memInfos.getTotalMemory() == 0 ) + { + percentage = 0.0; + GEOS_WARNING( "umpire memory percentage could not be resolved" ); + } + else + { + percentage = GEOS_FMT( "({:.1f}%)", ( 100.0f * (float)mark ) / (float)memInfos.getTotalMemory() ); + } + + string const minMarkValue = GEOS_FMT( "{} {:>8}", + LvArray::system::calculateSize( minMark ), percentage ); + string const maxMarkValue = GEOS_FMT( "{} {:>8}", + LvArray::system::calculateSize( maxMark ), percentage ); + string const avgMarkValue = GEOS_FMT( "{} {:>8}", + LvArray::system::calculateSize( sumMark / nbRank ), percentage ); + string const sumMarkValue = GEOS_FMT( "{} {:>8}", + LvArray::system::calculateSize( sumMark ), percentage ); + + tableData.addRow( allocatorName, + minMarkValue, + maxMarkValue, + avgMarkValue, + sumMarkValue ); pushStatsIntoAdiak( allocatorName + " sum across ranks", mark ); pushStatsIntoAdiak( allocatorName + " rank max", mark ); } + + TableLayout const memoryStatLayout ( {"Umpire Memory Pool\n(reserved / % over total)", + "Min over ranks", + "Max over ranks", + "Avg over ranks", + "Sum over ranks" } ); + TableTextFormatter const memoryStatLog( memoryStatLayout ); + + GEOS_LOG_RANK_0( memoryStatLog.toString( tableData )); } @@ -324,5 +374,4 @@ void cleanupEnvironment() finalizeMPI(); } - } // namespace geos From 8ef428e9eed65f4455785b194aca7aed707407d7 Mon Sep 17 00:00:00 2001 From: "Victor A. P. Magri" <50467563+victorapm@users.noreply.github.com> Date: Tue, 2 Jul 2024 20:32:21 -0400 Subject: [PATCH 2/5] Host configs for new LLNL machines + cuda12 (#3067) * Add cuda-12 host-config for lassen * Add ESSL_DIR variable * Add dane and ruby host configs * add new cuda12 job. --------- Co-authored-by: Matteo Cusini Co-authored-by: Randolph Settgast --- .devcontainer/devcontainer.json | 2 +- .github/workflows/ci_tests.yml | 11 ++++ host-configs/LLNL/dane-gcc-12.cmake | 9 +++ host-configs/LLNL/lassen-base.cmake | 11 ++-- .../LLNL/lassen-clang-13-cuda-12.cmake | 25 ++++++++ ...{quartz-base.cmake => llnl-cpu-base.cmake} | 37 ++++++------ host-configs/LLNL/quartz-clang-14.cmake | 10 ---- host-configs/LLNL/quartz-gcc-12.cmake | 16 ------ host-configs/LLNL/quartz-icc-19.cmake | 24 -------- host-configs/LLNL/ruby-clang-14.cmake | 6 ++ host-configs/LLNL/ruby-gcc-12.cmake | 9 +++ host-configs/environment.cmake | 8 +++ .../thirdparty/SetupGeosxThirdParty.cmake | 57 +++++++++++-------- 13 files changed, 128 insertions(+), 97 deletions(-) create mode 100644 host-configs/LLNL/dane-gcc-12.cmake create mode 100644 host-configs/LLNL/lassen-clang-13-cuda-12.cmake rename host-configs/LLNL/{quartz-base.cmake => llnl-cpu-base.cmake} (79%) delete mode 100644 host-configs/LLNL/quartz-clang-14.cmake delete mode 100644 host-configs/LLNL/quartz-gcc-12.cmake delete mode 100644 host-configs/LLNL/quartz-icc-19.cmake create mode 100644 host-configs/LLNL/ruby-clang-14.cmake create mode 100644 host-configs/LLNL/ruby-gcc-12.cmake diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3ca6152d8da..7640cb6bd49 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "build": { "dockerfile": "Dockerfile", "args": { - "GEOS_TPL_TAG": "262-349" + "GEOS_TPL_TAG": "270-418" } }, "runArgs": [ diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 27517eb59e8..7396cf889b9 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -284,6 +284,17 @@ jobs: DOCKER_RUN_ARGS: "--cpus=8 --memory=128g --runtime=nvidia -v /etc/pki/ca-trust/source/anchors/:/etc/pki/ca-trust/source/anchors/llnl:ro" DOCKER_CERTS_DIR: "/etc/pki/ca-trust/source/anchors" DOCKER_CERTS_UPDATE_COMMAND: "update-ca-trust" + + # compiler error in ElasticFirstOrderWaveEquationSEMKernel::StressComputation::launch in call to FE_TYPE::computeFirstOrderStiffnessTermX + # - name: Rockylinux (8, clang 17.0.6, cuda 12.5) + # BUILD_AND_TEST_CLI_ARGS: "--no-run-unit-tests --no-install-schema" + # CMAKE_BUILD_TYPE: Release + # DOCKER_REPOSITORY: geosx/rockylinux8-clang17-cuda12.5 + # RUNS_ON: streak2 + # NPROC: 2 + # DOCKER_RUN_ARGS: "--cpus=1 --memory=128g --runtime=nvidia -v /etc/pki/ca-trust/source/anchors/:/etc/pki/ca-trust/source/anchors/llnl:ro" + # DOCKER_CERTS_DIR: "/etc/pki/ca-trust/source/anchors" + # DOCKER_CERTS_UPDATE_COMMAND: "update-ca-trust" # Below this line, jobs that deploy to Google Cloud. - name: Pecan GPU (centos 7.7, gcc 8.2.0, open-mpi 4.0.1, mkl 2019.5, cuda 11.5.119) diff --git a/host-configs/LLNL/dane-gcc-12.cmake b/host-configs/LLNL/dane-gcc-12.cmake new file mode 100644 index 00000000000..c7cd796b8ab --- /dev/null +++ b/host-configs/LLNL/dane-gcc-12.cmake @@ -0,0 +1,9 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../../src/coreComponents/LvArray/host-configs/LLNL/dane-gcc-12.cmake) + +# MPI +set(MPI_HOME /usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-12.1.1-magic CACHE PATH "") + +# ATS +set(ATS_ARGUMENTS "--machine slurm112" CACHE STRING "") + +include(${CMAKE_CURRENT_LIST_DIR}/llnl-cpu-base.cmake) diff --git a/host-configs/LLNL/lassen-base.cmake b/host-configs/LLNL/lassen-base.cmake index 0aa8696dac3..79d08057de3 100644 --- a/host-configs/LLNL/lassen-base.cmake +++ b/host-configs/LLNL/lassen-base.cmake @@ -31,15 +31,16 @@ set(ENABLE_CUDA_NVTOOLSEXT OFF CACHE BOOL "") # ESSL set(ENABLE_ESSL ON CACHE BOOL "" FORCE ) -set(ESSL_INCLUDE_DIRS /usr/tcetmp/packages/essl/essl-6.3.0.2/include CACHE STRING "" FORCE ) -set(ESSL_LIBRARIES /usr/tcetmp/packages/essl/essl-6.3.0.2/lib64/libesslsmpcuda.so +set(ESSL_DIR /usr/tcetmp/packages/essl/essl-6.3.0.2 CACHE STRING "" FORCE ) +set(ESSL_INCLUDE_DIRS ${ESSL_DIR}/include CACHE STRING "" FORCE ) +set(ESSL_LIBRARIES ${ESSL_DIR}/lib64/libesslsmpcuda.so ${CUDA_TOOLKIT_ROOT_DIR}/lib64/libcublas.so ${CUDA_TOOLKIT_ROOT_DIR}/lib64/libcublasLt.so ${CUDA_TOOLKIT_ROOT_DIR}/lib64/libcudart.so - /usr/tcetmp/packages/essl/essl-6.3.0.2/lib64/liblapackforessl.so - /usr/tcetmp/packages/essl/essl-6.3.0.2/lib64/liblapackforessl_.so + ${ESSL_DIR}/lib64/liblapackforessl.so + ${ESSL_DIR}/lib64/liblapackforessl_.so CACHE PATH "" FORCE ) - + # TPL set(ENABLE_PAPI OFF CACHE BOOL "") set(SILO_BUILD_TYPE powerpc64-unknown-linux-gnu CACHE STRING "") diff --git a/host-configs/LLNL/lassen-clang-13-cuda-12.cmake b/host-configs/LLNL/lassen-clang-13-cuda-12.cmake new file mode 100644 index 00000000000..14ee23d0c81 --- /dev/null +++ b/host-configs/LLNL/lassen-clang-13-cuda-12.cmake @@ -0,0 +1,25 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../../src/coreComponents/LvArray/host-configs/LLNL/lassen-clang-13-cuda-12.cmake) + +# Fortran +set(CMAKE_Fortran_COMPILER /usr/tce/packages/gcc/gcc-8.3.1/bin/gfortran CACHE PATH "") +set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -mtune=power9" CACHE STRING "") +set(FORTRAN_MANGLE_NO_UNDERSCORE ON CACHE BOOL "") +set(OpenMP_Fortran_FLAGS "-fopenmp" CACHE STRING "") +set(OpenMP_Fortran_LIB_NAMES "" CACHE STRING "") + +# MPI +set(MPI_HOME /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-13.0.1-gcc-8.3.1/ CACHE PATH "") +set(MPI_Fortran_COMPILER /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1/bin/mpifort CACHE PATH "") + +include(${CMAKE_CURRENT_LIST_DIR}/lassen-base.cmake) + +# Overwrite options set on lassen-base.cmake +set(ENABLE_OPENMP OFF CACHE BOOL "" FORCE) +set(ENABLE_CUDA_NVTOOLSEXT ON CACHE BOOL "") + +# Overwrite ESSL defaults from lassen-base.cmake +# Reason: libesslsmpcuda.so depends on cuda-11 +set(ESSL_LIBRARIES ${ESSL_DIR}/lib64/libessl.so + ${ESSL_DIR}/lib64/liblapackforessl.so + ${ESSL_DIR}/lib64/liblapackforessl_.so + CACHE PATH "" FORCE ) diff --git a/host-configs/LLNL/quartz-base.cmake b/host-configs/LLNL/llnl-cpu-base.cmake similarity index 79% rename from host-configs/LLNL/quartz-base.cmake rename to host-configs/LLNL/llnl-cpu-base.cmake index 25973d661e8..58847109bac 100644 --- a/host-configs/LLNL/quartz-base.cmake +++ b/host-configs/LLNL/llnl-cpu-base.cmake @@ -1,6 +1,6 @@ ############################################################################### # -# Base configuration for LC Quartz builds +# Base configuration for LC cpu builds # Calling configuration file must define the following CMAKE variables: # # MPI_HOME @@ -10,6 +10,24 @@ # Fortran set(ENABLE_FORTRAN OFF CACHE BOOL "") +# Fortran +set(CMAKE_Fortran_COMPILER /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran CACHE PATH "") +set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -march=native -mtune=native" CACHE STRING "") + +# PYGEOSX +set(ENABLE_PYGEOSX ON CACHE BOOL "") +set(Python3_ROOT_DIR /usr/gapps/GEOSX/thirdPartyLibs/python/quartz-gcc-python/python CACHE PATH "") +set(Python3_EXECUTABLE ${Python3_ROOT_DIR}/bin/python3 CACHE PATH "") + +# YAPF python formatting +set(YAPF_EXECUTABLE /usr/gapps/GEOSX/thirdPartyLibs/python/quartz-gcc-python/python/bin/yapf CACHE PATH "" FORCE) + +# Sphinx +set(SPHINX_EXECUTABLE /usr/gapps/GEOSX/thirdPartyLibs/python/quartz-gcc-python/python/bin/sphinx-build CACHE PATH "" FORCE) + +# ATS +set(ATS_ARGUMENTS "--machine slurm56" CACHE STRING "") + # MPI set(ENABLE_MPI ON CACHE BOOL "") set(MPI_C_COMPILER ${MPI_HOME}/bin/mpicc CACHE PATH "") @@ -20,7 +38,7 @@ set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") # PAPI (For TPL caliper builds) set(ENABLE_PAPI ON CACHE BOOL "") -set(PAPI_PREFIX /usr/tce/packages/papi/papi-5.4.3 CACHE PATH "") +set(PAPI_PREFIX /usr/tce/packages/papi/papi-6.0.0.1/ CACHE PATH "") # OpenMP set(ENABLE_OPENMP ON CACHE BOOL "") @@ -31,16 +49,9 @@ set(ENABLE_PETSC OFF CACHE BOOL "Enables PETSc." FORCE) # PYGEOSX set(ENABLE_PYGEOSX ON CACHE BOOL "") -set(Python3_ROOT_DIR /usr/gapps/GEOSX/thirdPartyLibs/python/quartz-gcc-python/python CACHE PATH "") +set(Python3_ROOT_DIR /usr/apps/python-3.11.5 CACHE PATH "") set(Python3_EXECUTABLE ${Python3_ROOT_DIR}/bin/python3 CACHE PATH "") -# YAPF python formatting -set(YAPF_EXECUTABLE /usr/gapps/GEOSX/thirdPartyLibs/python/quartz-gcc-python/python/bin/yapf CACHE PATH "" FORCE) - -# Sphinx -set(SPHINX_EXECUTABLE /usr/gapps/GEOSX/thirdPartyLibs/python/quartz-gcc-python/python/bin/sphinx-build CACHE PATH "" FORCE) - - # caliper set(ENABLE_CALIPER ON CACHE BOOL "" FORCE) set(ENABLE_CALIPER_HYPRE ON CACHE BOOL "" FORCE) @@ -55,13 +66,7 @@ set(MKL_LIBRARIES ${MKL_ROOT}/lib/intel64/libmkl_intel_lp64.so CACHE STRING "") # ATS -set(ATS_ARGUMENTS "--machine slurm36" CACHE STRING "") set(USER $ENV{USER} CACHE STRING "") set(ATS_WORKING_DIR "/p/lustre2/${USER}/integratedTestsGEOS/${CONFIG_NAME}" CACHE PATH "") set(ATS_BASELINE_DIR "/p/lustre2/${USER}/integratedTestsGEOS/baselines" CACHE PATH "") - -# Temporary argument for python module change testing -# set(GEOS_PYTHON_PACKAGES_BRANCH "feature/sherman/outOfPlaceATS" CACHE STRING "" FORCE) - - include(${CMAKE_CURRENT_LIST_DIR}/../tpls.cmake) diff --git a/host-configs/LLNL/quartz-clang-14.cmake b/host-configs/LLNL/quartz-clang-14.cmake deleted file mode 100644 index 797e6acb2f3..00000000000 --- a/host-configs/LLNL/quartz-clang-14.cmake +++ /dev/null @@ -1,10 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../../src/coreComponents/LvArray/host-configs/LLNL/quartz-clang-14.cmake) - -# Fortran -set(CMAKE_Fortran_COMPILER /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran CACHE PATH "") -set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -march=native -mtune=native" CACHE STRING "") - -# MPI -set(MPI_HOME /usr/tce/packages/mvapich2/mvapich2-2.3.6-clang-14.0.6-magic CACHE PATH "") - -include(${CMAKE_CURRENT_LIST_DIR}/quartz-base.cmake) diff --git a/host-configs/LLNL/quartz-gcc-12.cmake b/host-configs/LLNL/quartz-gcc-12.cmake deleted file mode 100644 index a4e92537ad6..00000000000 --- a/host-configs/LLNL/quartz-gcc-12.cmake +++ /dev/null @@ -1,16 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../../src/coreComponents/LvArray/host-configs/LLNL/quartz-gcc-12.cmake) - -# C++ -# The "-march=native -mtune=native" which LvArray adds breaks the PVT package. -set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) - -# Fortran -set(CMAKE_Fortran_COMPILER /usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran CACHE PATH "") -set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -march=native -mtune=native" CACHE STRING "") - -# MPI -set(MPI_HOME /usr/tce/packages/mvapich2/mvapich2-2.3.6-gcc-12.1.1-magic CACHE PATH "") - -set(ENABLE_TRILINOS OFF CACHE BOOL "" FORCE) - -include(${CMAKE_CURRENT_LIST_DIR}/quartz-base.cmake) diff --git a/host-configs/LLNL/quartz-icc-19.cmake b/host-configs/LLNL/quartz-icc-19.cmake deleted file mode 100644 index a18d3f3da03..00000000000 --- a/host-configs/LLNL/quartz-icc-19.cmake +++ /dev/null @@ -1,24 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../../src/coreComponents/LvArray/host-configs/LLNL/quartz-icc-19.cmake) - -# Fortran -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/bin/intel64/ifort CACHE PATH "") -set(CMAKE_Fortran_FLAGS_RELEASE "-DNDEBUG -march=native -mtune=native -qoverride-limits" CACHE STRING "") -set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g ${CMAKE_Fortran_FLAGS_RELEASE}" CACHE STRING "") - -# MPI -set(MPI_HOME /usr/tce/packages/mvapich2/mvapich2-2.3-intel-19.0.4 CACHE PATH "") - -# GEOSX specific options -set(ENABLE_XML_UPDATES OFF CACHE BOOL "") - -# MKL -set(ENABLE_MKL ON CACHE BOOL "") -set(MKL_ROOT /usr/tce/packages/mkl/mkl-2019.0) -set(MKL_INCLUDE_DIRS ${MKL_ROOT}/include CACHE STRING "") -set(MKL_LIBRARIES ${MKL_ROOT}/lib/libmkl_intel_lp64.so - ${MKL_ROOT}/lib/libmkl_intel_thread.so - ${MKL_ROOT}/lib/libmkl_core.so - ${COMPILER_DIR}/compiler/lib/intel64/libiomp5.so - CACHE STRING "") - -include(${CMAKE_CURRENT_LIST_DIR}/quartz-base.cmake) diff --git a/host-configs/LLNL/ruby-clang-14.cmake b/host-configs/LLNL/ruby-clang-14.cmake new file mode 100644 index 00000000000..39b8409ba64 --- /dev/null +++ b/host-configs/LLNL/ruby-clang-14.cmake @@ -0,0 +1,6 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../../src/coreComponents/LvArray/host-configs/LLNL/ruby-clang-14.cmake) + +# MPI +set(MPI_HOME /usr/tce/packages/mvapich2/mvapich2-2.3.7-clang-14.0.6-magic CACHE PATH "") + +include(${CMAKE_CURRENT_LIST_DIR}/llnl-cpu-base.cmake) diff --git a/host-configs/LLNL/ruby-gcc-12.cmake b/host-configs/LLNL/ruby-gcc-12.cmake new file mode 100644 index 00000000000..2c369280809 --- /dev/null +++ b/host-configs/LLNL/ruby-gcc-12.cmake @@ -0,0 +1,9 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../../src/coreComponents/LvArray/host-configs/LLNL/ruby-gcc-12.cmake) + +# MPI +set(MPI_HOME /usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-12.1.1-magic CACHE PATH "") + +# ATS +set(ATS_ARGUMENTS "--machine slurm56" CACHE STRING "") + +include(${CMAKE_CURRENT_LIST_DIR}/llnl-cpu-base.cmake) diff --git a/host-configs/environment.cmake b/host-configs/environment.cmake index c4db8c745a2..33a3b52fa6b 100644 --- a/host-configs/environment.cmake +++ b/host-configs/environment.cmake @@ -70,5 +70,13 @@ if(ENABLE_CUDA) endif() +if(DEFINED ENV{BLAS_LIBRARIES}) + set(BLAS_LIBRARIES "$ENV{BLAS_LIBRARIES}" CACHE PATH "" FORCE) +endif() + +if(DEFINED ENV{LAPACK_LIBRARIES}) + set(LAPACK_LIBRARIES "$ENV{LAPACK_LIBRARIES}" CACHE PATH "" FORCE) +endif() + set(GEOSX_TPL_DIR "$ENV{GEOSX_TPL_DIR}" CACHE PATH "" FORCE) include(${CMAKE_CURRENT_LIST_DIR}/tpls.cmake) diff --git a/src/cmake/thirdparty/SetupGeosxThirdParty.cmake b/src/cmake/thirdparty/SetupGeosxThirdParty.cmake index 9fa1eab84c4..7fa1e0c194a 100644 --- a/src/cmake/thirdparty/SetupGeosxThirdParty.cmake +++ b/src/cmake/thirdparty/SetupGeosxThirdParty.cmake @@ -285,6 +285,14 @@ else() mandatory_tpl_doesnt_exist("pugixml" PUGIXML_DIR) endif() +################################ +# CUDA +################################ +if ( ENABLE_CUDA) + find_package(CUDAToolkit REQUIRED) + message( " ----> $CUDAToolkit_VERSION = ${CUDAToolkit_VERSION}") +endif() + ################################ # CAMP ( required before raja on crusher / using spack installed tpls ) ################################ @@ -631,41 +639,45 @@ endif() if(DEFINED HYPRE_DIR AND ENABLE_HYPRE) message(STATUS "HYPRE_DIR = ${HYPRE_DIR}") - set( HYPRE_DEPENDS blas lapack umpire) + set( HYPRE_DEPENDS blas lapack umpire ) if( ENABLE_SUPERLU_DIST ) - set( HYPRE_DEPENDS ${HYPRE_DEPENDS} superlu_dist ) + list( APPEND HYPRE_DEPENDS superlu_dist ) endif() if( ${ENABLE_HYPRE_DEVICE} STREQUAL "CUDA" ) - set( EXTRA_LIBS ${CUDA_cusparse_LIBRARY} ${CUDA_cublas_LIBRARY} ${CUDA_curand_LIBRARY} ${CUDA_cusolver_LIBRARY} ) + list( APPEND HYPRE_DEPENDS CUDA::cusparse CUDA::cublas CUDA::curand CUDA::cusolver ) + + # Add libnvJitLink when using CUDA >= 12.2.2. Note: requires cmake >= 3.26 + if( CUDAToolkit_VERSION VERSION_GREATER_EQUAL "12.2.2" ) + list( APPEND HYPRE_DEPENDS CUDA::nvJitLink ) + endif() elseif( ${ENABLE_HYPRE_DEVICE} STREQUAL "HIP" ) find_package( rocblas REQUIRED ) find_package( rocsolver REQUIRED ) find_package( rocsparse REQUIRED ) find_package( rocrand REQUIRED ) - set( HYPRE_DEPENDS ${HYPRE_DEPENDS} roc::rocblas roc::rocsparse roc::rocsolver roc::rocrand ) + append( APPEND HYPRE_DEPENDS roc::rocblas roc::rocsparse roc::rocsolver roc::rocrand ) endif( ) - find_and_import(NAME hypre - INCLUDE_DIRECTORIES ${HYPRE_DIR}/include - LIBRARY_DIRECTORIES ${HYPRE_DIR}/lib - HEADER HYPRE.h - LIBRARIES HYPRE - EXTRA_LIBRARIES ${EXTRA_LIBS} - DEPENDS ${HYPRE_DEPENDS}) + find_and_import( NAME hypre + INCLUDE_DIRECTORIES ${HYPRE_DIR}/include + LIBRARY_DIRECTORIES ${HYPRE_DIR}/lib + HEADER HYPRE.h + LIBRARIES HYPRE + DEPENDS ${HYPRE_DEPENDS} ) extract_version_from_header( NAME hypre HEADER "${HYPRE_DIR}/include/HYPRE_config.h" VERSION_STRING "HYPRE_RELEASE_VERSION" ) # Extract some additional information about development version of hypre - file(READ ${HYPRE_DIR}/include/HYPRE_config.h header_file) - if("${header_file}" MATCHES "HYPRE_DEVELOP_STRING *\"([^\"]*)\"") - set(hypre_dev_string "${CMAKE_MATCH_1}") - if("${header_file}" MATCHES "HYPRE_BRANCH_NAME *\"([^\"]*)\"") - set(hypre_dev_branch "${CMAKE_MATCH_1}") + file( READ ${HYPRE_DIR}/include/HYPRE_config.h header_file ) + if( "${header_file}" MATCHES "HYPRE_DEVELOP_STRING *\"([^\"]*)\"" ) + set( hypre_dev_string "${CMAKE_MATCH_1}" ) + if( "${header_file}" MATCHES "HYPRE_BRANCH_NAME *\"([^\"]*)\"" ) + set( hypre_dev_branch "${CMAKE_MATCH_1}" ) endif() - set(hypre_VERSION "${hypre_dev_string} (${hypre_dev_branch})" CACHE STRING "" FORCE) - message(" ----> hypre_VERSION = ${hypre_VERSION}") + set( hypre_VERSION "${hypre_dev_string} (${hypre_dev_branch})" CACHE STRING "" FORCE ) + message( " ----> hypre_VERSION = ${hypre_VERSION}" ) endif() # Prepend Hypre to link flags, fix for Umpire appearing before Hypre on the link line @@ -682,8 +694,8 @@ if(DEFINED HYPRE_DIR AND ENABLE_HYPRE) # set(ENABLE_HYPRE ON CACHE BOOL "") # endif() - set(ENABLE_HYPRE ON CACHE BOOL "") - set(thirdPartyLibs ${thirdPartyLibs} hypre ${HYPRE_DEPENDS} ) + set( ENABLE_HYPRE ON CACHE BOOL "" ) + set( thirdPartyLibs ${thirdPartyLibs} hypre ${HYPRE_DEPENDS} ) else() if(ENABLE_HYPRE) message(WARNING "ENABLE_HYPRE is ON but HYPRE_DIR isn't defined.") @@ -907,12 +919,7 @@ message(STATUS "thirdPartyLibs = ${thirdPartyLibs}") # NvToolExt ############################### if ( ENABLE_CUDA AND ENABLE_CUDA_NVTOOLSEXT ) - find_package(CUDAToolkit REQUIRED) - - message( " ----> $CUDAToolkit_VERSION = ${CUDAToolkit_VERSION}") - set(thirdPartyLibs ${thirdPartyLibs} CUDA::nvToolsExt) endif() message(STATUS "thirdPartyLibs = ${thirdPartyLibs}") - From 1d43a2bc087b725dfb423a511f237347e965ec7f Mon Sep 17 00:00:00 2001 From: Randolph Settgast Date: Wed, 3 Jul 2024 02:19:09 +0100 Subject: [PATCH 3/5] update LvArray submodule hash (#3208) --- src/coreComponents/LvArray | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/LvArray b/src/coreComponents/LvArray index 7aace428c3e..1d2490252c5 160000 --- a/src/coreComponents/LvArray +++ b/src/coreComponents/LvArray @@ -1 +1 @@ -Subproject commit 7aace428c3ead5df5edbd9980d736fc95ee08da8 +Subproject commit 1d2490252c5cc97f87c9da0f5dd305e66f62f2c2 From 390b3565713bd6f567e8e6636c06cbd75d9aa8e6 Mon Sep 17 00:00:00 2001 From: Dickson Kachuma <81433670+dkachuma@users.noreply.github.com> Date: Tue, 2 Jul 2024 23:27:57 -0500 Subject: [PATCH 4/5] Remove EOS template parameter from compositional fluid model (#3166) * Add generic parameters * Fix LBC test * Add EOS parameters to flash --------- Co-authored-by: Pavel Tomin --- .../constitutive/CMakeLists.txt | 8 +- .../fluid/multifluid/MultiFluidSelector.hpp | 12 +- .../CompositionalMultiphaseFluid.cpp | 45 +- .../CompositionalMultiphaseFluid.hpp | 27 +- .../PVTDriverRunTestCompositionalSRK.cpp | 26 - .../PVTDriverRunTestCompositionalSRKLBC.cpp | 26 - ...ompositionalTwoPhaseConstantViscosity.cpp} | 6 +- ...onalTwoPhaseLohrenzBrayClarkViscosity.cpp} | 6 +- .../functions/FugacityCalculator.hpp | 154 ++++ .../functions/NegativeTwoPhaseFlash.hpp | 713 ++++++++++-------- .../compositional/functions/StabilityTest.hpp | 47 +- .../models/CompositionalDensity.cpp | 48 +- .../models/CompositionalDensity.hpp | 120 ++- .../compositional/models/EquationOfState.hpp | 105 +++ .../models/LohrenzBrayClarkViscosity.hpp | 2 +- .../models/NegativeTwoPhaseFlashModel.cpp | 49 +- .../models/NegativeTwoPhaseFlashModel.hpp | 77 +- .../unitTests/testCompositionalDensity.cpp | 32 +- .../testLohrenzBrayClarkViscosity.cpp | 16 +- .../unitTests/testNegativeTwoPhaseFlash.cpp | 26 +- .../testNegativeTwoPhaseFlash9Comp.cpp | 38 +- .../unitTests/testStabilityTest2Comp.cpp | 21 +- .../unitTests/testStabilityTest9Comp.cpp | 43 +- ...son.rst => CompositionalTwoPhaseFluid.rst} | 3 + ...sitionalTwoPhaseFluidLohrenzBrayClark.rst} | 3 + ...alTwoPhaseFluidLohrenzBrayClark_other.rst} | 0 ...sitionalTwoPhaseFluidSoaveRedlichKwong.rst | 19 - ...ionalTwoPhaseFluidSoaveRedlichKwongLBC.rst | 23 - ...woPhaseFluidSoaveRedlichKwongLBC_other.rst | 31 - ...alTwoPhaseFluidSoaveRedlichKwong_other.rst | 31 - ...t => CompositionalTwoPhaseFluid_other.rst} | 0 .../schema/docs/Constitutive.rst | 176 +++-- .../schema/docs/Constitutive_other.rst | 176 +++-- src/coreComponents/schema/schema.xsd | 87 +-- src/coreComponents/schema/schema.xsd.other | 106 +-- .../testPVT_Compositional.xml | 12 +- src/docs/sphinx/CompleteXMLSchema.rst | 60 +- 37 files changed, 1251 insertions(+), 1123 deletions(-) delete mode 100644 src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRK.cpp delete mode 100644 src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRKLBC.cpp rename src/coreComponents/constitutive/fluid/multifluid/compositional/{PVTDriverRunTestCompositionalPRLBC.cpp => PVTDriverRunTestCompositionalTwoPhaseConstantViscosity.cpp} (83%) rename src/coreComponents/constitutive/fluid/multifluid/compositional/{PVTDriverRunTestCompositionalPR.cpp => PVTDriverRunTestCompositionalTwoPhaseLohrenzBrayClarkViscosity.cpp} (81%) create mode 100644 src/coreComponents/constitutive/fluid/multifluid/compositional/functions/FugacityCalculator.hpp create mode 100644 src/coreComponents/constitutive/fluid/multifluid/compositional/models/EquationOfState.hpp rename src/coreComponents/schema/docs/{CompositionalTwoPhaseFluidPengRobinson.rst => CompositionalTwoPhaseFluid.rst} (83%) rename src/coreComponents/schema/docs/{CompositionalTwoPhaseFluidPengRobinsonLBC.rst => CompositionalTwoPhaseFluidLohrenzBrayClark.rst} (86%) rename src/coreComponents/schema/docs/{CompositionalTwoPhaseFluidPengRobinsonLBC_other.rst => CompositionalTwoPhaseFluidLohrenzBrayClark_other.rst} (100%) delete mode 100644 src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwong.rst delete mode 100644 src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwongLBC.rst delete mode 100644 src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwongLBC_other.rst delete mode 100644 src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwong_other.rst rename src/coreComponents/schema/docs/{CompositionalTwoPhaseFluidPengRobinson_other.rst => CompositionalTwoPhaseFluid_other.rst} (100%) diff --git a/src/coreComponents/constitutive/CMakeLists.txt b/src/coreComponents/constitutive/CMakeLists.txt index fad11918dca..4b9bd811ef6 100644 --- a/src/coreComponents/constitutive/CMakeLists.txt +++ b/src/coreComponents/constitutive/CMakeLists.txt @@ -64,6 +64,7 @@ set( constitutive_headers fluid/multifluid/compositional/functions/CompositionalProperties.hpp fluid/multifluid/compositional/functions/CompositionalPropertiesImpl.hpp fluid/multifluid/compositional/functions/CubicEOSPhaseModel.hpp + fluid/multifluid/compositional/functions/FugacityCalculator.hpp fluid/multifluid/compositional/functions/KValueInitialization.hpp fluid/multifluid/compositional/functions/NegativeTwoPhaseFlash.hpp fluid/multifluid/compositional/functions/RachfordRice.hpp @@ -71,6 +72,7 @@ set( constitutive_headers fluid/multifluid/compositional/models/ComponentProperties.hpp fluid/multifluid/compositional/models/CompositionalDensity.hpp fluid/multifluid/compositional/models/ConstantViscosity.hpp + fluid/multifluid/compositional/models/EquationOfState.hpp fluid/multifluid/compositional/models/FunctionBase.hpp fluid/multifluid/compositional/models/LohrenzBrayClarkViscosity.hpp fluid/multifluid/compositional/models/LohrenzBrayClarkViscosityImpl.hpp @@ -226,10 +228,8 @@ set( constitutive_sources fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.cpp fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp fluid/multifluid/compositional/CompositionalMultiphaseFluidUpdates.cpp - fluid/multifluid/compositional/PVTDriverRunTestCompositionalPR.cpp - fluid/multifluid/compositional/PVTDriverRunTestCompositionalPRLBC.cpp - fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRK.cpp - fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRKLBC.cpp + fluid/multifluid/compositional/PVTDriverRunTestCompositionalTwoPhaseConstantViscosity.cpp + fluid/multifluid/compositional/PVTDriverRunTestCompositionalTwoPhaseLohrenzBrayClarkViscosity.cpp fluid/multifluid/reactive/ReactiveBrineFluid.cpp fluid/multifluid/reactive/ReactiveMultiFluid.cpp fluid/multifluid/reactive/ReactiveFluidDriver.cpp diff --git a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidSelector.hpp b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidSelector.hpp index 79a1682cc1a..2e1eb17f92b 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/MultiFluidSelector.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/MultiFluidSelector.hpp @@ -51,11 +51,9 @@ void constitutiveUpdatePassThru( MultiFluidBase const & fluid, // Need to split compilation units for all the options #if !defined(GEOS_DEVICE_COMPILE) CO2BrineEzrokhiThermalFluid, - CompositionalTwoPhasePengRobinsonLBCViscosity, - CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity, + CompositionalTwoPhaseLohrenzBrayClarkViscosity, #endif - CompositionalTwoPhasePengRobinsonConstantViscosity, - CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity + CompositionalTwoPhaseConstantViscosity >::execute( fluid, std::forward< LAMBDA >( lambda ) ); } @@ -75,11 +73,9 @@ void constitutiveUpdatePassThru( MultiFluidBase & fluid, // Need to split compilation units for all the options" #if !defined(GEOS_DEVICE_COMPILE) CO2BrineEzrokhiThermalFluid, - CompositionalTwoPhasePengRobinsonLBCViscosity, - CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity, + CompositionalTwoPhaseLohrenzBrayClarkViscosity, #endif - CompositionalTwoPhasePengRobinsonConstantViscosity, - CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity + CompositionalTwoPhaseConstantViscosity >::execute( fluid, std::forward< LAMBDA >( lambda ) ); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp index 05fb49acc66..aecd47507d1 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.cpp @@ -88,19 +88,10 @@ integer CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::getWaterP return PVTProps::PVTFunctionHelpers::findName( m_phaseNames, expectedWaterPhaseNames, viewKeyStruct::phaseNamesString() ); } -// Naming conventions -namespace compositional -{ -template< int NP > struct PhaseName {}; -template<> struct PhaseName< 2 > { static constexpr char const * catalogName() { return "TwoPhase"; } }; -template<> struct PhaseName< 3 > { static constexpr char const * catalogName() { return "ThreePhase"; } }; -} - template< typename FLASH, typename PHASE1, typename PHASE2, typename PHASE3 > string CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::catalogName() { - return GEOS_FMT( "Compositional{}Fluid{}{}", - compositional::PhaseName< FLASH::KernelWrapper::getNumberOfPhases() >::catalogName(), + return GEOS_FMT( "Compositional{}Fluid{}", FLASH::catalogName(), PHASE1::Viscosity::catalogName() ); } @@ -268,39 +259,21 @@ CompositionalMultiphaseFluid< FLASH, PHASE1, PHASE2, PHASE3 >::createModelParame // Explicit instantiation of the model template. template class CompositionalMultiphaseFluid< - compositional::NegativeTwoPhaseFlashPRPR, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::ConstantViscosity, compositional::NullModel >, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::ConstantViscosity, compositional::NullModel > >; -template class CompositionalMultiphaseFluid< - compositional::NegativeTwoPhaseFlashSRKSRK, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::ConstantViscosity, compositional::NullModel >, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::ConstantViscosity, compositional::NullModel > >; + compositional::NegativeTwoPhaseFlashModel, + compositional::PhaseModel< compositional::CompositionalDensity, compositional::ConstantViscosity, compositional::NullModel >, + compositional::PhaseModel< compositional::CompositionalDensity, compositional::ConstantViscosity, compositional::NullModel > >; template class CompositionalMultiphaseFluid< - compositional::NegativeTwoPhaseFlashPRPR, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >; -template class CompositionalMultiphaseFluid< - compositional::NegativeTwoPhaseFlashSRKSRK, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >; - -REGISTER_CATALOG_ENTRY( ConstitutiveBase, - CompositionalTwoPhasePengRobinsonConstantViscosity, - string const &, - dataRepository::Group * const ) - -REGISTER_CATALOG_ENTRY( ConstitutiveBase, - CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity, - string const &, - dataRepository::Group * const ) + compositional::NegativeTwoPhaseFlashModel, + compositional::PhaseModel< compositional::CompositionalDensity, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >, + compositional::PhaseModel< compositional::CompositionalDensity, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >; REGISTER_CATALOG_ENTRY( ConstitutiveBase, - CompositionalTwoPhasePengRobinsonLBCViscosity, + CompositionalTwoPhaseConstantViscosity, string const &, dataRepository::Group * const ) REGISTER_CATALOG_ENTRY( ConstitutiveBase, - CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity, + CompositionalTwoPhaseLohrenzBrayClarkViscosity, string const &, dataRepository::Group * const ) diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp index 562b0eecf49..2c077184450 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp @@ -28,9 +28,6 @@ #include "constitutive/fluid/multifluid/compositional/models/NullModel.hpp" #include "constitutive/fluid/multifluid/compositional/models/PhaseModel.hpp" -#include "constitutive/fluid/multifluid/MultiFluidBase.hpp" -#include "constitutive/fluid/multifluid/MultiFluidUtils.hpp" - namespace geos { namespace constitutive @@ -134,22 +131,14 @@ class CompositionalMultiphaseFluid : public MultiFluidBase PhaseComp::ValueType m_kValues; }; -using CompositionalTwoPhasePengRobinsonConstantViscosity = CompositionalMultiphaseFluid< - compositional::NegativeTwoPhaseFlashPRPR, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::ConstantViscosity, compositional::NullModel >, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::ConstantViscosity, compositional::NullModel > >; -using CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity = CompositionalMultiphaseFluid< - compositional::NegativeTwoPhaseFlashSRKSRK, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::ConstantViscosity, compositional::NullModel >, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::ConstantViscosity, compositional::NullModel > >; -using CompositionalTwoPhasePengRobinsonLBCViscosity = CompositionalMultiphaseFluid< - compositional::NegativeTwoPhaseFlashPRPR, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSPR >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >; -using CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity = CompositionalMultiphaseFluid< - compositional::NegativeTwoPhaseFlashSRKSRK, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >, - compositional::PhaseModel< compositional::CompositionalDensity< compositional::CubicEOSSRK >, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >; +using CompositionalTwoPhaseConstantViscosity = CompositionalMultiphaseFluid< + compositional::NegativeTwoPhaseFlashModel, + compositional::PhaseModel< compositional::CompositionalDensity, compositional::ConstantViscosity, compositional::NullModel >, + compositional::PhaseModel< compositional::CompositionalDensity, compositional::ConstantViscosity, compositional::NullModel > >; +using CompositionalTwoPhaseLohrenzBrayClarkViscosity = CompositionalMultiphaseFluid< + compositional::NegativeTwoPhaseFlashModel, + compositional::PhaseModel< compositional::CompositionalDensity, compositional::LohrenzBrayClarkViscosity, compositional::NullModel >, + compositional::PhaseModel< compositional::CompositionalDensity, compositional::LohrenzBrayClarkViscosity, compositional::NullModel > >; } /* namespace constitutive */ diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRK.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRK.cpp deleted file mode 100644 index edcfd2af4f5..00000000000 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRK.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2018-2020 TotalEnergies - * Copyright (c) 2019- GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -/* - * PVTDriverRunTestCompositionalSRK.cpp - */ - -#include "constitutive/fluid/multifluid/PVTDriverRunTest.hpp" -#include "constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp" - -namespace geos -{ -template void PVTDriver::runTest< constitutive::CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity >( - constitutive::CompositionalTwoPhaseSoaveRedlichKwongConstantViscosity &, arrayView2d< real64 > const & ); -} diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRKLBC.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRKLBC.cpp deleted file mode 100644 index 1ab0ab8b15f..00000000000 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalSRKLBC.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2018-2020 TotalEnergies - * Copyright (c) 2019- GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -/* - * PVTDriverRunTestCompositionalSRKLBC.cpp - */ - -#include "constitutive/fluid/multifluid/PVTDriverRunTest.hpp" -#include "constitutive/fluid/multifluid/compositional/CompositionalMultiphaseFluid.hpp" - -namespace geos -{ -template void PVTDriver::runTest< constitutive::CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity >( - constitutive::CompositionalTwoPhaseSoaveRedlichKwongLBCViscosity &, arrayView2d< real64 > const & ); -} diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalPRLBC.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalTwoPhaseConstantViscosity.cpp similarity index 83% rename from src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalPRLBC.cpp rename to src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalTwoPhaseConstantViscosity.cpp index 449d4459c57..4bdc6b832e4 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalPRLBC.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalTwoPhaseConstantViscosity.cpp @@ -13,7 +13,7 @@ */ /* - * PVTDriverRunTestCompositionalPRLBC.cpp + * PVTDriverRunTestCompositionalTwoPhaseConstantViscosity.cpp */ #include "constitutive/fluid/multifluid/PVTDriverRunTest.hpp" @@ -21,6 +21,6 @@ namespace geos { -template void PVTDriver::runTest< constitutive::CompositionalTwoPhasePengRobinsonLBCViscosity >( - constitutive::CompositionalTwoPhasePengRobinsonLBCViscosity &, arrayView2d< real64 > const & ); +template void PVTDriver::runTest< constitutive::CompositionalTwoPhaseConstantViscosity >( + constitutive::CompositionalTwoPhaseConstantViscosity &, arrayView2d< real64 > const & ); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalPR.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalTwoPhaseLohrenzBrayClarkViscosity.cpp similarity index 81% rename from src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalPR.cpp rename to src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalTwoPhaseLohrenzBrayClarkViscosity.cpp index eec79c6c150..df3caa11849 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalPR.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/PVTDriverRunTestCompositionalTwoPhaseLohrenzBrayClarkViscosity.cpp @@ -13,7 +13,7 @@ */ /* - * PVTDriverRunTestCompositionalPR.cpp + * PVTDriverRunTestCompositionalTwoPhaseLohrenzBrayClarkViscosity.cpp */ #include "constitutive/fluid/multifluid/PVTDriverRunTest.hpp" @@ -21,6 +21,6 @@ namespace geos { -template void PVTDriver::runTest< constitutive::CompositionalTwoPhasePengRobinsonConstantViscosity >( - constitutive::CompositionalTwoPhasePengRobinsonConstantViscosity &, arrayView2d< real64 > const & ); +template void PVTDriver::runTest< constitutive::CompositionalTwoPhaseLohrenzBrayClarkViscosity >( + constitutive::CompositionalTwoPhaseLohrenzBrayClarkViscosity &, arrayView2d< real64 > const & ); } diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/FugacityCalculator.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/FugacityCalculator.hpp new file mode 100644 index 00000000000..8965a34d42d --- /dev/null +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/FugacityCalculator.hpp @@ -0,0 +1,154 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file FugacityCalculator.hpp + */ + +#ifndef GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_FUNCTIONS_FUGACITYCALCULATOR_HPP_ +#define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_FUNCTIONS_FUGACITYCALCULATOR_HPP_ + +#include "constitutive/fluid/multifluid/compositional/models/ComponentProperties.hpp" +#include "constitutive/fluid/multifluid/compositional/models/EquationOfState.hpp" +#include "constitutive/fluid/multifluid/compositional/functions/CubicEOSPhaseModel.hpp" + +namespace geos +{ + +namespace constitutive +{ + +namespace compositional +{ + +struct FugacityCalculator +{ + /** + * @brief Calculate the log fugacity for a phase + * @param[in] numComps number of components + * @param[in] pressure pressure + * @param[in] temperature temperature + * @param[in] composition composition of the phase + * @param[in] componentProperties The compositional component properties + * @param[in] equationOfState The equation of state + * @param[out] logFugacity the calculated log fugacity + */ + template< int USD > + GEOS_HOST_DEVICE + static void computeLogFugacity( integer const numComps, + real64 const pressure, + real64 const temperature, + arraySlice1d< real64 const, USD > const & composition, + ComponentProperties::KernelWrapper const & componentProperties, + EquationOfStateType const equationOfState, + arraySlice1d< real64 > const & logFugacity ); + + /** + * @brief Calculate the derivatives for the log fugacity for a phase + * @param[in] numComps number of components + * @param[in] pressure pressure + * @param[in] temperature temperature + * @param[in] composition composition of the phase + * @param[in] componentProperties The compositional component properties + * @param[in] equationOfState The equation of state + * @param[in] logFugacity the calculated log fugacity + * @param[out] logFugacityDerivs the calculated derivatives of the log fugacity + */ + template< int USD1, int USD2 > + GEOS_HOST_DEVICE + static void computeLogFugacityDerivatives( integer const numComps, + real64 const pressure, + real64 const temperature, + arraySlice1d< real64 const, USD1 > const & composition, + ComponentProperties::KernelWrapper const & componentProperties, + EquationOfStateType const equationOfState, + arraySlice1d< real64 const > const & logFugacity, + arraySlice2d< real64, USD2 > const & logFugacityDerivs ); +}; + +template< int USD > +GEOS_HOST_DEVICE +void FugacityCalculator::computeLogFugacity( integer const numComps, + real64 const pressure, + real64 const temperature, + arraySlice1d< real64 const, USD > const & composition, + ComponentProperties::KernelWrapper const & componentProperties, + EquationOfStateType const equationOfState, + arraySlice1d< real64 > const & logFugacity ) +{ + if( equationOfState == EquationOfStateType::PengRobinson ) + { + CubicEOSPhaseModel< PengRobinsonEOS >:: + computeLogFugacityCoefficients( numComps, + pressure, + temperature, + composition, + componentProperties, + logFugacity ); + } + else if( equationOfState == EquationOfStateType::SoaveRedlichKwong ) + { + CubicEOSPhaseModel< SoaveRedlichKwongEOS >:: + computeLogFugacityCoefficients( numComps, + pressure, + temperature, + composition, + componentProperties, + logFugacity ); + } +} + +template< int USD1, int USD2 > +GEOS_HOST_DEVICE +void FugacityCalculator::computeLogFugacityDerivatives( integer const numComps, + real64 const pressure, + real64 const temperature, + arraySlice1d< real64 const, USD1 > const & composition, + ComponentProperties::KernelWrapper const & componentProperties, + EquationOfStateType const equationOfState, + arraySlice1d< real64 const > const & logFugacity, + arraySlice2d< real64, USD2 > const & logFugacityDerivs ) +{ + if( equationOfState == EquationOfStateType::PengRobinson ) + { + CubicEOSPhaseModel< PengRobinsonEOS >:: + computeLogFugacityCoefficients( numComps, + pressure, + temperature, + composition, + componentProperties, + logFugacity, + logFugacityDerivs ); + } + else if( equationOfState == EquationOfStateType::SoaveRedlichKwong ) + { + CubicEOSPhaseModel< SoaveRedlichKwongEOS >:: + computeLogFugacityCoefficients( numComps, + pressure, + temperature, + composition, + componentProperties, + logFugacity, + logFugacityDerivs ); + } +} + +} // namespace compositional + +} // namespace constitutive + +} // namespace geos + + +#endif //GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_FUNCTIONS_FUGACITYCALCULATOR_HPP_ diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/NegativeTwoPhaseFlash.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/NegativeTwoPhaseFlash.hpp index 1b9a9a5bc57..3042b1a2c94 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/NegativeTwoPhaseFlash.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/NegativeTwoPhaseFlash.hpp @@ -19,9 +19,9 @@ #ifndef GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_FUNCTIONS_NEGATIVETWOPHASEFLASH_HPP_ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_FUNCTIONS_NEGATIVETWOPHASEFLASH_HPP_ -#include "common/DataTypes.hpp" #include "RachfordRice.hpp" #include "KValueInitialization.hpp" +#include "FugacityCalculator.hpp" #include "constitutive/fluid/multifluid/MultiFluidConstants.hpp" #include "constitutive/fluid/multifluid/compositional/models/ComponentProperties.hpp" #include "denseLinearAlgebra/interfaces/blaslapack/BlasLapackLA.hpp" @@ -32,12 +32,15 @@ namespace geos namespace constitutive { +using namespace multifluid; + namespace compositional { struct NegativeTwoPhaseFlash { - using Deriv = geos::constitutive::multifluid::DerivativeOffset; + using Deriv = multifluid::DerivativeOffset; + public: /** * @brief Perform negative two-phase EOS flash @@ -46,135 +49,27 @@ struct NegativeTwoPhaseFlash * @param[in] temperature temperature * @param[in] composition composition of the mixture * @param[in] componentProperties The compositional component properties + * @param[in] liquidEos The equation of state for the liquid phase + * @param[in] vapourEos The equation of state for the vapour phase + * @param[in/out] kValues The phase equilibrium ratios * @param[out] vapourPhaseMoleFraction the calculated vapour (gas) mole fraction * @param[out] liquidComposition the calculated liquid phase composition * @param[out] vapourComposition the calculated vapour phase composition * @return an indicator of success of the flash */ - template< typename EOS_TYPE_LIQUID, typename EOS_TYPE_VAPOUR, integer USD1, integer USD2, integer USD3 > + template< int USD1, int USD2 > GEOS_HOST_DEVICE static bool compute( integer const numComps, real64 const pressure, real64 const temperature, - arraySlice1d< real64 const, USD1 > const & composition, + arraySlice1d< real64 const > const & composition, ComponentProperties::KernelWrapper const & componentProperties, - arraySlice2d< real64, USD3 > const & kValues, + EquationOfStateType const liquidEos, + EquationOfStateType const vapourEos, + arraySlice2d< real64, USD1 > const & kValues, real64 & vapourPhaseMoleFraction, arraySlice1d< real64, USD2 > const & liquidComposition, - arraySlice1d< real64, USD2 > const & vapourComposition ) - { - constexpr integer maxNumComps = MultiFluidConstants::MAX_NUM_COMPONENTS; - stackArray1d< real64, maxNumComps > logLiquidFugacity( numComps ); - stackArray1d< real64, maxNumComps > logVapourFugacity( numComps ); - stackArray1d< real64, maxNumComps > fugacityRatios( numComps ); - stackArray1d< integer, maxNumComps > availableComponents( numComps ); - auto const & kVapourLiquid = kValues[0]; - - calculatePresentComponents( numComps, composition, availableComponents ); - - auto const presentComponents = availableComponents.toSliceConst(); - - // Initialise compositions to feed composition - for( integer ic = 0; ic < numComps; ++ic ) - { - liquidComposition[ic] = composition[ic]; - vapourComposition[ic] = composition[ic]; - } - - // Check if k-Values need to be initialised - bool needInitialisation = true; - for( integer ic = 0; ic < numComps; ++ic ) - { - if( kVapourLiquid[ic] < MultiFluidConstants::epsilon ) - { - needInitialisation = true; - break; - } - } - - bool kValueReset = true; - constexpr real64 boundsTolerance = MultiFluidConstants::SSITolerance; - if( needInitialisation ) - { - KValueInitialization::computeWilsonGasLiquidKvalue( numComps, - pressure, - temperature, - componentProperties, - kVapourLiquid ); - } - - vapourPhaseMoleFraction = RachfordRice::solve( kVapourLiquid.toSliceConst(), composition, presentComponents ); - real64 const initialVapourFraction = vapourPhaseMoleFraction; - - bool converged = false; - for( localIndex iterationCount = 0; iterationCount < MultiFluidConstants::maxSSIIterations; ++iterationCount ) - { - real64 const error = computeFugacityRatio< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >( - numComps, - pressure, - temperature, - composition, - componentProperties, - kVapourLiquid.toSliceConst(), - presentComponents, - vapourPhaseMoleFraction, - liquidComposition, - vapourComposition, - logLiquidFugacity.toSlice(), - logVapourFugacity.toSlice(), - fugacityRatios.toSlice() ); - - // Compute fugacity ratios and check convergence - converged = (error < MultiFluidConstants::fugacityTolerance); - - if( converged ) - { - break; - } - - // Update K-values - if( (vapourPhaseMoleFraction < -boundsTolerance || vapourPhaseMoleFraction > 1.0+boundsTolerance) - && 0.2 < LvArray::math::abs( vapourPhaseMoleFraction-initialVapourFraction ) - && !kValueReset ) - { - KValueInitialization::computeConstantLiquidKvalue( numComps, - pressure, - temperature, - componentProperties, - kVapourLiquid ); - kValueReset = true; - } - else - { - for( integer const ic : presentComponents ) - { - kVapourLiquid[ic] *= exp( fugacityRatios[ic] ); - } - } - } - - // Retrieve physical bounds from negative flash values - if( vapourPhaseMoleFraction < MultiFluidConstants::epsilon ) - { - vapourPhaseMoleFraction = 0.0; - for( integer ic = 0; ic < numComps; ++ic ) - { - liquidComposition[ic] = composition[ic]; - vapourComposition[ic] = composition[ic]; - } - } - else if( 1.0 - vapourPhaseMoleFraction < MultiFluidConstants::epsilon ) - { - vapourPhaseMoleFraction = 1.0; - for( integer ic = 0; ic < numComps; ++ic ) - { - liquidComposition[ic] = composition[ic]; - vapourComposition[ic] = composition[ic]; - } - } - - return converged; - } + arraySlice1d< real64, USD2 > const & vapourComposition ); /** * @brief Calculate derivatives from the two-phase negative flash @@ -183,6 +78,8 @@ struct NegativeTwoPhaseFlash * @param[in] temperature temperature * @param[in] composition composition of the mixture * @param[in] componentProperties The compositional component properties + * @param[in] liquidEos The equation of state for the liquid phase + * @param[in] vapourEos The equation of state for the vapour phase * @param[in] vapourFraction the calculated vapour (gas) mole fraction * @param[in] liquidComposition the calculated liquid phase composition * @param[in] vapourComposition the calculated vapour phase composition @@ -190,163 +87,21 @@ struct NegativeTwoPhaseFlash * @param[out] liquidCompositionDerivs derivatives of the calculated liquid phase composition * @param[out] vapourCompositionDerivs derivatives of the calculated vapour phase composition */ - template< typename EOS_TYPE_LIQUID, typename EOS_TYPE_VAPOUR, integer USD1, integer USD2 > + template< integer USD1, integer USD2, integer USD3 > GEOS_HOST_DEVICE static void computeDerivatives( integer const numComps, real64 const pressure, real64 const temperature, arraySlice1d< real64 const > const & composition, ComponentProperties::KernelWrapper const & componentProperties, - real64 const vapourFraction, + EquationOfStateType const liquidEos, + EquationOfStateType const vapourEos, + real64 const & vapourFraction, arraySlice1d< real64 const, USD1 > const & liquidComposition, arraySlice1d< real64 const, USD1 > const & vapourComposition, - arraySlice1d< real64, USD1 > const & vapourFractionDerivs, - arraySlice2d< real64, USD2 > const & liquidCompositionDerivs, - arraySlice2d< real64, USD2 > const & vapourCompositionDerivs ) - { - constexpr integer maxNumComps = MultiFluidConstants::MAX_NUM_COMPONENTS; - constexpr integer maxNumDofs = MultiFluidConstants::MAX_NUM_COMPONENTS + 2; - - integer const numDofs = numComps + 2; - - auto const setZero = []( real64 & val ) { val = 0.0; }; - LvArray::forValuesInSlice( vapourFractionDerivs, setZero ); - LvArray::forValuesInSlice( liquidCompositionDerivs, setZero ); - LvArray::forValuesInSlice( vapourCompositionDerivs, setZero ); - - // Check if we are single or 2-phase - if( vapourFraction < MultiFluidConstants::epsilon ) - { - for( integer ic = 0; ic < numComps; ++ic ) - { - liquidCompositionDerivs( ic, Deriv::dC + ic ) = 1.0; - vapourCompositionDerivs( ic, Deriv::dC + ic ) = 1.0; - } - } - else if( 1.0 - vapourFraction < MultiFluidConstants::epsilon ) - { - for( integer ic = 0; ic < numComps; ++ic ) - { - liquidCompositionDerivs( ic, Deriv::dC + ic ) = 1.0; - vapourCompositionDerivs( ic, Deriv::dC + ic ) = 1.0; - } - } - else - { - // Calculate the liquid and vapour fugacities and derivatives - stackArray1d< real64, maxNumComps > logLiquidFugacity( numComps ); - stackArray1d< real64, maxNumComps > logVapourFugacity( numComps ); - stackArray2d< real64, maxNumComps * maxNumDofs > logLiquidFugacityDerivs( numComps, numDofs ); - stackArray2d< real64, maxNumComps * maxNumDofs > logVapourFugacityDerivs( numComps, numDofs ); - - EOS_TYPE_LIQUID::computeLogFugacityCoefficients( numComps, - pressure, - temperature, - liquidComposition, - componentProperties, - logLiquidFugacity ); - EOS_TYPE_LIQUID::computeLogFugacityCoefficients( numComps, - pressure, - temperature, - liquidComposition, - componentProperties, - logLiquidFugacity, - logLiquidFugacityDerivs ); - EOS_TYPE_VAPOUR::computeLogFugacityCoefficients( numComps, - pressure, - temperature, - vapourComposition, - componentProperties, - logVapourFugacity ); - EOS_TYPE_VAPOUR::computeLogFugacityCoefficients( numComps, - pressure, - temperature, - vapourComposition, - componentProperties, - logVapourFugacity, - logVapourFugacityDerivs ); - - constexpr integer maxNumVals = 2*MultiFluidConstants::MAX_NUM_COMPONENTS+1; - integer const numVals = 2*numComps; - stackArray1d< real64, maxNumVals > b( numVals + 1 ); - stackArray1d< real64, maxNumVals > x( numVals + 1 ); - stackArray2d< real64, maxNumVals * maxNumVals > A( numVals + 1, numVals + 1 ); - - LvArray::forValuesInSlice( A.toSlice(), setZero ); - LvArray::forValuesInSlice( b.toSlice(), setZero ); - - for( integer ic = 0; ic < numComps; ++ic ) - { - integer const xi = ic; - integer const yi = ic + numComps; - integer const vi = numVals; - - integer e = ic; - A( e, xi ) = 1.0 - vapourFraction; - A( e, yi ) = vapourFraction; - A( e, vi ) = vapourComposition[ic] - liquidComposition[ic]; - - e = ic + numComps; - real64 const phiL = exp( logLiquidFugacity( ic ) ); - real64 const phiV = exp( logVapourFugacity( ic ) ); - for( integer jc = 0; jc < numComps; ++jc ) - { - integer const xj = jc; - integer const yj = jc + numComps; - real64 const dPhiLdx = logLiquidFugacityDerivs( ic, Deriv::dC+jc ); - real64 const dPhiVdy = logVapourFugacityDerivs( ic, Deriv::dC+jc ); - A( e, xj ) = liquidComposition[ic] * phiL * dPhiLdx; - A( e, yj ) = -vapourComposition[ic] * phiV * dPhiVdy; - } - A( e, xi ) += phiL; - A( e, yi ) -= phiV; - - e = numVals; - A( e, xi ) = -1.0; - A( e, yi ) = 1.0; - } - // Pressure and temperature derivatives - for( integer const pc : {Deriv::dP, Deriv::dT} ) - { - for( integer ic = 0; ic < numComps; ++ic ) - { - real64 const phiL = exp( logLiquidFugacity( ic ) ); - real64 const phiV = exp( logVapourFugacity( ic ) ); - b( ic ) = 0.0; - b( ic + numComps ) = -liquidComposition[ic] * phiL * logLiquidFugacityDerivs( ic, pc ) - + vapourComposition[ic] * phiV * logVapourFugacityDerivs( ic, pc ); - } - b( numVals ) = 0.0; - solveLinearSystem( A, b, x ); - for( integer ic = 0; ic < numComps; ++ic ) - { - liquidCompositionDerivs( ic, pc ) = x( ic ); - vapourCompositionDerivs( ic, pc ) = x( ic + numComps ); - } - vapourFractionDerivs( pc ) = x( numVals ); - } - // Composition derivatives - for( integer kc = 0; kc < numComps; ++kc ) - { - integer const pc = Deriv::dC + kc; - - for( integer ic = 0; ic < numComps; ++ic ) - { - b( ic ) = -composition[ic]; - b( ic + numComps ) = 0.0; - } - b( kc ) += 1.0; - b( numVals ) = 0.0; - solveLinearSystem( A, b, x ); - for( integer ic = 0; ic < numComps; ++ic ) - { - liquidCompositionDerivs( ic, pc ) = x( ic ); - vapourCompositionDerivs( ic, pc ) = x( ic + numComps ); - } - vapourFractionDerivs( pc ) = x( numVals ); - } - } - } + arraySlice1d< real64, USD2 > const & vapourFractionDerivs, + arraySlice2d< real64, USD3 > const & liquidCompositionDerivs, + arraySlice2d< real64, USD3 > const & vapourCompositionDerivs ); private: /** @@ -368,7 +123,7 @@ struct NegativeTwoPhaseFlash integer presentCount = 0; for( integer ic = 0; ic < numComps; ++ic ) { - if( MultiFluidConstants::epsilon < composition[ic] ) + if( MultiFluidConstants::minForSpeciesPresence < composition[ic] ) { presentComponents[presentCount++] = ic; } @@ -405,9 +160,23 @@ struct NegativeTwoPhaseFlash /** * @brief Calculate the logarithms of the fugacity ratios * @param[in] numComps number of components - * @param[in] composition composition to be normalized + * @param[in] pressure pressure + * @param[in] temperature temperature + * @param[in] composition composition of the mixture + * @param[in] componentProperties The compositional component properties + * @param[in] liquidEos The equation of state for the liquid phase + * @param[in] vapourEos The equation of state for the vapour phase + * @param[in] kValues The k-values + * @param[in] presentComponents The indices of the present components + * @param[out] vapourPhaseMoleFraction the calculated vapour (gas) mole fraction + * @param[out] liquidComposition the calculated liquid phase composition + * @param[out] vapourComposition the calculated vapour phase composition + * @param[out] logLiquidFugacity the calculated log fugacity ratios for the liquid phase + * @param[out] logVapourFugacity the calculated log fugacity ratios for the vapour phase + * @param[out] fugacityRatios the fugacity rations + * @return The error */ - template< typename EOS_TYPE_LIQUID, typename EOS_TYPE_VAPOUR, integer USD > + template< integer USD > GEOS_HOST_DEVICE static real64 computeFugacityRatio( integer const numComps, @@ -415,6 +184,8 @@ struct NegativeTwoPhaseFlash real64 const temperature, arraySlice1d< real64 const > const & composition, ComponentProperties::KernelWrapper const & componentProperties, + EquationOfStateType const liquidEos, + EquationOfStateType const vapourEos, arraySlice1d< real64 const, USD > const & kValues, arraySlice1d< integer const > const & presentComponents, real64 & vapourPhaseMoleFraction, @@ -422,58 +193,384 @@ struct NegativeTwoPhaseFlash arraySlice1d< real64, USD > const & vapourComposition, arraySlice1d< real64 > const & logLiquidFugacity, arraySlice1d< real64 > const & logVapourFugacity, - arraySlice1d< real64 > const & fugacityRatios ) - { - // Solve Rachford-Rice Equation - vapourPhaseMoleFraction = RachfordRice::solve( kValues, composition, presentComponents ); - - // Assign phase compositions - for( integer const ic : presentComponents ) - { - liquidComposition[ic] = composition[ic] / ( 1.0 + vapourPhaseMoleFraction * ( kValues[ic] - 1.0 ) ); - vapourComposition[ic] = kValues[ic] * liquidComposition[ic]; - } - normalizeComposition( numComps, liquidComposition ); - normalizeComposition( numComps, vapourComposition ); - - // Compute the phase fugacities - EOS_TYPE_LIQUID::computeLogFugacityCoefficients( numComps, - pressure, - temperature, - liquidComposition.toSliceConst(), - componentProperties, - logLiquidFugacity ); - EOS_TYPE_VAPOUR::computeLogFugacityCoefficients( numComps, - pressure, - temperature, - vapourComposition.toSliceConst(), - componentProperties, - logVapourFugacity ); - - // Compute fugacity ratios and calculate the error - real64 error = 0.0; - for( integer const ic : presentComponents ) - { - fugacityRatios[ic] = ( logLiquidFugacity[ic] - logVapourFugacity[ic] ) + log( liquidComposition[ic] ) - log( vapourComposition[ic] ); - error += (fugacityRatios[ic]*fugacityRatios[ic]); - } - return LvArray::math::sqrt( error ); - } + arraySlice1d< real64 > const & fugacityRatios ); + /** + * @brief Solve the lineat system for the derivatives of the flash + * @param[in] A the coefficient matrix + * @param[in] b the rhs + * @param[out] x the solution + * @return @c true if the problem is well solved @c false otherwise + */ GEOS_HOST_DEVICE static bool solveLinearSystem( arraySlice2d< real64 const > const & A, arraySlice1d< real64 const > const & b, arraySlice1d< real64 > const & x ) { #if defined(GEOS_DEVICE_COMPILE) + GEOS_UNUSED_VAR( A ); + GEOS_UNUSED_VAR( b ); + GEOS_UNUSED_VAR( x ); return false; #else BlasLapackLA::solveLinearSystem( A, b, x ); return true; #endif } + }; +template< int USD1, int USD2 > +GEOS_HOST_DEVICE +bool NegativeTwoPhaseFlash::compute( integer const numComps, + real64 const pressure, + real64 const temperature, + arraySlice1d< real64 const > const & composition, + ComponentProperties::KernelWrapper const & componentProperties, + EquationOfStateType const liquidEos, + EquationOfStateType const vapourEos, + arraySlice2d< real64, USD1 > const & kValues, + real64 & vapourPhaseMoleFraction, + arraySlice1d< real64, USD2 > const & liquidComposition, + arraySlice1d< real64, USD2 > const & vapourComposition ) +{ + constexpr integer maxNumComps = MultiFluidConstants::MAX_NUM_COMPONENTS; + stackArray1d< real64, maxNumComps > logLiquidFugacity( numComps ); + stackArray1d< real64, maxNumComps > logVapourFugacity( numComps ); + stackArray1d< real64, maxNumComps > fugacityRatios( numComps ); + stackArray1d< integer, maxNumComps > componentIndices( numComps ); + auto const & kVapourLiquid = kValues[0]; + + calculatePresentComponents( numComps, composition, componentIndices ); + + // Initialise compositions to feed composition + for( integer ic = 0; ic < numComps; ++ic ) + { + liquidComposition[ic] = composition[ic]; + vapourComposition[ic] = composition[ic]; + } + + // Check if k-Values need to be initialised + bool needInitialisation = true; + for( integer ic = 0; ic < numComps; ++ic ) + { + if( kVapourLiquid[ic] < MultiFluidConstants::epsilon ) + { + needInitialisation = true; + break; + } + } + + bool kValueReset = true; + constexpr real64 boundsTolerance = 1.0e-3; + + if( needInitialisation ) + { + KValueInitialization::computeWilsonGasLiquidKvalue( numComps, + pressure, + temperature, + componentProperties, + kVapourLiquid ); + } + + auto const presentComponents = componentIndices.toSliceConst(); + + real64 const initialVapourFraction = RachfordRice::solve( kVapourLiquid.toSliceConst(), composition, presentComponents ); + + bool converged = false; + for( localIndex iterationCount = 0; iterationCount < MultiFluidConstants::maxSSIIterations; ++iterationCount ) + { + real64 const error = computeFugacityRatio( numComps, + pressure, + temperature, + composition, + componentProperties, + liquidEos, + vapourEos, + kVapourLiquid.toSliceConst(), + presentComponents, + vapourPhaseMoleFraction, + liquidComposition, + vapourComposition, + logLiquidFugacity.toSlice(), + logVapourFugacity.toSlice(), + fugacityRatios.toSlice() ); + + // Compute fugacity ratios and check convergence + converged = (error < MultiFluidConstants::fugacityTolerance); + + if( converged ) + { + break; + } + + // Update K-values + if( (vapourPhaseMoleFraction < -boundsTolerance || 1.0-vapourPhaseMoleFraction < -boundsTolerance) + && 0.2 < LvArray::math::abs( vapourPhaseMoleFraction-initialVapourFraction ) + && !kValueReset ) + { + KValueInitialization::computeConstantLiquidKvalue( numComps, + pressure, + temperature, + componentProperties, + kVapourLiquid ); + kValueReset = true; + } + else + { + for( integer ic = 0; ic < numComps; ++ic ) + { + kVapourLiquid[ic] *= exp( fugacityRatios[ic] ); + } + } + } + + // Retrieve physical bounds from negative flash values + if( vapourPhaseMoleFraction < MultiFluidConstants::epsilon ) + { + vapourPhaseMoleFraction = 0.0; + for( integer ic = 0; ic < numComps; ++ic ) + { + liquidComposition[ic] = composition[ic]; + vapourComposition[ic] = composition[ic]; + } + } + else if( 1.0 - vapourPhaseMoleFraction < MultiFluidConstants::epsilon ) + { + vapourPhaseMoleFraction = 1.0; + for( integer ic = 0; ic < numComps; ++ic ) + { + liquidComposition[ic] = composition[ic]; + vapourComposition[ic] = composition[ic]; + } + } + + return converged; +} + +template< integer USD1, integer USD2, integer USD3 > +GEOS_HOST_DEVICE +void NegativeTwoPhaseFlash::computeDerivatives( + integer const numComps, + real64 const pressure, + real64 const temperature, + arraySlice1d< real64 const > const & composition, + ComponentProperties::KernelWrapper const & componentProperties, + EquationOfStateType const liquidEos, + EquationOfStateType const vapourEos, + real64 const & vapourFraction, + arraySlice1d< real64 const, USD1 > const & liquidComposition, + arraySlice1d< real64 const, USD1 > const & vapourComposition, + arraySlice1d< real64, USD2 > const & vapourFractionDerivs, + arraySlice2d< real64, USD3 > const & liquidCompositionDerivs, + arraySlice2d< real64, USD3 > const & vapourCompositionDerivs ) +{ + constexpr integer maxNumComps = MultiFluidConstants::MAX_NUM_COMPONENTS; + constexpr integer maxNumDofs = MultiFluidConstants::MAX_NUM_COMPONENTS + 2; + + integer const numDofs = numComps + 2; + + auto const setZero = []( real64 & val ) { val = 0.0; }; + LvArray::forValuesInSlice( vapourFractionDerivs, setZero ); + LvArray::forValuesInSlice( liquidCompositionDerivs, setZero ); + LvArray::forValuesInSlice( vapourCompositionDerivs, setZero ); + + // Check if we are single or 2-phase + if( vapourFraction < MultiFluidConstants::epsilon ) + { + for( integer ic = 0; ic < numComps; ++ic ) + { + liquidCompositionDerivs( ic, Deriv::dC + ic ) = 1.0; + vapourCompositionDerivs( ic, Deriv::dC + ic ) = 1.0; + } + } + else if( 1.0 - vapourFraction < MultiFluidConstants::epsilon ) + { + for( integer ic = 0; ic < numComps; ++ic ) + { + liquidCompositionDerivs( ic, Deriv::dC + ic ) = 1.0; + vapourCompositionDerivs( ic, Deriv::dC + ic ) = 1.0; + } + } + else + { + // Calculate the liquid and vapour fugacities and derivatives + stackArray1d< real64, maxNumComps > logLiquidFugacity( numComps ); + stackArray1d< real64, maxNumComps > logVapourFugacity( numComps ); + stackArray2d< real64, maxNumComps * maxNumDofs > logLiquidFugacityDerivs( numComps, numDofs ); + stackArray2d< real64, maxNumComps * maxNumDofs > logVapourFugacityDerivs( numComps, numDofs ); + + FugacityCalculator::computeLogFugacity( numComps, + pressure, + temperature, + liquidComposition, + componentProperties, + liquidEos, + logLiquidFugacity ); + FugacityCalculator::computeLogFugacity( numComps, + pressure, + temperature, + vapourComposition, + componentProperties, + vapourEos, + logVapourFugacity ); + + FugacityCalculator::computeLogFugacityDerivatives( numComps, + pressure, + temperature, + liquidComposition, + componentProperties, + liquidEos, + logLiquidFugacity.toSliceConst(), + logLiquidFugacityDerivs.toSlice() ); + FugacityCalculator::computeLogFugacityDerivatives( numComps, + pressure, + temperature, + vapourComposition, + componentProperties, + vapourEos, + logVapourFugacity.toSliceConst(), + logVapourFugacityDerivs.toSlice() ); + + constexpr integer maxNumVals = 2*MultiFluidConstants::MAX_NUM_COMPONENTS+1; + integer const numVals = 2*numComps; + stackArray1d< real64, maxNumVals > b( numVals + 1 ); + stackArray1d< real64, maxNumVals > x( numVals + 1 ); + stackArray2d< real64, maxNumVals * maxNumVals > A( numVals + 1, numVals + 1 ); + + LvArray::forValuesInSlice( A.toSlice(), setZero ); + LvArray::forValuesInSlice( b.toSlice(), setZero ); + + for( integer ic = 0; ic < numComps; ++ic ) + { + integer const xi = ic; + integer const yi = ic + numComps; + integer const vi = numVals; + + integer e = ic; + A( e, xi ) = 1.0 - vapourFraction; + A( e, yi ) = vapourFraction; + A( e, vi ) = vapourComposition[ic] - liquidComposition[ic]; + + e = ic + numComps; + real64 const phiL = exp( logLiquidFugacity( ic ) ); + real64 const phiV = exp( logVapourFugacity( ic ) ); + for( integer jc = 0; jc < numComps; ++jc ) + { + integer const xj = jc; + integer const yj = jc + numComps; + real64 const dPhiLdx = logLiquidFugacityDerivs( ic, Deriv::dC+jc ); + real64 const dPhiVdy = logVapourFugacityDerivs( ic, Deriv::dC+jc ); + A( e, xj ) = liquidComposition[ic] * phiL * dPhiLdx; + A( e, yj ) = -vapourComposition[ic] * phiV * dPhiVdy; + } + A( e, xi ) += phiL; + A( e, yi ) -= phiV; + + e = numVals; + A( e, xi ) = -1.0; + A( e, yi ) = 1.0; + } + // Pressure and temperature derivatives + for( integer const pc : {Deriv::dP, Deriv::dT} ) + { + for( integer ic = 0; ic < numComps; ++ic ) + { + real64 const phiL = exp( logLiquidFugacity( ic ) ); + real64 const phiV = exp( logVapourFugacity( ic ) ); + b( ic ) = 0.0; + b( ic + numComps ) = -liquidComposition[ic] * phiL * logLiquidFugacityDerivs( ic, pc ) + + vapourComposition[ic] * phiV * logVapourFugacityDerivs( ic, pc ); + } + b( numVals ) = 0.0; + solveLinearSystem( A, b, x ); + for( integer ic = 0; ic < numComps; ++ic ) + { + liquidCompositionDerivs( ic, pc ) = x( ic ); + vapourCompositionDerivs( ic, pc ) = x( ic + numComps ); + } + vapourFractionDerivs( pc ) = x( numVals ); + } + // Composition derivatives + for( integer kc = 0; kc < numComps; ++kc ) + { + integer const pc = Deriv::dC + kc; + + for( integer ic = 0; ic < numComps; ++ic ) + { + b( ic ) = -composition[ic]; + b( ic + numComps ) = 0.0; + } + b( kc ) += 1.0; + b( numVals ) = 0.0; + solveLinearSystem( A, b, x ); + for( integer ic = 0; ic < numComps; ++ic ) + { + liquidCompositionDerivs( ic, pc ) = x( ic ); + vapourCompositionDerivs( ic, pc ) = x( ic + numComps ); + } + vapourFractionDerivs( pc ) = x( numVals ); + } + } +} + +template< integer USD > +GEOS_HOST_DEVICE +real64 NegativeTwoPhaseFlash::computeFugacityRatio( + integer const numComps, + real64 const pressure, + real64 const temperature, + arraySlice1d< real64 const > const & composition, + ComponentProperties::KernelWrapper const & componentProperties, + EquationOfStateType const liquidEos, + EquationOfStateType const vapourEos, + arraySlice1d< real64 const, USD > const & kValues, + arraySlice1d< integer const > const & presentComponents, + real64 & vapourPhaseMoleFraction, + arraySlice1d< real64, USD > const & liquidComposition, + arraySlice1d< real64, USD > const & vapourComposition, + arraySlice1d< real64 > const & logLiquidFugacity, + arraySlice1d< real64 > const & logVapourFugacity, + arraySlice1d< real64 > const & fugacityRatios ) +{ + // Solve Rachford-Rice Equation + vapourPhaseMoleFraction = RachfordRice::solve( kValues, composition, presentComponents ); + + // Assign phase compositions + for( integer ic = 0; ic < numComps; ++ic ) + { + liquidComposition[ic] = composition[ic] / ( 1.0 + vapourPhaseMoleFraction * ( kValues[ic] - 1.0 ) ); + vapourComposition[ic] = kValues[ic] * liquidComposition[ic]; + } + + normalizeComposition( numComps, liquidComposition ); + normalizeComposition( numComps, vapourComposition ); + + FugacityCalculator::computeLogFugacity( numComps, + pressure, + temperature, + liquidComposition.toSliceConst(), + componentProperties, + liquidEos, + logLiquidFugacity ); + FugacityCalculator::computeLogFugacity( numComps, + pressure, + temperature, + vapourComposition.toSliceConst(), + componentProperties, + vapourEos, + logVapourFugacity ); + + // Compute fugacity ratios and calculate the error + real64 error = 0.0; + for( integer const ic : presentComponents ) + { + fugacityRatios[ic] = ( logLiquidFugacity[ic] - logVapourFugacity[ic] ) + log( liquidComposition[ic] ) - log( vapourComposition[ic] ); + error += (fugacityRatios[ic]*fugacityRatios[ic]); + } + return LvArray::math::sqrt( error ); +} + } // namespace compositional } // namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/StabilityTest.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/StabilityTest.hpp index 8ddef572339..4d6740aedc9 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/StabilityTest.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/functions/StabilityTest.hpp @@ -20,6 +20,7 @@ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_FUNCTIONS_STABILITYTEST_HPP_ #include "KValueInitialization.hpp" +#include "FugacityCalculator.hpp" #include "constitutive/fluid/multifluid/Layouts.hpp" #include "constitutive/fluid/multifluid/MultiFluidConstants.hpp" #include "constitutive/fluid/multifluid/compositional/models/ComponentProperties.hpp" @@ -45,17 +46,19 @@ struct StabilityTest * @param[in] temperature temperature * @param[in] composition composition of the mixture * @param[in] componentProperties The compositional component properties + * @param[in] equationOfState The equation of state * @param[out] tangentPlaneDistance the minimum tangent plane distance (TPD) * @param[out] kValues the k-values estimated from the stationary points * @return a flag indicating that 2 stationary points have been found */ - template< typename EOS_TYPE, integer USD1 > + template< integer USD1 > GEOS_HOST_DEVICE static bool compute( integer const numComps, real64 const pressure, real64 const temperature, arraySlice1d< real64 const, USD1 > const & composition, ComponentProperties::KernelWrapper const & componentProperties, + EquationOfStateType const & equationOfState, real64 & tangentPlaneDistance, arraySlice1d< real64 > const & kValues ) { @@ -76,12 +79,13 @@ struct StabilityTest { hyperplane[ic] = 0.0; } - EOS_TYPE::computeLogFugacityCoefficients( numComps, - pressure, - temperature, - composition, - componentProperties, - logFugacity ); + FugacityCalculator::computeLogFugacity( numComps, + pressure, + temperature, + composition, + componentProperties, + equationOfState, + logFugacity ); for( integer const ic : presentComponents ) { hyperplane[ic] = LvArray::math::log( composition[ic] ) + logFugacity[ic]; @@ -109,12 +113,14 @@ struct StabilityTest normalizedComposition[ic] = trialComposition( trialIndex, ic ); } normalizeComposition( numComps, normalizedComposition.toSlice() ); - EOS_TYPE::computeLogFugacityCoefficients( numComps, - pressure, - temperature, - normalizedComposition.toSliceConst(), - componentProperties, - logFugacity ); + + FugacityCalculator::computeLogFugacity( numComps, + pressure, + temperature, + normalizedComposition.toSliceConst(), + componentProperties, + equationOfState, + logFugacity ); for( integer const ic : presentComponents ) { logTrialComposition[ic] = LvArray::math::log( trialComposition( trialIndex, ic ) ); @@ -128,12 +134,15 @@ struct StabilityTest normalizedComposition[ic] = trialComposition( trialIndex, ic ); } normalizeComposition( numComps, normalizedComposition.toSlice() ); - EOS_TYPE::computeLogFugacityCoefficients( numComps, - pressure, - temperature, - normalizedComposition.toSliceConst(), - componentProperties, - logFugacity ); + + FugacityCalculator::computeLogFugacity( numComps, + pressure, + temperature, + normalizedComposition.toSliceConst(), + componentProperties, + equationOfState, + logFugacity ); + real64 error = 0.0; for( integer const ic : presentComponents ) { diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/CompositionalDensity.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/CompositionalDensity.cpp index da9ec1e02cc..adbc7263298 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/CompositionalDensity.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/CompositionalDensity.cpp @@ -25,7 +25,53 @@ namespace constitutive { namespace compositional -{} // namespace compositional +{ +CompositionalDensity::CompositionalDensity( string const & name, + ComponentProperties const & componentProperties, + integer const phaseIndex, + ModelParameters const & modelParameters ) + : FunctionBase( name, componentProperties ) +{ + EquationOfState const * equationOfState = modelParameters.get< EquationOfState >(); + string const eosName = equationOfState->m_equationsOfStateNames[phaseIndex]; + m_equationOfState = EnumStrings< EquationOfStateType >::fromString( eosName ); + + // Calculate the dimensional volume shift + m_componentDimensionalVolumeShift.resize( componentProperties.getNumberOfComponents()); + calculateDimensionalVolumeShift( componentProperties, + m_equationOfState, + m_componentDimensionalVolumeShift ); +} + +CompositionalDensity::KernelWrapper +CompositionalDensity::createKernelWrapper() const +{ + return KernelWrapper( m_componentDimensionalVolumeShift, m_equationOfState ); +} + +std::unique_ptr< ModelParameters > +CompositionalDensity::createParameters( std::unique_ptr< ModelParameters > parameters ) +{ + return EquationOfState::create( std::move( parameters ) ); +} + +void CompositionalDensity::calculateDimensionalVolumeShift( ComponentProperties const & componentProperties, + EquationOfStateType const & equationOfState, + arraySlice1d< real64 > componentDimensionalVolumeShift ) +{ + if( equationOfState == EquationOfStateType::PengRobinson ) + { + CubicEOSPhaseModel< PengRobinsonEOS >::calculateDimensionalVolumeShift( componentProperties, + componentDimensionalVolumeShift ); + } + else if( equationOfState == EquationOfStateType::SoaveRedlichKwong ) + { + CubicEOSPhaseModel< SoaveRedlichKwongEOS >::calculateDimensionalVolumeShift( componentProperties, + componentDimensionalVolumeShift ); + } +} + +} // namespace compositional } // namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/CompositionalDensity.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/CompositionalDensity.hpp index 7adcd78a3e1..751732a4711 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/CompositionalDensity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/CompositionalDensity.hpp @@ -20,10 +20,12 @@ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_MODELS_COMPOSITIONALDENSITY_HPP_ #include "FunctionBase.hpp" +#include "EquationOfState.hpp" #include "constitutive/fluid/multifluid/MultiFluidUtils.hpp" #include "constitutive/fluid/multifluid/MultiFluidConstants.hpp" #include "constitutive/fluid/multifluid/compositional/functions/CompositionalProperties.hpp" +#include "constitutive/fluid/multifluid/compositional/functions/CubicEOSPhaseModel.hpp" namespace geos { @@ -34,12 +36,13 @@ namespace constitutive namespace compositional { -template< typename EOS_TYPE > class CompositionalDensityUpdate final : public FunctionBaseUpdate { public: - explicit CompositionalDensityUpdate( arrayView1d< real64 const > const & volumeShift ) - : m_componentDimensionalVolumeShift( volumeShift ) + CompositionalDensityUpdate( arrayView1d< real64 const > const & volumeShift, + EquationOfStateType const equationOfState ) + : m_componentDimensionalVolumeShift( volumeShift ), + m_equationOfState( equationOfState ) {} template< integer USD1, integer USD2 > @@ -54,26 +57,30 @@ class CompositionalDensityUpdate final : public FunctionBaseUpdate arraySlice1d< real64, USD2 > const & dMassDensity, bool useMass ) const; +private: + template< integer USD > + GEOS_HOST_DEVICE + void computeCompressibilityFactor( integer const numComps, + real64 const & pressure, + real64 const & temperature, + arraySlice1d< real64 const, USD > const & composition, + ComponentProperties::KernelWrapper const & componentProperties, + EquationOfStateType const equationOfState, + real64 & compressibilityFactor, + arraySlice1d< real64 > const & compressibilityFactorDerivs ) const; + private: arrayView1d< real64 const > m_componentDimensionalVolumeShift; + EquationOfStateType const m_equationOfState; }; -template< typename EOS_TYPE > class CompositionalDensity : public FunctionBase { public: CompositionalDensity( string const & name, ComponentProperties const & componentProperties, integer const phaseIndex, - ModelParameters const & modelParameters ) - : FunctionBase( name, componentProperties ) - { - GEOS_UNUSED_VAR( phaseIndex, modelParameters ); - // Calculate the dimensional volume shift - m_componentDimensionalVolumeShift.resize( componentProperties.getNumberOfComponents()); - EOS_TYPE::calculateDimensionalVolumeShift( componentProperties, - m_componentDimensionalVolumeShift ); - } + ModelParameters const & modelParameters ); static string catalogName() { return "CompositionalDensity"; } @@ -83,34 +90,39 @@ class CompositionalDensity : public FunctionBase } /// Type of kernel wrapper for in-kernel update - using KernelWrapper = CompositionalDensityUpdate< EOS_TYPE >; + using KernelWrapper = CompositionalDensityUpdate; /** * @brief Create an update kernel wrapper. * @return the wrapper */ - KernelWrapper createKernelWrapper() const - { - return KernelWrapper( m_componentDimensionalVolumeShift ); - } + KernelWrapper createKernelWrapper() const; + + // Create parameters unique to this model + static std::unique_ptr< ModelParameters > createParameters( std::unique_ptr< ModelParameters > parameters ); + +private: + static void calculateDimensionalVolumeShift( ComponentProperties const & componentProperties, + EquationOfStateType const & equationOfState, + arraySlice1d< real64 > componentDimensionalVolumeShift ); private: array1d< real64 > m_componentDimensionalVolumeShift; + EquationOfStateType m_equationOfState; }; -template< typename EOS_TYPE > template< integer USD1, integer USD2 > GEOS_HOST_DEVICE -void CompositionalDensityUpdate< EOS_TYPE >:: -compute( ComponentProperties::KernelWrapper const & componentProperties, - real64 const & pressure, - real64 const & temperature, - arraySlice1d< real64 const, USD1 > const & phaseComposition, - real64 & molarDensity, - arraySlice1d< real64, USD2 > const & dMolarDensity, - real64 & massDensity, - arraySlice1d< real64, USD2 > const & dMassDensity, - bool useMass ) const +void CompositionalDensityUpdate::compute( + ComponentProperties::KernelWrapper const & componentProperties, + real64 const & pressure, + real64 const & temperature, + arraySlice1d< real64 const, USD1 > const & phaseComposition, + real64 & molarDensity, + arraySlice1d< real64, USD2 > const & dMolarDensity, + real64 & massDensity, + arraySlice1d< real64, USD2 > const & dMassDensity, + bool useMass ) const { GEOS_UNUSED_VAR( useMass ); @@ -120,13 +132,14 @@ compute( ComponentProperties::KernelWrapper const & componentProperties, real64 compressibilityFactor = 0.0; stackArray1d< real64, 2+MultiFluidConstants::MAX_NUM_COMPONENTS > tempDerivs( numDofs ); - EOS_TYPE::computeCompressibilityFactor( numComps, - pressure, - temperature, - phaseComposition, - componentProperties, - compressibilityFactor, - tempDerivs.toSlice() ); + computeCompressibilityFactor( numComps, + pressure, + temperature, + phaseComposition, + componentProperties, + m_equationOfState, + compressibilityFactor, + tempDerivs.toSlice() ); CompositionalProperties::computeMolarDensity( numComps, pressure, @@ -147,6 +160,41 @@ compute( ComponentProperties::KernelWrapper const & componentProperties, dMassDensity ); } +template< integer USD > +GEOS_HOST_DEVICE +void CompositionalDensityUpdate::computeCompressibilityFactor( integer const numComps, + real64 const & pressure, + real64 const & temperature, + arraySlice1d< real64 const, USD > const & composition, + ComponentProperties::KernelWrapper const & componentProperties, + EquationOfStateType const equationOfState, + real64 & compressibilityFactor, + arraySlice1d< real64 > const & compressibilityFactorDerivs ) const +{ + if( equationOfState == EquationOfStateType::PengRobinson ) + { + CubicEOSPhaseModel< PengRobinsonEOS >:: + computeCompressibilityFactor( numComps, + pressure, + temperature, + composition, + componentProperties, + compressibilityFactor, + compressibilityFactorDerivs ); + } + else if( equationOfState == EquationOfStateType::SoaveRedlichKwong ) + { + CubicEOSPhaseModel< SoaveRedlichKwongEOS >:: + computeCompressibilityFactor( numComps, + pressure, + temperature, + composition, + componentProperties, + compressibilityFactor, + compressibilityFactorDerivs ); + } +} + } // end namespace compositional } // end namespace constitutive diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/EquationOfState.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/EquationOfState.hpp new file mode 100644 index 00000000000..567ca46592c --- /dev/null +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/EquationOfState.hpp @@ -0,0 +1,105 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2018-2020 TotalEnergies + * Copyright (c) 2019- GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file EquationOfState.hpp + */ + +#ifndef GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_MODELS_EQUATIONOFSTATE_HPP_ +#define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_MODELS_EQUATIONOFSTATE_HPP_ + +#include "ModelParameters.hpp" +#include "constitutive/fluid/multifluid/MultiFluidBase.hpp" +#include "dataRepository/InputFlags.hpp" +#include "codingUtilities/EnumStrings.hpp" + +namespace geos +{ + +namespace constitutive +{ + +namespace compositional +{ + +enum class EquationOfStateType : integer +{ + PengRobinson, + SoaveRedlichKwong +}; + +ENUM_STRINGS( EquationOfStateType, + "pr", + "srk" ); + +class EquationOfState : public ModelParameters +{ +public: + EquationOfState( std::unique_ptr< ModelParameters > parameters ): + ModelParameters( std::move( parameters ) ) + {} + + ~EquationOfState() override = default; + + static std::unique_ptr< ModelParameters > create( std::unique_ptr< ModelParameters > parameters ) + { + if( parameters && parameters->get< EquationOfState >() != nullptr ) + { + return parameters; + } + return std::make_unique< EquationOfState >( std::move( parameters ) ); + } + + string_array m_equationsOfStateNames; + +protected: + void registerParametersImpl( MultiFluidBase * fluid ) override + { + fluid->registerWrapper( viewKeyStruct::equationsOfStateString(), &m_equationsOfStateNames ). + setInputFlag( dataRepository::InputFlags::REQUIRED ). + setDescription( "List of equation of state types for each phase. Valid options:\n* " + + EnumStrings< EquationOfStateType >::concat( "\n* " ) ); + } + + void postInputInitializationImpl( MultiFluidBase const * fluid, ComponentProperties const & componentProperties ) override + { + GEOS_UNUSED_VAR( componentProperties ); + + integer const numPhase = fluid->numFluidPhases(); + + GEOS_THROW_IF_NE_MSG( m_equationsOfStateNames.size(), numPhase, + GEOS_FMT( "{}: invalid number of values in attribute '{}'", fluid->getFullName(), + viewKeyStruct::equationsOfStateString() ), + InputError ); + + // If any value is invalid conversion will throw + for( string const & eos : m_equationsOfStateNames ) + { + EnumStrings< EquationOfStateType >::fromString( eos ); + } + } + + struct viewKeyStruct + { + static constexpr char const * equationsOfStateString() { return "equationsOfState"; } + }; +}; + +} // end namespace compositional + +} // end namespace constitutive + +} // end namespace geos + +#endif //GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_MODELS_EQUATIONOFSTATE_HPP_ diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/LohrenzBrayClarkViscosity.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/LohrenzBrayClarkViscosity.hpp index cdd591d100c..a3e4b1aa372 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/LohrenzBrayClarkViscosity.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/LohrenzBrayClarkViscosity.hpp @@ -271,7 +271,7 @@ class LohrenzBrayClarkViscosity : public FunctionBase integer const phaseIndex, ModelParameters const & modelParameters ); - static string catalogName() { return "LBC"; } + static string catalogName() { return "LohrenzBrayClark"; } FunctionType functionType() const override { diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.cpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.cpp index 6026dd4e213..ff189b2419a 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.cpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.cpp @@ -28,42 +28,47 @@ namespace compositional { // Naming conventions -template< typename EOS_TYPE_LIQUID, typename EOS_TYPE_VAPOUR > -string NegativeTwoPhaseFlashModel< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >::catalogName() +string NegativeTwoPhaseFlashModel::catalogName() { - return EOS_TYPE_LIQUID::catalogName(); + return "TwoPhase"; } -template< typename EOS_TYPE_LIQUID, typename EOS_TYPE_VAPOUR > -NegativeTwoPhaseFlashModel< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >:: -NegativeTwoPhaseFlashModel( string const & name, - ComponentProperties const & componentProperties, - ModelParameters const & modelParameters ): +NegativeTwoPhaseFlashModel::NegativeTwoPhaseFlashModel( string const & name, + ComponentProperties const & componentProperties, + ModelParameters const & modelParameters ): FunctionBase( name, componentProperties ) { - GEOS_UNUSED_VAR( modelParameters ); + m_parameters = modelParameters.get< EquationOfState >(); } -template< typename EOS_TYPE_LIQUID, typename EOS_TYPE_VAPOUR > -typename NegativeTwoPhaseFlashModel< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >::KernelWrapper -NegativeTwoPhaseFlashModel< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >::createKernelWrapper() const +NegativeTwoPhaseFlashModel::KernelWrapper +NegativeTwoPhaseFlashModel::createKernelWrapper() const { - return KernelWrapper( m_componentProperties.getNumberOfComponents(), 0, 1 ); + constexpr integer liquidIndex = 0; + constexpr integer vapourIndex = 1; + EquationOfStateType const liquidEos = EnumStrings< EquationOfStateType >::fromString( m_parameters->m_equationsOfStateNames[liquidIndex] ); + EquationOfStateType const vapourEos = EnumStrings< EquationOfStateType >::fromString( m_parameters->m_equationsOfStateNames[vapourIndex] ); + return KernelWrapper( m_componentProperties.getNumberOfComponents(), liquidIndex, vapourIndex, liquidEos, vapourEos ); } -template< typename EOS_TYPE_LIQUID, typename EOS_TYPE_VAPOUR > -NegativeTwoPhaseFlashModelUpdate< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >:: -NegativeTwoPhaseFlashModelUpdate( integer const numComponents, - integer const liquidIndex, - integer const vapourIndex ): +NegativeTwoPhaseFlashModelUpdate::NegativeTwoPhaseFlashModelUpdate( + integer const numComponents, + integer const liquidIndex, + integer const vapourIndex, + EquationOfStateType const liquidEos, + EquationOfStateType const vapourEos ): m_numComponents( numComponents ), m_liquidIndex( liquidIndex ), - m_vapourIndex( vapourIndex ) + m_vapourIndex( vapourIndex ), + m_liquidEos( liquidEos ), + m_vapourEos( vapourEos ) {} -// Explicit instantiation of the model template. -template class NegativeTwoPhaseFlashModel< CubicEOSPhaseModel< PengRobinsonEOS >, CubicEOSPhaseModel< PengRobinsonEOS > >; -template class NegativeTwoPhaseFlashModel< CubicEOSPhaseModel< SoaveRedlichKwongEOS >, CubicEOSPhaseModel< SoaveRedlichKwongEOS > >; +std::unique_ptr< ModelParameters > +NegativeTwoPhaseFlashModel::createParameters( std::unique_ptr< ModelParameters > parameters ) +{ + return EquationOfState::create( std::move( parameters ) ); +} } // end namespace compositional diff --git a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.hpp b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.hpp index 1682af63be4..b42dcf136c8 100644 --- a/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.hpp +++ b/src/coreComponents/constitutive/fluid/multifluid/compositional/models/NegativeTwoPhaseFlashModel.hpp @@ -20,10 +20,10 @@ #define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_COMPOSITIONAL_MODELS_NEGATIVETWOPHASEFLASHMODEL_HPP_ #include "FunctionBase.hpp" +#include "EquationOfState.hpp" #include "constitutive/fluid/multifluid/Layouts.hpp" #include "constitutive/fluid/multifluid/MultiFluidUtils.hpp" -#include "constitutive/fluid/multifluid/compositional/functions/CubicEOSPhaseModel.hpp" #include "constitutive/fluid/multifluid/compositional/functions/NegativeTwoPhaseFlash.hpp" namespace geos @@ -35,7 +35,8 @@ namespace constitutive namespace compositional { -template< typename EOS_TYPE_LIQUID, typename EOS_TYPE_VAPOUR > +class EquationOfState; + class NegativeTwoPhaseFlashModelUpdate final : public FunctionBaseUpdate { public: @@ -45,7 +46,9 @@ class NegativeTwoPhaseFlashModelUpdate final : public FunctionBaseUpdate NegativeTwoPhaseFlashModelUpdate( integer const numComponents, integer const liquidIndex, - integer const vapourIndex ); + integer const vapourIndex, + EquationOfStateType const liquidEos, + EquationOfStateType const vapourEos ); // Mark as a 2-phase flash GEOS_HOST_DEVICE @@ -64,33 +67,35 @@ class NegativeTwoPhaseFlashModelUpdate final : public FunctionBaseUpdate integer const numDofs = 2 + m_numComponents; // Iterative solve to converge flash - bool const flashStatus = NegativeTwoPhaseFlash::compute< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >( - m_numComponents, - pressure, - temperature, - compFraction, - componentProperties, - kValues, - phaseFraction.value[m_vapourIndex], - phaseCompFraction.value[m_liquidIndex], - phaseCompFraction.value[m_vapourIndex] ); + bool const flashStatus = NegativeTwoPhaseFlash::compute( m_numComponents, + pressure, + temperature, + compFraction, + componentProperties, + m_liquidEos, + m_vapourEos, + kValues, + phaseFraction.value[m_vapourIndex], + phaseCompFraction.value[m_liquidIndex], + phaseCompFraction.value[m_vapourIndex] ); GEOS_ERROR_IF( !flashStatus, GEOS_FMT( "Negative two phase flash failed to converge at pressure {:.5e} and temperature {:.3f}", pressure, temperature )); // Calculate derivatives - NegativeTwoPhaseFlash::computeDerivatives< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >( - m_numComponents, - pressure, - temperature, - compFraction, - componentProperties, - phaseFraction.value[m_vapourIndex], - phaseCompFraction.value[m_liquidIndex].toSliceConst(), - phaseCompFraction.value[m_vapourIndex].toSliceConst(), - phaseFraction.derivs[m_vapourIndex], - phaseCompFraction.derivs[m_liquidIndex], - phaseCompFraction.derivs[m_vapourIndex] ); + NegativeTwoPhaseFlash::computeDerivatives( m_numComponents, + pressure, + temperature, + compFraction, + componentProperties, + m_liquidEos, + m_vapourEos, + phaseFraction.value[m_vapourIndex], + phaseCompFraction.value[m_liquidIndex].toSliceConst(), + phaseCompFraction.value[m_vapourIndex].toSliceConst(), + phaseFraction.derivs[m_vapourIndex], + phaseCompFraction.derivs[m_liquidIndex], + phaseCompFraction.derivs[m_vapourIndex] ); // Complete by calculating liquid phase fraction phaseFraction.value[m_liquidIndex] = 1.0 - phaseFraction.value[m_vapourIndex]; @@ -102,11 +107,12 @@ class NegativeTwoPhaseFlashModelUpdate final : public FunctionBaseUpdate private: integer const m_numComponents; - integer const m_liquidIndex{0}; - integer const m_vapourIndex{1}; + integer const m_liquidIndex; + integer const m_vapourIndex; + EquationOfStateType const m_liquidEos; + EquationOfStateType const m_vapourEos; }; -template< typename EOS_TYPE_LIQUID, typename EOS_TYPE_VAPOUR > class NegativeTwoPhaseFlashModel : public FunctionBase { public: @@ -122,21 +128,20 @@ class NegativeTwoPhaseFlashModel : public FunctionBase } /// Type of kernel wrapper for in-kernel update - using KernelWrapper = NegativeTwoPhaseFlashModelUpdate< EOS_TYPE_LIQUID, EOS_TYPE_VAPOUR >; + using KernelWrapper = NegativeTwoPhaseFlashModelUpdate; /** * @brief Create an update kernel wrapper. * @return the wrapper */ KernelWrapper createKernelWrapper() const; -}; -using NegativeTwoPhaseFlashPRPR = NegativeTwoPhaseFlashModel< - CubicEOSPhaseModel< PengRobinsonEOS >, - CubicEOSPhaseModel< PengRobinsonEOS > >; -using NegativeTwoPhaseFlashSRKSRK = NegativeTwoPhaseFlashModel< - CubicEOSPhaseModel< SoaveRedlichKwongEOS >, - CubicEOSPhaseModel< SoaveRedlichKwongEOS > >; + // Create parameters unique to this model + static std::unique_ptr< ModelParameters > createParameters( std::unique_ptr< ModelParameters > parameters ); + +private: + EquationOfState const * m_parameters{}; +}; } // end namespace compositional diff --git a/src/coreComponents/constitutive/unitTests/testCompositionalDensity.cpp b/src/coreComponents/constitutive/unitTests/testCompositionalDensity.cpp index 2a77b2c1c99..6fae07ef3bb 100644 --- a/src/coreComponents/constitutive/unitTests/testCompositionalDensity.cpp +++ b/src/coreComponents/constitutive/unitTests/testCompositionalDensity.cpp @@ -14,7 +14,6 @@ // Source includes #include "codingUtilities/UnitTestUtilities.hpp" -#include "constitutive/fluid/multifluid/compositional/functions/CubicEOSPhaseModel.hpp" #include "constitutive/fluid/multifluid/compositional/models/CompositionalDensity.hpp" #include "TestFluid.hpp" #include "TestFluidUtilities.hpp" @@ -53,7 +52,7 @@ struct FluidData< 9 > } }; -template< int NC, typename EOS_TYPE > +template< int NC, EquationOfStateType EOS_TYPE > class CompositionalDensityTestFixture : public ::testing::TestWithParam< DensityData< NC > > { static constexpr real64 relTol = 1.0e-5; @@ -66,8 +65,13 @@ class CompositionalDensityTestFixture : public ::testing::TestWithParam< Densit : m_fluid( FluidData< NC >::createFluid() ) { ComponentProperties const & componentProperties = this->m_fluid->getComponentProperties(); - m_parameters = CompositionalDensity< EOS_TYPE >::createParameters( std::make_unique< ModelParameters >() ); - m_density = std::make_unique< CompositionalDensity< EOS_TYPE > >( "PhaseDensity", componentProperties, 0, *m_parameters ); + m_parameters = CompositionalDensity::createParameters( std::make_unique< ModelParameters >() ); + + auto equationOfState = const_cast< EquationOfState * >(m_parameters->get< EquationOfState >()); + string const eosName = EnumStrings< EquationOfStateType >::toString( EOS_TYPE ); + equationOfState->m_equationsOfStateNames.emplace_back( eosName ); + + m_density = std::make_unique< CompositionalDensity >( "PhaseDensity", componentProperties, 0, *m_parameters ); } ~CompositionalDensityTestFixture() = default; @@ -198,27 +202,28 @@ class CompositionalDensityTestFixture : public ::testing::TestWithParam< Densit } protected: - std::unique_ptr< CompositionalDensity< EOS_TYPE > > m_density{}; + std::unique_ptr< CompositionalDensity > m_density{}; std::unique_ptr< TestFluid< NC > > m_fluid{}; std::unique_ptr< ModelParameters > m_parameters{}; }; -using CompositionalDensity9CompPR = CompositionalDensityTestFixture< 9, CubicEOSPhaseModel< PengRobinsonEOS > >; -using CompositionalDensity9CompSRK = CompositionalDensityTestFixture< 9, CubicEOSPhaseModel< SoaveRedlichKwongEOS > >; +using PengRobinson = CompositionalDensityTestFixture< 9, EquationOfStateType::PengRobinson >; +using SoaveRedlichKwong = CompositionalDensityTestFixture< 9, EquationOfStateType::SoaveRedlichKwong >; -TEST_P( CompositionalDensity9CompPR, testDensityDerivatives ) +TEST_P( PengRobinson, testDensityDerivatives ) { testDensityDerivatives( GetParam() ); } -TEST_P( CompositionalDensity9CompSRK, testDensityDerivatives ) +TEST_P( SoaveRedlichKwong, testDensityDerivatives ) { testDensityDerivatives( GetParam() ); } +/* UNCRUSTIFY-OFF */ + INSTANTIATE_TEST_SUITE_P( - CompositionalDensityTest, - CompositionalDensity9CompPR, + CompositionalDensityTest, PengRobinson, ::testing::ValuesIn( { DensityData< 9 >{1.839590e+06, 2.971500e+02, {0.009000, 0.003000, 0.534700, 0.114600, 0.087900, 0.045600, 0.020900, 0.015100, 0.169200}, 8.355571e+03, 4.559906e+02 }, DensityData< 9 >{1.839590e+06, 2.971500e+02, {0.008260, 0.005440, 0.770320, 0.104560, 0.061770, 0.024590, 0.008840, 0.004720, 0.011490}, 7.703898e+02, 2.691914e+01 }, @@ -235,8 +240,7 @@ INSTANTIATE_TEST_SUITE_P( } ) ); INSTANTIATE_TEST_SUITE_P( - CompositionalDensityTest, - CompositionalDensity9CompSRK, + CompositionalDensityTest, SoaveRedlichKwong, ::testing::ValuesIn( { DensityData< 9 >{1.839590e+06, 2.971500e+02, {0.009000, 0.003000, 0.534700, 0.114600, 0.087900, 0.045600, 0.020900, 0.015100, 0.169200}, 7.433979e+03, 4.056963e+02 }, DensityData< 9 >{1.839590e+06, 2.971500e+02, {0.008260, 0.005440, 0.770320, 0.104560, 0.061770, 0.024590, 0.008840, 0.004720, 0.011490}, 7.629968e+02, 2.666082e+01 }, @@ -253,6 +257,8 @@ INSTANTIATE_TEST_SUITE_P( } ) ); +/* UNCRUSTIFY-ON */ + } // testing } // geos diff --git a/src/coreComponents/constitutive/unitTests/testLohrenzBrayClarkViscosity.cpp b/src/coreComponents/constitutive/unitTests/testLohrenzBrayClarkViscosity.cpp index e90725c0274..3d878664e63 100644 --- a/src/coreComponents/constitutive/unitTests/testLohrenzBrayClarkViscosity.cpp +++ b/src/coreComponents/constitutive/unitTests/testLohrenzBrayClarkViscosity.cpp @@ -67,11 +67,19 @@ class LohrenzBrayClarkViscosityTestFixture : public ::testing::TestWithParam< V : m_fluid( FluidData< NC >::createFluid() ) { ComponentProperties const & componentProperties = this->m_fluid->getComponentProperties(); - m_parameters = LohrenzBrayClarkViscosity::createParameters( nullptr ); + + m_parameters = CompositionalDensity::createParameters( std::make_unique< ModelParameters >() ); + m_parameters = LohrenzBrayClarkViscosity::createParameters( std::move( m_parameters ) ); + auto * parameters = const_cast< LohrenzBrayClarkViscosity::Parameters * >(m_parameters->get< LohrenzBrayClarkViscosity::Parameters >()); parameters->m_componentCriticalVolume.resize( NC ); TestFluid< 9 >::populateArray( parameters->m_componentCriticalVolume, this->m_fluid->criticalVolume ); - m_density = std::make_unique< CompositionalDensity< CubicEOSPhaseModel< PengRobinsonEOS > > >( "PhaseDensity", componentProperties, 0, *m_parameters ); + + auto * equationOfState = const_cast< EquationOfState * >(m_parameters->get< EquationOfState >()); + string const eosName = EnumStrings< EquationOfStateType >::toString( EquationOfStateType::PengRobinson ); + equationOfState->m_equationsOfStateNames.emplace_back( eosName ); + + m_density = std::make_unique< CompositionalDensity >( "PhaseDensity", componentProperties, 0, *m_parameters ); m_viscosity = std::make_unique< LohrenzBrayClarkViscosity >( "PhaseViscosity", componentProperties, 0, *m_parameters ); } @@ -214,7 +222,7 @@ class LohrenzBrayClarkViscosityTestFixture : public ::testing::TestWithParam< V protected: std::unique_ptr< TestFluid< NC > > m_fluid{}; - std::unique_ptr< CompositionalDensity< CubicEOSPhaseModel< PengRobinsonEOS > > > m_density{}; + std::unique_ptr< CompositionalDensity > m_density{}; std::unique_ptr< LohrenzBrayClarkViscosity > m_viscosity{}; std::unique_ptr< ModelParameters > m_parameters{}; }; @@ -232,7 +240,7 @@ TEST_P( LohrenzBrayClarkViscosity9, testViscosityDerivatives ) } //------------------------------------------------------------------------------- -// Data generated by PVTPackage +// Data //------------------------------------------------------------------------------- INSTANTIATE_TEST_SUITE_P( LohrenzBrayClarkViscosity, diff --git a/src/coreComponents/constitutive/unitTests/testNegativeTwoPhaseFlash.cpp b/src/coreComponents/constitutive/unitTests/testNegativeTwoPhaseFlash.cpp index 6dfc1929eb1..1d99f30cafa 100644 --- a/src/coreComponents/constitutive/unitTests/testNegativeTwoPhaseFlash.cpp +++ b/src/coreComponents/constitutive/unitTests/testNegativeTwoPhaseFlash.cpp @@ -59,7 +59,7 @@ using FlashData = std::tuple< Feed< NC > const // expected vapour composition >; -template< int NC, typename EOS_TYPE > +template< int NC, EquationOfStateType EOS_TYPE > class NegativeTwoPhaseFlashTestFixture : public ::testing::TestWithParam< FlashData< NC > > { static constexpr real64 relTol = 1.0e-5; @@ -97,12 +97,14 @@ class NegativeTwoPhaseFlashTestFixture : public ::testing::TestWithParam< Flash stackArray2d< real64, numComps > kValues( 1, numComps ); kValues.zero(); - bool status = NegativeTwoPhaseFlash::compute< EOS_TYPE, EOS_TYPE >( + bool status = NegativeTwoPhaseFlash::compute( numComps, pressure, temperature, composition.toSliceConst(), componentProperties, + EOS_TYPE, + EOS_TYPE, kValues.toSlice(), vapourFraction, liquidComposition.toSlice(), @@ -180,12 +182,14 @@ class NegativeTwoPhaseFlashTestFixture : public ::testing::TestWithParam< Flash stackArray1d< real64, numComps > displacedVapourComposition( numComps ); kValues.zero(); - NegativeTwoPhaseFlash::compute< EOS_TYPE, EOS_TYPE >( + NegativeTwoPhaseFlash::compute( numComps, p, t, zmf.toSliceConst(), componentProperties, + EOS_TYPE, + EOS_TYPE, kValues.toSlice(), values[0], displacedLiquidComposition.toSlice(), @@ -197,23 +201,27 @@ class NegativeTwoPhaseFlashTestFixture : public ::testing::TestWithParam< Flash } }; - NegativeTwoPhaseFlash::compute< EOS_TYPE, EOS_TYPE >( + NegativeTwoPhaseFlash::compute( numComps, pressure, temperature, composition.toSliceConst(), componentProperties, + EOS_TYPE, + EOS_TYPE, kValues.toSlice(), vapourFraction, liquidComposition.toSlice(), vapourComposition.toSlice() ); - NegativeTwoPhaseFlash::computeDerivatives< EOS_TYPE, EOS_TYPE >( + NegativeTwoPhaseFlash::computeDerivatives( numComps, pressure, temperature, composition.toSliceConst(), componentProperties, + EOS_TYPE, + EOS_TYPE, vapourFraction, liquidComposition.toSliceConst(), vapourComposition.toSliceConst(), @@ -262,10 +270,10 @@ class NegativeTwoPhaseFlashTestFixture : public ::testing::TestWithParam< Flash std::unique_ptr< TestFluid< NC > > m_fluid{}; }; -using NegativeTwoPhaseFlash2CompPR = NegativeTwoPhaseFlashTestFixture< 2, CubicEOSPhaseModel< PengRobinsonEOS > >; -using NegativeTwoPhaseFlash2CompSRK = NegativeTwoPhaseFlashTestFixture< 2, CubicEOSPhaseModel< SoaveRedlichKwongEOS > >; -using NegativeTwoPhaseFlash4CompPR = NegativeTwoPhaseFlashTestFixture< 4, CubicEOSPhaseModel< PengRobinsonEOS > >; -using NegativeTwoPhaseFlash4CompSRK = NegativeTwoPhaseFlashTestFixture< 4, CubicEOSPhaseModel< SoaveRedlichKwongEOS > >; +using NegativeTwoPhaseFlash2CompPR = NegativeTwoPhaseFlashTestFixture< 2, EquationOfStateType::PengRobinson >; +using NegativeTwoPhaseFlash2CompSRK = NegativeTwoPhaseFlashTestFixture< 2, EquationOfStateType::SoaveRedlichKwong >; +using NegativeTwoPhaseFlash4CompPR = NegativeTwoPhaseFlashTestFixture< 4, EquationOfStateType::PengRobinson >; +using NegativeTwoPhaseFlash4CompSRK = NegativeTwoPhaseFlashTestFixture< 4, EquationOfStateType::SoaveRedlichKwong >; TEST_P( NegativeTwoPhaseFlash2CompPR, testNegativeFlash ) { diff --git a/src/coreComponents/constitutive/unitTests/testNegativeTwoPhaseFlash9Comp.cpp b/src/coreComponents/constitutive/unitTests/testNegativeTwoPhaseFlash9Comp.cpp index 9e214b56e5b..5f70782df7f 100644 --- a/src/coreComponents/constitutive/unitTests/testNegativeTwoPhaseFlash9Comp.cpp +++ b/src/coreComponents/constitutive/unitTests/testNegativeTwoPhaseFlash9Comp.cpp @@ -38,7 +38,7 @@ using FlashData = std::tuple< Feed< 2 > const // expected vapour composition (2 selected components) >; -template< typename EOS_TYPE > +template< EquationOfStateType EOS_TYPE > class NegativeTwoPhaseFlashTest9CompFixture : public ::testing::TestWithParam< FlashData > { static constexpr real64 relTol = 1.0e-5; @@ -78,12 +78,14 @@ class NegativeTwoPhaseFlashTest9CompFixture : public ::testing::TestWithParam< stackArray2d< real64, numComps > kValues( 1, numComps ); kValues.zero(); - bool status = NegativeTwoPhaseFlash::compute< EOS_TYPE, EOS_TYPE >( + bool status = NegativeTwoPhaseFlash::compute( numComps, pressure, temperature, composition.toSliceConst(), componentProperties, + EOS_TYPE, + EOS_TYPE, kValues.toSlice(), vapourFraction, liquidComposition.toSlice(), @@ -155,12 +157,14 @@ class NegativeTwoPhaseFlashTest9CompFixture : public ::testing::TestWithParam< stackArray1d< real64, numComps > displacedLiquidComposition( numComps ); stackArray1d< real64, numComps > displacedVapourComposition( numComps ); - NegativeTwoPhaseFlash::compute< EOS_TYPE, EOS_TYPE >( + NegativeTwoPhaseFlash::compute( numComps, p, t, zmf.toSliceConst(), componentProperties, + EOS_TYPE, + EOS_TYPE, kValues.toSlice(), values[0], displacedLiquidComposition.toSlice(), @@ -172,23 +176,27 @@ class NegativeTwoPhaseFlashTest9CompFixture : public ::testing::TestWithParam< } }; - NegativeTwoPhaseFlash::compute< EOS_TYPE, EOS_TYPE >( + NegativeTwoPhaseFlash::compute( numComps, pressure, temperature, composition.toSliceConst(), componentProperties, + EOS_TYPE, + EOS_TYPE, kValues.toSlice(), vapourFraction, liquidComposition.toSlice(), vapourComposition.toSlice() ); - NegativeTwoPhaseFlash::computeDerivatives< EOS_TYPE, EOS_TYPE >( + NegativeTwoPhaseFlash::computeDerivatives( numComps, pressure, temperature, composition.toSliceConst(), componentProperties, + EOS_TYPE, + EOS_TYPE, vapourFraction, liquidComposition.toSliceConst(), vapourComposition.toSliceConst(), @@ -239,7 +247,7 @@ class NegativeTwoPhaseFlashTest9CompFixture : public ::testing::TestWithParam< static std::unique_ptr< TestFluid< numComps > > createFluid(); }; -template< typename EOS_TYPE > +template< EquationOfStateType EOS_TYPE > std::unique_ptr< TestFluid< numComps > > NegativeTwoPhaseFlashTest9CompFixture< EOS_TYPE >::createFluid() { std::unique_ptr< TestFluid< numComps > > fluid = TestFluid< numComps >::create( {0, 0, 0, 0, 0, 0, 0, 0, 0} ); @@ -263,25 +271,25 @@ std::unique_ptr< TestFluid< numComps > > NegativeTwoPhaseFlashTest9CompFixture< return fluid; } -using NegativeTwoPhaseFlash9CompPR = NegativeTwoPhaseFlashTest9CompFixture< CubicEOSPhaseModel< PengRobinsonEOS > >; -using NegativeTwoPhaseFlash9CompSRK = NegativeTwoPhaseFlashTest9CompFixture< CubicEOSPhaseModel< SoaveRedlichKwongEOS > >; +using PengRobinson = NegativeTwoPhaseFlashTest9CompFixture< EquationOfStateType::PengRobinson >; +using SoaveRedlichKwong = NegativeTwoPhaseFlashTest9CompFixture< EquationOfStateType::SoaveRedlichKwong >; -TEST_P( NegativeTwoPhaseFlash9CompPR, testNegativeFlash ) +TEST_P( PengRobinson, testNegativeFlash ) { testFlash( GetParam() ); } -TEST_P( NegativeTwoPhaseFlash9CompPR, testNegativeFlashDerivatives ) +TEST_P( PengRobinson, testNegativeFlashDerivatives ) { testFlashDerivatives( GetParam() ); } -TEST_P( NegativeTwoPhaseFlash9CompSRK, testNegativeFlash ) +TEST_P( SoaveRedlichKwong, testNegativeFlash ) { testFlash( GetParam() ); } -TEST_P( NegativeTwoPhaseFlash9CompSRK, testNegativeFlashDerivatives ) +TEST_P( SoaveRedlichKwong, testNegativeFlashDerivatives ) { testFlashDerivatives( GetParam() ); } @@ -293,8 +301,7 @@ TEST_P( NegativeTwoPhaseFlash9CompSRK, testNegativeFlashDerivatives ) /* UNCRUSTIFY-OFF */ INSTANTIATE_TEST_SUITE_P( - NegativeTwoPhaseFlash, - NegativeTwoPhaseFlash9CompPR, + NegativeTwoPhaseFlash, PengRobinson, ::testing::Values( FlashData( 1.000000e+05, 2.781500e+02, {0.000363, 0.000007, 0.003471, 0.006007, 0.018423, 0.034034, 0.042565, 0.056120, 0.839010}, 1, 0.000000, {0.000363, 0.839010}, {0.000363, 0.839010} ), FlashData( 1.000000e+05, 2.781500e+02, {0.009000, 0.003000, 0.534700, 0.114600, 0.087900, 0.045600, 0.020900, 0.015100, 0.169200}, 1, 0.798353, {0.000363, 0.839010}, {0.011181, 0.000020} ), @@ -422,8 +429,7 @@ INSTANTIATE_TEST_SUITE_P( ); INSTANTIATE_TEST_SUITE_P( - NegativeTwoPhaseFlash, - NegativeTwoPhaseFlash9CompSRK, + NegativeTwoPhaseFlash, SoaveRedlichKwong, ::testing::Values( FlashData( 1.000000e+05, 2.781500e+02, {0.000363, 0.000007, 0.003471, 0.006007, 0.018423, 0.034034, 0.042565, 0.056120, 0.839010}, 1, 0.000197, {0.000361, 0.839175}, {0.010852, 0.000016} ), FlashData( 1.000000e+05, 2.781500e+02, {0.009000, 0.003000, 0.534700, 0.114600, 0.087900, 0.045600, 0.020900, 0.015100, 0.169200}, 1, 0.798097, {0.000372, 0.837963}, {0.011183, 0.000016} ), diff --git a/src/coreComponents/constitutive/unitTests/testStabilityTest2Comp.cpp b/src/coreComponents/constitutive/unitTests/testStabilityTest2Comp.cpp index ca3ceef354d..df5e3d9abeb 100644 --- a/src/coreComponents/constitutive/unitTests/testStabilityTest2Comp.cpp +++ b/src/coreComponents/constitutive/unitTests/testStabilityTest2Comp.cpp @@ -38,7 +38,7 @@ using StabilityData = std::tuple< real64 const // expected tangent plane distance >; -template< typename EOS_TYPE > +template< EquationOfStateType EOS_TYPE > class StabilityTestTest2CompFixture : public ::testing::TestWithParam< StabilityData > { static constexpr real64 relTol = 1.0e-5; @@ -67,13 +67,14 @@ class StabilityTestTest2CompFixture : public ::testing::TestWithParam< Stabilit real64 tangentPlaneDistance = LvArray::NumericLimits< real64 >::max; stackArray1d< real64, numComps > kValues( numComps ); - bool const stabilityStatus = StabilityTest::compute< EOS_TYPE >( numComps, - pressure, - temperature, - composition.toSliceConst(), - componentProperties, - tangentPlaneDistance, - kValues.toSlice() ); + bool const stabilityStatus = StabilityTest::compute( numComps, + pressure, + temperature, + composition.toSliceConst(), + componentProperties, + EOS_TYPE, + tangentPlaneDistance, + kValues.toSlice() ); // Expect this to succeed ASSERT_EQ( stabilityStatus, true ); @@ -94,8 +95,8 @@ class StabilityTestTest2CompFixture : public ::testing::TestWithParam< Stabilit } }; -using PengRobinson = StabilityTestTest2CompFixture< CubicEOSPhaseModel< PengRobinsonEOS > >; -using SoaveRedlichKwong = StabilityTestTest2CompFixture< CubicEOSPhaseModel< SoaveRedlichKwongEOS > >; +using PengRobinson = StabilityTestTest2CompFixture< EquationOfStateType::PengRobinson >; +using SoaveRedlichKwong = StabilityTestTest2CompFixture< EquationOfStateType::SoaveRedlichKwong >; TEST_P( PengRobinson, testStabilityTest ) { testStability( GetParam() ); diff --git a/src/coreComponents/constitutive/unitTests/testStabilityTest9Comp.cpp b/src/coreComponents/constitutive/unitTests/testStabilityTest9Comp.cpp index 43a0a7f39f5..6ccca148aa5 100644 --- a/src/coreComponents/constitutive/unitTests/testStabilityTest9Comp.cpp +++ b/src/coreComponents/constitutive/unitTests/testStabilityTest9Comp.cpp @@ -17,7 +17,6 @@ #include "constitutive/fluid/multifluid/MultiFluidConstants.hpp" #include "constitutive/fluid/multifluid/compositional/functions/StabilityTest.hpp" #include "constitutive/fluid/multifluid/compositional/functions/NegativeTwoPhaseFlash.hpp" -#include "constitutive/fluid/multifluid/compositional/functions/CubicEOSPhaseModel.hpp" #include "TestFluid.hpp" #include "TestFluidUtilities.hpp" @@ -38,7 +37,7 @@ using FlashData = std::tuple< real64 const // expected tangent plane distance >; -template< typename EOS_TYPE > +template< EquationOfStateType EOS_TYPE > class StabilityTestTest9CompFixture : public ::testing::TestWithParam< FlashData > { static constexpr real64 relTol = 1.0e-5; @@ -65,13 +64,14 @@ class StabilityTestTest9CompFixture : public ::testing::TestWithParam< FlashDat real64 tangentPlaneDistance = LvArray::NumericLimits< real64 >::max; stackArray1d< real64, numComps > kValues( numComps ); - bool const stabilityStatus = StabilityTest::compute< EOS_TYPE >( numComps, - pressure, - temperature, - composition.toSliceConst(), - componentProperties, - tangentPlaneDistance, - kValues.toSlice() ); + bool const stabilityStatus = StabilityTest::compute( numComps, + pressure, + temperature, + composition.toSliceConst(), + componentProperties, + EOS_TYPE, + tangentPlaneDistance, + kValues.toSlice() ); // Expect this to succeed ASSERT_EQ( stabilityStatus, true ); @@ -92,25 +92,28 @@ class StabilityTestTest9CompFixture : public ::testing::TestWithParam< FlashDat real64 tangentPlaneDistance = LvArray::NumericLimits< real64 >::max; stackArray2d< real64, numComps > kValues( 1, numComps ); - StabilityTest::compute< EOS_TYPE >( numComps, - pressure, - temperature, - composition.toSliceConst(), - componentProperties, - tangentPlaneDistance, - kValues[0] ); + StabilityTest::compute( numComps, + pressure, + temperature, + composition.toSliceConst(), + componentProperties, + EOS_TYPE, + tangentPlaneDistance, + kValues[0] ); // Now perform the nagative flash real64 vapourFraction = -1.0; stackArray1d< real64, numComps > liquidComposition( numComps ); stackArray1d< real64, numComps > vapourComposition( numComps ); - bool const status = NegativeTwoPhaseFlash::compute< EOS_TYPE, EOS_TYPE >( + bool const status = NegativeTwoPhaseFlash::compute( numComps, pressure, temperature, composition.toSliceConst(), componentProperties, + EOS_TYPE, + EOS_TYPE, kValues.toSlice(), vapourFraction, liquidComposition.toSlice(), @@ -143,7 +146,7 @@ class StabilityTestTest9CompFixture : public ::testing::TestWithParam< FlashDat static std::unique_ptr< TestFluid< numComps > > createFluid(); }; -template< typename EOS_TYPE > +template< EquationOfStateType EOS_TYPE > std::unique_ptr< TestFluid< numComps > > StabilityTestTest9CompFixture< EOS_TYPE >::createFluid() { std::unique_ptr< TestFluid< numComps > > fluid = TestFluid< numComps >::create( {0, 0, 0, 0, 0, 0, 0, 0, 0} ); @@ -167,8 +170,8 @@ std::unique_ptr< TestFluid< numComps > > StabilityTestTest9CompFixture< EOS_TYPE return fluid; } -using PengRobinson = StabilityTestTest9CompFixture< CubicEOSPhaseModel< PengRobinsonEOS > >; -using SoaveRedlichKwong = StabilityTestTest9CompFixture< CubicEOSPhaseModel< SoaveRedlichKwongEOS > >; +using PengRobinson = StabilityTestTest9CompFixture< EquationOfStateType::PengRobinson >; +using SoaveRedlichKwong = StabilityTestTest9CompFixture< EquationOfStateType::SoaveRedlichKwong >; TEST_P( PengRobinson, testStabilityTest ) { testStability( GetParam() ); diff --git a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidPengRobinson.rst b/src/coreComponents/schema/docs/CompositionalTwoPhaseFluid.rst similarity index 83% rename from src/coreComponents/schema/docs/CompositionalTwoPhaseFluidPengRobinson.rst rename to src/coreComponents/schema/docs/CompositionalTwoPhaseFluid.rst index daeebbf1cce..e521b87e413 100644 --- a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidPengRobinson.rst +++ b/src/coreComponents/schema/docs/CompositionalTwoPhaseFluid.rst @@ -12,6 +12,9 @@ componentMolarWeight real64_array required Component molar weights componentNames string_array required List of component names componentVolumeShift real64_array {0} Component volume shifts constantPhaseViscosity real64_array {0} Constant phase viscosity +equationsOfState string_array required | List of equation of state types for each phase. Valid options: + | * pr + | * srk name groupName required A name is required for any non-unique nodes phaseNames groupNameRef_array required List of fluid phases ============================ ================== ======== ============================================================================================================ diff --git a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidPengRobinsonLBC.rst b/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidLohrenzBrayClark.rst similarity index 86% rename from src/coreComponents/schema/docs/CompositionalTwoPhaseFluidPengRobinsonLBC.rst rename to src/coreComponents/schema/docs/CompositionalTwoPhaseFluidLohrenzBrayClark.rst index 91834dab00d..7e0e2716d63 100644 --- a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidPengRobinsonLBC.rst +++ b/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidLohrenzBrayClark.rst @@ -12,6 +12,9 @@ componentCriticalVolume real64_array {0} Component critic componentMolarWeight real64_array required Component molar weights componentNames string_array required List of component names componentVolumeShift real64_array {0} Component volume shifts +equationsOfState string_array required | List of equation of state types for each phase. Valid options: + | * pr + | * srk name groupName required A name is required for any non-unique nodes phaseNames groupNameRef_array required List of fluid phases viscosityMixingRule string HerningZipperer | Viscosity mixing rule to be used for Lohrenz-Bray-Clark computation. Valid options: diff --git a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidPengRobinsonLBC_other.rst b/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidLohrenzBrayClark_other.rst similarity index 100% rename from src/coreComponents/schema/docs/CompositionalTwoPhaseFluidPengRobinsonLBC_other.rst rename to src/coreComponents/schema/docs/CompositionalTwoPhaseFluidLohrenzBrayClark_other.rst diff --git a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwong.rst b/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwong.rst deleted file mode 100644 index daeebbf1cce..00000000000 --- a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwong.rst +++ /dev/null @@ -1,19 +0,0 @@ - - -============================ ================== ======== ============================================================================================================ -Name Type Default Description -============================ ================== ======== ============================================================================================================ -checkPVTTablesRanges integer 1 Enable (1) or disable (0) an error when the input pressure or temperature of the PVT tables is out of range. -componentAcentricFactor real64_array required Component acentric factors -componentBinaryCoeff real64_array2d {{0}} Table of binary interaction coefficients -componentCriticalPressure real64_array required Component critical pressures -componentCriticalTemperature real64_array required Component critical temperatures -componentMolarWeight real64_array required Component molar weights -componentNames string_array required List of component names -componentVolumeShift real64_array {0} Component volume shifts -constantPhaseViscosity real64_array {0} Constant phase viscosity -name groupName required A name is required for any non-unique nodes -phaseNames groupNameRef_array required List of fluid phases -============================ ================== ======== ============================================================================================================ - - diff --git a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwongLBC.rst b/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwongLBC.rst deleted file mode 100644 index 91834dab00d..00000000000 --- a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwongLBC.rst +++ /dev/null @@ -1,23 +0,0 @@ - - -============================ ================== =============== ========================================================================================================================= -Name Type Default Description -============================ ================== =============== ========================================================================================================================= -checkPVTTablesRanges integer 1 Enable (1) or disable (0) an error when the input pressure or temperature of the PVT tables is out of range. -componentAcentricFactor real64_array required Component acentric factors -componentBinaryCoeff real64_array2d {{0}} Table of binary interaction coefficients -componentCriticalPressure real64_array required Component critical pressures -componentCriticalTemperature real64_array required Component critical temperatures -componentCriticalVolume real64_array {0} Component critical volumes -componentMolarWeight real64_array required Component molar weights -componentNames string_array required List of component names -componentVolumeShift real64_array {0} Component volume shifts -name groupName required A name is required for any non-unique nodes -phaseNames groupNameRef_array required List of fluid phases -viscosityMixingRule string HerningZipperer | Viscosity mixing rule to be used for Lohrenz-Bray-Clark computation. Valid options: - | * HerningZipperer - | * Wilke - | * Brokaw -============================ ================== =============== ========================================================================================================================= - - diff --git a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwongLBC_other.rst b/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwongLBC_other.rst deleted file mode 100644 index c8f51e2b3c9..00000000000 --- a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwongLBC_other.rst +++ /dev/null @@ -1,31 +0,0 @@ - - -===================== ========================================================================================= ============================================================================================================ -Name Type Description -===================== ========================================================================================= ============================================================================================================ -dPhaseCompFraction LvArray_Array, int, LvArray_ChaiBuffer> Derivative of phase component fraction with respect to pressure, temperature, and global component fractions -dPhaseDensity real64_array4d Derivative of phase density with respect to pressure, temperature, and global component fractions -dPhaseEnthalpy real64_array4d Derivative of phase enthalpy with respect to pressure, temperature, and global component fractions -dPhaseFraction real64_array4d Derivative of phase fraction with respect to pressure, temperature, and global component fractions -dPhaseInternalEnergy real64_array4d Derivative of phase internal energy with respect to pressure, temperature, and global component fractions -dPhaseMassDensity real64_array4d Derivative of phase mass density with respect to pressure, temperature, and global component fractions -dPhaseViscosity real64_array4d Derivative of phase viscosity with respect to pressure, temperature, and global component fractions -dTotalDensity real64_array3d Derivative of total density with respect to pressure, temperature, and global component fractions -kValues real64_array4d Phase equilibrium ratios -phaseCompFraction real64_array4d Phase component fraction -phaseCompFraction_n real64_array4d Phase component fraction at the previous converged time step -phaseDensity real64_array3d Phase density -phaseDensity_n real64_array3d Phase density at the previous converged time step -phaseEnthalpy real64_array3d Phase enthalpy -phaseEnthalpy_n real64_array3d Phase enthalpy at the previous converged time step -phaseFraction real64_array3d Phase fraction -phaseInternalEnergy real64_array3d Phase internal energy -phaseInternalEnergy_n real64_array3d Phase internal energy at the previous converged time step -phaseMassDensity real64_array3d Phase mass density -phaseViscosity real64_array3d Phase viscosity -totalDensity real64_array2d Total density -totalDensity_n real64_array2d Total density at the previous converged time step -useMass integer (no description available) -===================== ========================================================================================= ============================================================================================================ - - diff --git a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwong_other.rst b/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwong_other.rst deleted file mode 100644 index c8f51e2b3c9..00000000000 --- a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidSoaveRedlichKwong_other.rst +++ /dev/null @@ -1,31 +0,0 @@ - - -===================== ========================================================================================= ============================================================================================================ -Name Type Description -===================== ========================================================================================= ============================================================================================================ -dPhaseCompFraction LvArray_Array, int, LvArray_ChaiBuffer> Derivative of phase component fraction with respect to pressure, temperature, and global component fractions -dPhaseDensity real64_array4d Derivative of phase density with respect to pressure, temperature, and global component fractions -dPhaseEnthalpy real64_array4d Derivative of phase enthalpy with respect to pressure, temperature, and global component fractions -dPhaseFraction real64_array4d Derivative of phase fraction with respect to pressure, temperature, and global component fractions -dPhaseInternalEnergy real64_array4d Derivative of phase internal energy with respect to pressure, temperature, and global component fractions -dPhaseMassDensity real64_array4d Derivative of phase mass density with respect to pressure, temperature, and global component fractions -dPhaseViscosity real64_array4d Derivative of phase viscosity with respect to pressure, temperature, and global component fractions -dTotalDensity real64_array3d Derivative of total density with respect to pressure, temperature, and global component fractions -kValues real64_array4d Phase equilibrium ratios -phaseCompFraction real64_array4d Phase component fraction -phaseCompFraction_n real64_array4d Phase component fraction at the previous converged time step -phaseDensity real64_array3d Phase density -phaseDensity_n real64_array3d Phase density at the previous converged time step -phaseEnthalpy real64_array3d Phase enthalpy -phaseEnthalpy_n real64_array3d Phase enthalpy at the previous converged time step -phaseFraction real64_array3d Phase fraction -phaseInternalEnergy real64_array3d Phase internal energy -phaseInternalEnergy_n real64_array3d Phase internal energy at the previous converged time step -phaseMassDensity real64_array3d Phase mass density -phaseViscosity real64_array3d Phase viscosity -totalDensity real64_array2d Total density -totalDensity_n real64_array2d Total density at the previous converged time step -useMass integer (no description available) -===================== ========================================================================================= ============================================================================================================ - - diff --git a/src/coreComponents/schema/docs/CompositionalTwoPhaseFluidPengRobinson_other.rst b/src/coreComponents/schema/docs/CompositionalTwoPhaseFluid_other.rst similarity index 100% rename from src/coreComponents/schema/docs/CompositionalTwoPhaseFluidPengRobinson_other.rst rename to src/coreComponents/schema/docs/CompositionalTwoPhaseFluid_other.rst diff --git a/src/coreComponents/schema/docs/Constitutive.rst b/src/coreComponents/schema/docs/Constitutive.rst index d094325ded1..09b1aadeaff 100644 --- a/src/coreComponents/schema/docs/Constitutive.rst +++ b/src/coreComponents/schema/docs/Constitutive.rst @@ -1,93 +1,91 @@ -============================================== ==== ======= ========================================================= -Name Type Default Description -============================================== ==== ======= ========================================================= -BiotPorosity node :ref:`XML_BiotPorosity` -BlackOilFluid node :ref:`XML_BlackOilFluid` -BrooksCoreyBakerRelativePermeability node :ref:`XML_BrooksCoreyBakerRelativePermeability` -BrooksCoreyCapillaryPressure node :ref:`XML_BrooksCoreyCapillaryPressure` -BrooksCoreyRelativePermeability node :ref:`XML_BrooksCoreyRelativePermeability` -BrooksCoreyStone2RelativePermeability node :ref:`XML_BrooksCoreyStone2RelativePermeability` -CO2BrineEzrokhiFluid node :ref:`XML_CO2BrineEzrokhiFluid` -CO2BrineEzrokhiThermalFluid node :ref:`XML_CO2BrineEzrokhiThermalFluid` -CO2BrinePhillipsFluid node :ref:`XML_CO2BrinePhillipsFluid` -CO2BrinePhillipsThermalFluid node :ref:`XML_CO2BrinePhillipsThermalFluid` -CarmanKozenyPermeability node :ref:`XML_CarmanKozenyPermeability` -CeramicDamage node :ref:`XML_CeramicDamage` -CompositionalMultiphaseFluid node :ref:`XML_CompositionalMultiphaseFluid` -CompositionalTwoPhaseFluidPengRobinson node :ref:`XML_CompositionalTwoPhaseFluidPengRobinson` -CompositionalTwoPhaseFluidPengRobinsonLBC node :ref:`XML_CompositionalTwoPhaseFluidPengRobinsonLBC` -CompositionalTwoPhaseFluidSoaveRedlichKwong node :ref:`XML_CompositionalTwoPhaseFluidSoaveRedlichKwong` -CompositionalTwoPhaseFluidSoaveRedlichKwongLBC node :ref:`XML_CompositionalTwoPhaseFluidSoaveRedlichKwongLBC` -CompressibleSinglePhaseFluid node :ref:`XML_CompressibleSinglePhaseFluid` -CompressibleSolidCarmanKozenyPermeability node :ref:`XML_CompressibleSolidCarmanKozenyPermeability` -CompressibleSolidConstantPermeability node :ref:`XML_CompressibleSolidConstantPermeability` -CompressibleSolidExponentialDecayPermeability node :ref:`XML_CompressibleSolidExponentialDecayPermeability` -CompressibleSolidParallelPlatesPermeability node :ref:`XML_CompressibleSolidParallelPlatesPermeability` -CompressibleSolidPressurePermeability node :ref:`XML_CompressibleSolidPressurePermeability` -CompressibleSolidSlipDependentPermeability node :ref:`XML_CompressibleSolidSlipDependentPermeability` -CompressibleSolidWillisRichardsPermeability node :ref:`XML_CompressibleSolidWillisRichardsPermeability` -ConstantDiffusion node :ref:`XML_ConstantDiffusion` -ConstantPermeability node :ref:`XML_ConstantPermeability` -Coulomb node :ref:`XML_Coulomb` -DamageElasticIsotropic node :ref:`XML_DamageElasticIsotropic` -DamageSpectralElasticIsotropic node :ref:`XML_DamageSpectralElasticIsotropic` -DamageVolDevElasticIsotropic node :ref:`XML_DamageVolDevElasticIsotropic` -DeadOilFluid node :ref:`XML_DeadOilFluid` -DelftEgg node :ref:`XML_DelftEgg` -DruckerPrager node :ref:`XML_DruckerPrager` -ElasticIsotropic node :ref:`XML_ElasticIsotropic` -ElasticIsotropicPressureDependent node :ref:`XML_ElasticIsotropicPressureDependent` -ElasticOrthotropic node :ref:`XML_ElasticOrthotropic` -ElasticTransverseIsotropic node :ref:`XML_ElasticTransverseIsotropic` -ExponentialDecayPermeability node :ref:`XML_ExponentialDecayPermeability` -ExtendedDruckerPrager node :ref:`XML_ExtendedDruckerPrager` -FrictionlessContact node :ref:`XML_FrictionlessContact` -JFunctionCapillaryPressure node :ref:`XML_JFunctionCapillaryPressure` -LinearIsotropicDispersion node :ref:`XML_LinearIsotropicDispersion` -ModifiedCamClay node :ref:`XML_ModifiedCamClay` -MultiPhaseConstantThermalConductivity node :ref:`XML_MultiPhaseConstantThermalConductivity` -MultiPhaseVolumeWeightedThermalConductivity node :ref:`XML_MultiPhaseVolumeWeightedThermalConductivity` -NullModel node :ref:`XML_NullModel` -ParallelPlatesPermeability node :ref:`XML_ParallelPlatesPermeability` -ParticleFluid node :ref:`XML_ParticleFluid` -PerfectlyPlastic node :ref:`XML_PerfectlyPlastic` -PorousDamageElasticIsotropic node :ref:`XML_PorousDamageElasticIsotropic` -PorousDamageSpectralElasticIsotropic node :ref:`XML_PorousDamageSpectralElasticIsotropic` -PorousDamageVolDevElasticIsotropic node :ref:`XML_PorousDamageVolDevElasticIsotropic` -PorousDelftEgg node :ref:`XML_PorousDelftEgg` -PorousDruckerPrager node :ref:`XML_PorousDruckerPrager` -PorousElasticIsotropic node :ref:`XML_PorousElasticIsotropic` -PorousElasticOrthotropic node :ref:`XML_PorousElasticOrthotropic` -PorousElasticTransverseIsotropic node :ref:`XML_PorousElasticTransverseIsotropic` -PorousExtendedDruckerPrager node :ref:`XML_PorousExtendedDruckerPrager` -PorousModifiedCamClay node :ref:`XML_PorousModifiedCamClay` -PorousViscoDruckerPrager node :ref:`XML_PorousViscoDruckerPrager` -PorousViscoExtendedDruckerPrager node :ref:`XML_PorousViscoExtendedDruckerPrager` -PorousViscoModifiedCamClay node :ref:`XML_PorousViscoModifiedCamClay` -PressurePermeability node :ref:`XML_PressurePermeability` -PressurePorosity node :ref:`XML_PressurePorosity` -ProppantPermeability node :ref:`XML_ProppantPermeability` -ProppantPorosity node :ref:`XML_ProppantPorosity` -ProppantSlurryFluid node :ref:`XML_ProppantSlurryFluid` -ProppantSolidProppantPermeability node :ref:`XML_ProppantSolidProppantPermeability` -ReactiveBrine node :ref:`XML_ReactiveBrine` -ReactiveBrineThermal node :ref:`XML_ReactiveBrineThermal` -SinglePhaseConstantThermalConductivity node :ref:`XML_SinglePhaseConstantThermalConductivity` -SlipDependentPermeability node :ref:`XML_SlipDependentPermeability` -SolidInternalEnergy node :ref:`XML_SolidInternalEnergy` -TableCapillaryPressure node :ref:`XML_TableCapillaryPressure` -TableRelativePermeability node :ref:`XML_TableRelativePermeability` -TableRelativePermeabilityHysteresis node :ref:`XML_TableRelativePermeabilityHysteresis` -ThermalCompressibleSinglePhaseFluid node :ref:`XML_ThermalCompressibleSinglePhaseFluid` -VanGenuchtenBakerRelativePermeability node :ref:`XML_VanGenuchtenBakerRelativePermeability` -VanGenuchtenCapillaryPressure node :ref:`XML_VanGenuchtenCapillaryPressure` -VanGenuchtenStone2RelativePermeability node :ref:`XML_VanGenuchtenStone2RelativePermeability` -ViscoDruckerPrager node :ref:`XML_ViscoDruckerPrager` -ViscoExtendedDruckerPrager node :ref:`XML_ViscoExtendedDruckerPrager` -ViscoModifiedCamClay node :ref:`XML_ViscoModifiedCamClay` -WillisRichardsPermeability node :ref:`XML_WillisRichardsPermeability` -============================================== ==== ======= ========================================================= +============================================= ==== ======= ======================================================== +Name Type Default Description +============================================= ==== ======= ======================================================== +BiotPorosity node :ref:`XML_BiotPorosity` +BlackOilFluid node :ref:`XML_BlackOilFluid` +BrooksCoreyBakerRelativePermeability node :ref:`XML_BrooksCoreyBakerRelativePermeability` +BrooksCoreyCapillaryPressure node :ref:`XML_BrooksCoreyCapillaryPressure` +BrooksCoreyRelativePermeability node :ref:`XML_BrooksCoreyRelativePermeability` +BrooksCoreyStone2RelativePermeability node :ref:`XML_BrooksCoreyStone2RelativePermeability` +CO2BrineEzrokhiFluid node :ref:`XML_CO2BrineEzrokhiFluid` +CO2BrineEzrokhiThermalFluid node :ref:`XML_CO2BrineEzrokhiThermalFluid` +CO2BrinePhillipsFluid node :ref:`XML_CO2BrinePhillipsFluid` +CO2BrinePhillipsThermalFluid node :ref:`XML_CO2BrinePhillipsThermalFluid` +CarmanKozenyPermeability node :ref:`XML_CarmanKozenyPermeability` +CeramicDamage node :ref:`XML_CeramicDamage` +CompositionalMultiphaseFluid node :ref:`XML_CompositionalMultiphaseFluid` +CompositionalTwoPhaseFluid node :ref:`XML_CompositionalTwoPhaseFluid` +CompositionalTwoPhaseFluidLohrenzBrayClark node :ref:`XML_CompositionalTwoPhaseFluidLohrenzBrayClark` +CompressibleSinglePhaseFluid node :ref:`XML_CompressibleSinglePhaseFluid` +CompressibleSolidCarmanKozenyPermeability node :ref:`XML_CompressibleSolidCarmanKozenyPermeability` +CompressibleSolidConstantPermeability node :ref:`XML_CompressibleSolidConstantPermeability` +CompressibleSolidExponentialDecayPermeability node :ref:`XML_CompressibleSolidExponentialDecayPermeability` +CompressibleSolidParallelPlatesPermeability node :ref:`XML_CompressibleSolidParallelPlatesPermeability` +CompressibleSolidPressurePermeability node :ref:`XML_CompressibleSolidPressurePermeability` +CompressibleSolidSlipDependentPermeability node :ref:`XML_CompressibleSolidSlipDependentPermeability` +CompressibleSolidWillisRichardsPermeability node :ref:`XML_CompressibleSolidWillisRichardsPermeability` +ConstantDiffusion node :ref:`XML_ConstantDiffusion` +ConstantPermeability node :ref:`XML_ConstantPermeability` +Coulomb node :ref:`XML_Coulomb` +DamageElasticIsotropic node :ref:`XML_DamageElasticIsotropic` +DamageSpectralElasticIsotropic node :ref:`XML_DamageSpectralElasticIsotropic` +DamageVolDevElasticIsotropic node :ref:`XML_DamageVolDevElasticIsotropic` +DeadOilFluid node :ref:`XML_DeadOilFluid` +DelftEgg node :ref:`XML_DelftEgg` +DruckerPrager node :ref:`XML_DruckerPrager` +ElasticIsotropic node :ref:`XML_ElasticIsotropic` +ElasticIsotropicPressureDependent node :ref:`XML_ElasticIsotropicPressureDependent` +ElasticOrthotropic node :ref:`XML_ElasticOrthotropic` +ElasticTransverseIsotropic node :ref:`XML_ElasticTransverseIsotropic` +ExponentialDecayPermeability node :ref:`XML_ExponentialDecayPermeability` +ExtendedDruckerPrager node :ref:`XML_ExtendedDruckerPrager` +FrictionlessContact node :ref:`XML_FrictionlessContact` +JFunctionCapillaryPressure node :ref:`XML_JFunctionCapillaryPressure` +LinearIsotropicDispersion node :ref:`XML_LinearIsotropicDispersion` +ModifiedCamClay node :ref:`XML_ModifiedCamClay` +MultiPhaseConstantThermalConductivity node :ref:`XML_MultiPhaseConstantThermalConductivity` +MultiPhaseVolumeWeightedThermalConductivity node :ref:`XML_MultiPhaseVolumeWeightedThermalConductivity` +NullModel node :ref:`XML_NullModel` +ParallelPlatesPermeability node :ref:`XML_ParallelPlatesPermeability` +ParticleFluid node :ref:`XML_ParticleFluid` +PerfectlyPlastic node :ref:`XML_PerfectlyPlastic` +PorousDamageElasticIsotropic node :ref:`XML_PorousDamageElasticIsotropic` +PorousDamageSpectralElasticIsotropic node :ref:`XML_PorousDamageSpectralElasticIsotropic` +PorousDamageVolDevElasticIsotropic node :ref:`XML_PorousDamageVolDevElasticIsotropic` +PorousDelftEgg node :ref:`XML_PorousDelftEgg` +PorousDruckerPrager node :ref:`XML_PorousDruckerPrager` +PorousElasticIsotropic node :ref:`XML_PorousElasticIsotropic` +PorousElasticOrthotropic node :ref:`XML_PorousElasticOrthotropic` +PorousElasticTransverseIsotropic node :ref:`XML_PorousElasticTransverseIsotropic` +PorousExtendedDruckerPrager node :ref:`XML_PorousExtendedDruckerPrager` +PorousModifiedCamClay node :ref:`XML_PorousModifiedCamClay` +PorousViscoDruckerPrager node :ref:`XML_PorousViscoDruckerPrager` +PorousViscoExtendedDruckerPrager node :ref:`XML_PorousViscoExtendedDruckerPrager` +PorousViscoModifiedCamClay node :ref:`XML_PorousViscoModifiedCamClay` +PressurePermeability node :ref:`XML_PressurePermeability` +PressurePorosity node :ref:`XML_PressurePorosity` +ProppantPermeability node :ref:`XML_ProppantPermeability` +ProppantPorosity node :ref:`XML_ProppantPorosity` +ProppantSlurryFluid node :ref:`XML_ProppantSlurryFluid` +ProppantSolidProppantPermeability node :ref:`XML_ProppantSolidProppantPermeability` +ReactiveBrine node :ref:`XML_ReactiveBrine` +ReactiveBrineThermal node :ref:`XML_ReactiveBrineThermal` +SinglePhaseConstantThermalConductivity node :ref:`XML_SinglePhaseConstantThermalConductivity` +SlipDependentPermeability node :ref:`XML_SlipDependentPermeability` +SolidInternalEnergy node :ref:`XML_SolidInternalEnergy` +TableCapillaryPressure node :ref:`XML_TableCapillaryPressure` +TableRelativePermeability node :ref:`XML_TableRelativePermeability` +TableRelativePermeabilityHysteresis node :ref:`XML_TableRelativePermeabilityHysteresis` +ThermalCompressibleSinglePhaseFluid node :ref:`XML_ThermalCompressibleSinglePhaseFluid` +VanGenuchtenBakerRelativePermeability node :ref:`XML_VanGenuchtenBakerRelativePermeability` +VanGenuchtenCapillaryPressure node :ref:`XML_VanGenuchtenCapillaryPressure` +VanGenuchtenStone2RelativePermeability node :ref:`XML_VanGenuchtenStone2RelativePermeability` +ViscoDruckerPrager node :ref:`XML_ViscoDruckerPrager` +ViscoExtendedDruckerPrager node :ref:`XML_ViscoExtendedDruckerPrager` +ViscoModifiedCamClay node :ref:`XML_ViscoModifiedCamClay` +WillisRichardsPermeability node :ref:`XML_WillisRichardsPermeability` +============================================= ==== ======= ======================================================== diff --git a/src/coreComponents/schema/docs/Constitutive_other.rst b/src/coreComponents/schema/docs/Constitutive_other.rst index 93ffa5b4966..d95527f1483 100644 --- a/src/coreComponents/schema/docs/Constitutive_other.rst +++ b/src/coreComponents/schema/docs/Constitutive_other.rst @@ -1,93 +1,91 @@ -============================================== ==== =================================================================== -Name Type Description -============================================== ==== =================================================================== -BiotPorosity node :ref:`DATASTRUCTURE_BiotPorosity` -BlackOilFluid node :ref:`DATASTRUCTURE_BlackOilFluid` -BrooksCoreyBakerRelativePermeability node :ref:`DATASTRUCTURE_BrooksCoreyBakerRelativePermeability` -BrooksCoreyCapillaryPressure node :ref:`DATASTRUCTURE_BrooksCoreyCapillaryPressure` -BrooksCoreyRelativePermeability node :ref:`DATASTRUCTURE_BrooksCoreyRelativePermeability` -BrooksCoreyStone2RelativePermeability node :ref:`DATASTRUCTURE_BrooksCoreyStone2RelativePermeability` -CO2BrineEzrokhiFluid node :ref:`DATASTRUCTURE_CO2BrineEzrokhiFluid` -CO2BrineEzrokhiThermalFluid node :ref:`DATASTRUCTURE_CO2BrineEzrokhiThermalFluid` -CO2BrinePhillipsFluid node :ref:`DATASTRUCTURE_CO2BrinePhillipsFluid` -CO2BrinePhillipsThermalFluid node :ref:`DATASTRUCTURE_CO2BrinePhillipsThermalFluid` -CarmanKozenyPermeability node :ref:`DATASTRUCTURE_CarmanKozenyPermeability` -CeramicDamage node :ref:`DATASTRUCTURE_CeramicDamage` -CompositionalMultiphaseFluid node :ref:`DATASTRUCTURE_CompositionalMultiphaseFluid` -CompositionalTwoPhaseFluidPengRobinson node :ref:`DATASTRUCTURE_CompositionalTwoPhaseFluidPengRobinson` -CompositionalTwoPhaseFluidPengRobinsonLBC node :ref:`DATASTRUCTURE_CompositionalTwoPhaseFluidPengRobinsonLBC` -CompositionalTwoPhaseFluidSoaveRedlichKwong node :ref:`DATASTRUCTURE_CompositionalTwoPhaseFluidSoaveRedlichKwong` -CompositionalTwoPhaseFluidSoaveRedlichKwongLBC node :ref:`DATASTRUCTURE_CompositionalTwoPhaseFluidSoaveRedlichKwongLBC` -CompressibleSinglePhaseFluid node :ref:`DATASTRUCTURE_CompressibleSinglePhaseFluid` -CompressibleSolidCarmanKozenyPermeability node :ref:`DATASTRUCTURE_CompressibleSolidCarmanKozenyPermeability` -CompressibleSolidConstantPermeability node :ref:`DATASTRUCTURE_CompressibleSolidConstantPermeability` -CompressibleSolidExponentialDecayPermeability node :ref:`DATASTRUCTURE_CompressibleSolidExponentialDecayPermeability` -CompressibleSolidParallelPlatesPermeability node :ref:`DATASTRUCTURE_CompressibleSolidParallelPlatesPermeability` -CompressibleSolidPressurePermeability node :ref:`DATASTRUCTURE_CompressibleSolidPressurePermeability` -CompressibleSolidSlipDependentPermeability node :ref:`DATASTRUCTURE_CompressibleSolidSlipDependentPermeability` -CompressibleSolidWillisRichardsPermeability node :ref:`DATASTRUCTURE_CompressibleSolidWillisRichardsPermeability` -ConstantDiffusion node :ref:`DATASTRUCTURE_ConstantDiffusion` -ConstantPermeability node :ref:`DATASTRUCTURE_ConstantPermeability` -Coulomb node :ref:`DATASTRUCTURE_Coulomb` -DamageElasticIsotropic node :ref:`DATASTRUCTURE_DamageElasticIsotropic` -DamageSpectralElasticIsotropic node :ref:`DATASTRUCTURE_DamageSpectralElasticIsotropic` -DamageVolDevElasticIsotropic node :ref:`DATASTRUCTURE_DamageVolDevElasticIsotropic` -DeadOilFluid node :ref:`DATASTRUCTURE_DeadOilFluid` -DelftEgg node :ref:`DATASTRUCTURE_DelftEgg` -DruckerPrager node :ref:`DATASTRUCTURE_DruckerPrager` -ElasticIsotropic node :ref:`DATASTRUCTURE_ElasticIsotropic` -ElasticIsotropicPressureDependent node :ref:`DATASTRUCTURE_ElasticIsotropicPressureDependent` -ElasticOrthotropic node :ref:`DATASTRUCTURE_ElasticOrthotropic` -ElasticTransverseIsotropic node :ref:`DATASTRUCTURE_ElasticTransverseIsotropic` -ExponentialDecayPermeability node :ref:`DATASTRUCTURE_ExponentialDecayPermeability` -ExtendedDruckerPrager node :ref:`DATASTRUCTURE_ExtendedDruckerPrager` -FrictionlessContact node :ref:`DATASTRUCTURE_FrictionlessContact` -JFunctionCapillaryPressure node :ref:`DATASTRUCTURE_JFunctionCapillaryPressure` -LinearIsotropicDispersion node :ref:`DATASTRUCTURE_LinearIsotropicDispersion` -ModifiedCamClay node :ref:`DATASTRUCTURE_ModifiedCamClay` -MultiPhaseConstantThermalConductivity node :ref:`DATASTRUCTURE_MultiPhaseConstantThermalConductivity` -MultiPhaseVolumeWeightedThermalConductivity node :ref:`DATASTRUCTURE_MultiPhaseVolumeWeightedThermalConductivity` -NullModel node :ref:`DATASTRUCTURE_NullModel` -ParallelPlatesPermeability node :ref:`DATASTRUCTURE_ParallelPlatesPermeability` -ParticleFluid node :ref:`DATASTRUCTURE_ParticleFluid` -PerfectlyPlastic node :ref:`DATASTRUCTURE_PerfectlyPlastic` -PorousDamageElasticIsotropic node :ref:`DATASTRUCTURE_PorousDamageElasticIsotropic` -PorousDamageSpectralElasticIsotropic node :ref:`DATASTRUCTURE_PorousDamageSpectralElasticIsotropic` -PorousDamageVolDevElasticIsotropic node :ref:`DATASTRUCTURE_PorousDamageVolDevElasticIsotropic` -PorousDelftEgg node :ref:`DATASTRUCTURE_PorousDelftEgg` -PorousDruckerPrager node :ref:`DATASTRUCTURE_PorousDruckerPrager` -PorousElasticIsotropic node :ref:`DATASTRUCTURE_PorousElasticIsotropic` -PorousElasticOrthotropic node :ref:`DATASTRUCTURE_PorousElasticOrthotropic` -PorousElasticTransverseIsotropic node :ref:`DATASTRUCTURE_PorousElasticTransverseIsotropic` -PorousExtendedDruckerPrager node :ref:`DATASTRUCTURE_PorousExtendedDruckerPrager` -PorousModifiedCamClay node :ref:`DATASTRUCTURE_PorousModifiedCamClay` -PorousViscoDruckerPrager node :ref:`DATASTRUCTURE_PorousViscoDruckerPrager` -PorousViscoExtendedDruckerPrager node :ref:`DATASTRUCTURE_PorousViscoExtendedDruckerPrager` -PorousViscoModifiedCamClay node :ref:`DATASTRUCTURE_PorousViscoModifiedCamClay` -PressurePermeability node :ref:`DATASTRUCTURE_PressurePermeability` -PressurePorosity node :ref:`DATASTRUCTURE_PressurePorosity` -ProppantPermeability node :ref:`DATASTRUCTURE_ProppantPermeability` -ProppantPorosity node :ref:`DATASTRUCTURE_ProppantPorosity` -ProppantSlurryFluid node :ref:`DATASTRUCTURE_ProppantSlurryFluid` -ProppantSolidProppantPermeability node :ref:`DATASTRUCTURE_ProppantSolidProppantPermeability` -ReactiveBrine node :ref:`DATASTRUCTURE_ReactiveBrine` -ReactiveBrineThermal node :ref:`DATASTRUCTURE_ReactiveBrineThermal` -SinglePhaseConstantThermalConductivity node :ref:`DATASTRUCTURE_SinglePhaseConstantThermalConductivity` -SlipDependentPermeability node :ref:`DATASTRUCTURE_SlipDependentPermeability` -SolidInternalEnergy node :ref:`DATASTRUCTURE_SolidInternalEnergy` -TableCapillaryPressure node :ref:`DATASTRUCTURE_TableCapillaryPressure` -TableRelativePermeability node :ref:`DATASTRUCTURE_TableRelativePermeability` -TableRelativePermeabilityHysteresis node :ref:`DATASTRUCTURE_TableRelativePermeabilityHysteresis` -ThermalCompressibleSinglePhaseFluid node :ref:`DATASTRUCTURE_ThermalCompressibleSinglePhaseFluid` -VanGenuchtenBakerRelativePermeability node :ref:`DATASTRUCTURE_VanGenuchtenBakerRelativePermeability` -VanGenuchtenCapillaryPressure node :ref:`DATASTRUCTURE_VanGenuchtenCapillaryPressure` -VanGenuchtenStone2RelativePermeability node :ref:`DATASTRUCTURE_VanGenuchtenStone2RelativePermeability` -ViscoDruckerPrager node :ref:`DATASTRUCTURE_ViscoDruckerPrager` -ViscoExtendedDruckerPrager node :ref:`DATASTRUCTURE_ViscoExtendedDruckerPrager` -ViscoModifiedCamClay node :ref:`DATASTRUCTURE_ViscoModifiedCamClay` -WillisRichardsPermeability node :ref:`DATASTRUCTURE_WillisRichardsPermeability` -============================================== ==== =================================================================== +============================================= ==== ================================================================== +Name Type Description +============================================= ==== ================================================================== +BiotPorosity node :ref:`DATASTRUCTURE_BiotPorosity` +BlackOilFluid node :ref:`DATASTRUCTURE_BlackOilFluid` +BrooksCoreyBakerRelativePermeability node :ref:`DATASTRUCTURE_BrooksCoreyBakerRelativePermeability` +BrooksCoreyCapillaryPressure node :ref:`DATASTRUCTURE_BrooksCoreyCapillaryPressure` +BrooksCoreyRelativePermeability node :ref:`DATASTRUCTURE_BrooksCoreyRelativePermeability` +BrooksCoreyStone2RelativePermeability node :ref:`DATASTRUCTURE_BrooksCoreyStone2RelativePermeability` +CO2BrineEzrokhiFluid node :ref:`DATASTRUCTURE_CO2BrineEzrokhiFluid` +CO2BrineEzrokhiThermalFluid node :ref:`DATASTRUCTURE_CO2BrineEzrokhiThermalFluid` +CO2BrinePhillipsFluid node :ref:`DATASTRUCTURE_CO2BrinePhillipsFluid` +CO2BrinePhillipsThermalFluid node :ref:`DATASTRUCTURE_CO2BrinePhillipsThermalFluid` +CarmanKozenyPermeability node :ref:`DATASTRUCTURE_CarmanKozenyPermeability` +CeramicDamage node :ref:`DATASTRUCTURE_CeramicDamage` +CompositionalMultiphaseFluid node :ref:`DATASTRUCTURE_CompositionalMultiphaseFluid` +CompositionalTwoPhaseFluid node :ref:`DATASTRUCTURE_CompositionalTwoPhaseFluid` +CompositionalTwoPhaseFluidLohrenzBrayClark node :ref:`DATASTRUCTURE_CompositionalTwoPhaseFluidLohrenzBrayClark` +CompressibleSinglePhaseFluid node :ref:`DATASTRUCTURE_CompressibleSinglePhaseFluid` +CompressibleSolidCarmanKozenyPermeability node :ref:`DATASTRUCTURE_CompressibleSolidCarmanKozenyPermeability` +CompressibleSolidConstantPermeability node :ref:`DATASTRUCTURE_CompressibleSolidConstantPermeability` +CompressibleSolidExponentialDecayPermeability node :ref:`DATASTRUCTURE_CompressibleSolidExponentialDecayPermeability` +CompressibleSolidParallelPlatesPermeability node :ref:`DATASTRUCTURE_CompressibleSolidParallelPlatesPermeability` +CompressibleSolidPressurePermeability node :ref:`DATASTRUCTURE_CompressibleSolidPressurePermeability` +CompressibleSolidSlipDependentPermeability node :ref:`DATASTRUCTURE_CompressibleSolidSlipDependentPermeability` +CompressibleSolidWillisRichardsPermeability node :ref:`DATASTRUCTURE_CompressibleSolidWillisRichardsPermeability` +ConstantDiffusion node :ref:`DATASTRUCTURE_ConstantDiffusion` +ConstantPermeability node :ref:`DATASTRUCTURE_ConstantPermeability` +Coulomb node :ref:`DATASTRUCTURE_Coulomb` +DamageElasticIsotropic node :ref:`DATASTRUCTURE_DamageElasticIsotropic` +DamageSpectralElasticIsotropic node :ref:`DATASTRUCTURE_DamageSpectralElasticIsotropic` +DamageVolDevElasticIsotropic node :ref:`DATASTRUCTURE_DamageVolDevElasticIsotropic` +DeadOilFluid node :ref:`DATASTRUCTURE_DeadOilFluid` +DelftEgg node :ref:`DATASTRUCTURE_DelftEgg` +DruckerPrager node :ref:`DATASTRUCTURE_DruckerPrager` +ElasticIsotropic node :ref:`DATASTRUCTURE_ElasticIsotropic` +ElasticIsotropicPressureDependent node :ref:`DATASTRUCTURE_ElasticIsotropicPressureDependent` +ElasticOrthotropic node :ref:`DATASTRUCTURE_ElasticOrthotropic` +ElasticTransverseIsotropic node :ref:`DATASTRUCTURE_ElasticTransverseIsotropic` +ExponentialDecayPermeability node :ref:`DATASTRUCTURE_ExponentialDecayPermeability` +ExtendedDruckerPrager node :ref:`DATASTRUCTURE_ExtendedDruckerPrager` +FrictionlessContact node :ref:`DATASTRUCTURE_FrictionlessContact` +JFunctionCapillaryPressure node :ref:`DATASTRUCTURE_JFunctionCapillaryPressure` +LinearIsotropicDispersion node :ref:`DATASTRUCTURE_LinearIsotropicDispersion` +ModifiedCamClay node :ref:`DATASTRUCTURE_ModifiedCamClay` +MultiPhaseConstantThermalConductivity node :ref:`DATASTRUCTURE_MultiPhaseConstantThermalConductivity` +MultiPhaseVolumeWeightedThermalConductivity node :ref:`DATASTRUCTURE_MultiPhaseVolumeWeightedThermalConductivity` +NullModel node :ref:`DATASTRUCTURE_NullModel` +ParallelPlatesPermeability node :ref:`DATASTRUCTURE_ParallelPlatesPermeability` +ParticleFluid node :ref:`DATASTRUCTURE_ParticleFluid` +PerfectlyPlastic node :ref:`DATASTRUCTURE_PerfectlyPlastic` +PorousDamageElasticIsotropic node :ref:`DATASTRUCTURE_PorousDamageElasticIsotropic` +PorousDamageSpectralElasticIsotropic node :ref:`DATASTRUCTURE_PorousDamageSpectralElasticIsotropic` +PorousDamageVolDevElasticIsotropic node :ref:`DATASTRUCTURE_PorousDamageVolDevElasticIsotropic` +PorousDelftEgg node :ref:`DATASTRUCTURE_PorousDelftEgg` +PorousDruckerPrager node :ref:`DATASTRUCTURE_PorousDruckerPrager` +PorousElasticIsotropic node :ref:`DATASTRUCTURE_PorousElasticIsotropic` +PorousElasticOrthotropic node :ref:`DATASTRUCTURE_PorousElasticOrthotropic` +PorousElasticTransverseIsotropic node :ref:`DATASTRUCTURE_PorousElasticTransverseIsotropic` +PorousExtendedDruckerPrager node :ref:`DATASTRUCTURE_PorousExtendedDruckerPrager` +PorousModifiedCamClay node :ref:`DATASTRUCTURE_PorousModifiedCamClay` +PorousViscoDruckerPrager node :ref:`DATASTRUCTURE_PorousViscoDruckerPrager` +PorousViscoExtendedDruckerPrager node :ref:`DATASTRUCTURE_PorousViscoExtendedDruckerPrager` +PorousViscoModifiedCamClay node :ref:`DATASTRUCTURE_PorousViscoModifiedCamClay` +PressurePermeability node :ref:`DATASTRUCTURE_PressurePermeability` +PressurePorosity node :ref:`DATASTRUCTURE_PressurePorosity` +ProppantPermeability node :ref:`DATASTRUCTURE_ProppantPermeability` +ProppantPorosity node :ref:`DATASTRUCTURE_ProppantPorosity` +ProppantSlurryFluid node :ref:`DATASTRUCTURE_ProppantSlurryFluid` +ProppantSolidProppantPermeability node :ref:`DATASTRUCTURE_ProppantSolidProppantPermeability` +ReactiveBrine node :ref:`DATASTRUCTURE_ReactiveBrine` +ReactiveBrineThermal node :ref:`DATASTRUCTURE_ReactiveBrineThermal` +SinglePhaseConstantThermalConductivity node :ref:`DATASTRUCTURE_SinglePhaseConstantThermalConductivity` +SlipDependentPermeability node :ref:`DATASTRUCTURE_SlipDependentPermeability` +SolidInternalEnergy node :ref:`DATASTRUCTURE_SolidInternalEnergy` +TableCapillaryPressure node :ref:`DATASTRUCTURE_TableCapillaryPressure` +TableRelativePermeability node :ref:`DATASTRUCTURE_TableRelativePermeability` +TableRelativePermeabilityHysteresis node :ref:`DATASTRUCTURE_TableRelativePermeabilityHysteresis` +ThermalCompressibleSinglePhaseFluid node :ref:`DATASTRUCTURE_ThermalCompressibleSinglePhaseFluid` +VanGenuchtenBakerRelativePermeability node :ref:`DATASTRUCTURE_VanGenuchtenBakerRelativePermeability` +VanGenuchtenCapillaryPressure node :ref:`DATASTRUCTURE_VanGenuchtenCapillaryPressure` +VanGenuchtenStone2RelativePermeability node :ref:`DATASTRUCTURE_VanGenuchtenStone2RelativePermeability` +ViscoDruckerPrager node :ref:`DATASTRUCTURE_ViscoDruckerPrager` +ViscoExtendedDruckerPrager node :ref:`DATASTRUCTURE_ViscoExtendedDruckerPrager` +ViscoModifiedCamClay node :ref:`DATASTRUCTURE_ViscoModifiedCamClay` +WillisRichardsPermeability node :ref:`DATASTRUCTURE_WillisRichardsPermeability` +============================================= ==== ================================================================== diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index 64b3936663f..ecbf7a1b217 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -593,20 +593,12 @@ - - + + - - - - - - - - - - + + @@ -4147,10 +4139,8 @@ Local- Add jump stabilization on interior of macro elements--> - - - - + + @@ -4471,60 +4461,7 @@ The expected format is "{ waterMax, oilMax }", in that order--> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -4543,12 +4480,16 @@ The expected format is "{ waterMax, oilMax }", in that order--> + + - + @@ -4567,6 +4508,10 @@ The expected format is "{ waterMax, oilMax }", in that order--> + + - + @@ -1938,103 +1936,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional.xml b/src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional.xml index 20ac42736ec..2d811787db2 100644 --- a/src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional.xml +++ b/src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional.xml @@ -69,9 +69,10 @@ - - - - Date: Tue, 2 Jul 2024 21:29:14 -0700 Subject: [PATCH 5/5] Disable generation of globalIDs in GEOS for fracture meshes (#3200) * disable generation of globalIDs in GEOS for fracture meshes --------- Co-authored-by: Matteo Cusini <49037133+CusiniM@users.noreply.github.com> Co-authored-by: TotoGaz <49004943+TotoGaz@users.noreply.github.com> --- src/coreComponents/mesh/ElementType.hpp | 2 +- src/coreComponents/mesh/generators/VTKUtilities.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/coreComponents/mesh/ElementType.hpp b/src/coreComponents/mesh/ElementType.hpp index 8345080149f..512ffea943d 100644 --- a/src/coreComponents/mesh/ElementType.hpp +++ b/src/coreComponents/mesh/ElementType.hpp @@ -111,7 +111,7 @@ ENUM_STRINGS( ElementType, /// String available for mesh errors inline auto constexpr generalMeshErrorAdvice = "Consider checking the validity of your mesh with " - "the `mesh_doctor` GEOS python tools (documentation at" + "the `mesh_doctor` GEOS python tools (documentation at " "https://geosx-geosx.readthedocs-hosted.com/en/latest/docs/sphinx/pythonTools/mesh_doctor.html)."; } // namespace geos diff --git a/src/coreComponents/mesh/generators/VTKUtilities.cpp b/src/coreComponents/mesh/generators/VTKUtilities.cpp index 47bce1e7aa0..5fd230acdf3 100644 --- a/src/coreComponents/mesh/generators/VTKUtilities.cpp +++ b/src/coreComponents/mesh/generators/VTKUtilities.cpp @@ -734,7 +734,7 @@ findNeighborRanks( std::vector< vtkBoundingBox > boundingBoxes ) } -vtkSmartPointer< vtkDataSet > manageGlobalIds( vtkSmartPointer< vtkDataSet > mesh, int useGlobalIds ) +vtkSmartPointer< vtkDataSet > manageGlobalIds( vtkSmartPointer< vtkDataSet > mesh, int useGlobalIds, bool isFractured ) { auto hasGlobalIds = []( vtkSmartPointer< vtkDataSet > m ) -> bool { @@ -776,6 +776,8 @@ vtkSmartPointer< vtkDataSet > manageGlobalIds( vtkSmartPointer< vtkDataSet > mes } else { + GEOS_ERROR_IF( isFractured, "Automatic generation of global IDs for fractured meshes is disabled. Please split with mesh_doctor. \n" << generalMeshErrorAdvice ); + GEOS_LOG_RANK_0( "Generating global Ids from VTK mesh" ); output = generateGlobalIDs( mesh ); } @@ -910,7 +912,7 @@ redistributeMeshes( integer const logLevel, } // Generate global IDs for vertices and cells, if needed - vtkSmartPointer< vtkDataSet > mesh = manageGlobalIds( loadedMesh, useGlobalIds ); + vtkSmartPointer< vtkDataSet > mesh = manageGlobalIds( loadedMesh, useGlobalIds, !std::empty( fractures ) ); if( MpiWrapper::commRank( comm ) != ( MpiWrapper::commSize( comm ) - 1 ) ) {