From 479229abf877380c3bd604f466f652e720ec3e5c Mon Sep 17 00:00:00 2001 From: li97 Date: Thu, 24 Apr 2025 22:21:34 -0700 Subject: [PATCH 01/17] prototype from laplace --- .../ruby-toss_4_x86_64_ib-gcc@12.1.1.cmake | 4 + .../Electrostatics/Electrostatics_base.xml | 121 ++++++++ src/cmake/GeosxOptions.cmake | 1 + .../physicsSolvers/CMakeLists.txt | 5 + .../electrostatics/CMakeLists.txt | 45 +++ .../electrostatics/Electrostatics.cpp | 269 ++++++++++++++++++ .../electrostatics/Electrostatics.hpp | 132 +++++++++ .../electrostatics/ElectrostaticsKernels.hpp | 207 ++++++++++++++ src/coreComponents/schema/schema.xsd | 50 +++- src/coreComponents/schema/schema.xsd.other | 30 +- 10 files changed, 834 insertions(+), 30 deletions(-) create mode 100644 inputFiles/Electrostatics/Electrostatics_base.xml create mode 100644 src/coreComponents/physicsSolvers/electrostatics/CMakeLists.txt create mode 100644 src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp create mode 100644 src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp create mode 100644 src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp diff --git a/host-configs/LLNL/ruby-toss_4_x86_64_ib-gcc@12.1.1.cmake b/host-configs/LLNL/ruby-toss_4_x86_64_ib-gcc@12.1.1.cmake index 31d0bab32a5..075954ef656 100644 --- a/host-configs/LLNL/ruby-toss_4_x86_64_ib-gcc@12.1.1.cmake +++ b/host-configs/LLNL/ruby-toss_4_x86_64_ib-gcc@12.1.1.cmake @@ -15,6 +15,8 @@ set(CMAKE_C_COMPILER "/usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gcc" CACHE PATH set(CMAKE_CXX_COMPILER "/usr/tce/packages/gcc/gcc-12.1.1-magic/bin/g++" CACHE PATH "") +set(CMAKE_Fortran_COMPILER "/usr/tce/packages/gcc/gcc-12.1.1-magic/bin/gfortran" CACHE PATH "") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG" CACHE STRING "") @@ -37,6 +39,8 @@ set(MPI_C_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-12.1.1-magic/b set(MPI_CXX_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-12.1.1-magic/bin/mpicxx" CACHE PATH "") +set(MPI_Fortran_COMPILER "/usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-12.1.1-magic/bin/mpif90" CACHE PATH "") + set(MPIEXEC_EXECUTABLE "/usr/bin/srun" CACHE PATH "") set(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "") diff --git a/inputFiles/Electrostatics/Electrostatics_base.xml b/inputFiles/Electrostatics/Electrostatics_base.xml new file mode 100644 index 00000000000..3f032d05190 --- /dev/null +++ b/inputFiles/Electrostatics/Electrostatics_base.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/cmake/GeosxOptions.cmake b/src/cmake/GeosxOptions.cmake index 34aa30aaf4b..51ab3498f6c 100644 --- a/src/cmake/GeosxOptions.cmake +++ b/src/cmake/GeosxOptions.cmake @@ -113,6 +113,7 @@ option( GEOS_ENABLE_SIMPLEPDE "Enables simple PDE physics package" ON ) option( GEOS_ENABLE_SOLIDMECHANICS "Enables solid mechanics physics package" ON ) option( GEOS_ENABLE_SURFACEGENERATION "Enables surface generation physics package" ON ) option( GEOS_ENABLE_WAVEPROPAGATION "Enables wave propagation physics package" ON ) +option( GEOS_ENABLE_ELECTROSTATICS "Enables Butler-Volmer electrostatics physics package" ON ) #set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "" FORCE) #blt_append_custom_compiler_flag(FLAGS_VAR CMAKE_CXX_FLAGS DEFAULT -rdynamic) diff --git a/src/coreComponents/physicsSolvers/CMakeLists.txt b/src/coreComponents/physicsSolvers/CMakeLists.txt index 2dfde913d31..7b7c781f98d 100644 --- a/src/coreComponents/physicsSolvers/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/CMakeLists.txt @@ -117,6 +117,11 @@ if( GEOS_ENABLE_MULTIPHYSICS ) list( APPEND dependencyList multiPhysicsSolvers ) endif() +if( GEOS_ENABLE_ELECTROSTATICS ) + add_subdirectory( electrostatics ) + list( APPEND dependencyList electrostaticsSolvers ) +endif() + geos_decorate_link_dependencies( LIST decoratedDependencies DEPENDENCIES ${dependencyList} ) diff --git a/src/coreComponents/physicsSolvers/electrostatics/CMakeLists.txt b/src/coreComponents/physicsSolvers/electrostatics/CMakeLists.txt new file mode 100644 index 00000000000..8f458c002df --- /dev/null +++ b/src/coreComponents/physicsSolvers/electrostatics/CMakeLists.txt @@ -0,0 +1,45 @@ +# SPDX-License-Identifier: LGPL-2.1-only +# +# Copyright (c) 2016-2024 Lawrence Livermore National Security LLC +# Copyright (c) 2018-2024 TotalEnergies +# Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University +# Copyright (c) 2023-2024 Chevron +# Copyright (c) 2019- GEOS/GEOSX Contributors +# All rights reserved +# +# See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. +# +#-------------------------------------------------------------------------------------------------- + +#[[ +Package: Electrostatics +Contains: +#]] + +# Specify solver headers +set(electrostaticsSolvers_headers + Electrostatics.hpp + ElectrostaticsKernels.hpp) + +set(electrostaticsSolvers_sources + Electrostatics.cpp) + +set( dependencyList ${parallelDeps} physicsSolversBase ) + +geos_decorate_link_dependencies( LIST decoratedDependencies DEPENDENCIES ${dependencyList} ) + +blt_add_library( NAME electrostaticsSolvers + SOURCES ${electrostaticsSolvers_sources} + HEADERS ${electrostaticsSolvers_headers} + DEPENDS_ON ${decoratedDependencies} ${externalComponentDeps} + OBJECT ${GEOS_BUILD_OBJ_LIBS} + SHARED ${GEOS_BUILD_SHARED_LIBS} + ) + +target_include_directories( electrostaticsSolvers PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) + +install( TARGETS electrostaticsSolvers LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) + +if( externalComponentDeps ) + target_include_directories( electrostaticsSolvers PUBLIC ${CMAKE_SOURCE_DIR}/externalComponents ) +endif() \ No newline at end of file diff --git a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp new file mode 100644 index 00000000000..21c0c0e2c17 --- /dev/null +++ b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp @@ -0,0 +1,269 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file Electrostatics.cpp + */ + +#include "Electrostatics.hpp" +#include "ElectrostaticsKernels.hpp" + +#include "fieldSpecification/FieldSpecificationManager.hpp" +#include "fieldSpecification/TractionBoundaryCondition.hpp" +#include "mesh/DomainPartition.hpp" +// #include "mesh/FaceElementSubRegion.hpp" +// #include "mesh/CellElementSubRegion.hpp" +// #include "mesh/mpiCommunications/NeighborCommunicator.hpp" + +namespace geos +{ + +using namespace dataRepository; +using namespace constitutive; + +Electrostatics::Electrostatics(const string& name, Group* const parent) +: +PhysicsSolverBase(name, parent), +m_fieldName("primaryField"), +m_timeIntegrationOption(TimeIntegrationOption::QuasiStatic) +{ + registerWrapper(viewKeyStruct::timeIntegrationOption(), &m_timeIntegrationOption). + setApplyDefaultValue(m_timeIntegrationOption). + setInputFlag(InputFlags:: OPTIONAL). + setDescription("Time integration method. Options are:\n* " + EnumStrings< TimeIntegrationOption >::concat( "\n*" )); + + registerWrapper(viewKeyStruct::fieldVarName(), &m_fieldName). + setRTTypeName(rtTypes::CustomTypes::groupNameRef). + setInputFlag(InputFlags::REQUIRED). + setDescription("Name of field variable"); +} + +Electrostatics::~Electrostatics() {} + +void Electrostatics::registerDataOnMesh(Group& meshBodies) +{ + forDiscretizationOnMeshTargets(meshBodies, + [&](string const&, MeshLevel& mesh, string_array const& regionNames) { + NodeManager& nodes = mesh.getNodeManager(); + + nodes.registerWrapper(m_fieldName) + .setApplyDefaultValue(0.0) + .setPlotLevel(PlotLevel::LEVEL_0) + .setDescription("Primary field variable"); + + ElementRegionManager& elemManager = mesh.getElemManager(); + + elemManager.forElementSubRegions< CellElementSubRegion >(regionNames, + [&]( localIndex const, CellElementSubRegion& subRegion) { + subRegion.registerWrapper( viewKeyStruct::coeffNameString(), &m_conductivity). + setApplyDefaultValue( 1.0 ). + setPlotLevel( PlotLevel::LEVEL_0 ). + setDescription( "Field variable representing conductivity" ); + } + ); + } + ); +} + +real64 Electrostatics::solverStep(real64 const& time_n, real64 const& dt, + const int cycleNumber, DomainPartition& domain) +{ + GEOS_MARK_FUNCTION; + real64 dtReturn = dt; + + setupSystem(domain, m_dofManager, m_localMatrix, m_rhs, m_solution, false); + + dtReturn = linearImplicitStep(time_n, dt, cycleNumber, domain); + + return dtReturn; +} + +void Electrostatics::implicitStepSetup(real64 const& GEOS_UNUSED_PARAM(time_n), + real64 const& GEOS_UNUSED_PARAM(dt), + DomainPartition& domain) +{ + Timestamp const meshModificationTimestamp = getMeshModificationTimestamp(domain); + + if (meshModificationTimestamp > getSystemSetupTimestamp()) + { + setupSystem(domain, m_dofManager, m_localMatrix, m_rhs, m_solution); + setSystemSetupTimestamp(meshModificationTimestamp); + } +} + +void Electrostatics::setupDofs(DomainPartition const& GEOS_UNUSED_PARAM(domain), + DofManager& dofManager) const +{ + GEOS_MARK_FUNCTION; + dofManager.addField(m_fieldName, FieldLocation::Node, 1, getMeshTargets()); + dofManager.addCoupling(m_fieldName, m_fieldName, DofManager::Connector::Elem); +} + +void Electrostatics::setupSystem(DomainPartition& domain, DofManager& dofManager, + CRSMatrix< real64, globalIndex >& localMatrix, + ParallelVector& rhs, ParallelVector& solution, + bool const setSparsity) +{ + GEOS_LOG("Electrostatics::setupSystem"); + + GEOS_MARK_FUNCTION; + PhysicsSolverBase::setupSystem(domain, dofManager, localMatrix, rhs, solution, setSparsity); + + SparsityPattern sparsityPattern(dofManager.numLocalDofs(), dofManager.numGlobalDofs(), 8*8*1.2); + + forDiscretizationOnMeshTargets(domain.getMeshBodies(), + [&](string const&, MeshLevel& mesh, string_array const& regionNames) { + NodeManager const& nodeManager = mesh.getNodeManager(); + arrayView1d const dofNumber = nodeManager.getReference(dofManager.getKey(m_fieldName)); + + finiteElement::fillSparsity(mesh, regionNames, getDiscretizationName(), + dofNumber, dofManager.rankOffset(), sparsityPattern); + } + ); + + sparsityPattern.compress(); + localMatrix.assimilate>(std::move(sparsityPattern)); +} + +void Electrostatics::assembleSystem(real64 const GEOS_UNUSED_PARAM(time_n), real64 const dt, + DomainPartition& domain, DofManager const& dofManager, + CRSMatrixView const& localMatrix, + arrayView1d const& localRhs) +{ + GEOS_MARK_FUNCTION; + + localMatrix.zero(); + localRhs.zero(); + + forDiscretizationOnMeshTargets(domain.getMeshBodies(), + [&](string const&, MeshLevel& mesh, string_array const& regionNames) { + NodeManager& nodeManager = mesh.getNodeManager(); + string const dofKey = dofManager.getKey(m_fieldName); + arrayView1d const& dofIndex = nodeManager.getReference>(dofKey); + + ElectrostaticsKernelFactory kernelFactory(dofIndex, dofManager.rankOffset(), localMatrix, localRhs, dt, m_fieldName); + + string const dummyString = "dummy"; + finiteElement::regionBasedKernelApplication, constitutive::NullModel, CellElementSubRegion>( + mesh, regionNames, this->getDiscretizationName(), dummyString, kernelFactory); + }); +} + +void Electrostatics::applyBoundaryConditions(real64 const time_n, real64 const dt, + DomainPartition& domain, DofManager const& dofManager, + CRSMatrixView const& localMatrix, + arrayView1d const& localRhs) +{ + applyPotentialBC(time_n + dt, dofManager, domain, localMatrix, localRhs); + + applyCurrentBC(time_n + dt, dofManager, domain, localRhs); +} + +// real64 Electrostatics::calculateResidualNorm(real64 const& GEOS_UNUSED_PARAM(time_n), real64 const& GEOS_UNUSED_PARAM(dt), +// DomainPartition const& domain, DofManager const& dofManager, +// arrayView1d const& localRhs) +// { +// GEOS_MARK_FUNCTION; +// +// real64 totalResidualNorm = 0.0; +// +// forDiscretizationOnMeshTargets(domain.getMeshBodies(), +// [&](string const&, MeshLevel const& mesh, string_array const&){ +// NodeManager const& nodeManager = mesh.getNodeManager(); +// string const dofKey = dofManager.getKey(m_fieldName); +// arrayView1d const dofNumber = nodeManager.getReference>(dofKey); +// +// globalIndex const rankOffset = dofManager.rankOffset(); +// arrayView1d const ghostRank = nodeManager.ghostRank(); +// +// RAJA::ReduceSum localSum(0.0); +// +// SortedArrayView const& targetNodes = nodeManager.sets() +// }); +// } + +void Electrostatics::applySystemSolution(DofManager const& dofManager, arrayView1d const& localSolution, + real64 const scalingFactor, real64 const dt, DomainPartition& domain) +{ + GEOS_UNUSED_VAR(dt); + dofManager.addVectorToField(localSolution, m_fieldName, m_fieldName, scalingFactor); + + forDiscretizationOnMeshTargets(domain.getMeshBodies(), + [&](string const&, MeshLevel& mesh, string_array const&) { + FieldIdentifiers fieldsToBeSync; + fieldsToBeSync.addFields(FieldLocation::Node, {m_fieldName}); + + CommunicationTools::getInstance().synchronizeFields(fieldsToBeSync, mesh, domain.getNeighbors(), true); + }); +} + +void Electrostatics::applyPotentialBC(real64 const time, DofManager const& dofManager, DomainPartition& domain, + CRSMatrixView const& localMatrix, + arrayView1d const& localRhs) +{ + FieldSpecificationManager const& fsManager = FieldSpecificationManager::getInstance(); + + forDiscretizationOnMeshTargets(domain.getMeshBodies(), + [&](string const&, MeshLevel& mesh, string_array const&) + { + fsManager.apply(time, mesh, m_fieldName, + [&](FieldSpecificationBase const& bc, string const&, SortedArrayView const& targetSet, + NodeManager& targetGroup, string const& GEOS_UNUSED_PARAM(fieldName)) + { + bc.applyBoundaryConditionToSystem>( + targetSet, time, targetGroup, m_fieldName, dofManager.getKey(m_fieldName), + dofManager.rankOffset(), localMatrix, localRhs); + }); + }); +} + +void Electrostatics::applyCurrentBC(real64 const time, DofManager const& dofManager, + DomainPartition& domain, arrayView1d const& localRhs) +{ + FieldSpecificationManager& fsManager = FieldSpecificationManager::getInstance(); + + forDiscretizationOnMeshTargets(domain.getMeshBodies(), + [&](string const&, MeshLevel& mesh, string_array const&) + { + FaceManager const& faceManager = mesh.getFaceManager(); + NodeManager const& nodeManager = mesh.getNodeManager(); + + string const dofKey = dofManager.getKey(m_fieldName); + arrayView1d const blockLocalDofNumber = nodeManager.getReference(dofKey); + globalIndex const dofRankOffset = dofManager.rankOffset(); + + fsManager.template apply(time, mesh, TractionBoundaryCondition::catalogName(), + [&](TractionBoundaryCondition const& bc, string const&, SortedArrayView const& targetSet, + Group&, string const&) + { + bc.launch(time, blockLocalDofNumber, dofRankOffset, faceManager, targetSet, localRhs); + }); + }); +} + +void Electrostatics::updateState(DomainPartition& domain) +{ + GEOS_UNUSED_VAR(domain); +} + +void Electrostatics::resetStateToBeginningOfStep(DomainPartition& GEOS_UNUSED_PARAM(domain)) {} + +void Electrostatics::implicitStepComplete(real64 const& GEOS_UNUSED_PARAM(time_n), + real64 const& GEOS_UNUSED_PARAM(dt), + DomainPartition& GEOS_UNUSED_PARAM(domain)) +{} + +REGISTER_CATALOG_ENTRY(PhysicsSolverBase, Electrostatics, string const&, dataRepository::Group* const) +} \ No newline at end of file diff --git a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp new file mode 100644 index 00000000000..557dab13897 --- /dev/null +++ b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp @@ -0,0 +1,132 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file Electrostatics.hpp + */ + +#ifndef GEOS_PHYSICSSOLVERS_ELECTROSTATICS_HPP_ +#define GEOS_PHYSICSSOLVERS_ELECTROSTATICS_HPP_ + + +#include "common/format/EnumStrings.hpp" +#include "common/TimingMacros.hpp" +#include "mesh/mpiCommunications/CommunicationTools.hpp" +#include "mesh/mpiCommunications/MPI_iCommData.hpp" +#include "physicsSolvers/PhysicsSolverBase.hpp" + +namespace geos +{ + +/** + * @class Electrostatics + * + * This class implements a finite element solution to the charge balance equation with interface reaction. + */ +class Electrostatics : public PhysicsSolverBase +{ +public: + /// The constructor needs a user-defined "name" and a parent Group (to place this instance in the + /// tree structure of classes) + Electrostatics(const string& name, Group* const parent); + + /// Destructor + virtual ~Electrostatics() override; + + /// "CatalogName()" return the string used as XML tag in the input file. It ties the XML tag with + /// this C++ classes. This is important. + static string catalogName() { return "Electrostatics"; } + + /** + * @copydoc PhysicsSolverBase::getCatalogName() + */ + string getCatalogName() const override { return catalogName(); } + + // virtual void initializePreSubGroups() override; + + /// This method ties properties with their supporting mesh + virtual void registerDataOnMesh(Group & meshBodies) override final; + + virtual real64 solverStep(real64 const& time_n, real64 const& dt, + integer const cycleNumber, + DomainPartition& domain) override; + + virtual void implicitStepSetup(real64 const& time_n, real64 const& dt, + DomainPartition& domain) override; + + virtual void setupDofs(DomainPartition const& domain, DofManager& dofManager) const override; + + virtual void setupSystem(DomainPartition& domain, DofManager& dofManager, + CRSMatrix& localMatrix, + ParallelVector& rhs, ParallelVector& solution, + bool const setSparsity = false) override; + + virtual void assembleSystem(real64 const time, real64 const dt, + DomainPartition& domain, DofManager const& dofManager, + CRSMatrixView const& localMatrix, + arrayView1d const& localRhs) override; + + virtual void applyBoundaryConditions(real64 const time, real64 const dt, + DomainPartition& domain, DofManager const& dofManager, + CRSMatrixView const& localMatrix, + arrayView1d const& localRhs) override; + + // virtual real64 calculateResidualNorm(real64 const& time_n, real64 const& dt, + // DomainPartition const& domain, DofManager const& dofManager, + // arrayView1d const& localRhs) override; + + virtual void applySystemSolution(DofManager const& dofManager, + arrayView1d const& localSolution, + real64 const scalingFactor, real64 const dt, + DomainPartition& domain) override; + + virtual void updateState(DomainPartition& domain) override final; + + virtual void resetStateToBeginningOfStep(DomainPartition& GEOS_UNUSED_PARAM(domain)) override; + + virtual void implicitStepComplete(real64 const& time, real64 const& dt, + DomainPartition& domain) override; + + void applyPotentialBC(real64 const time, DofManager const& dofManager, DomainPartition& domain, + CRSMatrixView const& localMatrix, + arrayView1d const& localRhs); + + void applyCurrentBC(real64 const time, DofManager const& dofManager, + DomainPartition& domain, arrayView1d const& localRhs); + + enum class TimeIntegrationOption : integer + { + QuasiStatic, + ImplicitTransient + }; + + struct viewKeyStruct : public PhysicsSolverBase::viewKeyStruct + { + static constexpr char const* timeIntegrationOption() { return "timeIntegrationOption"; } + static constexpr char const* fieldVarName() { return "fieldName"; } + static constexpr char const* coeffNameString() { return "coeffField"; } + }; + +private: + string m_fieldName; + TimeIntegrationOption m_timeIntegrationOption; + array1d< real64 > m_conductivity; +}; + +ENUM_STRINGS(Electrostatics::TimeIntegrationOption, + "QuasiStatic", "ImplicitTransient"); +} /* namespace geos */ + +#endif /* GEOS_PHYSICSSOLVERS_ELECTROSTATICS_HPP_ */ \ No newline at end of file diff --git a/src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp b/src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp new file mode 100644 index 00000000000..55db85a8aeb --- /dev/null +++ b/src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp @@ -0,0 +1,207 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + + +/** + * @file ElectrostaticsKernels.hpp + */ + +#ifndef GEOS_PHYSICSSOLVERS_ELECTROSTATICS_ELECTROSTATICSKERNELS_HPP_ +#define GEOS_PHYSICSSOLVERS_ELECTROSTATICS_ELECTROSTATICSKERNELS_HPP_ + +#include "finiteElement/kernelInterface/ImplicitKernelBase.hpp" +#include "finiteElement/kernelInterface/SparsityKernelBase.hpp" + +namespace geos +{ +//***************************************************************************** +/** + * @brief Implements kernels for solving electrostatics equation. + * @copydoc geos::finiteElement::KernelBase + * @tparam NUM_NODES_PER_ELEM The number of nodes per element for the + * @p SUBREGION_TYPE. + * @tparam UNUSED An unused parameter since we are assuming that the test and + * trial space have the same number of support points. + * + * ### ElectrostaticsKernel Description + * Implements the KernelBase interface functions required for solving electrostatics + * equation using one of the finite element kernel application functions such as + * geos::finiteElement::RegionBasedKernelApplication. + * + * In this implementation, the template parameter @p NUM_NODES_PER_ELEM is used + * in place of both @p NUM_TEST_SUPPORT_POINTS_PER_ELEM and + * @p NUM_TRIAL_SUPPORT_POINTS_PER_ELEM, which are assumed to be equal. This + * results in the @p UNUSED template parameter as only the NUM_NODES_PER_ELEM + * is passed to the ImplicitKernelBase template to form the base class. + * + * Additionally, the number of degrees of freedom per support point for both + * the test and trial spaces are specified as `1` when specifying the base + * class. + */ +template +class ElectrostaticsKernel : public finiteElement::ImplicitKernelBase +{ +public: + using Base = finiteElement::ImplicitKernelBase; + + using Base::numDofPerTestSupportPoint; + using Base::numDofPerTrialSupportPoint; + using Base::maxNumTestSupportPointsPerElem; + using Base::m_dofNumber; + using Base::m_dofRankOffset; + using Base::m_matrix; + using Base::m_rhs; + using Base::m_elemsToNodes; + using Base::m_finiteElementSpace; + using Base::m_meshData; + using Base::m_dt; + + /** + * @brief Constructor + * @copydoc geos::finiteElement::ImplicitKernelBase::ImplicitKernelBase + * @param fieldName The name of the primary field + */ + ElectrostaticsKernel(NodeManager const& nodeManager, EdgeManager const& edgeManager, + FaceManager const& faceManager, localIndex const targetRegionIndex, + SUBREGION_TYPE const& elementSubRegion, FE_TYPE const& finiteElementSpace, + CONSTITUTIVE_TYPE& inputConstitutiveType, arrayView1d const inputDofNumber, + globalIndex const rankOffset, CRSMatrixView const inputMatrix, + arrayView1d const inputRhs, real64 const inputDt, string const fieldName) + : + Base(nodeManager, edgeManager, faceManager, targetRegionIndex, elementSubRegion, finiteElementSpace, + inputConstitutiveType, inputDofNumber, rankOffset, inputMatrix, inputRhs, inputDt), + m_X(nodeManager.referencePosition()), + m_potential(nodeManager.template getReference>(fieldName)) + {} + + /** + * @class StackVariables + * @copydoc geos::finiteElement::ImplicitKernelBase::StackVariables + * + * Adds a stack array for the primary field. + */ + struct StackVariables : Base::StackVariables + { + public: + GEOS_HOST_DEVICE + StackVariables() + : Base::StackVariables(), xLocal(), primaryField_local{0.0} {} + +#if !defined(CALC_FEM_SHAPE_IN_KERNEL) + int xLocal; +#else + real64 xLocal[maxNumTestSupportPointsPerElem][3]; +#endif + + real64 primaryField_local[maxNumTestSupportPointsPerElem]; + }; + + /** + * @brief Copy global values from primary field to a local stack array. + * @copydoc geos::finiteElement::ImplicitKernelBase::setup + * + * For the ElectrostaticsKernel implementation, global values from the + * primaryField, and degree of freedom numbers are placed into element local + * stack storage. + */ + GEOS_HOST_DEVICE + inline void setup(localIndex const k, StackVariables& stack) const + { + m_finiteElementSpace.template setup(k, m_meshData, stack.feStack); + stack.numRows = m_finiteElementSpace.template numSupportPoints(stack.feStack); + stack.numCols = stack.numRows; + for (localIndex a = 0; a < stack.numRows; ++a) + { + localIndex const localNodeIndex = m_elemsToNodes(k, a); + +#if defined(CALC_FEM_SHAPE_IN_KERNEL) + for (int i = 0; i < 3; ++i) + { + stack.xLocal[a][i] = m_X[localNodeIndex][i]; + } +#endif + + stack.primaryField_local[a] = m_potential[localNodeIndex]; + stack.localRowDofIndex[a] = m_dofNumber[localNodeIndex]; + stack.localColDofIndex[a] = m_dofNumber[localNodeIndex]; + } + m_finiteElementSpace.template addGradGradStabilizationMatrix( + stack.feStack, stack.localJacobian); + } + + /** + * @copydoc geos::finiteElement::ImplicitKernelBase::quadraturePointKernel + */ + GEOS_HOST_DEVICE + inline void quadraturePointKernel(localIndex const k, localIndex const q, StackVariables& stack) const + { + real64 dNdX[maxNumTestSupportPointsPerElem][3]; + real64 const detJ = m_finiteElementSpace.template getGradN(k, q, stack.xLocal, stack.feStack, dNdX); + + for (localIndex a = 0; a < stack.numRows; ++a) + { + for (localIndex b = 0; b < stack.numCols; ++b) + { + stack.localJacobian[a][b] += LvArray::tensorOps::AiBi<3>(dNdX[a], dNdX[b]) * detJ; + } + } + } + + /** + * @copydoc geos::finiteElement::ImplicitKernelBase::complete + * + * Form element residual from the fully formed element Jacobian dotted with + * the primary field and map the element local Jacobian/Residual to the + * global matrix/vector. + */ + GEOS_HOST_DEVICE + inline real64 complete(localIndex const k, StackVariables & stack) const + { + GEOS_UNUSED_VAR(k); + real64 maxForce = 0; + + for (localIndex a = 0; a < stack.numRows; ++a) + { + for (localIndex b = 0; b < stack.numRows; ++b) + { + stack.localResidual[a] += stack.localJacobian[a][b] * stack.primaryField_local[b]; + } + } + + for (localIndex a = 0; a < stack.numRows; ++a) + { + localIndex const dof = LvArray::integerConversion(stack.localRowDofIndex[a] - m_dofRankOffset); + if (dof < 0 || dof >= m_matrix.numRows()) continue; + m_matrix.template addToRowBinarySearchUnsorted( + dof, stack.localColDofIndex, stack.localJacobian[a], stack.numCols); + + RAJA::atomicAdd(&m_rhs[dof], stack.localResidual[a]); + maxForce = fmax(maxForce, fabs(stack.localResidual[a])); + } + + return maxForce; + } + +protected: + arrayView2d const m_X; + arrayView1d const m_potential; +}; + +using ElectrostaticsKernelFactory = finiteElement::KernelFactory const, + globalIndex const, CRSMatrixView const, + arrayView1d const, real64 const, string const>; +} // namespace geos + +#endif // GEOS_PHYSICSSOLVERS_ELECTROSTATICS_ELECTROSTATICSKERNELS_HPP_ \ No newline at end of file diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index 45ba9515488..d1cb610d42a 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -359,6 +359,10 @@ + + + + @@ -2328,6 +2332,7 @@ Information output from lower logLevels is added with the desired log level--> + @@ -3096,6 +3101,38 @@ Information output from lower logLevels is added with the desired log level--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3525,18 +3562,7 @@ Information output from lower logLevels is added with the desired log level--> +Information output from lower logLevels is added with the desired log level--> diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index 184c279f96c..204bb2d1f23 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -528,6 +528,7 @@ + @@ -782,8 +783,6 @@ - - @@ -920,6 +919,17 @@ + + + + + + + + + + + @@ -978,8 +988,6 @@ - - @@ -1026,8 +1034,6 @@ - - @@ -1041,8 +1047,6 @@ - - @@ -1176,8 +1180,6 @@ - - @@ -1191,8 +1193,6 @@ - - @@ -1219,8 +1219,6 @@ - - @@ -1271,8 +1269,6 @@ - - @@ -1286,8 +1282,6 @@ - - From e303da300158278056823bb2edab37a62e46f8a6 Mon Sep 17 00:00:00 2001 From: li97 Date: Sat, 26 Apr 2025 16:52:13 -0700 Subject: [PATCH 02/17] add electrochemistry material model --- .../Electrostatics/Electrostatics_base.xml | 8 +- .../constitutive/CMakeLists.txt | 2 + .../constitutive/ConstitutivePassThru.hpp | 16 +++ .../electroChemistry/ElectroChemistryBase.cpp | 56 ++++++++ .../electroChemistry/ElectroChemistryBase.hpp | 128 ++++++++++++++++++ .../electrostatics/Electrostatics.cpp | 33 +++-- .../electrostatics/Electrostatics.hpp | 3 +- .../electrostatics/ElectrostaticsKernels.hpp | 4 +- src/coreComponents/schema/schema.xsd | 11 ++ src/coreComponents/schema/schema.xsd.other | 5 + 10 files changed, 245 insertions(+), 21 deletions(-) create mode 100644 src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.cpp create mode 100644 src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.hpp diff --git a/inputFiles/Electrostatics/Electrostatics_base.xml b/inputFiles/Electrostatics/Electrostatics_base.xml index 3f032d05190..871251594d9 100644 --- a/inputFiles/Electrostatics/Electrostatics_base.xml +++ b/inputFiles/Electrostatics/Electrostatics_base.xml @@ -52,13 +52,13 @@ - + defaultConductivity="100.0"/> - + defaultConductivity="10.0"/> diff --git a/src/coreComponents/constitutive/CMakeLists.txt b/src/coreComponents/constitutive/CMakeLists.txt index a65eb5eec19..526285b57ac 100644 --- a/src/coreComponents/constitutive/CMakeLists.txt +++ b/src/coreComponents/constitutive/CMakeLists.txt @@ -205,6 +205,7 @@ set( constitutive_headers thermalConductivity/SinglePhaseThermalConductivityBase.hpp thermalConductivity/SinglePhaseThermalConductivitySelector.hpp thermalConductivity/ThermalConductivityFields.hpp + electroChemistry/ElectroChemistryBase.hpp ) # # Specify all sources @@ -328,6 +329,7 @@ set( constitutive_sources thermalConductivity/MultiPhaseVolumeWeightedThermalConductivity.cpp thermalConductivity/SinglePhaseThermalConductivity.cpp thermalConductivity/SinglePhaseThermalConductivityBase.cpp + electroChemistry/ElectroChemistryBase.cpp ) set( dependencyList ${parallelDeps} functions denseLinearAlgebra ) diff --git a/src/coreComponents/constitutive/ConstitutivePassThru.hpp b/src/coreComponents/constitutive/ConstitutivePassThru.hpp index 65314e99b1e..47292c7b372 100644 --- a/src/coreComponents/constitutive/ConstitutivePassThru.hpp +++ b/src/coreComponents/constitutive/ConstitutivePassThru.hpp @@ -53,6 +53,7 @@ #include "permeability/WillisRichardsPermeability.hpp" #include "contact/CoulombFriction.hpp" #include "contact/RateAndStateFriction.hpp" +#include "electroChemistry/ElectroChemistryBase.hpp" namespace geos @@ -469,6 +470,21 @@ struct ConstitutivePassThru< CoupledSolidBase > } }; +/** + * Base material model for electrochemistry. + */ +template<> +struct ConstitutivePassThru +{ + template< typename LAMBDA > + static + void execute( ConstitutiveBase & constitutiveRelation, LAMBDA && lambda ) + { + ConstitutivePassThruHandler::execute(constitutiveRelation, + std::forward(lambda)); + } +}; + } /* namespace constitutive */ } /* namespace geos */ diff --git a/src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.cpp b/src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.cpp new file mode 100644 index 00000000000..36d197e9a89 --- /dev/null +++ b/src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.cpp @@ -0,0 +1,56 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file ElectroChemistryBase.cpp + */ + +#include "constitutive/electroChemistry/ElectroChemistryBase.hpp" + +namespace geos +{ + +using namespace dataRepository; + +namespace constitutive +{ + +ElectroChemistryBase::ElectroChemistryBase(string const& name, Group * const parent) +: +ConstitutiveBase(name, parent), +m_conductivity() +{ + registerWrapper(viewKeyStruct::defaultConductivityString(), &m_defaultConductivity). + setApplyDefaultValue(1.0). + setInputFlag(InputFlags::OPTIONAL). + setDescription("Default Electro Conductivity"); + + registerWrapper(viewKeyStruct::conductivityString(), &m_conductivity). + setApplyDefaultValue(-1.0). // will be overwritten + setDescription("Electro Conductivity Field"); +} + +ElectroChemistryBase::~ElectroChemistryBase() {} + +void ElectroChemistryBase::postInputInitialization() +{ + this->getWrapper>(viewKeyStruct::conductivityString()). + setApplyDefaultValue(m_defaultConductivity); +} + +REGISTER_CATALOG_ENTRY(ConstitutiveBase, ElectroChemistryBase, string const&, Group * const) +} // namespace constitutive + +} // namespace geos \ No newline at end of file diff --git a/src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.hpp b/src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.hpp new file mode 100644 index 00000000000..602ecdef3f6 --- /dev/null +++ b/src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.hpp @@ -0,0 +1,128 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file ElectroChemistryBase.hpp + */ + +#ifndef GEOS_CONSTITUTIVE_ELECTROCHEMISTRYBASE_HPP +#define GEOS_CONSTITUTIVE_ELECTROCHEMISTRYBASE_HPP + +#include "common/DataLayouts.hpp" +#include "common/GEOS_RAJA_Interface.hpp" +#include "constitutive/ConstitutiveBase.hpp" + +namespace geos +{ + +namespace constitutive +{ + +/** + * @brief The abstract base class for electrochemistry material + */ +class ElectroChemistryBaseUpdate +{ +public: + + /** + * @brief Constructor for the class performing the electro conductivity updates + * @param conductivity the array of cell-wise conductivities in the subregion + */ + ElectroChemistryBaseUpdate(arrayView1d const& conductivity) + : + m_conductivity(conductivity) + {} + + /** + * @brief Number of elements storing conductivity data + * @return Number of elements + */ + localIndex numElem() const + { + return m_conductivity.size(); + } + + /** + * @brief Get conductivity + * @param[in] k index of the cell in the subRegion + * @return the conductivity of element k + */ + GEOS_HOST_DEVICE + inline + real64 getConductivity(localIndex const k) const + { + return m_conductivity[k]; + } + +protected: + + /// View on the cell-wise conductivities + arrayView1d m_conductivity; +}; + +/** + * @brief The abstract base class for electro conductivity + */ +class ElectroChemistryBase : public ConstitutiveBase +{ +public: + + /** + * @brief Constructor for the abstract base class + * @param[in] name the name of the class + * @param[in] parent pointer to the parent Group + */ + ElectroChemistryBase( string const & name, dataRepository::Group * const parent ); + + /** + * Destructor + */ + virtual ~ElectroChemistryBase() override; + + static string catalogName() { return "ElectroChemistryBase"; } + + virtual string getCatalogName() const override { return catalogName(); } + + /// Keys for data in this class + struct viewKeyStruct : public ConstitutiveBase::viewKeyStruct + { + static constexpr char const* conductivityString() {return "conductivity";} + static constexpr char const* defaultConductivityString() {return "defaultConductivity";} + }; + + // virtual void allocateConstitutiveData( dataRepository::Group & parent, + // localIndex const numConstitutivePointsPerParentIndex ) override; + + using KernelWrapper = ElectroChemistryBaseUpdate; + KernelWrapper createKernelUpdates() + { + return KernelWrapper(m_conductivity); + } + +protected: + + /// Post-process XML input + virtual void postInputInitialization() override; + + array1d m_conductivity; + + real64 m_defaultConductivity = 1.0; +}; +} // namespace constitutive + +} // namespace geos + +#endif //GEOS_CONSTITUTIVE_ELECTROCHEMISTRYBASE_HPP \ No newline at end of file diff --git a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp index 21c0c0e2c17..9059c3ac9b0 100644 --- a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp +++ b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp @@ -20,12 +20,15 @@ #include "Electrostatics.hpp" #include "ElectrostaticsKernels.hpp" +#include "constitutive/electroChemistry/ElectroChemistryBase.hpp" + #include "fieldSpecification/FieldSpecificationManager.hpp" #include "fieldSpecification/TractionBoundaryCondition.hpp" + #include "mesh/DomainPartition.hpp" -// #include "mesh/FaceElementSubRegion.hpp" -// #include "mesh/CellElementSubRegion.hpp" -// #include "mesh/mpiCommunications/NeighborCommunicator.hpp" +#include "mesh/FaceElementSubRegion.hpp" +#include "mesh/CellElementSubRegion.hpp" +#include "mesh/mpiCommunications/NeighborCommunicator.hpp" namespace geos { @@ -67,14 +70,17 @@ void Electrostatics::registerDataOnMesh(Group& meshBodies) elemManager.forElementSubRegions< CellElementSubRegion >(regionNames, [&]( localIndex const, CellElementSubRegion& subRegion) { - subRegion.registerWrapper( viewKeyStruct::coeffNameString(), &m_conductivity). - setApplyDefaultValue( 1.0 ). - setPlotLevel( PlotLevel::LEVEL_0 ). - setDescription( "Field variable representing conductivity" ); - } - ); - } - ); + subRegion.registerWrapper(viewKeyStruct::electroMaterialNamesString()). + setPlotLevel(PlotLevel::NOPLOT). + setRestartFlags(RestartFlags::NO_WRITE). + setSizedFromParent(0); + + string& electroMaterialName = subRegion.getReference(viewKeyStruct::electroMaterialNamesString()); + electroMaterialName = PhysicsSolverBase::getConstitutiveName(subRegion); + GEOS_ERROR_IF( electroMaterialName.empty(), GEOS_FMT("{}: ElectroChemistryBase model not found on subregion {}", + getDataContext(), subRegion.getName())); + }); + }); } real64 Electrostatics::solverStep(real64 const& time_n, real64 const& dt, @@ -155,9 +161,8 @@ void Electrostatics::assembleSystem(real64 const GEOS_UNUSED_PARAM(time_n), real ElectrostaticsKernelFactory kernelFactory(dofIndex, dofManager.rankOffset(), localMatrix, localRhs, dt, m_fieldName); - string const dummyString = "dummy"; - finiteElement::regionBasedKernelApplication, constitutive::NullModel, CellElementSubRegion>( - mesh, regionNames, this->getDiscretizationName(), dummyString, kernelFactory); + finiteElement::regionBasedKernelApplication, constitutive::ElectroChemistryBase, CellElementSubRegion>( + mesh, regionNames, this->getDiscretizationName(), viewKeyStruct::electroMaterialNamesString(), kernelFactory); }); } diff --git a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp index 557dab13897..2a706cd5654 100644 --- a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp +++ b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp @@ -116,13 +116,12 @@ class Electrostatics : public PhysicsSolverBase { static constexpr char const* timeIntegrationOption() { return "timeIntegrationOption"; } static constexpr char const* fieldVarName() { return "fieldName"; } - static constexpr char const* coeffNameString() { return "coeffField"; } + static constexpr char const* electroMaterialNamesString() {return "electroMaterialNames";} }; private: string m_fieldName; TimeIntegrationOption m_timeIntegrationOption; - array1d< real64 > m_conductivity; }; ENUM_STRINGS(Electrostatics::TimeIntegrationOption, diff --git a/src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp b/src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp index 55db85a8aeb..ae7383ddd74 100644 --- a/src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp +++ b/src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp @@ -64,6 +64,7 @@ class ElectrostaticsKernel : public finiteElement::ImplicitKernelBase(k, q, stack.xLocal, stack.feStack, dNdX); @@ -154,7 +156,7 @@ class ElectrostaticsKernel : public finiteElement::ImplicitKernelBase(dNdX[a], dNdX[b]) * detJ; + stack.localJacobian[a][b] += conductivity * LvArray::tensorOps::AiBi<3>(dNdX[a], dNdX[b]) * detJ; } } } diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index d1cb610d42a..62493b3d2b5 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -747,6 +747,10 @@ + + + + @@ -4777,6 +4781,7 @@ Information output from lower logLevels is added with the desired log level--> + @@ -5652,6 +5657,12 @@ For instance, if "oil" is before "gas" in "phaseNames", the table order should b + + + + + + diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index 204bb2d1f23..97d4106eee9 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -1583,6 +1583,7 @@ + @@ -2530,6 +2531,10 @@ + + + + From b14c914ff5da6e3c8cc1e0e8187998d4cdefd2ec Mon Sep 17 00:00:00 2001 From: li97 Date: Tue, 6 May 2025 21:17:04 -0700 Subject: [PATCH 03/17] implement BV term --- .../Electrostatics_alternative.xml | 160 ++++++++++++++++++ .../Electrostatics/Electrostatics_base.xml | 51 +++++- .../electrostatics/Electrostatics.cpp | 121 +++++++++++-- .../electrostatics/Electrostatics.hpp | 13 +- .../electrostatics/ElectrostaticsKernels.hpp | 4 +- src/coreComponents/schema/schema.xsd | 2 + 6 files changed, 323 insertions(+), 28 deletions(-) create mode 100644 inputFiles/Electrostatics/Electrostatics_alternative.xml diff --git a/inputFiles/Electrostatics/Electrostatics_alternative.xml b/inputFiles/Electrostatics/Electrostatics_alternative.xml new file mode 100644 index 00000000000..7f823fbd2fa --- /dev/null +++ b/inputFiles/Electrostatics/Electrostatics_alternative.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/inputFiles/Electrostatics/Electrostatics_base.xml b/inputFiles/Electrostatics/Electrostatics_base.xml index 871251594d9..205477e72d5 100644 --- a/inputFiles/Electrostatics/Electrostatics_base.xml +++ b/inputFiles/Electrostatics/Electrostatics_base.xml @@ -4,14 +4,21 @@ + targetRegions="{Region1, Region2, SEIRegion}"> + + @@ -37,6 +44,11 @@ name="ground" xMin="{ 9.99, -0.01, -0.01 }" xMax="{ 10.01, 1.01, 1.01 }"/> + + @@ -49,6 +61,11 @@ name="Region2" cellBlocks="{electrolyte}" materialList="{electrolyteMaterial}"/> + + @@ -59,6 +76,9 @@ + + @@ -77,10 +97,14 @@ + + + target="/Solvers/halfcell"/> - - - - + + + + diff --git a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp index 9059c3ac9b0..6ed22e2ac4e 100644 --- a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp +++ b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp @@ -51,10 +51,21 @@ m_timeIntegrationOption(TimeIntegrationOption::QuasiStatic) setRTTypeName(rtTypes::CustomTypes::groupNameRef). setInputFlag(InputFlags::REQUIRED). setDescription("Name of field variable"); + + registerWrapper(viewKeyStruct::surfaceGeneratorNameString(), &m_surfaceGeneratorName). + setInputFlag(InputFlags::OPTIONAL). + setDescription("Name of the surface generator to use"); } Electrostatics::~Electrostatics() {} +void Electrostatics::postInputInitialization() +{ + PhysicsSolverBase::postInputInitialization(); + + m_surfaceGenerator = this->getParent().getGroupPointer(m_surfaceGeneratorName); +} + void Electrostatics::registerDataOnMesh(Group& meshBodies) { forDiscretizationOnMeshTargets(meshBodies, @@ -89,7 +100,13 @@ real64 Electrostatics::solverStep(real64 const& time_n, real64 const& dt, GEOS_MARK_FUNCTION; real64 dtReturn = dt; - setupSystem(domain, m_dofManager, m_localMatrix, m_rhs, m_solution, false); + // if (m_surfaceGenerator != nullptr && cycleNumber == 0) + // { + // m_surfaceGenerator->solverStep(time_n, dt, cycleNumber, domain); + // } + + // setupSystem(domain, m_dofManager, m_localMatrix, m_rhs, m_solution, false); + implicitStepSetup(time_n, dt, domain); dtReturn = linearImplicitStep(time_n, dt, cycleNumber, domain); @@ -125,22 +142,7 @@ void Electrostatics::setupSystem(DomainPartition& domain, DofManager& dofManager GEOS_LOG("Electrostatics::setupSystem"); GEOS_MARK_FUNCTION; - PhysicsSolverBase::setupSystem(domain, dofManager, localMatrix, rhs, solution, setSparsity); - - SparsityPattern sparsityPattern(dofManager.numLocalDofs(), dofManager.numGlobalDofs(), 8*8*1.2); - - forDiscretizationOnMeshTargets(domain.getMeshBodies(), - [&](string const&, MeshLevel& mesh, string_array const& regionNames) { - NodeManager const& nodeManager = mesh.getNodeManager(); - arrayView1d const dofNumber = nodeManager.getReference(dofManager.getKey(m_fieldName)); - - finiteElement::fillSparsity(mesh, regionNames, getDiscretizationName(), - dofNumber, dofManager.rankOffset(), sparsityPattern); - } - ); - - sparsityPattern.compress(); - localMatrix.assimilate>(std::move(sparsityPattern)); + PhysicsSolverBase::setupSystem(domain, dofManager, localMatrix, rhs, solution, true); } void Electrostatics::assembleSystem(real64 const GEOS_UNUSED_PARAM(time_n), real64 const dt, @@ -164,6 +166,8 @@ void Electrostatics::assembleSystem(real64 const GEOS_UNUSED_PARAM(time_n), real finiteElement::regionBasedKernelApplication, constitutive::ElectroChemistryBase, CellElementSubRegion>( mesh, regionNames, this->getDiscretizationName(), viewKeyStruct::electroMaterialNamesString(), kernelFactory); }); + + applyButlerVolmerCurrent(dofManager, domain, localMatrix, localRhs); } void Electrostatics::applyBoundaryConditions(real64 const time_n, real64 const dt, @@ -258,6 +262,89 @@ void Electrostatics::applyCurrentBC(real64 const time, DofManager const& dofMana }); } +void Electrostatics::applyButlerVolmerCurrent(DofManager const& dofManager, DomainPartition& domain, + CRSMatrixView const& localMatrix, + arrayView1d const& localRhs) +{ + GEOS_MARK_FUNCTION; + + forDiscretizationOnMeshTargets(domain.getMeshBodies(), + [&](string const&, MeshLevel& mesh, string_array const&) + { + FaceManager const& faceManager = mesh.getFaceManager(); + NodeManager& nodeManager = mesh.getNodeManager(); + ElementRegionManager& elemManager = mesh.getElemManager(); + + arrayView1d const phi = nodeManager.getReference>(m_fieldName).toViewConst(); + + arrayView2d const faceNormal = faceManager.faceNormal(); + ArrayOfArraysView const facesToNodes = faceManager.nodeList().toViewConst(); + + string const dofKey = dofManager.getKey(m_fieldName); + arrayView1d const nodeDofNumber = nodeManager.getReference(dofKey); + globalIndex const rankOffset = dofManager.rankOffset(); + + constexpr localIndex maxNodesPerFace = 4; + constexpr localIndex maxDofPerElem = maxNodesPerFace * 2; + + elemManager.forElementSubRegions([&](FaceElementSubRegion& subRegion) { + // Hard-coded for debugging + real64 const k_rxn = 1.0; + + arrayView1d const area = subRegion.getElementArea(); + arrayView2d const elemsToFaces = subRegion.faceList().toViewConst(); + + forAll>(subRegion.size(), [=](localIndex const kfe) { + localIndex const kf0 = elemsToFaces[kfe][0], kf1 = elemsToFaces[kfe][1]; + + localIndex const numNodesPerFace = facesToNodes.sizeOfArray(kf0); + real64 const Ja = area[kfe] / numNodesPerFace; + + stackArray1d< globalIndex, maxDofPerElem > rowDof(numNodesPerFace*2); + stackArray1d< real64, maxDofPerElem > nodeRHS(numNodesPerFace*2); + stackArray2d< real64, maxDofPerElem *maxDofPerElem > dRdPhi(numNodesPerFace*2, numNodesPerFace*2); + + for (localIndex a = 0; a < numNodesPerFace; ++a) + { + localIndex const node0 = facesToNodes[kf0][a]; + localIndex const node1 = facesToNodes[kf1][a == 0 ? a : numNodesPerFace - a]; + + real64 phi_jump = phi[node0] - phi[node1]; + + rowDof[a] = nodeDofNumber[node0]; + rowDof[numNodesPerFace + a] = nodeDofNumber[node1]; + + nodeRHS[a] += k_rxn * Ja * phi_jump; + nodeRHS[numNodesPerFace + a] -= k_rxn * Ja * phi_jump; + + // initial implementation with mass lumping + dRdPhi(a, a) += k_rxn * Ja; + dRdPhi(a, numNodesPerFace + a) -= k_rxn * Ja; + dRdPhi(numNodesPerFace + a, numNodesPerFace + a) += k_rxn * Ja; + dRdPhi(numNodesPerFace + a, a) -= k_rxn * Ja; + } + + // // debuggging with std::cout + // std::cout << "rowDofs are" << std::endl; + // for (auto i = 0; i < numNodesPerFace * 2; ++i) + // std::cout << rowDof[i] << " "; + // std::cout << std::endl; + for (localIndex idof = 0; idof < numNodesPerFace * 2; ++idof) + { + localIndex const localRow = LvArray::integerConversion(rowDof[idof] - rankOffset); + if (localRow >= 0 && localRow < localMatrix.numRows()) + { + std::cout << "For dof #" << rowDof[idof] - rankOffset << std::endl; + localMatrix.addToRowBinarySearchUnsorted( + localRow, rowDof.data(), dRdPhi[idof].dataIfContiguous(), numNodesPerFace*2); + RAJA::atomicAdd(&localRhs[localRow], nodeRHS[idof]); + } + } + }); + }); + }); +} + void Electrostatics::updateState(DomainPartition& domain) { GEOS_UNUSED_VAR(domain); diff --git a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp index 2a706cd5654..b67ebfea84f 100644 --- a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp +++ b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp @@ -106,6 +106,10 @@ class Electrostatics : public PhysicsSolverBase void applyCurrentBC(real64 const time, DofManager const& dofManager, DomainPartition& domain, arrayView1d const& localRhs); + void applyButlerVolmerCurrent(DofManager const& dofManager, DomainPartition& domain, + CRSMatrixView const& localMatrix, + arrayView1d const& localRhs); + enum class TimeIntegrationOption : integer { QuasiStatic, @@ -117,11 +121,18 @@ class Electrostatics : public PhysicsSolverBase static constexpr char const* timeIntegrationOption() { return "timeIntegrationOption"; } static constexpr char const* fieldVarName() { return "fieldName"; } static constexpr char const* electroMaterialNamesString() {return "electroMaterialNames";} + static constexpr char const* surfaceGeneratorNameString() {return "surfaceGeneratorName";} }; -private: +protected: + virtual void postInputInitialization() override; + string m_fieldName; TimeIntegrationOption m_timeIntegrationOption; + +private: + PhysicsSolverBase *m_surfaceGenerator; + string m_surfaceGeneratorName; }; ENUM_STRINGS(Electrostatics::TimeIntegrationOption, diff --git a/src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp b/src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp index ae7383ddd74..e378dc8955c 100644 --- a/src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp +++ b/src/coreComponents/physicsSolvers/electrostatics/ElectrostaticsKernels.hpp @@ -150,13 +150,13 @@ class ElectrostaticsKernel : public finiteElement::ImplicitKernelBase(k, q, stack.xLocal, stack.feStack, dNdX); + real64 const detJxW = m_finiteElementSpace.template getGradN(k, q, stack.xLocal, stack.feStack, dNdX); for (localIndex a = 0; a < stack.numRows; ++a) { for (localIndex b = 0; b < stack.numCols; ++b) { - stack.localJacobian[a][b] += conductivity * LvArray::tensorOps::AiBi<3>(dNdX[a], dNdX[b]) * detJ; + stack.localJacobian[a][b] += conductivity * LvArray::tensorOps::AiBi<3>(dNdX[a], dNdX[b]) * detJxW; } } } diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index 62493b3d2b5..e206e31ce3d 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -3121,6 +3121,8 @@ Information output from lower logLevels is added with the desired log level--> + + + + + + + + + \ No newline at end of file diff --git a/inputFiles/Electrostatics/LiSEDefect2D_butterfly.jou b/inputFiles/Electrostatics/LiSEDefect2D_butterfly.jou new file mode 100644 index 00000000000..c99895dd445 --- /dev/null +++ b/inputFiles/Electrostatics/LiSEDefect2D_butterfly.jou @@ -0,0 +1,186 @@ +# ============================================================================== +# Battery with Defect 2D +# ============================================================================== +reset + +# Domain width +{L = 6} + +# SE depth +{Ly1 = 1} + +# Cu depth +{Ly2 = 1.25} + +# Defect radius +{R = 1} + +# Defect depth +{h = 0.6} + +# Plane thickness +{thickness=0.01} + + +# ------------------------------------------------------------------------------ +# CREATE COPPER AND DEFECT +# ------------------------------------------------------------------------------ +create brick width {L} depth {Ly2} height {thickness} +volume 1 move X {L/2} Y {Ly1 + Ly2/2} Z {thickness/2} + +create cylinder radius {R} height {thickness} +volume 2 move X {L/2} Y {h} Z {thickness/2} + +# Ratio between the width of the inner square to the defect diameter +{factor = 0.5} + +create brick width {factor*R*2} depth {factor*R*2} height {thickness} +volume 3 move X {L/2} Y {h} Z {thickness/2} + +subtract volume 1 from volume 2 keep +subtract volume 4 from volume 2 + +subtract volume 2 from volume 1 keep +delete volume 1 + +subtract volume 2 from volume 3 keep +subtract volume 6 from volume 3 + +subtract volume 3 from volume 2 keep +delete volume 2 + +merge surface 14 44 +merge surface 24 50 +merge surface 39 43 +merge surface 42 45 + +create surface vertex 12 47 30 31 32 +sweep surface 51 vector 0 0 -1 distance {thickness} +subtract volume 5 from volume 8 keep +subtract volume 7 from volume 8 keep +delete volume 8 + +create surface vertex 13 49 28 34 33 +sweep surface 70 vector 0 0 -1 distance {thickness} +subtract volume 5 from volume 11 keep +subtract volume 7 from volume 11 keep +delete volume 11 + +subtract volume 9 12 from volume 7 keep +delete volume 7 + +subtract volume 10 13 from volume 5 keep +delete volume 5 + +merge surface 14 93 +merge surface 39 81 +merge surface 42 62 +merge surface 58 64 +merge surface 61 92 +merge surface 65 97 +merge surface 77 83 +merge surface 78 89 +merge surface 85 95 +merge surface 91 99 + +# ------------------------------------------------------------------------------ +# CREATE SE +# ------------------------------------------------------------------------------ +create vertex 0 0 {thickness} +create vertex {L} 0 {thickness} + +create surface vertex 114 102 49 47 75 87 132 131 +sweep surface 101 vector 0 0 -1 distance {thickness} + +merge surface 87 109 +merge surface 38 107 +merge surface 80 108 +merge surface 60 106 +merge surface 67 105 + +# ------------------------------------------------------------------------------ +# MESH +# ------------------------------------------------------------------------------ +# No. of intervals in left & right arcs +{Narc_lateral = 5} + +# No. of intervals in top arc +{Narc_top = 40} + +# No. of intervals in left & right radius +{Nrad_lateral = 5} + +# No. of intervals in outter radius +{Nrad_out= 20} + +# No. of intervals in SE depth +{Nse= 10} + +surface all scheme submap + +curve 111 152 interval {Narc_lateral} +curve 116 156 interval {Nrad_lateral} +mesh surface 59 79 + +curve 180 interval {Narc_top} +surface 94 scheme submap +mesh surface 94 + +curve 129 172 interval {Nrad_out} +mesh surface 66 88 + +mesh surface 96 + +mesh surface 40 + +curve 202 interval {Nse} +mesh surface 110 + +volume 14 scheme sweep +mesh volume 14 + +volume 3 9 10 12 13 15 scheme sweep +mesh volume 3 9 10 12 13 15 + +volume 16 scheme sweep +mesh volume 16 + +# ------------------------------------------------------------------------------ +# DEFINE BLOCK IDs +# ------------------------------------------------------------------------------ +block 1 volume 10 13 15 +block 1 name "COPPER" +block 2 volume 3 9 12 14 +block 2 name "DEFECT" +block 3 volume 16 +block 3 name "SE" + +# ------------------------------------------------------------------------------ +# SET BOUNDARY IDs +# ------------------------------------------------------------------------------ +nodeset 1 surface 86 102 +nodeset 1 name "xneg" + +nodeset 2 surface 68 104 +nodeset 2 name "xpos" + +nodeset 3 surface 103 +nodeset 3 name "yneg" + +nodeset 4 surface 100 +nodeset 4 name "ypos" + +nodeset 5 surface 41 63 69 82 84 90 98 101 +nodeset 5 name "zneg" + +nodeset 6 surface 40 59 66 79 88 94 96 110 +nodeset 6 name "zpos" + +nodeset 7 surface 38 60 80 +nodeset 7 name "LISEInterface" + +nodeset 8 surface 67 87 +nodeset 8 name "CUSEInterface" + +export Abaqus "LiSEDefect2D_butterfly.inp" overwrite + diff --git a/inputFiles/Electrostatics/LiSEdefect_Electrostatics_base.xml b/inputFiles/Electrostatics/LiSEdefect_Electrostatics_base.xml new file mode 100644 index 00000000000..c42f799f958 --- /dev/null +++ b/inputFiles/Electrostatics/LiSEdefect_Electrostatics_base.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inputFiles/Electrostatics/LiSEdefect_Electrostatics_main.xml b/inputFiles/Electrostatics/LiSEdefect_Electrostatics_main.xml new file mode 100644 index 00000000000..218b1b5543a --- /dev/null +++ b/inputFiles/Electrostatics/LiSEdefect_Electrostatics_main.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/coreComponents/constitutive/electroChemistry/ButlerVolmerReaction.cpp b/src/coreComponents/constitutive/electroChemistry/ButlerVolmerReaction.cpp index 0d04ce1de09..4630ff015f7 100644 --- a/src/coreComponents/constitutive/electroChemistry/ButlerVolmerReaction.cpp +++ b/src/coreComponents/constitutive/electroChemistry/ButlerVolmerReaction.cpp @@ -34,11 +34,12 @@ m_krxn() { registerWrapper(viewKeyStruct::defaultReactivityCoefficientString(), &m_defaultKrxn). setApplyDefaultValue(1.0). - setInputFlag(InputFlags::OPTIONAL). + setInputFlag(InputFlags::REQUIRED). setDescription("Default BV Reactivity Coefficient"); registerWrapper(viewKeyStruct::reactivityCoefficientString(), &m_krxn). setApplyDefaultValue(-1.0). // will be overwritten + setPlotLevel(PlotLevel::LEVEL_0). setDescription("Reactivity Coefficient Field"); } diff --git a/src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.cpp b/src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.cpp index 36d197e9a89..a8f71a6e220 100644 --- a/src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.cpp +++ b/src/coreComponents/constitutive/electroChemistry/ElectroChemistryBase.cpp @@ -34,11 +34,12 @@ m_conductivity() { registerWrapper(viewKeyStruct::defaultConductivityString(), &m_defaultConductivity). setApplyDefaultValue(1.0). - setInputFlag(InputFlags::OPTIONAL). + setInputFlag(InputFlags::REQUIRED). setDescription("Default Electro Conductivity"); registerWrapper(viewKeyStruct::conductivityString(), &m_conductivity). setApplyDefaultValue(-1.0). // will be overwritten + setPlotLevel(PlotLevel::LEVEL_0). setDescription("Electro Conductivity Field"); } diff --git a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp index 92b8945a715..f475f969b8b 100644 --- a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp +++ b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp @@ -120,6 +120,14 @@ real64 Electrostatics::solverStep(real64 const& time_n, real64 const& dt, // } // setupSystem(domain, m_dofManager, m_localMatrix, m_rhs, m_solution, false); + if (cycleNumber == 0) { + FieldSpecificationManager& fieldSpecificationManager = FieldSpecificationManager::getInstance(); + forDiscretizationOnMeshTargets(domain.getMeshBodies(), + [&](string const&, MeshLevel& mesh, string_array const&) { + fieldSpecificationManager.applyInitialConditions(mesh); + }); + } + implicitStepSetup(time_n, dt, domain); dtReturn = linearImplicitStep(time_n, dt, cycleNumber, domain); From 4a8d60509c2f48b9d1616aa5da97e092589baf94 Mon Sep 17 00:00:00 2001 From: li97 Date: Wed, 27 Aug 2025 15:12:01 -0700 Subject: [PATCH 06/17] schema file --- src/coreComponents/schema/schema.xsd | 11 +++++++++++ src/coreComponents/schema/schema.xsd.other | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index e206e31ce3d..c74af7ba76f 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -619,6 +619,10 @@ + + + + @@ -4751,6 +4755,7 @@ Information output from lower logLevels is added with the desired log level--> + @@ -4946,6 +4951,12 @@ The expected format is "{ waterMax, oilMax }", in that order--> + + + + + + diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index 97d4106eee9..c9afff8883c 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -1551,6 +1551,7 @@ + @@ -1782,6 +1783,10 @@ + + + + From c05b1481d08cab767b257aba2de520cd1d7630dd Mon Sep 17 00:00:00 2001 From: li97 Date: Wed, 27 Aug 2025 17:06:11 -0700 Subject: [PATCH 07/17] Add physics to BV term --- .../electrostatics/Electrostatics.cpp | 13 +++++++------ .../electrostatics/Electrostatics.hpp | 5 +++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp index f475f969b8b..f6dff6ae335 100644 --- a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp +++ b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.cpp @@ -340,14 +340,15 @@ void Electrostatics::applyButlerVolmerCurrent(DofManager const& dofManager, Doma rowDof[a] = nodeDofNumber[node0]; rowDof[numNodesPerFace + a] = nodeDofNumber[node1]; - nodeRHS[a] += k_rxn * Ja * phi_jump; - nodeRHS[numNodesPerFace + a] -= k_rxn * Ja * phi_jump; + // The factor 2.0 comes from linearizing BV with Taylor expansion + nodeRHS[a] += 2.0 * k_rxn * Ja * phi_jump / thermodynamicPotential; + nodeRHS[numNodesPerFace + a] -= 2.0 * k_rxn * Ja * phi_jump / thermodynamicPotential; // initial implementation with mass lumping - dRdPhi(a, a) += k_rxn * Ja; - dRdPhi(a, numNodesPerFace + a) -= k_rxn * Ja; - dRdPhi(numNodesPerFace + a, numNodesPerFace + a) += k_rxn * Ja; - dRdPhi(numNodesPerFace + a, a) -= k_rxn * Ja; + dRdPhi(a, a) += 2.0 * k_rxn * Ja / thermodynamicPotential; + dRdPhi(a, numNodesPerFace + a) -= 2.0 * k_rxn * Ja / thermodynamicPotential; + dRdPhi(numNodesPerFace + a, numNodesPerFace + a) += 2.0 * k_rxn * Ja / thermodynamicPotential; + dRdPhi(numNodesPerFace + a, a) -= 2.0 * k_rxn * Ja / thermodynamicPotential; } for (localIndex idof = 0; idof < numNodesPerFace * 2; ++idof) diff --git a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp index 4ae3cd4cd12..320e037f7cd 100644 --- a/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp +++ b/src/coreComponents/physicsSolvers/electrostatics/Electrostatics.hpp @@ -131,6 +131,11 @@ class Electrostatics : public PhysicsSolverBase string m_fieldName; TimeIntegrationOption m_timeIntegrationOption; + static constexpr double F = 96485.33212; // C/mol, Faraday's constant + static constexpr double T = 298.15; // K, Temperature + static constexpr double R = 8.314462618; // J/mol/K, ideal gas constant + real64 thermodynamicPotential = R * T / F; // Volt + private: PhysicsSolverBase *m_surfaceGenerator; string m_surfaceGeneratorName; From bb6b20817eb5fe2decf32f900440a109fb1e3db3 Mon Sep 17 00:00:00 2001 From: li97 Date: Thu, 18 Dec 2025 09:02:11 -0800 Subject: [PATCH 08/17] Elastic finite strain material model --- .../constitutive/CMakeLists.txt | 2 + .../constitutive/ConstitutivePassThru.hpp | 3 + .../solid/ElasticIsotropicFiniteStrain.cpp | 43 ++ .../solid/ElasticIsotropicFiniteStrain.hpp | 421 +++++++++++++++ .../constitutive/solid/SolidUtilities.hpp | 137 +++++ .../solidMechanics/CMakeLists.txt | 2 + .../ImplicitFiniteStrainQuasiStatic.hpp | 197 +++++++ .../ImplicitFiniteStrainQuasiStatic_impl.hpp | 111 ++++ src/coreComponents/schema/schema.xsd | 501 +++++++++--------- src/coreComponents/schema/schema.xsd.other | 102 ++-- .../constitutiveTests/CMakeLists.txt | 3 +- ...estFiniteDifferenceElasticFiniteStrain.cpp | 109 ++++ 12 files changed, 1360 insertions(+), 271 deletions(-) create mode 100644 src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.cpp create mode 100644 src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp create mode 100644 src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp create mode 100644 src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp create mode 100644 src/coreComponents/unitTests/constitutiveTests/testFiniteDifferenceElasticFiniteStrain.cpp diff --git a/src/coreComponents/constitutive/CMakeLists.txt b/src/coreComponents/constitutive/CMakeLists.txt index 897bfe32285..ea340ac600e 100644 --- a/src/coreComponents/constitutive/CMakeLists.txt +++ b/src/coreComponents/constitutive/CMakeLists.txt @@ -188,6 +188,7 @@ set( constitutive_headers solid/ElasticIsotropicPressureDependent.hpp solid/ElasticTransverseIsotropic.hpp solid/ElasticOrthotropic.hpp + solid/ElasticIsotropicFiniteStrain.hpp solid/InvariantDecompositions.hpp solid/PorousDamageSolid.hpp solid/PerfectlyPlastic.hpp @@ -335,6 +336,7 @@ set( constitutive_sources solid/ElasticIsotropicPressureDependent.cpp solid/ElasticTransverseIsotropic.cpp solid/ElasticOrthotropic.cpp + solid/ElasticIsotropicFiniteStrain.cpp solid/PorousDamageSolid.cpp solid/PerfectlyPlastic.cpp solid/PorousSolid.cpp diff --git a/src/coreComponents/constitutive/ConstitutivePassThru.hpp b/src/coreComponents/constitutive/ConstitutivePassThru.hpp index 64ea624e5d6..feeb34f1e2b 100644 --- a/src/coreComponents/constitutive/ConstitutivePassThru.hpp +++ b/src/coreComponents/constitutive/ConstitutivePassThru.hpp @@ -36,6 +36,7 @@ #include "solid/ElasticIsotropicPressureDependent.hpp" #include "solid/ElasticTransverseIsotropic.hpp" #include "solid/ElasticOrthotropic.hpp" +#include "solid/ElasticIsotropicFiniteStrain.hpp" #include "solid/PorousSolid.hpp" #include "solid/PorousDamageSolid.hpp" #include "solid/CompressibleSolid.hpp" @@ -164,6 +165,7 @@ struct ConstitutivePassThru< SolidBase > ModifiedCamClay, DelftEgg, DruckerPrager, + ElasticIsotropicFiniteStrain, ElasticIsotropic, ElasticTransverseIsotropic, ElasticIsotropicPressureDependent, @@ -237,6 +239,7 @@ struct ConstitutivePassThruTriaxialDriver< SolidBase > ModifiedCamClay, DelftEgg, DruckerPrager, + ElasticIsotropicFiniteStrain, ElasticIsotropic, ElasticTransverseIsotropic, ElasticIsotropicPressureDependent, diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.cpp b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.cpp new file mode 100644 index 00000000000..7b569498747 --- /dev/null +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.cpp @@ -0,0 +1,43 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file ElasticIsotropicFiniteStrain.cpp + */ + +#include "ElasticIsotropicFiniteStrain.hpp" + +namespace geos +{ +using namespace dataRepository; + +namespace constitutive +{ + +ElasticIsotropicFiniteStrain::ElasticIsotropicFiniteStrain(string const & name, Group * const parent) + : ElasticIsotropic( name, parent ) {} + +ElasticIsotropicFiniteStrain::~ElasticIsotropicFiniteStrain() +{} + +void ElasticIsotropicFiniteStrain::postInputInitialization() +{ + ElasticIsotropic::postInputInitialization(); +} + +REGISTER_CATALOG_ENTRY( ConstitutiveBase, ElasticIsotropicFiniteStrain, std::string const &, Group * const ) + +} // namespace constitutive +} // namespace geos \ No newline at end of file diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp new file mode 100644 index 00000000000..65229a2f91d --- /dev/null +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp @@ -0,0 +1,421 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file ElasticIsotropicFiniteStrain.hpp + */ + +#ifndef GEOS_CONSTITUTIVE_SOLID_ELASTICISOTROPICFINITESTRAIN_HPP_ +#define GEOS_CONSTITUTIVE_SOLID_ELASTICISOTROPICFINITESTRAIN_HPP_ + +#include "ElasticIsotropic.hpp" +#include "PropertyConversions.hpp" +#include "SolidModelDiscretizationOpsFullyAnisotroipic.hpp" +#include "LvArray/src/tensorOps.hpp" + +namespace geos{ + +namespace constitutive { + +/** + * @class ElasticIsotropicFiniteStrainUpdates + * + * Class to provide material updates that may be + * called from a kernel function. + */ +class ElasticIsotropicFiniteStrainUpdates : public ElasticIsotropicUpdates +{ +public: + ElasticIsotropicFiniteStrainUpdates( + arrayView1d< real64 const > const & bulkModulus, + arrayView1d< real64 const > const & shearModulus, + arrayView1d< real64 const > const & thermalExpansionCoefficient, + arrayView3d< real64, solid::STRESS_USD > const & newStress, + arrayView3d< real64, solid::STRESS_USD > const & oldStress, + bool const & disableInelasticity ) + : ElasticIsotropicUpdates(bulkModulus, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity) + {} + + /// Default copy constructor + ElasticIsotropicFiniteStrainUpdates( ElasticIsotropicFiniteStrainUpdates const & ) = default; + + /// Default move constructor + ElasticIsotropicFiniteStrainUpdates( ElasticIsotropicFiniteStrainUpdates && ) = default; + + /// Deleted default constructor + ElasticIsotropicFiniteStrainUpdates() = delete; + + /// Deleted copy assignment operator + ElasticIsotropicFiniteStrainUpdates & operator=( ElasticIsotropicFiniteStrainUpdates const & ) = delete; + + /// Deleted move assignment operator + ElasticIsotropicFiniteStrainUpdates & operator=( ElasticIsotropicFiniteStrainUpdates && ) = delete; + + /// Use the uncompressed version of the stiffness bilinear form + using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotroipic; // typo in "Anisotroipic" + + // // Bring in base implementations to prevent hiding warnings + // using ElasticIsotropicUpdates::smallStrainNoStateUpdate; + + // returns first Piola-Kirchhoff stress which is asymmetric + GEOS_HOST_DEVICE + void finiteStrainNoStateUpdate_StressOnly(localIndex const k, localIndex const q, + real64 const (&totalElasticStrain)[6], + real64 const (&fInv)[3][3], + real64 (&firstPiolaStress)[3][3], + real64 (&kirchhoffStress)[6] + ) const; + + GEOS_HOST_DEVICE + void finiteStrainUpdate_StressOnly(localIndex const k, localIndex const q, + real64 const (&totalElasticStrain)[6], + real64 const (&fInv)[3][3], + real64 (&firstPiolaStress)[3][3] + ) const; + + GEOS_HOST_DEVICE + void finiteStrainNoStateUpdate(localIndex const k, localIndex const q, + real64 const (&elasticDeformGrad)[3][3], + real64 (&firstPiolaStress)[3][3], + real64 (&kirchhoffStress)[6], + real64 (&stiffness)[9][9]) const; + + GEOS_HOST_DEVICE + void finiteStrainUpdate(localIndex const k, localIndex const q, + real64 const (&elasticDeformGrad)[3][3], + real64 (&firstPiolaStress)[3][3], + real64 (&stiffness)[9][9]) const; + + GEOS_HOST_DEVICE + void computeLogElasticStrain(real64 const (&elasticDeformGrad)[3][3], + real64 (&elasticStrain)[6], + real64 (&eigenValues)[3], + real64 (&eigenVectors)[3][3], + real64 (&eigenVectorsT)[3][3]) const; + +private: + GEOS_HOST_DEVICE + void computeMaterialTangentColumn(real64 const (&deltaFe)[3][3], real64 const (&deltaCe)[6], + real64 const (&M_hat)[6], real64 const (&Q)[3][3], + real64 const (&Q_T)[3][3], real64 const (&dtau_dEe)[6][6], + real64 const (&fInvT)[3][3], real64 (&deltaP_mat)[3][3]) const; +}; + +GEOS_HOST_DEVICE +inline +void ElasticIsotropicFiniteStrainUpdates::computeLogElasticStrain( + real64 const (&elasticDeformGrad)[3][3], real64 (&elasticStrain)[6], + real64 (&eigenValues)[3], real64 (&eigenVectors)[3][3], real64 (&eigenVectorsT)[3][3]) const +{ + real64 C_e[3][3] = {}; // Right Cauchy tensor + LvArray::tensorOps::Rij_eq_AkiAkj<3, 3>(C_e, elasticDeformGrad); + + real64 Ce_symmetric[6] = {}; + LvArray::tensorOps::denseToSymmetric<3>(Ce_symmetric, C_e); + + // initial eigen vector are stored in rows + LvArray::tensorOps::symEigenvectors<3>(eigenValues, eigenVectorsT, Ce_symmetric); + LvArray::tensorOps::transpose<3, 3>(eigenVectors, eigenVectorsT); + + // matrix logarithm + real64 logLambda[6] = { {0} }; + for( int i = 0; i < 3; i++ ) + { + logLambda[i] = 0.5 * log(eigenValues[i]); + } + + // elastic strain + // E_e = 0.5 * Q * ln(Lam) * Q^T + LvArray::tensorOps::Rij_eq_AikSymBklAjl<3>(elasticStrain, eigenVectors, logLambda); + + // scale shear components by 2.0 to use in small strain material model where stiffness is expressed in Voigt notation + elasticStrain[3] *= 2.0; + elasticStrain[4] *= 2.0; + elasticStrain[5] *= 2.0; +} + +GEOS_HOST_DEVICE +inline +void ElasticIsotropicFiniteStrainUpdates::computeMaterialTangentColumn( + real64 const (&deltaFe)[3][3], real64 const (&deltaCe)[6], real64 const (&M_hat)[6], + real64 const (&Q)[3][3], real64 const (&Q_T)[3][3], real64 const (&dtau_dEe)[6][6], + real64 const (&fInvT)[3][3], real64 (&deltaP_mat)[3][3]) const +{ + // Q^T * deltaCe * Q + real64 deltaCe_hat[6] = {}; + LvArray::tensorOps::Rij_eq_AikSymBklAjl<3>(deltaCe_hat, Q_T, deltaCe); + + // M \circ Q^T * deltaCe * Q + real64 deltaLnCe_hat[6] = {}; + LvArray::tensorOps::hadamardProduct<6>(deltaLnCe_hat, M_hat, deltaCe_hat); + + // derivative of matrix logarithm deltaEe = dEe / dFe = 1/2 * Q * (M \circ Q^T * deltaCe * Q) * Q^T + real64 deltaLnCe[6] = {}; + real64 deltaEe[6] = {}; + LvArray::tensorOps::Rij_eq_AikSymBklAjl<3>(deltaLnCe, Q, deltaLnCe_hat); + LvArray::tensorOps::copy<6>(deltaEe, deltaLnCe); + LvArray::tensorOps::scale<6>(deltaEe, 0.5); + + // scale shear components for stiffness in voigt notation + deltaEe[3] *= 2.0; + deltaEe[4] *= 2.0; + deltaEe[5] *= 2.0; + + // double contraction dtau / dEe * deltaEe + real64 dtau_voigt[6] = {}; + real64 deltaTau[3][3] = {}; + LvArray::tensorOps::Ri_eq_AijBj<6, 6>(dtau_voigt, dtau_dEe, deltaEe); + // scale back + dtau_voigt[3] *= 0.5; + dtau_voigt[4] *= 0.5; + dtau_voigt[5] *= 0.5; + LvArray::tensorOps::symmetricToDense<3>(deltaTau, dtau_voigt); + + // deltaTau * F^-T + LvArray::tensorOps::Rij_eq_AikBkj<3, 3, 3>(deltaP_mat, deltaTau, fInvT); +} + +GEOS_HOST_DEVICE +inline +void ElasticIsotropicFiniteStrainUpdates::finiteStrainNoStateUpdate_StressOnly(localIndex const k, localIndex const q, + real64 const (&totalElasticStrain)[6], + real64 const (&fInv)[3][3], + real64 (&firstPiolaStress)[3][3], + real64 (&kirchhoffStress)[6] + ) const +{ + this->smallStrainNoStateUpdate_StressOnly(k, q, totalElasticStrain, kirchhoffStress); + + // scale back + kirchhoffStress[3] *= 0.5; + kirchhoffStress[4] *= 0.5; + kirchhoffStress[5] *= 0.5; + LvArray::tensorOps::Rij_eq_symAikBjk<3>(firstPiolaStress, kirchhoffStress, fInv); +} + +GEOS_HOST_DEVICE +inline +void ElasticIsotropicFiniteStrainUpdates::finiteStrainUpdate_StressOnly(localIndex const k, localIndex const q, + real64 const (&totalElasticStrain)[6], + real64 const (&fInv)[3][3], + real64 (&firstPiolaStress)[3][3] + ) const +{ + real64 kirchhoffStress[6] = {}; + finiteStrainNoStateUpdate_StressOnly(k, q, totalElasticStrain, fInv, firstPiolaStress, kirchhoffStress); + + // Can only save the symmetric kirchhoff stress right now, the shear stress compoenents are scaled back by 0.5 + LvArray::tensorOps::copy<6>(m_oldStress[k][q], m_newStress[k][q]); + LvArray::tensorOps::copy<6>(m_newStress[k][q], kirchhoffStress); +} + +GEOS_HOST_DEVICE +inline +void ElasticIsotropicFiniteStrainUpdates::finiteStrainNoStateUpdate(localIndex const k, localIndex const q, + real64 const (&elasticDeformGrad)[3][3], + real64 (&firstPiolaStress)[3][3], + real64 (&kirchhoffStress)[6], + real64 (&stiffness)[9][9]) const +{ + real64 fInv[3][3] = {}; + real64 fInvT[3][3] = {}; + + real64 totalElasticStrain[6] = {}; + + real64 eigenValues[3] = {}; + real64 eigenVectors[3][3] = {}; + real64 eigenVectorsT[3][3] = {}; + + LvArray::tensorOps::invert<3>(fInv, elasticDeformGrad); + LvArray::tensorOps::transpose<3, 3>(fInvT, fInv); + + computeLogElasticStrain(elasticDeformGrad, totalElasticStrain, eigenValues, eigenVectors, eigenVectorsT); + + finiteStrainNoStateUpdate_StressOnly(k, q, totalElasticStrain, fInv, firstPiolaStress, kirchhoffStress); + + real64 smallStrainStiffness[6][6] = {}; + this->getElasticStiffness(k, q, smallStrainStiffness); + + // derivative of log matrix: \partial ln(C_e) / \partial C_e, C_e = F^T F + // build symmetric spectral of log matrix derivative + real64 M_hat[6] = {}; + M_hat[0] = 1.0 / eigenValues[0]; + M_hat[1] = 1.0 / eigenValues[1]; + M_hat[2] = 1.0 / eigenValues[2]; + + if (abs(eigenValues[1] - eigenValues[2]) <= 1e-12) { + M_hat[3] = 1.0 / eigenValues[1]; + } else { + M_hat[3] = log(eigenValues[1] / eigenValues[2]) / (eigenValues[1] - eigenValues[2]); + } + + if (abs(eigenValues[0] - eigenValues[2]) <= 1e-12) { + M_hat[4] = 1.0 / eigenValues[0]; + } else { + M_hat[4] = log(eigenValues[0] / eigenValues[2]) / (eigenValues[0] - eigenValues[2]); + } + + if (abs(eigenValues[0] - eigenValues[1]) <= 1e-12) { + M_hat[5] = 1.0 / eigenValues[0]; + } else { + M_hat[5] = log(eigenValues[0] / eigenValues[1]) / (eigenValues[0] - eigenValues[1]); + } + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + real64 deltaFe[3][3] = {0}; + deltaFe[i][j] = 1.0; + + // delCe = delFe^T * Fe + Fe^T * delFe + real64 dCe[3][3] = {0}; + for (int l = 0; l < 3; ++l) { + dCe[j][l] += deltaFe[i][j] * elasticDeformGrad[i][l]; + dCe[l][j] += elasticDeformGrad[i][l] * deltaFe[i][j]; + } + + real64 deltaCe[6] = {}; + LvArray::tensorOps::denseToSymmetric<3>(deltaCe, dCe); + + // material tangent + real64 deltaP_mat[3][3] = {}; + computeMaterialTangentColumn(deltaFe, deltaCe, M_hat, eigenVectors, eigenVectorsT, smallStrainStiffness, fInvT, deltaP_mat); + + // geometric tangent + real64 deltaP_geo[3][3] = {}; + real64 deltaFeT_FeInvT[3][3] = {0}; + for (int l = 0; l < 3; ++l) { + deltaFeT_FeInvT[j][l] += deltaFe[i][j] * fInvT[i][l]; + } + LvArray::tensorOps::Rij_eq_AikBkj<3, 3, 3>(deltaP_geo, firstPiolaStress, deltaFeT_FeInvT); + + real64 deltaP_total[3][3] = {}; + LvArray::tensorOps::copy<3, 3>(deltaP_total, deltaP_mat); + LvArray::tensorOps::scaledAdd<3, 3>(deltaP_total, deltaP_geo, -1.0); + + // input results into D operator + int col = 3 * i + j; + for (int m = 0; m < 3; ++m) { + for (int n = 0; n < 3; ++n) { + // row major flattening + int row = 3 * m + n; + stiffness[row][col] = deltaP_total[m][n]; + } + } + + } + } + +} + +GEOS_HOST_DEVICE +inline +void ElasticIsotropicFiniteStrainUpdates::finiteStrainUpdate(localIndex const k, localIndex const q, + real64 const (&elasticDeformGrad)[3][3], + real64 (&firstPiolaStress)[3][3], + real64 (&stiffness)[9][9]) const +{ + real64 kirchhoffStress[6] = {}; + finiteStrainNoStateUpdate(k, q, elasticDeformGrad, firstPiolaStress, kirchhoffStress, stiffness); + + // Can only save the symmetric kirchhoff stress right now, the shear stress compoenents are scaled back by 0.5 + LvArray::tensorOps::copy<6>(m_oldStress[k][q], m_newStress[k][q]); + LvArray::tensorOps::copy<6>(m_newStress[k][q], kirchhoffStress); +} + +/** + * @class ElasticIsotropicFiniteStrain + * + * Finite strain isotropic elastic material model. + */ +class ElasticIsotropicFiniteStrain : public ElasticIsotropic +{ +public: + /// @typedef Alias for ElasticIsotropicFiniteStrainUpdates + using KernelWrapper = ElasticIsotropicFiniteStrainUpdates; + + /** + * constructor + * @param[in] name name of the instance in the catalog + * @param[in] parent the group which contains this instance + */ + ElasticIsotropicFiniteStrain( string const & name, Group * const parent ); + + /** + * Default Destructor + */ + virtual ~ElasticIsotropicFiniteStrain() override; + + /// string name to use for this class in the catalog + static constexpr auto m_catalogNameString = "ElasticIsotropicFiniteStrain"; + + /** + * @brief Static catalog string + * @return A string that is used to register/lookup this class in the registry + */ + static std::string catalogName() { return m_catalogNameString; } + + /** + * @brief Get catalog name + * @return Name string + */ + virtual string getCatalogName() const override { return catalogName(); } + + /** + * @brief Create a instantiation of the ElasticFiniteStrainIsotropicUpdate class + * that refers to the data in this. + * @param includeState Flag whether to pass state arrays that may not be needed for "no-state" updates + * @return An instantiation of ElasticFiniteStrainIsotropicUpdate. + */ + KernelWrapper createKernelUpdates(bool const includeState = true) const + { + if (includeState) { + return KernelWrapper(m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_newStress, m_oldStress, m_disableInelasticity); + } else { + return KernelWrapper(m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + arrayView3d< real64, solid::STRESS_USD >(), + arrayView3d< real64, solid::STRESS_USD >(), + m_disableInelasticity); + } + } + + /** + * @brief Construct an update kernel for a derived type. + * @tparam UPDATE_KERNEL The type of update kernel from the derived type. + * @tparam PARAMS The parameter pack to hold the constructor parameters for the derived update kernel. + * @param constructorParams The constructor parameter for the derived type. + * @return An @p UPDATE_KERNEL object. + */ + template< typename UPDATE_KERNEL, typename ... PARAMS > + UPDATE_KERNEL createDerivedKernelUpdates( PARAMS && ... constructorParams ) + { + return UPDATE_KERNEL( std::forward< PARAMS >( constructorParams )..., + m_bulkModulus, + m_shearModulus, + m_thermalExpansionCoefficient, + m_newStress, + m_oldStress, + m_disableInelasticity ); + } + +protected: + virtual void postInputInitialization() override; +}; + +} // namespace constitutive + +} // namespace geos + +#endif /* GEOS_CONSTITUTIVE_SOLID_ELASTICISOTROPIC_HPP_ */ \ No newline at end of file diff --git a/src/coreComponents/constitutive/solid/SolidUtilities.hpp b/src/coreComponents/constitutive/solid/SolidUtilities.hpp index 337b7f30509..5da0903867b 100644 --- a/src/coreComponents/constitutive/solid/SolidUtilities.hpp +++ b/src/coreComponents/constitutive/solid/SolidUtilities.hpp @@ -157,6 +157,143 @@ struct SolidUtilities } } + /** + * @brief Perform a finite-difference check of the stiffness computation + * + * This method uses several stress evaluations and finite differencing to + * approximate the 9x9 stiffness matrix, and then computes an error between + * the coded stiffness method and the finite difference version. + * + * @note This method only works for models providing the finiteStrainUpdate + * method returning a 9x9 stiffness. + * + * @param solid the solid kernel wrapper + * @param k the element number + * @param q the quadrature index + * @param elasticDeformGrad elastic deformation gradient (on top of which a FD perturbation will be added) + * @param print flag to decide if debug output is printed or not + */ + template< typename SOLID_TYPE > + GEOS_HOST_DEVICE + static bool + checkFiniteStrainStiffness( SOLID_TYPE const & solid, + localIndex k, + localIndex q, + real64 const ( &elasticDeformGrad )[3][3], + bool print = false ) + { + real64 firstPiolaStress[3][3] = {}; + real64 stiffness[9][9] = {}; + solid.finiteStrainUpdate(0, 0, elasticDeformGrad, firstPiolaStress, stiffness); + + real64 stiffnessFD[9][9] = {}; + SolidUtilities::computeFiniteStrainFiniteDifferenceStiffness(solid, 0, 0, elasticDeformGrad, stiffnessFD); + + real64 error = 0; + real64 norm = 0; + real64 rerr = 0; + + for( localIndex i = 0; i < 9; ++i ) + { + for( localIndex j = 0; j < 9; ++j ) + { + error += pow( stiffnessFD[i][j] - stiffness[i][j], 2.0 ); + norm += pow( stiffness[i][j], 2.0 ); + } + } + error = sqrt(error); + norm = sqrt(norm); + rerr = error / norm; + + if( print ) + { + for( localIndex i = 0; i < 9; ++i ) + { + for( localIndex j = 0; j < 6; ++j ) + { + // printf( "[%12.5e vs %12.5e] ", stiffnessFD[i][j], stiffness[i][j] ); + printf( "%12.5e ", fabs(stiffnessFD[i][j] - stiffness[i][j]) ); + } + printf( "\n" ); + } + + printf("Abs err = %12.5e, Rel err = %12.5e\n", error, rerr); + } + + return (rerr < 1e-3); + } + + /** + * @brief Perform a finite-difference stiffness computation for finite strain material model + * + * This method uses stress evaluations and finite differencing to + * approximate the 9x9 stiffness matrix. + * + * @note This method only works for models providing the finiteStrainUpdate + * method returning a 9x9 stiffness, as it will primarily be used to check + * the hand coded tangent against a finite difference reference. + * + * @param solid the solid kernel wrapper + * @param k the element number + * @param q the quadrature index + * @param elasticDeformGrad elastic deformation gradient (on top of which a FD perturbation will be added) + * @param stiffnessFD finite different stiffness approximation + */ + template< typename SOLID_TYPE > + GEOS_HOST_DEVICE + static void + computeFiniteStrainFiniteDifferenceStiffness( SOLID_TYPE const & solid, + localIndex k, + localIndex q, + real64 const ( &elasticDeformGrad )[3][3], + real64 ( & stiffnessFD )[9][9] ) + { + real64 eps = 1e-7; + real64 F[3][3] = {}; + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + F[i][j] = elasticDeformGrad[i][j]; + } + } + + real64 fInv[3][3] = {}; + real64 totalElasticStrain[6] = {}; + real64 eigenValues[3] = {}; + real64 eigenVectors[3][3] = {}; + real64 eigenVectorsT[3][3] = {}; + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + // plus + real64 P_plus[3][3] = {}; + F[i][j] += eps; + LvArray::tensorOps::invert<3>(fInv, F); + + solid.computeLogElasticStrain(F, totalElasticStrain, eigenValues, eigenVectors, eigenVectorsT); + solid.finiteStrainUpdate_StressOnly(k, q, totalElasticStrain, fInv, P_plus); + F[i][j] -= eps; + + // minus + real64 P_minus[3][3] = {}; + F[i][j] -= eps; + LvArray::tensorOps::invert<3>(fInv, F); + + solid.computeLogElasticStrain(F, totalElasticStrain, eigenValues, eigenVectors, eigenVectorsT); + solid.finiteStrainUpdate_StressOnly(k, q, totalElasticStrain, fInv, P_minus); + F[i][j] += eps; + + int col = 3 * i + j; + for (int m = 0; m < 3; ++m) { + for (int n = 0; n < 3; ++n) { + // row major flattening + int row = 3 * m + n; + stiffnessFD[row][col] = (P_plus[m][n] - P_minus[m][n]) / (2 * eps); + } + } + } + } + } + /** * @brief Hypo update (small strain, large rotation). * diff --git a/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt b/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt index ced15c47ba5..e764b38398d 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt @@ -36,6 +36,8 @@ set( solidMechanicsSolvers_headers kernels/ImplicitSmallStrainNewmark_impl.hpp kernels/ImplicitSmallStrainQuasiStatic.hpp kernels/ImplicitSmallStrainQuasiStatic_impl.hpp + kernels/ImplicitFiniteStrainQuasiStatic.hpp + kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp SolidMechanicsStateReset.hpp SolidMechanicsStatistics.hpp contact/ContactSolverBase.hpp diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp new file mode 100644 index 00000000000..69a6b9cc913 --- /dev/null +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp @@ -0,0 +1,197 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file ImplicitFiniteStrainQuasistatic.hpp + */ + +#ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_HPP_ +#define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_HPP_ + +#include "finiteElement/kernelInterface/ImplicitKernelBase.hpp" +#include "physicsSolvers/solidMechanics/SolidMechanicsFields.hpp" + +namespace geos +{ + +namespace solidMechanicsLagrangianFEMKernels +{ + +/** + * @brief Implements kernels for solving finite strain quasi-static equilibrium. + * @copydoc geos::finiteElement::ImplicitKernelBase + * @tparam NUM_NODES_PER_ELEM The number of nodes per element for the + * @p SUBREGION_TYPE. + * @tparam UNUSED An unused parameter since we are assuming that the test and + * trial space have the same number of support points. + * + * ### QuasiStatic Description + * Implements the KernelBase interface functions required for solving the + * quasi-static equilibrium equations using one of the + * "finite element kernel application" functions such as + * geos::finiteElement::RegionBasedKernelApplication. + * + * In this implementation, the template parameter @p NUM_NODES_PER_ELEM is used + * in place of both @p NUM_TEST_SUPPORT_POINTS_PER_ELEM and + * @p NUM_TRIAL_SUPPORT_POINTS_PER_ELEM, which are assumed to be equal. This + * results in the @p UNUSED template parameter as only the NUM_NODES_PER_ELEM + * is passed to the ImplicitKernelBase template to form the base class. + * + * Additionally, the number of degrees of freedom per support point for both + * the test and trial spaces are specified as `3` when specifying the base + * class. + */ +template +class ImplicitFiniteStrainQuasiStatic : + public finiteElement::ImplicitKernelBase +{ +public: + /// Alias for the base class; + using Base = finiteElement::ImplicitKernelBase; + + /// Maximum number of nodes per element, which is equal to the maxNumTestSupportPointPerElem and + /// maxNumTrialSupportPointPerElem by definition. When the FE_TYPE is not a Virtual Element, this + /// will be the actual number of nodes per element. + static constexpr int numNodesPerElem = Base::maxNumTestSupportPointsPerElem; + using Base::numDofPerTestSupportPoint; + using Base::numDofPerTrialSupportPoint; + using Base::m_dofNumber; + using Base::m_dofRankOffset; + using Base::m_matrix; + using Base::m_rhs; + using Base::m_elemsToNodes; + using Base::m_constitutiveUpdate; + using Base::m_finiteElementSpace; + using Base::m_meshData; + using Base::m_dt; + + /** + * @brief Constructor + * @copydoc geos::finiteElement::ImplicitKernelBase::ImplicitKernelBase + * @param inputGravityVector The gravity vector. + */ + ImplicitFiniteStrainQuasiStatic(NodeManager const & nodeManager, EdgeManager const & edgeManager, + FaceManager const & faceManager, localIndex const targetRegionIndex, + SUBREGION_TYPE const & elementSubRegion, FE_TYPE const & finiteElementSpace, + CONSTITUTIVE_TYPE const & inputConstitutiveType, arrayView1d const inputDofNumber, + globalIndex const rankOffset, CRSMatrixView const inputMatrix, + arrayView1d const inputRhs, real64 const inputDt, real64 const (&inputGravityVector)[3]); + + //***************************************************************************** + /** + * @class StackVariables + * @copydoc geos::finiteElement::ImplicitKernelBase::StackVariables + * + * Adds a stack array for the displacement, incremental displacement, and the + * constitutive stiffness. + */ + struct StackVariables : public Base::StackVariables + { + public: + + /// Constructor. + GEOS_HOST_DEVICE + StackVariables() + : Base::StackVariables(), + xLocal(), u_local(), uhat_local(), constitutiveStiffness() + {} + +#if !defined(CALC_FEM_SHAPE_IN_KERNEL) + /// Dummy + int xLocal; +#else + /// C-array stack storage for element local the nodal positions. + real64 xLocal[ numNodesPerElem ][ 3 ]; +#endif + + /// Stack storage for the element local nodal displacement + real64 u_local[numNodesPerElem][numDofPerTrialSupportPoint]; + + /// Stack storage for the element local nodal incremental displacement + real64 uhat_local[numNodesPerElem][numDofPerTrialSupportPoint]; + + /// Stack storage for the constitutive stiffness at a quadrature point. + real64 constitutiveStiffness[ 6 ][ 6 ]; + }; + //***************************************************************************** + + /** + * @brief Copy global values from primary field to a local stack array. + * @copydoc ::geos::finiteElement::ImplicitKernelBase::setup + * + * For the QuasiStatic implementation, global values from the displacement, + * incremental displacement, and degree of freedom numbers are placed into + * element local stack storage. + */ + GEOS_HOST_DEVICE + void setup(localIndex const k, StackVariables & stack) const; + + /// Hanyu: this may need to be implemented change Mandel stress to first PK + /** + * @brief Internal struct to provide no-op defaults used in the inclusion + * of lambda functions into kernel component functions. + * @struct NoOpFunctors + */ + struct NoOpFunctors + { + /** + * @brief operator() no-op used for adding an additional dynamics term + * inside the jacobian assembly loop. + * @param a Node index for the row. + * @param b Node index for the col. + */ + GEOS_HOST_DEVICE inline constexpr + void operator() ( localIndex const a, localIndex const b ) + { + GEOS_UNUSED_VAR( a ); + GEOS_UNUSED_VAR( b ); + } + + /** + * @brief operator() no-op used for modifying the stress tensor prior to + * integrating the divergence to produce nodal forces. + * @param stress The stress array. + */ + GEOS_HOST_DEVICE inline constexpr + void operator() ( real64 (& stress)[6] ) + { + GEOS_UNUSED_VAR( stress ); + } + }; + + /** + * @copydoc geos::finiteElement::KernelBase::quadraturePointKernel + * @tparam STRESS_MODIFIER Type of optional functor to allow for the + * modification of stress prior to integration. + * @param stressModifier An optional functor to allow for the modification + * of stress prior to integration. + * For solid mechanics kernels, the strain increment is calculated, and the + * constitutive update is called. In addition, the constitutive stiffness + * stack variable is filled by the constitutive model. + */ + template< typename STRESS_MODIFIER = NoOpFunctors > + GEOS_HOST_DEVICE + void quadraturePointKernel(localIndex const k, localIndex const q, StackVariables & stack, + STRESS_MODIFIER && stressModifier = NoOpFunctors{}) const; + +} + +} // namespace solidMechanicsLagrangianFEMKernels + +} // namespace geos + +#include "finiteElement/kernelInterface/SparsityKernelBase.hpp" + +#endif // GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_HPP_ \ No newline at end of file diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp new file mode 100644 index 00000000000..14e8471e8fd --- /dev/null +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp @@ -0,0 +1,111 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file ImplicitFinitStrainQuasiStatic_impl.hpp + */ + +#ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_IMPL_HPP_ +#define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_IMPL_HPP_ + +#include "ImplicitFinitStrainQuasiStatic.hpp" +namespace geos +{ + +namespace solidMechanicsLagrangianFEMKernels +{ + +template +ImplicitFiniteStrainQuasis :: ImplicitFinitStrainQuasiStatic( + FaceManager const & faceManager, localIndex const targetRegionIndex, + SUBREGION_TYPE const & elementSubRegion, FE_TYPE const & finiteElementSpace, + CONSTITUTIVE_TYPE const & inputConstitutiveType, arrayView1d const inputDofNumber, + globalIndex const rankOffset, CRSMatrixView const inputMatrix, + arrayView1d const inputRhs, real64 const inputDt, real64 const (&inputGravityVector)[3]) + : Base(nodeManager, edgeManager, faceManager, targetRegionIndex, elementSubRegion, finiteElementSpace, + inputConstitutiveType, inputDofNumber, rankOffset, inputMatrix, inputRhs, inputDt), + m_X(nodeManager.referencePosition()), + m_disp(nodeManager.getField()), + m_uhat(nodeManager.getField()), + m_gravityVector{inputGravityVector[0], inputGravityVector[1], inputGravityVector[2]}, + m_density(inputConstitutiveType.getDensity()) + {} + +template +GEOS_HOST_DEVICE +GEOS_FORCE_INLINE +void ImplicitFiniteStrainQuasiStatic :: setup( + localIndex const k, StackVariables& stack) const +{ + m_finiteElementSpace.template setup(k, m_meshData, stack.feStack); + + localIndex const numSupportPoints = m_finiteElementSpace.template numSupportPoints(stack.feStack); + + stack.numRows = 3 * numSupportPoints; + stack.numRows = stack.numRows; + + for (localIndex a = 0; a < numSupportPoints; ++a) + { + localIndex const localNodeIndex = m_elemsToNodes(k, a); + + for (int i = 0; i < numDofPerTestSupportPoint; ++i) + { +#if defined(CALC_FEM_SHAPE_IN_KERNEL) + stack.xLocal[ a ][ i ] = m_X[ localNodeIndex ][ i ]; +#endif + stack.u_local[ a ][i] = m_disp[ localNodeIndex ][i]; + stack.uhat_local[ a ][i] = m_uhat[ localNodeIndex ][i]; + stack.localRowDofIndex[a*3+i] = m_dofNumber[localNodeIndex]+i; + stack.localColDofIndex[a*3+i] = m_dofNumber[localNodeIndex]+i; + } + } + + // Hanyu: not adding stabilization to the local jacobian since this is for FEM +} + +template +template +GEOS_HOST_DEVICE +GEOS_FORCE_INLINE +void ImplicitFiniteStrainQuasiStatic::quadraturePointKernel( + localIndex const k, localIndex const q, StackVariables & stack, STRESS_MODIFIER && stressModifier) const +{ + real64 dNdX[numNodesPerElem][3]; + real64 const detJxW = m_finiteElementSpace.template getGradN(k, q, stack.xLocal, stack.feStack, dNdX); + + real64 stress[6] = {0}; + + typename CONSTITUTIVE_TYPE::KernelWrapper::DiscretizationOps stiffness; + + real64 dUhatdX[3][3] = { {0} }; + real64 dUdX[3][3] = { {0} }; + real64 F[3][3] = { {0} }; + + FE_TYPE::gradient(dNdX, stack.u_local, dUdX); + FE_TYPE::gradient(dNdX, stack.uhat_local, dUhatdX); + + // calculate deformation gradient + LvArray::tensorOps::copy<3, 3>(F, dUdX); + LvArray::tensorOps::add<3, 3>(F, dUhatdX); + LvArray::tensorOps::addIdentity< 3 >(F, 1.0); + + m_constitutiveUpdate.finiteStrainUpdate(k, q, m_dt, F, stress, stiffness); +} + +} // namespace solidMechanicsLagrangianFEMKernels + +} // namespace geos + +#endif // GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_IMPL_HPP_ \ No newline at end of file diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index 6268381dc4a..98e6dc0f022 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -759,6 +759,10 @@ + + + + @@ -791,6 +795,10 @@ + + + + @@ -1045,7 +1053,7 @@ + - Informations on events and subevents execution--> @@ -1073,7 +1081,7 @@ Information output from lower logLevels is added with the desired log level + - Informations on events and subevents execution--> @@ -1107,7 +1115,7 @@ Information output from lower logLevels is added with the desired log level + - Informations on events and subevents execution--> @@ -1147,7 +1155,7 @@ Information output from lower logLevels is added with the desired log level + - Informations on events and subevents execution--> @@ -1200,11 +1208,11 @@ Information output from lower logLevels is added with the desired log level - @@ -1243,13 +1251,6 @@ This keyword is ignored for single-phase flow simulations--> - - @@ -1277,13 +1278,6 @@ Information output from lower logLevels is added with the desired log level - - @@ -1310,13 +1304,6 @@ Information output from lower logLevels is added with the desired log level - - @@ -1351,13 +1338,6 @@ Information output from lower logLevels is added with the desired log level - - @@ -1382,13 +1362,6 @@ Information output from lower logLevels is added with the desired log level - - @@ -1427,13 +1400,6 @@ Information output from lower logLevels is added with the desired log level - - @@ -1458,13 +1424,6 @@ Information output from lower logLevels is added with the desired log level - - @@ -1540,7 +1499,7 @@ stress - traction is applied to the faces as specified by the inner product of i + - Output PVT table to log--> @@ -1692,6 +1651,11 @@ Information output from lower logLevels is added with the desired log level + + @@ -1745,8 +1709,7 @@ Information output from lower logLevels is added with the desired log level + - Well generation information: internal well table, perforation table--> @@ -1796,10 +1759,9 @@ Information output from lower logLevels is added with the desired log level + - VTK mesh generator steps--> @@ -1914,7 +1876,7 @@ Information output from lower logLevels is added with the desired log level + - VTK mesh generator steps--> @@ -2068,8 +2030,7 @@ the relative residual norm satisfies: + - Linear solver information--> @@ -2162,14 +2123,14 @@ Information output from lower logLevels is added with the desired log level * FullyImplicit * Sequential--> - - @@ -2412,8 +2373,6 @@ Information output from lower logLevels is added with the desired log level Information output from lower logLevels is added with the desired log level 1 - Output timing information -2 - - Information on output events (VTK/ChomboIO/HDF5) 3 - Information on Time history Initialization - Information on buffered data in an HDF5 file --> @@ -2569,9 +2528,10 @@ Information output from lower logLevels is added with the desired log level + + @@ -2598,16 +2560,20 @@ Information output from lower logLevels is added with the desired log level + + - + + + @@ -2643,9 +2609,10 @@ Information output from lower logLevels is added with the desired log level - - - - - - - - - - @@ -2788,9 +2746,10 @@ Information output from lower logLevels is added with the desired log level @@ -3071,13 +3032,13 @@ Information output from lower logLevels is added with the desired log level @@ -3148,14 +3109,14 @@ Information output from lower logLevels is added with the desired log level @@ -3186,13 +3147,13 @@ Information output from lower logLevels is added with the desired log level @@ -3205,8 +3166,8 @@ Information output from lower logLevels is added with the desired log level @@ -3242,18 +3203,15 @@ Local- Add jump stabilization on interior of macro elements--> + - The summary of declared fields and coupling--> @@ -3290,12 +3248,12 @@ Information output from lower logLevels is added with the desired log level * massRate * uninitialized--> - - @@ -3309,7 +3267,7 @@ Information output from lower logLevels is added with the desired log level - @@ -3388,9 +3346,10 @@ Equal to 1 for surface conditions, and to 0 for reservoir conditions--> + @@ -3544,7 +3506,16 @@ Information output from lower logLevels is added with the desired log level +Information output from lower logLevels is added with the desired log level +1 + - Convergence information + - Linear solver information + - Output residual norm + - Solution information (scaling, maximum changes, quality check) + - Time step information + - Solver timers information +2 + - The summary of declared fields and coupling--> @@ -3554,6 +3525,8 @@ Information output from lower logLevels is added with the desired log level--> * QuasiStatic *ImplicitTransient--> + + @@ -3582,9 +3555,10 @@ Information output from lower logLevels is added with the desired log level--> @@ -3761,8 +3738,8 @@ Information output from lower logLevels is added with the desired log level @@ -3805,9 +3782,10 @@ Local- Add jump stabilization on interior of macro elements--> @@ -3995,8 +3976,8 @@ Information output from lower logLevels is added with the desired log level @@ -4026,13 +4007,13 @@ Local- Add jump stabilization on interior of macro elements--> @@ -4043,8 +4024,8 @@ Information output from lower logLevels is added with the desired log level @@ -4070,14 +4051,14 @@ Local- Add jump stabilization on interior of macro elements--> @@ -4110,9 +4091,10 @@ Information output from lower logLevels is added with the desired log level @@ -4343,9 +4328,10 @@ Information output from lower logLevels is added with the desired log level @@ -4493,13 +4481,13 @@ For the energy balance equation, the mass flux is multiplied by the enthalpy in @@ -4540,13 +4528,13 @@ Information output from lower logLevels is added with the desired log level @@ -4557,8 +4545,8 @@ Information output from lower logLevels is added with the desired log level @@ -4590,13 +4578,13 @@ Local- Add jump stabilization on interior of macro elements--> @@ -4607,8 +4595,8 @@ Information output from lower logLevels is added with the desired log level @@ -4634,13 +4622,13 @@ Local- Add jump stabilization on interior of macro elements--> @@ -4677,13 +4665,13 @@ Information output from lower logLevels is added with the desired log level @@ -4694,8 +4682,8 @@ Information output from lower logLevels is added with the desired log level @@ -4721,13 +4709,13 @@ Local- Add jump stabilization on interior of macro elements--> @@ -4768,12 +4756,13 @@ For the energy balance equation, the mass flux is multiplied by the enthalpy in @@ -4810,13 +4799,13 @@ Information output from lower logLevels is added with the desired log level @@ -4849,13 +4838,13 @@ Information output from lower logLevels is added with the desired log level @@ -4868,8 +4857,8 @@ Information output from lower logLevels is added with the desired log level @@ -4899,13 +4888,13 @@ Local- Add jump stabilization on interior of macro elements--> @@ -4918,8 +4907,8 @@ Information output from lower logLevels is added with the desired log level @@ -4950,17 +4939,15 @@ Local- Add jump stabilization on interior of macro elements--> + - The summary of declared fields and coupling--> @@ -4997,15 +4984,16 @@ Information output from lower logLevels is added with the desired log level + - Output tolerance computed the given fracture element--> @@ -5020,7 +5008,7 @@ Information output from lower logLevels is added with the desired log level @@ -5070,14 +5058,16 @@ Information output from lower logLevels is added with the desired log level + - The summary of declared fields and coupling + - Output tolerance computed the given fracture element--> @@ -5090,7 +5080,7 @@ Information output from lower logLevels is added with the desired log level @@ -5127,15 +5117,16 @@ Information output from lower logLevels is added with the desired log level + - Output tolerance computed the given fracture element--> @@ -5152,7 +5143,7 @@ Information output from lower logLevels is added with the desired log level @@ -5187,13 +5178,16 @@ Information output from lower logLevels is added with the desired log level + - The summary of declared fields and coupling + - Output tolerance computed the given fracture element--> @@ -5206,7 +5200,7 @@ Information output from lower logLevels is added with the desired log level @@ -5243,9 +5237,10 @@ Information output from lower logLevels is added with the desired log level @@ -5315,9 +5310,10 @@ Information output from lower logLevels is added with the desired log level + - Information on stencil initialization--> @@ -5455,7 +5452,7 @@ Information output from lower logLevels is added with the desired log level + - Information on solver initialization--> @@ -5488,7 +5485,7 @@ Information output from lower logLevels is added with the desired log level + - Information on solver initialization--> @@ -5501,7 +5498,7 @@ Information output from lower logLevels is added with the desired log level + - Information on solver initialization--> @@ -5514,7 +5511,7 @@ Information output from lower logLevels is added with the desired log level + - Information on solver initialization--> @@ -5533,8 +5530,7 @@ Information output from lower logLevels is added with the desired log level + - Enable log output--> @@ -5579,8 +5575,7 @@ Information output from lower logLevels is added with the desired log level + - Enable log output--> @@ -5599,8 +5594,7 @@ Information output from lower logLevels is added with the desired log level + - Enable log output--> @@ -5615,7 +5609,7 @@ Information output from lower logLevels is added with the desired log level + - Information on solver initialization--> @@ -5628,7 +5622,7 @@ Information output from lower logLevels is added with the desired log level + - Information on solver initialization--> @@ -5641,7 +5635,7 @@ Information output from lower logLevels is added with the desired log level + - Information on solver initialization--> @@ -5654,7 +5648,7 @@ Information output from lower logLevels is added with the desired log level + - Information on solver initialization--> @@ -5667,7 +5661,7 @@ Information output from lower logLevels is added with the desired log level + - Information on solver initialization--> @@ -5748,8 +5742,7 @@ Information output from lower logLevels is added with the desired log level + - Enable log output--> @@ -5809,6 +5802,7 @@ Information output from lower logLevels is added with the desired log level + @@ -5817,6 +5811,7 @@ Information output from lower logLevels is added with the desired log level + @@ -5893,12 +5888,12 @@ Information output from lower logLevels is added with the desired log level - - @@ -6004,7 +5999,7 @@ The expected format is "{ waterMax, oilMax }", in that order--> + - Output PVT table to log--> @@ -6031,7 +6026,7 @@ Information output from lower logLevels is added with the desired log level + - Output PVT table to log--> @@ -6058,7 +6053,7 @@ Information output from lower logLevels is added with the desired log level + - Output PVT table to log--> @@ -6085,7 +6080,7 @@ Information output from lower logLevels is added with the desired log level + - Output PVT table to log--> @@ -6619,12 +6614,12 @@ Information output from lower logLevels is added with the desired log level - - @@ -6710,6 +6705,22 @@ For instance, if "oil" is before "gas" in "phaseNames", the table order should b + + + + + + + + + + + + + + + + @@ -6800,7 +6811,7 @@ For instance, if "oil" is before "gas" in "phaseNames", the table order should b - + @@ -6854,6 +6865,22 @@ For instance, if "oil" is before "gas" in "phaseNames", the table order should b + + + + + + + + + + + + + + + + + - Output PVT table to log--> @@ -7314,7 +7341,7 @@ Information output from lower logLevels is added with the desired log level + - Output PVT table to log--> @@ -7383,7 +7410,7 @@ If you want to do a two-phase simulation, please use instead wettingNonWettingRe - @@ -7435,7 +7462,7 @@ To neglect hysteresis on this phase, just use the same table name for the draina - @@ -7484,14 +7511,14 @@ To neglect hysteresis on this phase, just use the same table name for the draina - - @@ -7651,8 +7678,6 @@ The expected format is "{ waterMax, oilMax }", in that order--> - - diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index 165b8b9c08d..e0c5ce208e4 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -491,7 +491,7 @@ - + @@ -819,15 +819,8 @@ -<<<<<<< HEAD - - - - -======= ->>>>>>> develop @@ -964,10 +957,8 @@ - - - - + + @@ -1015,12 +1006,6 @@ -<<<<<<< HEAD - - - - -======= @@ -1032,7 +1017,6 @@ ->>>>>>> develop @@ -1520,7 +1504,7 @@ - + @@ -1564,6 +1548,7 @@ + @@ -1572,6 +1557,7 @@ + @@ -2505,6 +2491,20 @@ + + + + + + + + + + + + + + @@ -2615,6 +2615,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3017,24 +3063,14 @@ - - - - - - - - - - - - + + @@ -3053,6 +3089,8 @@ + + diff --git a/src/coreComponents/unitTests/constitutiveTests/CMakeLists.txt b/src/coreComponents/unitTests/constitutiveTests/CMakeLists.txt index 2f37d82ed38..acfc407818e 100644 --- a/src/coreComponents/unitTests/constitutiveTests/CMakeLists.txt +++ b/src/coreComponents/unitTests/constitutiveTests/CMakeLists.txt @@ -3,7 +3,8 @@ set( gtest_geosx_tests testCapillaryPressure.cpp testDamage.cpp testRelPerm.cpp - testRelPermHysteresis.cpp ) + testRelPermHysteresis.cpp + testFiniteDifferenceElasticFiniteStrain.cpp ) set( gtest_triaxial_xmls testTriaxial_druckerPragerExtended.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testFiniteDifferenceElasticFiniteStrain.cpp b/src/coreComponents/unitTests/constitutiveTests/testFiniteDifferenceElasticFiniteStrain.cpp new file mode 100644 index 00000000000..8bed576896b --- /dev/null +++ b/src/coreComponents/unitTests/constitutiveTests/testFiniteDifferenceElasticFiniteStrain.cpp @@ -0,0 +1,109 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +#include + +#include "constitutive/ConstitutiveManager.hpp" +#include "constitutive/solid/ElasticIsotropicFiniteStrain.hpp" +#include "constitutive/solid/SolidUtilities.hpp" +#include "dataRepository/xmlWrapper.hpp" +#include "mainInterface/GeosxState.hpp" +#include "mainInterface/initialization.hpp" + +using namespace geos; +using namespace ::geos::constitutive; + +TEST( ElasticFiniteStrainTests, testMaterialTangentFiniteDifference ) +{ + // create a model and test xml input + conduit::Node node; + dataRepository::Group rootGroup( "root", node ); + ConstitutiveManager constitutiveManager( "constitutive", &rootGroup ); + + string const inputStream = + "" + " " + ""; + + xmlWrapper::xmlDocument xmlDocument; + xmlWrapper::xmlResult xmlResult = xmlDocument.loadString( inputStream ); + if( !xmlResult ) + { + GEOS_LOG_RANK_0( "XML parsed with errors!" ); + GEOS_LOG_RANK_0( "Error description: " << xmlResult.description()); + GEOS_LOG_RANK_0( "Error offset: " << xmlResult.offset ); + } + + xmlWrapper::xmlNode xmlConstitutiveNode = xmlDocument.getChild( "Constitutive" ); + constitutiveManager.processInputFileRecursive( xmlDocument, xmlConstitutiveNode ); + constitutiveManager.postInputInitializationRecursive(); + + localIndex constexpr numElem = 1; + localIndex constexpr numQuad = 1; + + dataRepository::Group disc( "discretization", &rootGroup ); + disc.resize( numElem ); + + ElasticIsotropicFiniteStrain& constitutive_model = constitutiveManager.getConstitutiveRelation< ElasticIsotropicFiniteStrain >( "lithium" ); + constitutive_model.allocateConstitutiveData( disc, numQuad ); + + // confirm allocation sizes + EXPECT_EQ( constitutive_model.size(), numElem ); + EXPECT_EQ( constitutive_model.numQuadraturePoints(), numQuad ); + + ElasticIsotropicFiniteStrain::KernelWrapper cmw = constitutive_model.createKernelUpdates(); + real64 deformationGradient[3][3] = {}; + deformationGradient[0][0] = 1.05; + deformationGradient[0][1] = 0.02; + deformationGradient[0][2] = 0.01; + deformationGradient[1][0] = 0.0; + deformationGradient[1][1] = 1.02; + deformationGradient[1][2] = 0.0; + deformationGradient[2][0] = 0.0; + deformationGradient[2][1] = 0.0; + deformationGradient[2][2] = 1.01; + + EXPECT_TRUE( SolidUtilities::checkFiniteStrainStiffness( cmw, 0, 0, deformationGradient, true ) ); + + deformationGradient[0][0] = 1.5; + deformationGradient[0][1] = 2.0; + deformationGradient[0][2] = 3.0; + deformationGradient[1][0] = 1.2; + deformationGradient[1][1] = 1.3; + deformationGradient[1][2] = 4.0; + deformationGradient[2][0] = 2.5; + deformationGradient[2][1] = 1.2; + deformationGradient[2][2] = 1.4; + + EXPECT_TRUE( SolidUtilities::checkFiniteStrainStiffness( cmw, 0, 0, deformationGradient, true ) ); +} + +int main( int argc, char * * argv ) +{ + ::testing::InitGoogleTest( &argc, argv ); + + geos::GeosxState state( geos::basicSetup( argc, argv ) ); + + int const result = RUN_ALL_TESTS(); + + geos::basicCleanup(); + + return result; +} \ No newline at end of file From cbd5419eea3641b47b550f4ebd53152dcacdc0bf Mon Sep 17 00:00:00 2001 From: li97 Date: Thu, 18 Dec 2025 09:28:35 -0800 Subject: [PATCH 09/17] rename --- .../{unitTests => integrationTests}/CMakeLists.txt | 0 .../constitutiveTests/CMakeLists.txt | 0 .../constitutiveTests/constitutiveTestHelpers.hpp | 0 .../constitutiveTests/testCapillaryPressure.cpp | 0 .../constitutiveTests/testDamage.cpp | 0 .../constitutiveTests/testDistilledWater.txt | 0 .../testFiniteDifferenceElasticFiniteStrain.cpp | 0 .../constitutiveTests/testPVT.cpp | 0 .../constitutiveTests/testPVT.xml | 0 .../constitutiveTests/testPVT_CO2.txt | 0 .../constitutiveTests/testPVT_CO2Brine.xml | 0 .../constitutiveTests/testPVT_CO2BrineTables.xml | 0 ..._CO2BrineTables_testCo2BrinePhillipsMixtureA.txt | 0 ..._CO2BrineTables_testCo2BrinePhillipsMixtureB.txt | 0 ...testPVT_CO2Brine_testCo2BrineEzrokhiMixtureA.txt | 0 ...testPVT_CO2Brine_testCo2BrineEzrokhiMixtureB.txt | 0 ...estPVT_CO2Brine_testCo2BrinePhillipsMixtureA.txt | 0 ...estPVT_CO2Brine_testCo2BrinePhillipsMixtureB.txt | 0 ...CO2Brine_testCo2BrinePhillipsMixtureThermalA.txt | 0 ...CO2Brine_testCo2BrinePhillipsMixtureThermalB.txt | 0 ...ne_testCo2SpycherPruessBrinePhillipsMixtureA.txt | 0 ...ne_testCo2SpycherPruessBrinePhillipsMixtureB.txt | 0 .../constitutiveTests/testPVT_Compositional.xml | 0 .../testPVT_CompositionalPhillipsBrine.xml | 0 .../testPVT_CompositionalPhillipsBrine_brine.txt | 0 .../testPVT_Compositional_liveOilPR.txt | 0 .../testPVT_Compositional_liveOilPRLBC.txt | 0 .../testPVT_Compositional_liveOilSRK.txt | 0 .../testPVT_Compositional_liveOilSRKLBC.txt | 0 .../constitutiveTests/testPVT_PhaseComposition.xml | 0 .../testPVT_ThreePhaseCompositional.xml | 0 .../testPVT_ThreePhaseCompositional_blackOil.txt | 0 .../constitutiveTests/testPVT_brine.txt | 0 .../constitutiveTests/testPVT_data/brinePVT.txt | 0 .../testPVT_data/brinePVTEzrokhi.txt | 0 .../testPVT_data/brinePVT_thermal.txt | 0 .../testPVT_data/carbonDioxideFlash.txt | 0 .../testPVT_data/carbonDioxidePVT.txt | 0 .../testPVT_data/carbonDioxidePVT_thermal.txt | 0 .../carbonDioxideSpycherPruessFlash.txt | 0 .../testPVT_data/co2Solubility.txt | 0 .../constitutiveTests/testPVT_data/deadOilPVDO.txt | 0 .../constitutiveTests/testPVT_data/dryGasPVDG.txt | 0 .../constitutiveTests/testPVT_data/gasPVT.txt | 0 .../testPVT_data/h20Vapourisation.txt | 0 .../constitutiveTests/testPVT_data/liveOilPVDG.txt | 0 .../constitutiveTests/testPVT_data/liveOilPVTO.txt | 0 .../constitutiveTests/testPVT_data/oilPVT.txt | 0 .../constitutiveTests/testPVT_data/pres.txt | 0 .../testPVT_data/reactiveBrinePVT.txt | 0 .../testPVT_data/referencePVT_CO2.txt | 0 .../testPVT_data/referencePVT_H2_CH4.txt | 0 .../testPVT_data/referencePVT_brine.txt | 0 .../constitutiveTests/testPVT_data/temp.txt | 0 .../constitutiveTests/testPVT_data/watPVT.txt | 0 .../constitutiveTests/testPVT_deadOilA.txt | 0 .../constitutiveTests/testPVT_deadOilB.txt | 0 .../constitutiveTests/testPVT_docExample.xml | 0 .../testPVT_hydrocarbonMixture.txt | 0 .../constitutiveTests/testPVT_hydrogenMixtureA.txt | 0 .../constitutiveTests/testPVT_hydrogenMixtureB.txt | 0 .../constitutiveTests/testPVT_liveBlackOil.txt | 0 .../constitutiveTests/testReactiveBrine.txt | 0 .../constitutiveTests/testReactiveFluid.cpp | 0 .../constitutiveTests/testReactiveFluid.xml | 0 .../constitutiveTests/testRelPerm.cpp | 0 .../constitutiveTests/testRelPermHysteresis.cpp | 0 .../constitutiveTests/testTriaxial.cpp | 0 .../testTriaxial_delftEggCase1.txt | 0 .../testTriaxial_delftEggCase1.xml | 0 .../testTriaxial_delftEggCase2.txt | 0 .../testTriaxial_delftEggCase2.xml | 0 .../testTriaxial_delftEggLoadPathDryUseLinear.txt | 0 .../testTriaxial_delftEggLoadPathDryUseLinear.xml | 0 .../testTriaxial_delftEggLoadPathWetUseLinear.txt | 0 .../testTriaxial_delftEggLoadPathWetUseLinear.xml | 0 .../testTriaxial_delftEggUseLinear.txt | 0 .../testTriaxial_delftEggUseLinear.xml | 0 .../testTriaxial_druckerPragerExtended.txt | 0 .../testTriaxial_druckerPragerExtended.xml | 0 .../testTriaxial_elasticIsotropic.txt | 0 .../testTriaxial_elasticIsotropic.xml | 0 ...stTriaxial_elasticIsotropicPressureDependent.txt | 0 ...stTriaxial_elasticIsotropicPressureDependent.xml | 0 .../testTriaxial_modifiedCamClay.txt | 0 .../testTriaxial_modifiedCamClay.xml | 0 .../testTriaxial_modifiedCamClayVolumetric.txt | 0 .../testTriaxial_modifiedCamClayVolumetric.xml | 0 .../dataRepositoryTests/CMakeLists.txt | 0 .../dataRepositoryTests/testGroupPath.cpp | 0 .../dataRepositoryTests/testObjectCatalog.cpp | 0 .../dataRepositoryTests/testRestartBasic.cpp | 0 .../dataRepositoryTests/testRestartExtended.cpp | 0 .../dataRepositoryTests/testWrapperHelpers.cpp | 0 .../dataRepositoryTests/utils.hpp | 0 .../fieldSpecificationTests/CMakeLists.txt | 0 .../testAquiferBoundaryCondition.cpp | 0 .../testFieldSpecificationsEnums.cpp | 0 .../testRecursiveFieldApplication.cpp | 0 .../fileIOTests/CMakeLists.txt | 0 .../fileIOTests/testHDFFile.cpp | 0 .../fileIOTests/testHDFParallelFile.cpp | 0 .../fileIOTests/testMemoryStats.cpp | 0 .../finiteVolumeTests/CMakeLists.txt | 0 .../finiteVolumeTests/testMimeticInnerProducts.cpp | 0 .../fluidFlowTests/CMakeLists.txt | 0 .../fluidFlowTests/testCompFlowUtils.hpp | 0 .../fluidFlowTests/testCompMultiphaseFlow.cpp | 0 .../fluidFlowTests/testCompMultiphaseFlowHybrid.cpp | 0 .../fluidFlowTests/testFlowKernelHelpers.hpp | 0 .../fluidFlowTests/testFlowStatistics.cpp | 0 .../fluidFlowTests/testFlowUtils.hpp | 0 .../fluidFlowTests/testImmiscibleMultiphaseFlow.cpp | 0 .../testReactiveCompositionalMultiphaseOBL.cpp | 0 .../fluidFlowTests/testSingleFlowUtils.hpp | 0 .../fluidFlowTests/testSinglePhaseFVMKernels.cpp | 0 .../testSinglePhaseMobilityKernel.cpp | 0 .../testThermalCompMultiphaseFlow.cpp | 0 .../fluidFlowTests/testThermalSinglePhaseFlow.cpp | 0 .../fluidFlowTests/testTransmissibility.cpp | 0 .../linearAlgebraTests/CMakeLists.txt | 0 .../linearAlgebraTests/testDofManager.cpp | 0 .../linearAlgebraTests/testDofManagerUtils.hpp | 0 .../linearAlgebraTests/testLAIHelperFunctions.cpp | 0 .../meshTests/CMakeLists.txt | 0 .../meshTests/box_hybrid_mesh.vtu | Bin .../meshTests/cube.pvti | 0 .../meshTests/cube.pvtr | 0 .../meshTests/cube.pvts | 0 .../meshTests/cube.pvtu | 0 .../meshTests/cube.vti | 0 .../meshTests/cube.vtk | 0 .../meshTests/cube.vtr | 0 .../meshTests/cube.vts | 0 .../meshTests/cube.vtu | 0 .../meshTests/cube/cube_0.vti | 0 .../meshTests/cube/cube_0.vtr | 0 .../meshTests/cube/cube_0.vts | 0 .../meshTests/cube/cube_0.vtu | 0 .../meshTests/cube/cube_1.vti | 0 .../meshTests/cube/cube_1.vtr | 0 .../meshTests/cube/cube_1.vts | 0 .../meshTests/cube/cube_1.vtu | 0 .../meshTests/cube/cube_2.vti | 0 .../meshTests/cube/cube_2.vtr | 0 .../meshTests/cube/cube_2.vts | 0 .../meshTests/cube/cube_2.vtu | 0 .../meshTests/cube/cube_3.vti | 0 .../meshTests/cube/cube_3.vtr | 0 .../meshTests/cube/cube_3.vts | 0 .../meshTests/cube/cube_3.vtu | 0 .../meshTests/cube_RECTILINEAR_GRID.vtk | 0 .../meshTests/cube_STRUCTURED_GRID.vtk | 0 .../meshTests/cube_STRUCTURED_POINTS.vtk | 0 .../meshTests/cube_UNSTRUCTURED_GRID.vtk | 0 .../meshTests/meshDirName.hpp.in | 0 .../meshTests/supportedElements.vtk | 0 .../meshTests/supportedElementsAsVTKPolyhedra.vtk | 0 .../meshTests/testElementRegions.cpp | 0 .../meshTests/testMeshEnums.cpp | 0 .../meshTests/testMeshGeneration.cpp | 0 .../meshTests/testNeighborCommunicator.cpp | 0 .../meshTests/testVTKImport.cpp | 0 .../meshTests/toy_model.GRDECL | 0 .../meshTests/toy_model.msh | 0 .../meshTests/well1.vtk | 0 .../meshTests/well2.vtk | 0 .../tableFunctionsFileTests/CMakeLists.txt | 0 .../testTableFunctionsOutput.cpp | 0 .../testingUtilities/CMakeLists.txt | 0 .../testingUtilities/TestingTasks.cpp | 0 .../testingUtilities/TestingTasks.hpp | 0 .../toolchain/CMakeLists.txt | 0 .../toolchain/testToolchain.cpp | 0 .../virtualElementTests/CMakeLists.txt | 0 .../testConformingVirtualElementOrder1.cpp | 0 .../wavePropagationTests/CMakeLists.txt | 0 .../wavePropagationTests/testWavePropagation.cpp | 0 .../testWavePropagationAcousticFirstOrder.cpp | 0 .../testWavePropagationAdjoint1.cpp | 0 .../testWavePropagationAttenuationAcoustic.cpp | 0 .../testWavePropagationAttenuationAcousticVTI.cpp | 0 .../testWavePropagationAttenuationElastic.cpp | 0 .../wavePropagationTests/testWavePropagationDAS.cpp | 0 .../wavePropagationTests/testWavePropagationDG.cpp | 0 .../testWavePropagationElasticFirstOrder.cpp | 0 .../testWavePropagationElasticTTI.cpp | 0 .../testWavePropagationElasticVTI.cpp | 0 .../wavePropagationTests/testWavePropagationQ2.cpp | 0 .../testWavePropagationTaper.cpp | 0 .../wellsTests/CMakeLists.txt | 0 ...ermalReservoirCompositionalMultiphaseMSWells.cpp | 0 ...ermalReservoirCompositionalMultiphaseSSWells.cpp | 0 .../testReservoirCompositionalMultiphaseMSWells.cpp | 0 .../wellsTests/testReservoirSinglePhaseMSWells.cpp | 0 .../testReservoirThermalSinglePhaseMSWells.cpp | 0 ...stReservoirThermalSinglePhaseMSWells_RateInj.cpp | 0 ...ermalReservoirCompositionalMultiphaseMSWells.cpp | 0 ...ermalReservoirCompositionalMultiphaseSSWells.cpp | 0 .../wellsTests/testWellEnums.cpp | 0 .../xmlTests/CMakeLists.txt | 0 .../xmlTests/basic_input.xml | 0 .../xmlTests/include_input.xml | 0 .../boundary_conditions/constraints.xml | 0 .../boundary_conditions/tables/time.txt | 0 .../boundary_conditions/tables/velocity.txt | 0 .../boundary_conditions/velocity.xml | 0 .../xmlTests/multifile_input/fieldspec.xml | 0 .../xmlTests/multifile_input/mesh.xml | 0 .../xmlTests/multifile_input/outputs.xml | 0 .../xmlTests/multifile_input/solver.xml | 0 .../xmlTests/testXML.cpp | 0 .../xmlTests/testXMLFile.cpp | 0 213 files changed, 0 insertions(+), 0 deletions(-) rename src/coreComponents/{unitTests => integrationTests}/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/constitutiveTestHelpers.hpp (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testCapillaryPressure.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testDamage.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testDistilledWater.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testFiniteDifferenceElasticFiniteStrain.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2Brine.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2BrineTables.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureA.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureB.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureA.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureB.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureA.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureB.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalA.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalB.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureA.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureB.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_Compositional.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CompositionalPhillipsBrine.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_CompositionalPhillipsBrine_brine.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_Compositional_liveOilPR.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_Compositional_liveOilPRLBC.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_Compositional_liveOilSRK.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_Compositional_liveOilSRKLBC.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_PhaseComposition.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_ThreePhaseCompositional.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_ThreePhaseCompositional_blackOil.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_brine.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/brinePVT.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/brinePVTEzrokhi.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/brinePVT_thermal.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/carbonDioxideFlash.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/carbonDioxidePVT.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/carbonDioxidePVT_thermal.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/carbonDioxideSpycherPruessFlash.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/co2Solubility.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/deadOilPVDO.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/dryGasPVDG.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/gasPVT.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/h20Vapourisation.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/liveOilPVDG.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/liveOilPVTO.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/oilPVT.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/pres.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/reactiveBrinePVT.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/referencePVT_CO2.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/referencePVT_H2_CH4.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/referencePVT_brine.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/temp.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_data/watPVT.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_deadOilA.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_deadOilB.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_docExample.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_hydrocarbonMixture.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_hydrogenMixtureA.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_hydrogenMixtureB.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testPVT_liveBlackOil.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testReactiveBrine.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testReactiveFluid.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testReactiveFluid.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testRelPerm.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testRelPermHysteresis.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_delftEggCase1.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_delftEggCase1.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_delftEggCase2.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_delftEggCase2.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_delftEggLoadPathDryUseLinear.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_delftEggLoadPathDryUseLinear.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_delftEggLoadPathWetUseLinear.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_delftEggLoadPathWetUseLinear.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_delftEggUseLinear.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_delftEggUseLinear.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_druckerPragerExtended.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_druckerPragerExtended.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_elasticIsotropic.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_elasticIsotropic.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_elasticIsotropicPressureDependent.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_elasticIsotropicPressureDependent.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_modifiedCamClay.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_modifiedCamClay.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_modifiedCamClayVolumetric.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/constitutiveTests/testTriaxial_modifiedCamClayVolumetric.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/dataRepositoryTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/dataRepositoryTests/testGroupPath.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/dataRepositoryTests/testObjectCatalog.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/dataRepositoryTests/testRestartBasic.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/dataRepositoryTests/testRestartExtended.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/dataRepositoryTests/testWrapperHelpers.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/dataRepositoryTests/utils.hpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fieldSpecificationTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/fieldSpecificationTests/testAquiferBoundaryCondition.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fieldSpecificationTests/testFieldSpecificationsEnums.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fieldSpecificationTests/testRecursiveFieldApplication.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fileIOTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/fileIOTests/testHDFFile.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fileIOTests/testHDFParallelFile.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fileIOTests/testMemoryStats.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/finiteVolumeTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/finiteVolumeTests/testMimeticInnerProducts.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testCompFlowUtils.hpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testCompMultiphaseFlow.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testCompMultiphaseFlowHybrid.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testFlowKernelHelpers.hpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testFlowStatistics.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testFlowUtils.hpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testImmiscibleMultiphaseFlow.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testReactiveCompositionalMultiphaseOBL.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testSingleFlowUtils.hpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testSinglePhaseFVMKernels.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testSinglePhaseMobilityKernel.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testThermalCompMultiphaseFlow.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testThermalSinglePhaseFlow.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/fluidFlowTests/testTransmissibility.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/linearAlgebraTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/linearAlgebraTests/testDofManager.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/linearAlgebraTests/testDofManagerUtils.hpp (100%) rename src/coreComponents/{unitTests => integrationTests}/linearAlgebraTests/testLAIHelperFunctions.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/box_hybrid_mesh.vtu (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube.pvti (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube.pvtr (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube.pvts (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube.pvtu (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube.vti (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube.vtk (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube.vtr (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube.vts (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube.vtu (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_0.vti (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_0.vtr (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_0.vts (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_0.vtu (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_1.vti (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_1.vtr (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_1.vts (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_1.vtu (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_2.vti (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_2.vtr (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_2.vts (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_2.vtu (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_3.vti (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_3.vtr (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_3.vts (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube/cube_3.vtu (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube_RECTILINEAR_GRID.vtk (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube_STRUCTURED_GRID.vtk (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube_STRUCTURED_POINTS.vtk (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/cube_UNSTRUCTURED_GRID.vtk (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/meshDirName.hpp.in (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/supportedElements.vtk (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/supportedElementsAsVTKPolyhedra.vtk (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/testElementRegions.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/testMeshEnums.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/testMeshGeneration.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/testNeighborCommunicator.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/testVTKImport.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/toy_model.GRDECL (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/toy_model.msh (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/well1.vtk (100%) rename src/coreComponents/{unitTests => integrationTests}/meshTests/well2.vtk (100%) rename src/coreComponents/{unitTests => integrationTests}/tableFunctionsFileTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/tableFunctionsFileTests/testTableFunctionsOutput.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/testingUtilities/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/testingUtilities/TestingTasks.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/testingUtilities/TestingTasks.hpp (100%) rename src/coreComponents/{unitTests => integrationTests}/toolchain/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/toolchain/testToolchain.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/virtualElementTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/virtualElementTests/testConformingVirtualElementOrder1.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagation.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationAcousticFirstOrder.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationAdjoint1.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationAttenuationAcoustic.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationAttenuationAcousticVTI.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationAttenuationElastic.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationDAS.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationDG.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationElasticFirstOrder.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationElasticTTI.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationElasticVTI.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationQ2.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wavePropagationTests/testWavePropagationTaper.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wellsTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wellsTests/testIsothermalReservoirCompositionalMultiphaseSSWells.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wellsTests/testReservoirCompositionalMultiphaseMSWells.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wellsTests/testReservoirSinglePhaseMSWells.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wellsTests/testReservoirThermalSinglePhaseMSWells.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wellsTests/testReservoirThermalSinglePhaseMSWells_RateInj.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wellsTests/testThermalReservoirCompositionalMultiphaseMSWells.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wellsTests/testThermalReservoirCompositionalMultiphaseSSWells.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/wellsTests/testWellEnums.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/CMakeLists.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/basic_input.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/include_input.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/multifile_input/boundary_conditions/constraints.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/multifile_input/boundary_conditions/tables/time.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/multifile_input/boundary_conditions/tables/velocity.txt (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/multifile_input/boundary_conditions/velocity.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/multifile_input/fieldspec.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/multifile_input/mesh.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/multifile_input/outputs.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/multifile_input/solver.xml (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/testXML.cpp (100%) rename src/coreComponents/{unitTests => integrationTests}/xmlTests/testXMLFile.cpp (100%) diff --git a/src/coreComponents/unitTests/CMakeLists.txt b/src/coreComponents/integrationTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/CMakeLists.txt rename to src/coreComponents/integrationTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/CMakeLists.txt b/src/coreComponents/integrationTests/constitutiveTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/CMakeLists.txt rename to src/coreComponents/integrationTests/constitutiveTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/constitutiveTestHelpers.hpp b/src/coreComponents/integrationTests/constitutiveTests/constitutiveTestHelpers.hpp similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/constitutiveTestHelpers.hpp rename to src/coreComponents/integrationTests/constitutiveTests/constitutiveTestHelpers.hpp diff --git a/src/coreComponents/unitTests/constitutiveTests/testCapillaryPressure.cpp b/src/coreComponents/integrationTests/constitutiveTests/testCapillaryPressure.cpp similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testCapillaryPressure.cpp rename to src/coreComponents/integrationTests/constitutiveTests/testCapillaryPressure.cpp diff --git a/src/coreComponents/unitTests/constitutiveTests/testDamage.cpp b/src/coreComponents/integrationTests/constitutiveTests/testDamage.cpp similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testDamage.cpp rename to src/coreComponents/integrationTests/constitutiveTests/testDamage.cpp diff --git a/src/coreComponents/unitTests/constitutiveTests/testDistilledWater.txt b/src/coreComponents/integrationTests/constitutiveTests/testDistilledWater.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testDistilledWater.txt rename to src/coreComponents/integrationTests/constitutiveTests/testDistilledWater.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testFiniteDifferenceElasticFiniteStrain.cpp b/src/coreComponents/integrationTests/constitutiveTests/testFiniteDifferenceElasticFiniteStrain.cpp similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testFiniteDifferenceElasticFiniteStrain.cpp rename to src/coreComponents/integrationTests/constitutiveTests/testFiniteDifferenceElasticFiniteStrain.cpp diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT.cpp b/src/coreComponents/integrationTests/constitutiveTests/testPVT.cpp similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT.cpp rename to src/coreComponents/integrationTests/constitutiveTests/testPVT.cpp diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT.xml b/src/coreComponents/integrationTests/constitutiveTests/testPVT.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT.xml rename to src/coreComponents/integrationTests/constitutiveTests/testPVT.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine.xml b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine.xml rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables.xml b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2BrineTables.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables.xml rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2BrineTables.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureA.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureA.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureA.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureA.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureB.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureB.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureB.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2BrineTables_testCo2BrinePhillipsMixtureB.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureA.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureA.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureA.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureA.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureB.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureB.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureB.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrineEzrokhiMixtureB.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureA.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureA.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureA.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureA.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureB.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureB.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureB.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureB.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalA.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalA.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalA.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalA.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalB.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalB.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalB.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2BrinePhillipsMixtureThermalB.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureA.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureA.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureA.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureA.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureB.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureB.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureB.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CO2Brine_testCo2SpycherPruessBrinePhillipsMixtureB.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional.xml b/src/coreComponents/integrationTests/constitutiveTests/testPVT_Compositional.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional.xml rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_Compositional.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CompositionalPhillipsBrine.xml b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CompositionalPhillipsBrine.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CompositionalPhillipsBrine.xml rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CompositionalPhillipsBrine.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_CompositionalPhillipsBrine_brine.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_CompositionalPhillipsBrine_brine.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_CompositionalPhillipsBrine_brine.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_CompositionalPhillipsBrine_brine.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional_liveOilPR.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_Compositional_liveOilPR.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional_liveOilPR.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_Compositional_liveOilPR.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional_liveOilPRLBC.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_Compositional_liveOilPRLBC.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional_liveOilPRLBC.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_Compositional_liveOilPRLBC.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional_liveOilSRK.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_Compositional_liveOilSRK.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional_liveOilSRK.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_Compositional_liveOilSRK.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional_liveOilSRKLBC.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_Compositional_liveOilSRKLBC.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_Compositional_liveOilSRKLBC.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_Compositional_liveOilSRKLBC.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_PhaseComposition.xml b/src/coreComponents/integrationTests/constitutiveTests/testPVT_PhaseComposition.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_PhaseComposition.xml rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_PhaseComposition.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_ThreePhaseCompositional.xml b/src/coreComponents/integrationTests/constitutiveTests/testPVT_ThreePhaseCompositional.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_ThreePhaseCompositional.xml rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_ThreePhaseCompositional.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_ThreePhaseCompositional_blackOil.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_ThreePhaseCompositional_blackOil.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_ThreePhaseCompositional_blackOil.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_ThreePhaseCompositional_blackOil.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_brine.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_brine.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_brine.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_brine.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/brinePVT.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/brinePVT.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVTEzrokhi.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/brinePVTEzrokhi.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVTEzrokhi.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/brinePVTEzrokhi.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT_thermal.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/brinePVT_thermal.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/brinePVT_thermal.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/brinePVT_thermal.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideFlash.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/carbonDioxideFlash.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideFlash.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/carbonDioxideFlash.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/carbonDioxidePVT.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/carbonDioxidePVT.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT_thermal.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/carbonDioxidePVT_thermal.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxidePVT_thermal.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/carbonDioxidePVT_thermal.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideSpycherPruessFlash.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/carbonDioxideSpycherPruessFlash.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/carbonDioxideSpycherPruessFlash.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/carbonDioxideSpycherPruessFlash.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/co2Solubility.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/co2Solubility.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/co2Solubility.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/co2Solubility.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/deadOilPVDO.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/deadOilPVDO.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/deadOilPVDO.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/deadOilPVDO.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/dryGasPVDG.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/dryGasPVDG.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/dryGasPVDG.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/dryGasPVDG.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/gasPVT.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/gasPVT.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/gasPVT.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/gasPVT.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/h20Vapourisation.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/h20Vapourisation.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/h20Vapourisation.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/h20Vapourisation.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/liveOilPVDG.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/liveOilPVDG.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/liveOilPVDG.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/liveOilPVDG.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/liveOilPVTO.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/liveOilPVTO.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/liveOilPVTO.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/liveOilPVTO.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/oilPVT.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/oilPVT.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/oilPVT.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/oilPVT.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/pres.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/pres.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/pres.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/pres.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/reactiveBrinePVT.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/reactiveBrinePVT.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/reactiveBrinePVT.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/reactiveBrinePVT.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/referencePVT_CO2.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/referencePVT_CO2.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/referencePVT_CO2.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/referencePVT_CO2.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/referencePVT_H2_CH4.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/referencePVT_H2_CH4.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/referencePVT_H2_CH4.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/referencePVT_H2_CH4.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/referencePVT_brine.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/referencePVT_brine.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/referencePVT_brine.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/referencePVT_brine.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/temp.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/temp.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/temp.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/temp.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_data/watPVT.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_data/watPVT.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_data/watPVT.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_data/watPVT.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_deadOilA.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_deadOilA.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_deadOilA.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_deadOilA.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_deadOilB.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_deadOilB.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_deadOilB.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_deadOilB.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_docExample.xml b/src/coreComponents/integrationTests/constitutiveTests/testPVT_docExample.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_docExample.xml rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_docExample.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_hydrocarbonMixture.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_hydrocarbonMixture.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_hydrocarbonMixture.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_hydrocarbonMixture.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_hydrogenMixtureA.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_hydrogenMixtureA.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_hydrogenMixtureA.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_hydrogenMixtureA.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_hydrogenMixtureB.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_hydrogenMixtureB.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_hydrogenMixtureB.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_hydrogenMixtureB.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testPVT_liveBlackOil.txt b/src/coreComponents/integrationTests/constitutiveTests/testPVT_liveBlackOil.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testPVT_liveBlackOil.txt rename to src/coreComponents/integrationTests/constitutiveTests/testPVT_liveBlackOil.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testReactiveBrine.txt b/src/coreComponents/integrationTests/constitutiveTests/testReactiveBrine.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testReactiveBrine.txt rename to src/coreComponents/integrationTests/constitutiveTests/testReactiveBrine.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testReactiveFluid.cpp b/src/coreComponents/integrationTests/constitutiveTests/testReactiveFluid.cpp similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testReactiveFluid.cpp rename to src/coreComponents/integrationTests/constitutiveTests/testReactiveFluid.cpp diff --git a/src/coreComponents/unitTests/constitutiveTests/testReactiveFluid.xml b/src/coreComponents/integrationTests/constitutiveTests/testReactiveFluid.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testReactiveFluid.xml rename to src/coreComponents/integrationTests/constitutiveTests/testReactiveFluid.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testRelPerm.cpp b/src/coreComponents/integrationTests/constitutiveTests/testRelPerm.cpp similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testRelPerm.cpp rename to src/coreComponents/integrationTests/constitutiveTests/testRelPerm.cpp diff --git a/src/coreComponents/unitTests/constitutiveTests/testRelPermHysteresis.cpp b/src/coreComponents/integrationTests/constitutiveTests/testRelPermHysteresis.cpp similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testRelPermHysteresis.cpp rename to src/coreComponents/integrationTests/constitutiveTests/testRelPermHysteresis.cpp diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial.cpp b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial.cpp similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial.cpp rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial.cpp diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggCase1.txt b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggCase1.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggCase1.txt rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggCase1.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggCase1.xml b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggCase1.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggCase1.xml rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggCase1.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggCase2.txt b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggCase2.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggCase2.txt rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggCase2.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggCase2.xml b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggCase2.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggCase2.xml rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggCase2.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggLoadPathDryUseLinear.txt b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggLoadPathDryUseLinear.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggLoadPathDryUseLinear.txt rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggLoadPathDryUseLinear.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggLoadPathDryUseLinear.xml b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggLoadPathDryUseLinear.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggLoadPathDryUseLinear.xml rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggLoadPathDryUseLinear.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggLoadPathWetUseLinear.txt b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggLoadPathWetUseLinear.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggLoadPathWetUseLinear.txt rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggLoadPathWetUseLinear.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggLoadPathWetUseLinear.xml b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggLoadPathWetUseLinear.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggLoadPathWetUseLinear.xml rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggLoadPathWetUseLinear.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggUseLinear.txt b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggUseLinear.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggUseLinear.txt rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggUseLinear.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggUseLinear.xml b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggUseLinear.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_delftEggUseLinear.xml rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_delftEggUseLinear.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_druckerPragerExtended.txt b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_druckerPragerExtended.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_druckerPragerExtended.txt rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_druckerPragerExtended.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_druckerPragerExtended.xml b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_druckerPragerExtended.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_druckerPragerExtended.xml rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_druckerPragerExtended.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_elasticIsotropic.txt b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_elasticIsotropic.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_elasticIsotropic.txt rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_elasticIsotropic.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_elasticIsotropic.xml b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_elasticIsotropic.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_elasticIsotropic.xml rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_elasticIsotropic.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_elasticIsotropicPressureDependent.txt b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_elasticIsotropicPressureDependent.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_elasticIsotropicPressureDependent.txt rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_elasticIsotropicPressureDependent.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_elasticIsotropicPressureDependent.xml b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_elasticIsotropicPressureDependent.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_elasticIsotropicPressureDependent.xml rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_elasticIsotropicPressureDependent.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_modifiedCamClay.txt b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_modifiedCamClay.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_modifiedCamClay.txt rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_modifiedCamClay.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_modifiedCamClay.xml b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_modifiedCamClay.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_modifiedCamClay.xml rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_modifiedCamClay.xml diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_modifiedCamClayVolumetric.txt b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_modifiedCamClayVolumetric.txt similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_modifiedCamClayVolumetric.txt rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_modifiedCamClayVolumetric.txt diff --git a/src/coreComponents/unitTests/constitutiveTests/testTriaxial_modifiedCamClayVolumetric.xml b/src/coreComponents/integrationTests/constitutiveTests/testTriaxial_modifiedCamClayVolumetric.xml similarity index 100% rename from src/coreComponents/unitTests/constitutiveTests/testTriaxial_modifiedCamClayVolumetric.xml rename to src/coreComponents/integrationTests/constitutiveTests/testTriaxial_modifiedCamClayVolumetric.xml diff --git a/src/coreComponents/unitTests/dataRepositoryTests/CMakeLists.txt b/src/coreComponents/integrationTests/dataRepositoryTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/dataRepositoryTests/CMakeLists.txt rename to src/coreComponents/integrationTests/dataRepositoryTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/dataRepositoryTests/testGroupPath.cpp b/src/coreComponents/integrationTests/dataRepositoryTests/testGroupPath.cpp similarity index 100% rename from src/coreComponents/unitTests/dataRepositoryTests/testGroupPath.cpp rename to src/coreComponents/integrationTests/dataRepositoryTests/testGroupPath.cpp diff --git a/src/coreComponents/unitTests/dataRepositoryTests/testObjectCatalog.cpp b/src/coreComponents/integrationTests/dataRepositoryTests/testObjectCatalog.cpp similarity index 100% rename from src/coreComponents/unitTests/dataRepositoryTests/testObjectCatalog.cpp rename to src/coreComponents/integrationTests/dataRepositoryTests/testObjectCatalog.cpp diff --git a/src/coreComponents/unitTests/dataRepositoryTests/testRestartBasic.cpp b/src/coreComponents/integrationTests/dataRepositoryTests/testRestartBasic.cpp similarity index 100% rename from src/coreComponents/unitTests/dataRepositoryTests/testRestartBasic.cpp rename to src/coreComponents/integrationTests/dataRepositoryTests/testRestartBasic.cpp diff --git a/src/coreComponents/unitTests/dataRepositoryTests/testRestartExtended.cpp b/src/coreComponents/integrationTests/dataRepositoryTests/testRestartExtended.cpp similarity index 100% rename from src/coreComponents/unitTests/dataRepositoryTests/testRestartExtended.cpp rename to src/coreComponents/integrationTests/dataRepositoryTests/testRestartExtended.cpp diff --git a/src/coreComponents/unitTests/dataRepositoryTests/testWrapperHelpers.cpp b/src/coreComponents/integrationTests/dataRepositoryTests/testWrapperHelpers.cpp similarity index 100% rename from src/coreComponents/unitTests/dataRepositoryTests/testWrapperHelpers.cpp rename to src/coreComponents/integrationTests/dataRepositoryTests/testWrapperHelpers.cpp diff --git a/src/coreComponents/unitTests/dataRepositoryTests/utils.hpp b/src/coreComponents/integrationTests/dataRepositoryTests/utils.hpp similarity index 100% rename from src/coreComponents/unitTests/dataRepositoryTests/utils.hpp rename to src/coreComponents/integrationTests/dataRepositoryTests/utils.hpp diff --git a/src/coreComponents/unitTests/fieldSpecificationTests/CMakeLists.txt b/src/coreComponents/integrationTests/fieldSpecificationTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/fieldSpecificationTests/CMakeLists.txt rename to src/coreComponents/integrationTests/fieldSpecificationTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/fieldSpecificationTests/testAquiferBoundaryCondition.cpp b/src/coreComponents/integrationTests/fieldSpecificationTests/testAquiferBoundaryCondition.cpp similarity index 100% rename from src/coreComponents/unitTests/fieldSpecificationTests/testAquiferBoundaryCondition.cpp rename to src/coreComponents/integrationTests/fieldSpecificationTests/testAquiferBoundaryCondition.cpp diff --git a/src/coreComponents/unitTests/fieldSpecificationTests/testFieldSpecificationsEnums.cpp b/src/coreComponents/integrationTests/fieldSpecificationTests/testFieldSpecificationsEnums.cpp similarity index 100% rename from src/coreComponents/unitTests/fieldSpecificationTests/testFieldSpecificationsEnums.cpp rename to src/coreComponents/integrationTests/fieldSpecificationTests/testFieldSpecificationsEnums.cpp diff --git a/src/coreComponents/unitTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp b/src/coreComponents/integrationTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp similarity index 100% rename from src/coreComponents/unitTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp rename to src/coreComponents/integrationTests/fieldSpecificationTests/testRecursiveFieldApplication.cpp diff --git a/src/coreComponents/unitTests/fileIOTests/CMakeLists.txt b/src/coreComponents/integrationTests/fileIOTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/fileIOTests/CMakeLists.txt rename to src/coreComponents/integrationTests/fileIOTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/fileIOTests/testHDFFile.cpp b/src/coreComponents/integrationTests/fileIOTests/testHDFFile.cpp similarity index 100% rename from src/coreComponents/unitTests/fileIOTests/testHDFFile.cpp rename to src/coreComponents/integrationTests/fileIOTests/testHDFFile.cpp diff --git a/src/coreComponents/unitTests/fileIOTests/testHDFParallelFile.cpp b/src/coreComponents/integrationTests/fileIOTests/testHDFParallelFile.cpp similarity index 100% rename from src/coreComponents/unitTests/fileIOTests/testHDFParallelFile.cpp rename to src/coreComponents/integrationTests/fileIOTests/testHDFParallelFile.cpp diff --git a/src/coreComponents/unitTests/fileIOTests/testMemoryStats.cpp b/src/coreComponents/integrationTests/fileIOTests/testMemoryStats.cpp similarity index 100% rename from src/coreComponents/unitTests/fileIOTests/testMemoryStats.cpp rename to src/coreComponents/integrationTests/fileIOTests/testMemoryStats.cpp diff --git a/src/coreComponents/unitTests/finiteVolumeTests/CMakeLists.txt b/src/coreComponents/integrationTests/finiteVolumeTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/finiteVolumeTests/CMakeLists.txt rename to src/coreComponents/integrationTests/finiteVolumeTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/finiteVolumeTests/testMimeticInnerProducts.cpp b/src/coreComponents/integrationTests/finiteVolumeTests/testMimeticInnerProducts.cpp similarity index 100% rename from src/coreComponents/unitTests/finiteVolumeTests/testMimeticInnerProducts.cpp rename to src/coreComponents/integrationTests/finiteVolumeTests/testMimeticInnerProducts.cpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/CMakeLists.txt b/src/coreComponents/integrationTests/fluidFlowTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/CMakeLists.txt rename to src/coreComponents/integrationTests/fluidFlowTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/fluidFlowTests/testCompFlowUtils.hpp b/src/coreComponents/integrationTests/fluidFlowTests/testCompFlowUtils.hpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testCompFlowUtils.hpp rename to src/coreComponents/integrationTests/fluidFlowTests/testCompFlowUtils.hpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testCompMultiphaseFlow.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testCompMultiphaseFlow.cpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testCompMultiphaseFlow.cpp rename to src/coreComponents/integrationTests/fluidFlowTests/testCompMultiphaseFlow.cpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testCompMultiphaseFlowHybrid.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testCompMultiphaseFlowHybrid.cpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testCompMultiphaseFlowHybrid.cpp rename to src/coreComponents/integrationTests/fluidFlowTests/testCompMultiphaseFlowHybrid.cpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testFlowKernelHelpers.hpp b/src/coreComponents/integrationTests/fluidFlowTests/testFlowKernelHelpers.hpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testFlowKernelHelpers.hpp rename to src/coreComponents/integrationTests/fluidFlowTests/testFlowKernelHelpers.hpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testFlowStatistics.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testFlowStatistics.cpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testFlowStatistics.cpp rename to src/coreComponents/integrationTests/fluidFlowTests/testFlowStatistics.cpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testFlowUtils.hpp b/src/coreComponents/integrationTests/fluidFlowTests/testFlowUtils.hpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testFlowUtils.hpp rename to src/coreComponents/integrationTests/fluidFlowTests/testFlowUtils.hpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testImmiscibleMultiphaseFlow.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testImmiscibleMultiphaseFlow.cpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testImmiscibleMultiphaseFlow.cpp rename to src/coreComponents/integrationTests/fluidFlowTests/testImmiscibleMultiphaseFlow.cpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testReactiveCompositionalMultiphaseOBL.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testReactiveCompositionalMultiphaseOBL.cpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testReactiveCompositionalMultiphaseOBL.cpp rename to src/coreComponents/integrationTests/fluidFlowTests/testReactiveCompositionalMultiphaseOBL.cpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testSingleFlowUtils.hpp b/src/coreComponents/integrationTests/fluidFlowTests/testSingleFlowUtils.hpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testSingleFlowUtils.hpp rename to src/coreComponents/integrationTests/fluidFlowTests/testSingleFlowUtils.hpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testSinglePhaseFVMKernels.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseFVMKernels.cpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testSinglePhaseFVMKernels.cpp rename to src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseFVMKernels.cpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp rename to src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp rename to src/coreComponents/integrationTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testThermalSinglePhaseFlow.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testThermalSinglePhaseFlow.cpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testThermalSinglePhaseFlow.cpp rename to src/coreComponents/integrationTests/fluidFlowTests/testThermalSinglePhaseFlow.cpp diff --git a/src/coreComponents/unitTests/fluidFlowTests/testTransmissibility.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testTransmissibility.cpp similarity index 100% rename from src/coreComponents/unitTests/fluidFlowTests/testTransmissibility.cpp rename to src/coreComponents/integrationTests/fluidFlowTests/testTransmissibility.cpp diff --git a/src/coreComponents/unitTests/linearAlgebraTests/CMakeLists.txt b/src/coreComponents/integrationTests/linearAlgebraTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/linearAlgebraTests/CMakeLists.txt rename to src/coreComponents/integrationTests/linearAlgebraTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/linearAlgebraTests/testDofManager.cpp b/src/coreComponents/integrationTests/linearAlgebraTests/testDofManager.cpp similarity index 100% rename from src/coreComponents/unitTests/linearAlgebraTests/testDofManager.cpp rename to src/coreComponents/integrationTests/linearAlgebraTests/testDofManager.cpp diff --git a/src/coreComponents/unitTests/linearAlgebraTests/testDofManagerUtils.hpp b/src/coreComponents/integrationTests/linearAlgebraTests/testDofManagerUtils.hpp similarity index 100% rename from src/coreComponents/unitTests/linearAlgebraTests/testDofManagerUtils.hpp rename to src/coreComponents/integrationTests/linearAlgebraTests/testDofManagerUtils.hpp diff --git a/src/coreComponents/unitTests/linearAlgebraTests/testLAIHelperFunctions.cpp b/src/coreComponents/integrationTests/linearAlgebraTests/testLAIHelperFunctions.cpp similarity index 100% rename from src/coreComponents/unitTests/linearAlgebraTests/testLAIHelperFunctions.cpp rename to src/coreComponents/integrationTests/linearAlgebraTests/testLAIHelperFunctions.cpp diff --git a/src/coreComponents/unitTests/meshTests/CMakeLists.txt b/src/coreComponents/integrationTests/meshTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/meshTests/CMakeLists.txt rename to src/coreComponents/integrationTests/meshTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/meshTests/box_hybrid_mesh.vtu b/src/coreComponents/integrationTests/meshTests/box_hybrid_mesh.vtu similarity index 100% rename from src/coreComponents/unitTests/meshTests/box_hybrid_mesh.vtu rename to src/coreComponents/integrationTests/meshTests/box_hybrid_mesh.vtu diff --git a/src/coreComponents/unitTests/meshTests/cube.pvti b/src/coreComponents/integrationTests/meshTests/cube.pvti similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube.pvti rename to src/coreComponents/integrationTests/meshTests/cube.pvti diff --git a/src/coreComponents/unitTests/meshTests/cube.pvtr b/src/coreComponents/integrationTests/meshTests/cube.pvtr similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube.pvtr rename to src/coreComponents/integrationTests/meshTests/cube.pvtr diff --git a/src/coreComponents/unitTests/meshTests/cube.pvts b/src/coreComponents/integrationTests/meshTests/cube.pvts similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube.pvts rename to src/coreComponents/integrationTests/meshTests/cube.pvts diff --git a/src/coreComponents/unitTests/meshTests/cube.pvtu b/src/coreComponents/integrationTests/meshTests/cube.pvtu similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube.pvtu rename to src/coreComponents/integrationTests/meshTests/cube.pvtu diff --git a/src/coreComponents/unitTests/meshTests/cube.vti b/src/coreComponents/integrationTests/meshTests/cube.vti similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube.vti rename to src/coreComponents/integrationTests/meshTests/cube.vti diff --git a/src/coreComponents/unitTests/meshTests/cube.vtk b/src/coreComponents/integrationTests/meshTests/cube.vtk similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube.vtk rename to src/coreComponents/integrationTests/meshTests/cube.vtk diff --git a/src/coreComponents/unitTests/meshTests/cube.vtr b/src/coreComponents/integrationTests/meshTests/cube.vtr similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube.vtr rename to src/coreComponents/integrationTests/meshTests/cube.vtr diff --git a/src/coreComponents/unitTests/meshTests/cube.vts b/src/coreComponents/integrationTests/meshTests/cube.vts similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube.vts rename to src/coreComponents/integrationTests/meshTests/cube.vts diff --git a/src/coreComponents/unitTests/meshTests/cube.vtu b/src/coreComponents/integrationTests/meshTests/cube.vtu similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube.vtu rename to src/coreComponents/integrationTests/meshTests/cube.vtu diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_0.vti b/src/coreComponents/integrationTests/meshTests/cube/cube_0.vti similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_0.vti rename to src/coreComponents/integrationTests/meshTests/cube/cube_0.vti diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_0.vtr b/src/coreComponents/integrationTests/meshTests/cube/cube_0.vtr similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_0.vtr rename to src/coreComponents/integrationTests/meshTests/cube/cube_0.vtr diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_0.vts b/src/coreComponents/integrationTests/meshTests/cube/cube_0.vts similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_0.vts rename to src/coreComponents/integrationTests/meshTests/cube/cube_0.vts diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_0.vtu b/src/coreComponents/integrationTests/meshTests/cube/cube_0.vtu similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_0.vtu rename to src/coreComponents/integrationTests/meshTests/cube/cube_0.vtu diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_1.vti b/src/coreComponents/integrationTests/meshTests/cube/cube_1.vti similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_1.vti rename to src/coreComponents/integrationTests/meshTests/cube/cube_1.vti diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_1.vtr b/src/coreComponents/integrationTests/meshTests/cube/cube_1.vtr similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_1.vtr rename to src/coreComponents/integrationTests/meshTests/cube/cube_1.vtr diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_1.vts b/src/coreComponents/integrationTests/meshTests/cube/cube_1.vts similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_1.vts rename to src/coreComponents/integrationTests/meshTests/cube/cube_1.vts diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_1.vtu b/src/coreComponents/integrationTests/meshTests/cube/cube_1.vtu similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_1.vtu rename to src/coreComponents/integrationTests/meshTests/cube/cube_1.vtu diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_2.vti b/src/coreComponents/integrationTests/meshTests/cube/cube_2.vti similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_2.vti rename to src/coreComponents/integrationTests/meshTests/cube/cube_2.vti diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_2.vtr b/src/coreComponents/integrationTests/meshTests/cube/cube_2.vtr similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_2.vtr rename to src/coreComponents/integrationTests/meshTests/cube/cube_2.vtr diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_2.vts b/src/coreComponents/integrationTests/meshTests/cube/cube_2.vts similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_2.vts rename to src/coreComponents/integrationTests/meshTests/cube/cube_2.vts diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_2.vtu b/src/coreComponents/integrationTests/meshTests/cube/cube_2.vtu similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_2.vtu rename to src/coreComponents/integrationTests/meshTests/cube/cube_2.vtu diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_3.vti b/src/coreComponents/integrationTests/meshTests/cube/cube_3.vti similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_3.vti rename to src/coreComponents/integrationTests/meshTests/cube/cube_3.vti diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_3.vtr b/src/coreComponents/integrationTests/meshTests/cube/cube_3.vtr similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_3.vtr rename to src/coreComponents/integrationTests/meshTests/cube/cube_3.vtr diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_3.vts b/src/coreComponents/integrationTests/meshTests/cube/cube_3.vts similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_3.vts rename to src/coreComponents/integrationTests/meshTests/cube/cube_3.vts diff --git a/src/coreComponents/unitTests/meshTests/cube/cube_3.vtu b/src/coreComponents/integrationTests/meshTests/cube/cube_3.vtu similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube/cube_3.vtu rename to src/coreComponents/integrationTests/meshTests/cube/cube_3.vtu diff --git a/src/coreComponents/unitTests/meshTests/cube_RECTILINEAR_GRID.vtk b/src/coreComponents/integrationTests/meshTests/cube_RECTILINEAR_GRID.vtk similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube_RECTILINEAR_GRID.vtk rename to src/coreComponents/integrationTests/meshTests/cube_RECTILINEAR_GRID.vtk diff --git a/src/coreComponents/unitTests/meshTests/cube_STRUCTURED_GRID.vtk b/src/coreComponents/integrationTests/meshTests/cube_STRUCTURED_GRID.vtk similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube_STRUCTURED_GRID.vtk rename to src/coreComponents/integrationTests/meshTests/cube_STRUCTURED_GRID.vtk diff --git a/src/coreComponents/unitTests/meshTests/cube_STRUCTURED_POINTS.vtk b/src/coreComponents/integrationTests/meshTests/cube_STRUCTURED_POINTS.vtk similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube_STRUCTURED_POINTS.vtk rename to src/coreComponents/integrationTests/meshTests/cube_STRUCTURED_POINTS.vtk diff --git a/src/coreComponents/unitTests/meshTests/cube_UNSTRUCTURED_GRID.vtk b/src/coreComponents/integrationTests/meshTests/cube_UNSTRUCTURED_GRID.vtk similarity index 100% rename from src/coreComponents/unitTests/meshTests/cube_UNSTRUCTURED_GRID.vtk rename to src/coreComponents/integrationTests/meshTests/cube_UNSTRUCTURED_GRID.vtk diff --git a/src/coreComponents/unitTests/meshTests/meshDirName.hpp.in b/src/coreComponents/integrationTests/meshTests/meshDirName.hpp.in similarity index 100% rename from src/coreComponents/unitTests/meshTests/meshDirName.hpp.in rename to src/coreComponents/integrationTests/meshTests/meshDirName.hpp.in diff --git a/src/coreComponents/unitTests/meshTests/supportedElements.vtk b/src/coreComponents/integrationTests/meshTests/supportedElements.vtk similarity index 100% rename from src/coreComponents/unitTests/meshTests/supportedElements.vtk rename to src/coreComponents/integrationTests/meshTests/supportedElements.vtk diff --git a/src/coreComponents/unitTests/meshTests/supportedElementsAsVTKPolyhedra.vtk b/src/coreComponents/integrationTests/meshTests/supportedElementsAsVTKPolyhedra.vtk similarity index 100% rename from src/coreComponents/unitTests/meshTests/supportedElementsAsVTKPolyhedra.vtk rename to src/coreComponents/integrationTests/meshTests/supportedElementsAsVTKPolyhedra.vtk diff --git a/src/coreComponents/unitTests/meshTests/testElementRegions.cpp b/src/coreComponents/integrationTests/meshTests/testElementRegions.cpp similarity index 100% rename from src/coreComponents/unitTests/meshTests/testElementRegions.cpp rename to src/coreComponents/integrationTests/meshTests/testElementRegions.cpp diff --git a/src/coreComponents/unitTests/meshTests/testMeshEnums.cpp b/src/coreComponents/integrationTests/meshTests/testMeshEnums.cpp similarity index 100% rename from src/coreComponents/unitTests/meshTests/testMeshEnums.cpp rename to src/coreComponents/integrationTests/meshTests/testMeshEnums.cpp diff --git a/src/coreComponents/unitTests/meshTests/testMeshGeneration.cpp b/src/coreComponents/integrationTests/meshTests/testMeshGeneration.cpp similarity index 100% rename from src/coreComponents/unitTests/meshTests/testMeshGeneration.cpp rename to src/coreComponents/integrationTests/meshTests/testMeshGeneration.cpp diff --git a/src/coreComponents/unitTests/meshTests/testNeighborCommunicator.cpp b/src/coreComponents/integrationTests/meshTests/testNeighborCommunicator.cpp similarity index 100% rename from src/coreComponents/unitTests/meshTests/testNeighborCommunicator.cpp rename to src/coreComponents/integrationTests/meshTests/testNeighborCommunicator.cpp diff --git a/src/coreComponents/unitTests/meshTests/testVTKImport.cpp b/src/coreComponents/integrationTests/meshTests/testVTKImport.cpp similarity index 100% rename from src/coreComponents/unitTests/meshTests/testVTKImport.cpp rename to src/coreComponents/integrationTests/meshTests/testVTKImport.cpp diff --git a/src/coreComponents/unitTests/meshTests/toy_model.GRDECL b/src/coreComponents/integrationTests/meshTests/toy_model.GRDECL similarity index 100% rename from src/coreComponents/unitTests/meshTests/toy_model.GRDECL rename to src/coreComponents/integrationTests/meshTests/toy_model.GRDECL diff --git a/src/coreComponents/unitTests/meshTests/toy_model.msh b/src/coreComponents/integrationTests/meshTests/toy_model.msh similarity index 100% rename from src/coreComponents/unitTests/meshTests/toy_model.msh rename to src/coreComponents/integrationTests/meshTests/toy_model.msh diff --git a/src/coreComponents/unitTests/meshTests/well1.vtk b/src/coreComponents/integrationTests/meshTests/well1.vtk similarity index 100% rename from src/coreComponents/unitTests/meshTests/well1.vtk rename to src/coreComponents/integrationTests/meshTests/well1.vtk diff --git a/src/coreComponents/unitTests/meshTests/well2.vtk b/src/coreComponents/integrationTests/meshTests/well2.vtk similarity index 100% rename from src/coreComponents/unitTests/meshTests/well2.vtk rename to src/coreComponents/integrationTests/meshTests/well2.vtk diff --git a/src/coreComponents/unitTests/tableFunctionsFileTests/CMakeLists.txt b/src/coreComponents/integrationTests/tableFunctionsFileTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/tableFunctionsFileTests/CMakeLists.txt rename to src/coreComponents/integrationTests/tableFunctionsFileTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp b/src/coreComponents/integrationTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp similarity index 100% rename from src/coreComponents/unitTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp rename to src/coreComponents/integrationTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp diff --git a/src/coreComponents/unitTests/testingUtilities/CMakeLists.txt b/src/coreComponents/integrationTests/testingUtilities/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/testingUtilities/CMakeLists.txt rename to src/coreComponents/integrationTests/testingUtilities/CMakeLists.txt diff --git a/src/coreComponents/unitTests/testingUtilities/TestingTasks.cpp b/src/coreComponents/integrationTests/testingUtilities/TestingTasks.cpp similarity index 100% rename from src/coreComponents/unitTests/testingUtilities/TestingTasks.cpp rename to src/coreComponents/integrationTests/testingUtilities/TestingTasks.cpp diff --git a/src/coreComponents/unitTests/testingUtilities/TestingTasks.hpp b/src/coreComponents/integrationTests/testingUtilities/TestingTasks.hpp similarity index 100% rename from src/coreComponents/unitTests/testingUtilities/TestingTasks.hpp rename to src/coreComponents/integrationTests/testingUtilities/TestingTasks.hpp diff --git a/src/coreComponents/unitTests/toolchain/CMakeLists.txt b/src/coreComponents/integrationTests/toolchain/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/toolchain/CMakeLists.txt rename to src/coreComponents/integrationTests/toolchain/CMakeLists.txt diff --git a/src/coreComponents/unitTests/toolchain/testToolchain.cpp b/src/coreComponents/integrationTests/toolchain/testToolchain.cpp similarity index 100% rename from src/coreComponents/unitTests/toolchain/testToolchain.cpp rename to src/coreComponents/integrationTests/toolchain/testToolchain.cpp diff --git a/src/coreComponents/unitTests/virtualElementTests/CMakeLists.txt b/src/coreComponents/integrationTests/virtualElementTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/virtualElementTests/CMakeLists.txt rename to src/coreComponents/integrationTests/virtualElementTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/virtualElementTests/testConformingVirtualElementOrder1.cpp b/src/coreComponents/integrationTests/virtualElementTests/testConformingVirtualElementOrder1.cpp similarity index 100% rename from src/coreComponents/unitTests/virtualElementTests/testConformingVirtualElementOrder1.cpp rename to src/coreComponents/integrationTests/virtualElementTests/testConformingVirtualElementOrder1.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/CMakeLists.txt b/src/coreComponents/integrationTests/wavePropagationTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/CMakeLists.txt rename to src/coreComponents/integrationTests/wavePropagationTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagation.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagation.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagation.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagation.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationAcousticFirstOrder.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationAcousticFirstOrder.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationAcousticFirstOrder.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationAcousticFirstOrder.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationAdjoint1.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationAdjoint1.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationAdjoint1.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationAdjoint1.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationAttenuationAcoustic.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationAttenuationAcoustic.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationAttenuationAcoustic.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationAttenuationAcoustic.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationAttenuationAcousticVTI.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationAttenuationAcousticVTI.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationAttenuationAcousticVTI.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationAttenuationAcousticVTI.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationAttenuationElastic.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationAttenuationElastic.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationAttenuationElastic.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationAttenuationElastic.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationDAS.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationDAS.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationDAS.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationDAS.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationDG.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationDG.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationDG.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationDG.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationElasticFirstOrder.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationElasticFirstOrder.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationElasticFirstOrder.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationElasticFirstOrder.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationElasticTTI.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationElasticTTI.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationElasticTTI.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationElasticTTI.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationElasticVTI.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationElasticVTI.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationElasticVTI.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationElasticVTI.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationQ2.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationQ2.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationQ2.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationQ2.cpp diff --git a/src/coreComponents/unitTests/wavePropagationTests/testWavePropagationTaper.cpp b/src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationTaper.cpp similarity index 100% rename from src/coreComponents/unitTests/wavePropagationTests/testWavePropagationTaper.cpp rename to src/coreComponents/integrationTests/wavePropagationTests/testWavePropagationTaper.cpp diff --git a/src/coreComponents/unitTests/wellsTests/CMakeLists.txt b/src/coreComponents/integrationTests/wellsTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/wellsTests/CMakeLists.txt rename to src/coreComponents/integrationTests/wellsTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp b/src/coreComponents/integrationTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp similarity index 100% rename from src/coreComponents/unitTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp rename to src/coreComponents/integrationTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp diff --git a/src/coreComponents/unitTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseSSWells.cpp b/src/coreComponents/integrationTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseSSWells.cpp similarity index 100% rename from src/coreComponents/unitTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseSSWells.cpp rename to src/coreComponents/integrationTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseSSWells.cpp diff --git a/src/coreComponents/unitTests/wellsTests/testReservoirCompositionalMultiphaseMSWells.cpp b/src/coreComponents/integrationTests/wellsTests/testReservoirCompositionalMultiphaseMSWells.cpp similarity index 100% rename from src/coreComponents/unitTests/wellsTests/testReservoirCompositionalMultiphaseMSWells.cpp rename to src/coreComponents/integrationTests/wellsTests/testReservoirCompositionalMultiphaseMSWells.cpp diff --git a/src/coreComponents/unitTests/wellsTests/testReservoirSinglePhaseMSWells.cpp b/src/coreComponents/integrationTests/wellsTests/testReservoirSinglePhaseMSWells.cpp similarity index 100% rename from src/coreComponents/unitTests/wellsTests/testReservoirSinglePhaseMSWells.cpp rename to src/coreComponents/integrationTests/wellsTests/testReservoirSinglePhaseMSWells.cpp diff --git a/src/coreComponents/unitTests/wellsTests/testReservoirThermalSinglePhaseMSWells.cpp b/src/coreComponents/integrationTests/wellsTests/testReservoirThermalSinglePhaseMSWells.cpp similarity index 100% rename from src/coreComponents/unitTests/wellsTests/testReservoirThermalSinglePhaseMSWells.cpp rename to src/coreComponents/integrationTests/wellsTests/testReservoirThermalSinglePhaseMSWells.cpp diff --git a/src/coreComponents/unitTests/wellsTests/testReservoirThermalSinglePhaseMSWells_RateInj.cpp b/src/coreComponents/integrationTests/wellsTests/testReservoirThermalSinglePhaseMSWells_RateInj.cpp similarity index 100% rename from src/coreComponents/unitTests/wellsTests/testReservoirThermalSinglePhaseMSWells_RateInj.cpp rename to src/coreComponents/integrationTests/wellsTests/testReservoirThermalSinglePhaseMSWells_RateInj.cpp diff --git a/src/coreComponents/unitTests/wellsTests/testThermalReservoirCompositionalMultiphaseMSWells.cpp b/src/coreComponents/integrationTests/wellsTests/testThermalReservoirCompositionalMultiphaseMSWells.cpp similarity index 100% rename from src/coreComponents/unitTests/wellsTests/testThermalReservoirCompositionalMultiphaseMSWells.cpp rename to src/coreComponents/integrationTests/wellsTests/testThermalReservoirCompositionalMultiphaseMSWells.cpp diff --git a/src/coreComponents/unitTests/wellsTests/testThermalReservoirCompositionalMultiphaseSSWells.cpp b/src/coreComponents/integrationTests/wellsTests/testThermalReservoirCompositionalMultiphaseSSWells.cpp similarity index 100% rename from src/coreComponents/unitTests/wellsTests/testThermalReservoirCompositionalMultiphaseSSWells.cpp rename to src/coreComponents/integrationTests/wellsTests/testThermalReservoirCompositionalMultiphaseSSWells.cpp diff --git a/src/coreComponents/unitTests/wellsTests/testWellEnums.cpp b/src/coreComponents/integrationTests/wellsTests/testWellEnums.cpp similarity index 100% rename from src/coreComponents/unitTests/wellsTests/testWellEnums.cpp rename to src/coreComponents/integrationTests/wellsTests/testWellEnums.cpp diff --git a/src/coreComponents/unitTests/xmlTests/CMakeLists.txt b/src/coreComponents/integrationTests/xmlTests/CMakeLists.txt similarity index 100% rename from src/coreComponents/unitTests/xmlTests/CMakeLists.txt rename to src/coreComponents/integrationTests/xmlTests/CMakeLists.txt diff --git a/src/coreComponents/unitTests/xmlTests/basic_input.xml b/src/coreComponents/integrationTests/xmlTests/basic_input.xml similarity index 100% rename from src/coreComponents/unitTests/xmlTests/basic_input.xml rename to src/coreComponents/integrationTests/xmlTests/basic_input.xml diff --git a/src/coreComponents/unitTests/xmlTests/include_input.xml b/src/coreComponents/integrationTests/xmlTests/include_input.xml similarity index 100% rename from src/coreComponents/unitTests/xmlTests/include_input.xml rename to src/coreComponents/integrationTests/xmlTests/include_input.xml diff --git a/src/coreComponents/unitTests/xmlTests/multifile_input/boundary_conditions/constraints.xml b/src/coreComponents/integrationTests/xmlTests/multifile_input/boundary_conditions/constraints.xml similarity index 100% rename from src/coreComponents/unitTests/xmlTests/multifile_input/boundary_conditions/constraints.xml rename to src/coreComponents/integrationTests/xmlTests/multifile_input/boundary_conditions/constraints.xml diff --git a/src/coreComponents/unitTests/xmlTests/multifile_input/boundary_conditions/tables/time.txt b/src/coreComponents/integrationTests/xmlTests/multifile_input/boundary_conditions/tables/time.txt similarity index 100% rename from src/coreComponents/unitTests/xmlTests/multifile_input/boundary_conditions/tables/time.txt rename to src/coreComponents/integrationTests/xmlTests/multifile_input/boundary_conditions/tables/time.txt diff --git a/src/coreComponents/unitTests/xmlTests/multifile_input/boundary_conditions/tables/velocity.txt b/src/coreComponents/integrationTests/xmlTests/multifile_input/boundary_conditions/tables/velocity.txt similarity index 100% rename from src/coreComponents/unitTests/xmlTests/multifile_input/boundary_conditions/tables/velocity.txt rename to src/coreComponents/integrationTests/xmlTests/multifile_input/boundary_conditions/tables/velocity.txt diff --git a/src/coreComponents/unitTests/xmlTests/multifile_input/boundary_conditions/velocity.xml b/src/coreComponents/integrationTests/xmlTests/multifile_input/boundary_conditions/velocity.xml similarity index 100% rename from src/coreComponents/unitTests/xmlTests/multifile_input/boundary_conditions/velocity.xml rename to src/coreComponents/integrationTests/xmlTests/multifile_input/boundary_conditions/velocity.xml diff --git a/src/coreComponents/unitTests/xmlTests/multifile_input/fieldspec.xml b/src/coreComponents/integrationTests/xmlTests/multifile_input/fieldspec.xml similarity index 100% rename from src/coreComponents/unitTests/xmlTests/multifile_input/fieldspec.xml rename to src/coreComponents/integrationTests/xmlTests/multifile_input/fieldspec.xml diff --git a/src/coreComponents/unitTests/xmlTests/multifile_input/mesh.xml b/src/coreComponents/integrationTests/xmlTests/multifile_input/mesh.xml similarity index 100% rename from src/coreComponents/unitTests/xmlTests/multifile_input/mesh.xml rename to src/coreComponents/integrationTests/xmlTests/multifile_input/mesh.xml diff --git a/src/coreComponents/unitTests/xmlTests/multifile_input/outputs.xml b/src/coreComponents/integrationTests/xmlTests/multifile_input/outputs.xml similarity index 100% rename from src/coreComponents/unitTests/xmlTests/multifile_input/outputs.xml rename to src/coreComponents/integrationTests/xmlTests/multifile_input/outputs.xml diff --git a/src/coreComponents/unitTests/xmlTests/multifile_input/solver.xml b/src/coreComponents/integrationTests/xmlTests/multifile_input/solver.xml similarity index 100% rename from src/coreComponents/unitTests/xmlTests/multifile_input/solver.xml rename to src/coreComponents/integrationTests/xmlTests/multifile_input/solver.xml diff --git a/src/coreComponents/unitTests/xmlTests/testXML.cpp b/src/coreComponents/integrationTests/xmlTests/testXML.cpp similarity index 100% rename from src/coreComponents/unitTests/xmlTests/testXML.cpp rename to src/coreComponents/integrationTests/xmlTests/testXML.cpp diff --git a/src/coreComponents/unitTests/xmlTests/testXMLFile.cpp b/src/coreComponents/integrationTests/xmlTests/testXMLFile.cpp similarity index 100% rename from src/coreComponents/unitTests/xmlTests/testXMLFile.cpp rename to src/coreComponents/integrationTests/xmlTests/testXMLFile.cpp From b08bbb501c3862bb08fce4b1b1ed5688de08a96b Mon Sep 17 00:00:00 2001 From: li97 Date: Thu, 18 Dec 2025 12:39:32 -0800 Subject: [PATCH 10/17] Compiled successfully --- .../solid/ElasticIsotropicFiniteStrain.hpp | 4 +- .../solid/unitTests/CMakeLists.txt | 2 +- .../fluidFlowTests/CMakeLists.txt | 40 +- .../fluidFlowTests/testFlowKernelHelpers.hpp | 205 --- .../fluidFlowTests/testFlowStatistics.cpp | 1162 ----------------- .../testSinglePhaseFVMKernels.cpp | 234 ---- .../testSinglePhaseMobilityKernel.cpp | 70 - src/coreComponents/schema/schema.xsd | 130 +- src/coreComponents/schema/schema.xsd.other | 12 +- 9 files changed, 173 insertions(+), 1686 deletions(-) delete mode 100644 src/coreComponents/integrationTests/fluidFlowTests/testFlowKernelHelpers.hpp delete mode 100644 src/coreComponents/integrationTests/fluidFlowTests/testFlowStatistics.cpp delete mode 100644 src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseFVMKernels.cpp delete mode 100644 src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp index 65229a2f91d..3c6a147be1a 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp @@ -22,7 +22,7 @@ #include "ElasticIsotropic.hpp" #include "PropertyConversions.hpp" -#include "SolidModelDiscretizationOpsFullyAnisotroipic.hpp" +#include "SolidModelDiscretizationOpsFullyAnisotropic.hpp" #include "LvArray/src/tensorOps.hpp" namespace geos{ @@ -64,7 +64,7 @@ class ElasticIsotropicFiniteStrainUpdates : public ElasticIsotropicUpdates ElasticIsotropicFiniteStrainUpdates & operator=( ElasticIsotropicFiniteStrainUpdates && ) = delete; /// Use the uncompressed version of the stiffness bilinear form - using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotroipic; // typo in "Anisotroipic" + using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotropic; // // Bring in base implementations to prevent hiding warnings // using ElasticIsotropicUpdates::smallStrainNoStateUpdate; diff --git a/src/coreComponents/constitutive/solid/unitTests/CMakeLists.txt b/src/coreComponents/constitutive/solid/unitTests/CMakeLists.txt index 5967ee5fa5b..999f31cad17 100644 --- a/src/coreComponents/constitutive/solid/unitTests/CMakeLists.txt +++ b/src/coreComponents/constitutive/solid/unitTests/CMakeLists.txt @@ -4,7 +4,7 @@ set( gtest_geosx_tests testDamage.cpp testFiniteDifferenceElasticFiniteStrain.cpp ) -set( dependencyList gtest blas lapack constitutive ${parallelDeps} ) +set( dependencyList gtest mainInterface blas lapack constitutive ${parallelDeps} ) if( ENABLE_CUDA AND ENABLE_CUDA_NVTOOLSEXT ) list( APPEND dependencyList CUDA::nvToolsExt ) diff --git a/src/coreComponents/integrationTests/fluidFlowTests/CMakeLists.txt b/src/coreComponents/integrationTests/fluidFlowTests/CMakeLists.txt index 48f89e0bb0b..ce446028ce0 100644 --- a/src/coreComponents/integrationTests/fluidFlowTests/CMakeLists.txt +++ b/src/coreComponents/integrationTests/fluidFlowTests/CMakeLists.txt @@ -1,17 +1,17 @@ # Specify list of tests set( gtest_geosx_tests - testSinglePhaseMobilityKernel.cpp testThermalCompMultiphaseFlow.cpp testThermalSinglePhaseFlow.cpp - testFlowStatistics.cpp testTransmissibility.cpp - testImmiscibleMultiphaseFlow.cpp ) + testImmiscibleMultiphaseFlow.cpp + testSinglePhaseMFDPolyhedral.cpp ) if( ENABLE_PVTPackage ) list( APPEND gtest_geosx_tests testCompMultiphaseFlow.cpp testCompMultiphaseFlowHybrid.cpp - testReactiveCompositionalMultiphaseOBL.cpp ) + testReactiveCompositionalMultiphaseOBL.cpp + testCompositionalMultiPhaseMFDPolyhedral.cpp ) endif() set( tplDependencyList ${parallelDeps} gtest ) @@ -32,6 +32,38 @@ foreach(test ${gtest_geosx_tests}) geos_add_test( NAME ${test_name} COMMAND ${test_name} ) + + set_tests_properties(${test_name} PROPERTIES ENVIRONMENT "TEST_BINARY_DIR=$") + + # Add TEST_BINARY_DIR as a compile definition + target_compile_definitions(${test_name} PRIVATE TEST_BINARY_DIR=\"$\") + + # --- Copy mesh file to test binary dir --- + add_custom_command( + TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_CURRENT_SOURCE_DIR}/polyhedral_voronoi_regular.vtu + $ + ) + add_custom_command( + TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_CURRENT_SOURCE_DIR}/polyhedral_voronoi_lattice.vtu + $ + ) + add_custom_command( + TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_CURRENT_SOURCE_DIR}/polyhedral_voronoi_complex.vtu + $ + ) + add_custom_command( + TARGET ${test_name} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_CURRENT_SOURCE_DIR}/hex_pyr_tet_nested_mixed.vtu + $ + ) + endforeach() # For some reason, BLT is not setting CUDA language for these source files diff --git a/src/coreComponents/integrationTests/fluidFlowTests/testFlowKernelHelpers.hpp b/src/coreComponents/integrationTests/fluidFlowTests/testFlowKernelHelpers.hpp deleted file mode 100644 index c1c1fcaf6e1..00000000000 --- a/src/coreComponents/integrationTests/fluidFlowTests/testFlowKernelHelpers.hpp +++ /dev/null @@ -1,205 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#ifndef GEOS_TESTFLOWKERNELHELPERS_HPP -#define GEOS_TESTFLOWKERNELHELPERS_HPP - -#include "common/DataTypes.hpp" - -namespace geos -{ - -namespace detail -{ - -template< typename T, int NDIM > -void setArrayElement( ArrayView< T, NDIM > const & arr, - localIndex const dstIndex, - localIndex const srcIndex, - T const * const data ) -{ - localIndex const elemSize = arr.size() / arr.size( 0 ); // assume singleParameterResizeIndex == 0 - T const * const dataPtr = data + srcIndex * elemSize; - - localIndex i = 0; - LvArray::forValuesInSlice( arr[ dstIndex ], [&i, dataPtr]( T & value ) - { - value = dataPtr[ i ]; - ++i; - } ); -} - -} - -/** - * @brief Specializations of this struct provide a way to create data structures - * that flow kernels want (element/material accessors) - * @tparam FULL whether to create "full" accessors (i.e. nested arrays of Array) - * or for a single region (i.e. just an Array) - */ -template< bool FULL > -struct AccessorHelper { }; - -template<> -struct AccessorHelper< false > -{ - template< int NDIM, typename T > - using ElementAccessor = Array< T, NDIM >; - - template< int NDIM, typename T > - using MaterialAccessor = Array< T, NDIM >; - - template< int NDIM, typename T, typename ... DIMS > - static ElementAccessor< NDIM, T > - makeElementAccessor( T const * const data, - localIndex const stencilSize, - arraySlice1d< localIndex const > const & GEOS_UNUSED_PARAM( stencilRegIndices ), - arraySlice1d< localIndex const > const & GEOS_UNUSED_PARAM( stencilSubRegIndices ), - arraySlice1d< localIndex const > const & stencilElemIndices, - DIMS... otherDims ) - { - localIndex numElems = 0; - for( int i = 0; i < stencilSize; ++i ) - { - numElems = std::max( numElems, stencilElemIndices[i] + 1 ); - } - - ElementAccessor< NDIM, T > acc( numElems, otherDims ... ); - - for( int i = 0; i < stencilSize; ++i ) - { - detail::setArrayElement( acc, stencilElemIndices[i], i, data ); - } - - return acc; - } - - template< int NDIM, typename T, typename ... DIMS > - static MaterialAccessor< NDIM, T > - makeMaterialAccessor( T const * const data, - localIndex const stencilSize, - arraySlice1d< localIndex const > const & GEOS_UNUSED_PARAM( stencilRegIndices ), - arraySlice1d< localIndex const > const & GEOS_UNUSED_PARAM( stencilSubRegIndices ), - arraySlice1d< localIndex const > const & stencilElemIndices, - localIndex GEOS_UNUSED_PARAM( matIndex ), - DIMS... otherDims ) - { - localIndex numElems = 0; - for( int i = 0; i < stencilSize; ++i ) - { - numElems = std::max( numElems, stencilElemIndices[i] + 1 ); - } - - MaterialAccessor< NDIM, T > acc( numElems, 1, otherDims ... ); - - for( int i = 0; i < stencilSize; ++i ) - { - detail::setArrayElement( acc, stencilElemIndices[i], i, data ); - } - - return acc; - } -}; - -template<> -struct AccessorHelper< true > -{ - template< int NDIM, typename T > - using ElementAccessor = ElementRegionManager::ElementViewAccessor< Array< T, NDIM > >; - - template< int NDIM, typename T > - using MaterialAccessor = ElementRegionManager::MaterialViewAccessor< Array< T, NDIM > >; - - template< int NDIM, typename T, typename ... DIMS > - static ElementAccessor< NDIM, T > - makeElementAccessor( T const * const data, - localIndex const stencilSize, - arraySlice1d< localIndex const > const & stencilRegIndices, - arraySlice1d< localIndex const > const & stencilSubRegIndices, - arraySlice1d< localIndex const > const & stencilElemIndices, - DIMS... otherDims ) - { - localIndex numRegions = 0, numSubRegions = 0, numElems = 0; - for( int i = 0; i < stencilSize; ++i ) - { - numRegions = std::max( numRegions, stencilRegIndices[i] + 1 ); - numSubRegions = std::max( numSubRegions, stencilSubRegIndices[i] + 1 ); - numElems = std::max( numElems, stencilElemIndices[i] + 1 ); - } - - ElementAccessor< NDIM, T > acc; - acc.resize( numRegions ); - for( localIndex kr = 0; kr < numRegions; ++kr ) - { - acc[kr].resize( numSubRegions ); - for( localIndex ksr = 0; ksr < numSubRegions; ++ksr ) - { - acc[kr][ksr].resize( numElems, otherDims ... ); - } - } - - for( int i = 0; i < stencilSize; ++i ) - { - detail::setArrayElement( acc[stencilRegIndices[i]][stencilSubRegIndices[i]], stencilElemIndices[i], i, data ); - } - - return acc; - } - - template< int NDIM, typename T, typename ... DIMS > - static ElementAccessor< NDIM, T > - makeMaterialAccessor( T const * const data, - localIndex const stencilSize, - arraySlice1d< localIndex const > const & stencilRegIndices, - arraySlice1d< localIndex const > const & stencilSubRegIndices, - arraySlice1d< localIndex const > const & stencilElemIndices, - localIndex matIndex, - DIMS... otherDims ) - { - localIndex numRegions = 0, numSubRegions = 0, numElems = 0; - for( int i = 0; i < stencilSize; ++i ) - { - numRegions = std::max( numRegions, stencilRegIndices[i] + 1 ); - numSubRegions = std::max( numSubRegions, stencilSubRegIndices[i] + 1 ); - numElems = std::max( numElems, stencilElemIndices[i] + 1 ); - } - - ElementAccessor< NDIM, T > acc; - acc.resize( numRegions ); - for( localIndex kr = 0; kr < numRegions; ++kr ) - { - acc[kr].resize( numSubRegions ); - for( localIndex ksr = 0; ksr < numSubRegions; ++ksr ) - { - acc[kr][ksr].resize( matIndex + 1 ); - acc[kr][ksr][matIndex].resize( numElems, 1, otherDims ... ); - } - } - - for( int i = 0; i < stencilSize; ++i ) - { - detail::setArrayElement( acc[stencilRegIndices[i]][stencilSubRegIndices[i]][matIndex], - stencilElemIndices[i], - i, - data ); - } - - return acc; - } -}; - -} // namespace geos - -#endif //GEOS_TESTFLOWKERNELHELPERS_HPP diff --git a/src/coreComponents/integrationTests/fluidFlowTests/testFlowStatistics.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testFlowStatistics.cpp deleted file mode 100644 index 356661e434e..00000000000 --- a/src/coreComponents/integrationTests/fluidFlowTests/testFlowStatistics.cpp +++ /dev/null @@ -1,1162 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#include "integrationTests/fluidFlowTests/testCompFlowUtils.hpp" -#include "integrationTests/testingUtilities/TestingTasks.hpp" -#include "mainInterface/initialization.hpp" -#include "mainInterface/GeosxState.hpp" -#include "physicsSolvers/fluidFlow/SourceFluxStatistics.hpp" -#include "physicsSolvers/fluidFlow/SinglePhaseStatistics.hpp" - -#include - - -using namespace geos; -using namespace geos::dataRepository; -using namespace geos::testing; - -CommandLineOptions g_commandLineOptions; - - -//////////////////////////////// Test base utilities //////////////////////////////// - -/** - * @brief this struct is used to provide the input data of each flow tests - */ -struct TestInputs -{ - string xmlInput; - stdMap< string, string > tableFiles; - - string sourceFluxName; - string sinkFluxName; - string timeStepCheckerPath; - string timeStepFluxStatsPath; - string wholeSimFluxStatsPath; - string flowSolverPath; - - // rates for each timesteps, for each phases - array2d< real64 > sourceRates; - array2d< real64 > sinkRates; - - // parameters for precomputing results - real64 dt; - real64 sourceRateFactor; - real64 sinkRateFactor; - integer sourceElementsCount; - integer sinkElementsCount; - - /// In order to be sure that sub-timestepping is supported, requires the test to have at least one sub-timestep. - /// At least one simulation should test the timestep cuts ! - integer requiredSubTimeStep = 0; -}; - -/** - * @brief this struct computes from the test inputs the values to expect from the simulation. - */ -struct TestSet -{ - TestInputs const inputs; - - integer timestepCount; - integer totalElementsCount; - integer phaseCount; - - // stats for each timesteps, for each phases - array2d< real64 > sourceRates; - array2d< real64 > sinkRates; - array2d< real64 > sourceMassProd; - array2d< real64 > sinkMassProd; - array2d< real64 > massDeltas; - - // overall simulation stats for each phases - array1d< real64 > sourceMeanRate; - array1d< real64 > sinkMeanRate; - array1d< real64 > totalSourceMassProd; - array1d< real64 > totalSinkMassProd; - array1d< real64 > totalMassProd; - array1d< real64 > totalMeanRate; - - /** - * @brief Compute the expected statistics set for the tested simulation. - * @param inputParams the test simulation input parameters - */ - TestSet( TestInputs const & inputParams ): - inputs( inputParams ) - { - // tables must provide the same timestep & phase rates - EXPECT_EQ( inputs.sourceRates.size( 0 ), inputs.sinkRates.size( 0 )); - EXPECT_EQ( inputs.sourceRates.size( 1 ), inputs.sinkRates.size( 1 )); - - timestepCount = inputs.sourceRates.size( 0 ); - phaseCount = inputs.sourceRates.size( 1 ); - totalElementsCount = inputs.sourceElementsCount + inputs.sinkElementsCount; - - sourceRates.resize( timestepCount, phaseCount ); - sinkRates.resize( timestepCount, phaseCount ); - sourceMassProd.resize( timestepCount, phaseCount ); - sinkMassProd.resize( timestepCount, phaseCount ); - massDeltas.resize( timestepCount, phaseCount ); - sourceMeanRate.resize( phaseCount ); - sinkMeanRate.resize( phaseCount ); - totalSourceMassProd.resize( phaseCount ); - totalSinkMassProd.resize( phaseCount ); - totalMassProd.resize( phaseCount ); - totalMeanRate.resize( phaseCount ); - - for( integer ip = 0; ip < phaseCount; ++ip ) - { - totalSourceMassProd[ip] = 0.0; - totalSinkMassProd[ip] = 0.0; - sourceMeanRate[ip] = 0.0; - sinkMeanRate[ip] = 0.0; - for( integer timestepId = 0; timestepId < timestepCount; ++timestepId ) - { - // mass production / injection calculation - sourceRates[timestepId][ip] = inputs.sourceRates[timestepId][ip] * inputs.sourceRateFactor; - sourceMassProd[timestepId][ip] = inputs.sourceRates[timestepId][ip] * inputs.dt * inputs.sourceRateFactor; - totalSourceMassProd[ip] += sourceMassProd[timestepId][ip]; - sinkRates[timestepId][ip] = inputs.sinkRates[timestepId][ip] * inputs.sinkRateFactor; - sinkMassProd[timestepId][ip] = inputs.sinkRates[timestepId][ip] * inputs.dt * inputs.sinkRateFactor; - massDeltas[timestepId][ip] = -( sourceMassProd[timestepId][ip] + sinkMassProd[timestepId][ip] ); - totalSinkMassProd[ip] += sinkMassProd[timestepId][ip]; - // rates accumulations - sourceMeanRate[ip] += inputs.sourceRates[timestepId][ip] * inputs.sourceRateFactor; - sinkMeanRate[ip] += inputs.sinkRates[timestepId][ip] * inputs.sinkRateFactor; - } - // mean rates calculation - real64 const ratesMeanDivisor = 1.0 / double( timestepCount - 1 ); - sourceMeanRate[ip] *= ratesMeanDivisor; - sinkMeanRate[ip] *= ratesMeanDivisor; - // totals - totalMassProd[ip] = totalSinkMassProd[ip] + totalSourceMassProd[ip]; - totalMeanRate[ip] = sinkMeanRate[ip] + sourceMeanRate[ip]; - } - } -}; - - -class FlowStatisticsTest : public ::testing::Test -{ -public: - - void writeTableFiles( stdMap< string, string > const & files ) - { - for( auto const & [fileName, content] : files ) - { - std::ofstream os( fileName ); - ASSERT_TRUE( os.is_open() ); - os << content; - os.close(); - - m_tableFileNames.push_back( fileName ); - } - } - - void TearDown() override - { - // removing temp table files - for( string const & fileName : m_tableFileNames ) - { - ASSERT_TRUE( std::remove( fileName.c_str() ) == 0 ); - } - m_tableFileNames.clear(); - } - -private: - stdVector< string > m_tableFileNames; -}; - - - -class IterationTest : public IterationsStatistics -{ -public: - void AssertTimeStepEquals( TestSet testSet ) - { - EXPECT_GE( m_numTimeStepCuts, testSet.inputs.requiredSubTimeStep ) << "The test did not encountered any timestep cut, but were expected to. " - "Consider adapting the simulation so a timestep cut occurs to check they work as expected."; - } -}; - -void setRateTable( array2d< real64 > & rateTable, std::initializer_list< std::initializer_list< real64 > > timestepPhaseValues ) -{ - rateTable.resize( timestepPhaseValues.size(), timestepPhaseValues.begin()->size() ); - integer timestepId = 0; - for( auto const & phaseValues : timestepPhaseValues ) - { - integer ip = 0; - for( auto const & phaseValue : phaseValues ) - { - rateTable[timestepId][ip++] = phaseValue; - } - ++timestepId; - } -} - -real64 getTotalFluidMass( ProblemManager & problem, string_view flowSolverPath ) -{ - real64 totalMass = 0.0; - PhysicsSolverBase const & solver = problem.getGroupByPath< PhysicsSolverBase >( string( flowSolverPath ) ); - solver.forDiscretizationOnMeshTargets( problem.getDomainPartition().getMeshBodies(), - [&] ( string const &, - MeshLevel & mesh, - string_array const & ) - { - mesh.getElemManager().forElementRegions( [&]( ElementRegionBase & region ) - { - SinglePhaseStatistics::RegionStatistics & regionStats = region.getReference< SinglePhaseStatistics::RegionStatistics >( - SinglePhaseStatistics::viewKeyStruct::regionStatisticsString() ); - - totalMass += regionStats.totalMass; - } ); - } ); - return totalMass; -} - - -/** - * @brief Verification that the source flux statistics are correct for the current timestep - * @param expectedMasses the expected mass values per phase - * @param expectedRates the expected rate values per phase - * @param expectedElementCount the number of expected targeted elements - * @param stats the timestep stats - * @param context a context string to provide in any error message. - */ -void checkFluxStats( arraySlice1d< real64 > const & expectedMasses, - arraySlice1d< real64 > const & expectedRates, - integer const expectedElementCount, - SourceFluxStatsAggregator::WrappedStats const & stats, - string_view context ) -{ - for( int ip = 0; ip < stats.stats().getPhaseCount(); ++ip ) - { - EXPECT_DOUBLE_EQ( stats.stats().m_producedMass[ip], expectedMasses[ip] ) << GEOS_FMT( "The flux named '{}' did not produce the expected mass ({}, phase = {}).", - stats.getFluxName(), context, ip ); - EXPECT_DOUBLE_EQ( stats.stats().m_productionRate[ip], expectedRates[ip] ) << GEOS_FMT( "The flux named '{}' did not produce at the expected rate ({}, phase = {}).", - stats.getFluxName(), context, ip ); - } - EXPECT_DOUBLE_EQ( stats.stats().m_elementCount, expectedElementCount ) << GEOS_FMT( "The flux named '{}' did not produce in the expected elements ({}).", - stats.getFluxName(), context ); -} - -/** - * @brief Verification that the source flux statistics are correct over the whole simulation - * @param problem the simulation ProblemManager - * @param testSet the simulation TestSet - */ -void checkWholeSimFluxStats( ProblemManager & problem, TestSet const & testSet ) -{ - DomainPartition & domain = problem.getDomainPartition(); - SourceFluxStatsAggregator & wholeSimStats = - problem.getGroupByPath< SourceFluxStatsAggregator >( testSet.inputs.wholeSimFluxStatsPath ); - - wholeSimStats.forMeshLevelStatsWrapper( domain, - [&] ( MeshLevel & meshLevel, - SourceFluxStatsAggregator::WrappedStats & meshLevelStats ) - { - wholeSimStats.forAllFluxStatsWrappers( meshLevel, - [&] ( MeshLevel &, - SourceFluxStatsAggregator::WrappedStats & fluxStats ) - { - if( fluxStats.getFluxName() == testSet.inputs.sourceFluxName ) - { - checkFluxStats( testSet.totalSourceMassProd, - testSet.sourceMeanRate, - testSet.inputs.sourceElementsCount, - fluxStats, "over whole simulation" ); - } - else if( fluxStats.getFluxName() == testSet.inputs.sinkFluxName ) - { - checkFluxStats( testSet.totalSinkMassProd, - testSet.sinkMeanRate, - testSet.inputs.sinkElementsCount, - fluxStats, "over whole simulation" ); - } - else - { - FAIL() << "Unexpected SourceFlux found!"; - } - } ); - - for( int ip = 0; ip < meshLevelStats.stats().getPhaseCount(); ++ip ) - { - EXPECT_DOUBLE_EQ( meshLevelStats.stats().m_producedMass[ip], testSet.totalMassProd[ip] ) << "The fluxes did not produce the expected total mass (over whole simulation, phase = " << ip << ")."; - EXPECT_DOUBLE_EQ( meshLevelStats.stats().m_productionRate[ip], testSet.totalMeanRate[ip] ) << "The fluxes did not produce at the expected rate (over whole simulation, phase = " << ip << ")."; - } - } ); -} - -/** - * @brief Verification that the source flux statistics are correct for a given timestep - * @param problem the simulation ProblemManager - * @param testSet the simulation TestSet - * @param time_n the current timestep start - * @param timestepId the current timestep id (= cycle) - */ -void checkTimeStepFluxStats( ProblemManager & problem, TestSet const & testSet, - real64 const time_n, integer const timestepId ) -{ - DomainPartition & domain = problem.getDomainPartition(); - SourceFluxStatsAggregator & timestepStats = - problem.getGroupByPath< SourceFluxStatsAggregator >( testSet.inputs.timeStepFluxStatsPath ); - - timestepStats.forMeshLevelStatsWrapper( domain, - [&] ( MeshLevel & meshLevel, - SourceFluxStatsAggregator::WrappedStats & ) - { - timestepStats.forAllFluxStatsWrappers( meshLevel, - [&] ( MeshLevel &, - SourceFluxStatsAggregator::WrappedStats & fluxStats ) - { - if( fluxStats.getFluxName() == testSet.inputs.sourceFluxName ) - { - checkFluxStats( testSet.sourceMassProd[timestepId], - testSet.sourceRates[timestepId], - testSet.inputs.sourceElementsCount, - fluxStats, GEOS_FMT( "for timestep at t = {} s", time_n ) ); - } - else if( fluxStats.getFluxName() == testSet.inputs.sinkFluxName ) - { - checkFluxStats( testSet.sinkMassProd[timestepId], - testSet.sinkRates[timestepId], - testSet.inputs.sinkElementsCount, - fluxStats, GEOS_FMT( "for timestep at t = {} s", time_n ) ); - } - else - { - FAIL() << "Unexpected SourceFlux found!"; - } - } ); - } ); -} - -void checkTimeStepStats( TestSet const & testSet, - real64 const time_n, - integer const timestepId ) -{ - EXPECT_LT( timestepId, testSet.timestepCount ) << GEOS_FMT( "The tested time-step count were higher than expected (t = {} s).", - time_n ); -} - -void checkWholeSimTimeStepStats( ProblemManager & problem, - TestSet const & testSet, - TimeStepChecker const & timeStepChecker ) -{ - EXPECT_EQ( timeStepChecker.getTestedTimeStepCount(), testSet.timestepCount ) << "The tested time-step were different than expected."; - - PhysicsSolverBase & solver = problem.getGroupByPath< PhysicsSolverBase >( testSet.inputs.flowSolverPath ); - IterationTest & solverStats = static_cast< IterationTest & >(solver.getIterationStats()); - solverStats.AssertTimeStepEquals( testSet ); -} - - -//////////////////////////////// SinglePhase Flux Statistics Test //////////////////////////////// -namespace SinglePhaseFluxStatisticsTest -{ - - -TestSet getTestSet() -{ - TestInputs testInputs; - - testInputs.xmlInput = - R"xml( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -)xml"; - - - testInputs.sourceFluxName = "sourceFlux"; - testInputs.sinkFluxName = "sinkFlux"; - testInputs.timeStepCheckerPath = "/Tasks/timeStepChecker"; - testInputs.timeStepFluxStatsPath = "/Tasks/timeStepFluxStats"; - testInputs.wholeSimFluxStatsPath = "/Tasks/wholeSimFluxStats"; - testInputs.flowSolverPath = "/Solvers/testSolver"; - - testInputs.dt = 500.0; - testInputs.sourceElementsCount = 2; - testInputs.sinkElementsCount = 1; - - // FluxRate table from 0.0s to 5000.0s - setRateTable( testInputs.sourceRates, - { { 0.000 }, - { 0.000 }, - { 0.767 }, - { 0.894 }, - { 0.561 }, - { 0.234 }, - { 0.194 }, - { 0.178 }, - { 0.162 }, - { 0.059 }, - { 0.000 } } ); - testInputs.sinkRates=testInputs.sourceRates; - - // sink is 3x source production - testInputs.sourceRateFactor = -1.0; - testInputs.sinkRateFactor = 3.0; - - return TestSet( testInputs ); -} - -TEST_F( FlowStatisticsTest, checkSinglePhaseFluxStatistics ) -{ - TestSet const testSet = getTestSet(); - - GeosxState state( std::make_unique< CommandLineOptions >( g_commandLineOptions ) ); - ProblemManager & problem = state.getProblemManager(); - - setupProblemFromXML( problem, testSet.inputs.xmlInput.data() ); - - real64 firstMass; - - TimeStepChecker & timeStepChecker = problem.getGroupByPath< TimeStepChecker >( testSet.inputs.timeStepCheckerPath ); - timeStepChecker.setTimeStepCheckingFunction( [&]( real64 const time_n ) - { - integer const timestepId = timeStepChecker.getTestedTimeStepCount(); - checkTimeStepStats( testSet, time_n, timestepId ); - checkTimeStepFluxStats( problem, testSet, time_n, timestepId ); - - static bool passedFirstTimeStep = false; - if( !passedFirstTimeStep ) - { - passedFirstTimeStep = true; - firstMass = getTotalFluidMass( problem, testSet.inputs.flowSolverPath ); - } - } ); - - // run simulation - EXPECT_FALSE( problem.runSimulation() ) << "Simulation exited early."; - - checkWholeSimFluxStats( problem, testSet ); - checkWholeSimTimeStepStats( problem, testSet, timeStepChecker ); - - // check singlephasestatistics results - real64 const lastMass = getTotalFluidMass( problem, testSet.inputs.flowSolverPath ); - real64 const massDiffTol = 1e-7; - EXPECT_NEAR( lastMass - firstMass, - -testSet.totalMassProd[0], - massDiffTol * std::abs( testSet.totalMassProd[0] ) ) << GEOS_FMT( "{} total mass difference from start to end is not consistent with fluxes production.", - SinglePhaseStatistics::catalogName() ); -} - - -} /* namespace SinglePhaseFluxStatisticsTest */ - - -//////////////////////////////// Multiphase Flux Statistics Test //////////////////////////////// -namespace MultiPhaseFluxStatisticsTestMass -{ - - -TestSet getTestSet() -{ - TestInputs testInputs; - - testInputs.xmlInput = - R"xml( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -)xml"; - - testInputs.tableFiles.insert( {"pvtgas.txt", "DensityFun SpanWagnerCO2Density 1.5e7 2.5e7 1e5 370.15 400.15 2\n" - "ViscosityFun FenghourCO2Viscosity 1.5e7 2.5e7 1e5 370.15 400.15 2\n"} ); - - testInputs.tableFiles.insert( {"pvtliquid.txt", "DensityFun EzrokhiBrineDensity 0.1033 -2.2991e-5 -2.3658e-6\n" - "ViscosityFun EzrokhiBrineViscosity 0 0 0\n"} ); - - testInputs.tableFiles.insert( {"co2flash.txt", "FlashModel CO2Solubility 1.5e7 2.5e7 1e5 370.15 400.15 2 0\n"} ); - - - testInputs.sourceFluxName = "sourceFlux"; - testInputs.sinkFluxName = "sinkFlux"; - testInputs.timeStepCheckerPath = "/Tasks/timeStepChecker"; - testInputs.timeStepFluxStatsPath = "/Tasks/timeStepFluxStats"; - testInputs.wholeSimFluxStatsPath = "/Tasks/wholeSimFluxStats"; - testInputs.flowSolverPath = "/Solvers/testSolver"; - - testInputs.dt = 500.0; - testInputs.sourceElementsCount = 1; - testInputs.sinkElementsCount = 1; - - // FluxInjectionRate & FluxProductionRate table from 0.0s to 5000.0s - setRateTable( testInputs.sourceRates, - { { 0.000, 0.0 }, - { 0.000, 0.0 }, - { 0.267, 0.0 }, - { 0.561, 0.0 }, - { 0.194, 0.0 }, - { 0.102, 0.0 }, - { 0.059, 0.0 }, - { 0.000, 0.0 }, - { 0.000, 0.0 }, - { 0.000, 0.0 }, - { 0.000, 0.0 } } ); - setRateTable( testInputs.sinkRates, - { { 0.0, 0.000 }, - { 0.0, 0.000 }, - { 0.0, 0.003 }, - { 0.0, 0.062 }, - { 0.0, 0.121 }, - { 0.0, 0.427 }, - { 0.0, 0.502 }, - { 0.0, 0.199 }, - { 0.0, 0.083 }, - { 0.0, 0.027 }, - { 0.0, 0.000 } } ); - - testInputs.sourceRateFactor = -44e-3; - testInputs.sinkRateFactor = 18e-3; - - return TestSet( testInputs ); -} - - -TEST_F( FlowStatisticsTest, checkMultiPhaseFluxStatisticsMass ) -{ - TestSet const testSet = getTestSet(); - writeTableFiles( testSet.inputs.tableFiles ); - - GeosxState state( std::make_unique< CommandLineOptions >( g_commandLineOptions ) ); - ProblemManager & problem = state.getProblemManager(); - - setupProblemFromXML( problem, testSet.inputs.xmlInput.data() ); - - TimeStepChecker & timeStepChecker = problem.getGroupByPath< TimeStepChecker >( testSet.inputs.timeStepCheckerPath ); - timeStepChecker.setTimeStepCheckingFunction( [&]( real64 const time_n ) - { - integer const timestepId = timeStepChecker.getTestedTimeStepCount(); - checkTimeStepStats( testSet, time_n, timestepId ); - checkTimeStepFluxStats( problem, testSet, time_n, timestepId ); - } ); - - // run simulation - EXPECT_FALSE( problem.runSimulation() ) << "Simulation exited early."; - - checkWholeSimFluxStats( problem, testSet ); - checkWholeSimTimeStepStats( problem, testSet, timeStepChecker ); -} - - -} /* namespace MultiPhaseFluxStatisticsTest */ - - -//////////////////////////////// Multiphase Flux Statistics Test //////////////////////////////// -namespace MultiPhaseFluxStatisticsTestMol -{ - - -TestSet getTestSet() -{ - TestInputs testInputs; - - testInputs.xmlInput = - R"xml( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -)xml"; - - testInputs.tableFiles.insert( {"pvtgas.txt", "DensityFun SpanWagnerCO2Density 1.5e7 2.5e7 1e5 370.15 400.15 2\n" - "ViscosityFun FenghourCO2Viscosity 1.5e7 2.5e7 1e5 370.15 400.15 2\n"} ); - - testInputs.tableFiles.insert( {"pvtliquid.txt", "DensityFun EzrokhiBrineDensity 0.1033 -2.2991e-5 -2.3658e-6\n" - "ViscosityFun EzrokhiBrineViscosity 0 0 0\n"} ); - - testInputs.tableFiles.insert( {"co2flash.txt", "FlashModel CO2Solubility 1.5e7 2.5e7 1e5 370.15 400.15 2 0\n"} ); - - - testInputs.sourceFluxName = "sourceFlux"; - testInputs.sinkFluxName = "sinkFlux"; - testInputs.timeStepCheckerPath = "/Tasks/timeStepChecker"; - testInputs.timeStepFluxStatsPath = "/Tasks/timeStepFluxStats"; - testInputs.wholeSimFluxStatsPath = "/Tasks/wholeSimFluxStats"; - testInputs.flowSolverPath = "/Solvers/testSolver"; - - testInputs.dt = 500.0; - testInputs.sourceElementsCount = 1; - testInputs.sinkElementsCount = 1; - - // FluxInjectionRate & FluxProductionRate table from 0.0s to 5000.0s - setRateTable( testInputs.sourceRates, - { { 0.000, 0.0 }, - { 0.000, 0.0 }, - { 0.267, 0.0 }, - { 0.561, 0.0 }, - { 0.194, 0.0 }, - { 0.102, 0.0 }, - { 0.059, 0.0 }, - { 0.000, 0.0 }, - { 0.000, 0.0 }, - { 0.000, 0.0 }, - { 0.000, 0.0 } } ); - setRateTable( testInputs.sinkRates, - { { 0.0, 0.000 }, - { 0.0, 0.000 }, - { 0.0, 0.003 }, - { 0.0, 0.062 }, - { 0.0, 0.121 }, - { 0.0, 0.427 }, - { 0.0, 0.502 }, - { 0.0, 0.199 }, - { 0.0, 0.083 }, - { 0.0, 0.027 }, - { 0.0, 0.000 } } ); - - // scale is set to high values to make the solver generate timestep cuts - testInputs.sourceRateFactor = -8.0; - testInputs.sinkRateFactor = 8.0; - - // this simulation is set-up to have at least one timestep cut. - testInputs.requiredSubTimeStep = 2; - - return TestSet( testInputs ); -} - - -TEST_F( FlowStatisticsTest, checkMultiPhaseFluxStatisticsMol ) -{ - TestSet const testSet = getTestSet(); - writeTableFiles( testSet.inputs.tableFiles ); - - GeosxState state( std::make_unique< CommandLineOptions >( g_commandLineOptions ) ); - ProblemManager & problem = state.getProblemManager(); - - setupProblemFromXML( problem, testSet.inputs.xmlInput.data() ); - - TimeStepChecker & timeStepChecker = problem.getGroupByPath< TimeStepChecker >( testSet.inputs.timeStepCheckerPath ); - timeStepChecker.setTimeStepCheckingFunction( [&]( real64 const time_n ) - { - integer const timestepId = timeStepChecker.getTestedTimeStepCount(); - checkTimeStepStats( testSet, time_n, timestepId ); - checkTimeStepFluxStats( problem, testSet, time_n, timestepId ); - } ); - - // run simulation - EXPECT_FALSE( problem.runSimulation() ) << "Simulation exited early."; - - checkWholeSimFluxStats( problem, testSet ); - checkWholeSimTimeStepStats( problem, testSet, timeStepChecker ); -} - - -} /* namespace MultiPhaseFluxStatisticsTest */ - - -//////////////////////////////// Main //////////////////////////////// - - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - g_commandLineOptions = *geos::basicSetup( argc, argv ); - int const result = RUN_ALL_TESTS(); - geos::basicCleanup(); - return result; -} diff --git a/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseFVMKernels.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseFVMKernels.cpp deleted file mode 100644 index 6e9302a4ad3..00000000000 --- a/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseFVMKernels.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -// Source includes -#include "mainInterface/initialization.hpp" -#include "physicsSolvers/fluidFlow/SinglePhaseFVMKernels.hpp" -#include "testFlowKernelHelpers.hpp" - -// TPL includes -#include - -using namespace geos; -using namespace geos::singlePhaseFVMKernels; - - -template< localIndex stencilSize > -void computeFlux( arraySlice1d< real64 const > const & weight, - real64 const * pres, - real64 const * gravCoef, - real64 const * mob, - real64 const * dMob_dPres, - real64 const * dens, - real64 const * dDens_dPres, - real64 const dt, - real64 & flux, - real64 (& dFlux_dP)[stencilSize] ) -{ - localIndex constexpr numElems = 2; - - real64 densMean = 0.0; - real64 dDensMean_dP[stencilSize] {}; - for( localIndex i = 0; i < numElems; ++i ) - { - densMean += 0.5 * dens[i]; - dDensMean_dP[i] = 0.5 * dDens_dPres[i]; - } - real64 potDif = 0.0; - real64 sumWeightGrav = 0; - for( localIndex i = 0; i < stencilSize; ++i ) - { - potDif += weight[i] * (pres[i] - densMean * gravCoef[i]); - sumWeightGrav += weight[i] * gravCoef[i]; - } - localIndex const k_up = (potDif >= 0) ? 0 : 1; - flux = dt * potDif * mob[k_up]; - for( localIndex i = 0; i < stencilSize; ++i ) - { - dFlux_dP[i] = dt * ( weight[i] - sumWeightGrav * dDensMean_dP[i] ) * mob[k_up]; - } - dFlux_dP[k_up] += dt * potDif * dMob_dPres[k_up]; -} - -template< bool FULL, localIndex stencilSize > -void testFluxKernel( CellElementStencilTPFA const & stencil, - real64 const * pres, - real64 const * gravCoef, - real64 const * mob, - real64 const * dMob_dPres, - real64 const * dens, - real64 const * dDens_dPres, - real64 const dt ) -{ - localIndex constexpr numElems = CellElementStencilTPFA::maxNumPointsInFlux; - - CellElementStencilTPFA::IndexContainerViewConstType const & seri = stencil.getElementRegionIndices(); - CellElementStencilTPFA::IndexContainerViewConstType const & sesri = stencil.getElementSubRegionIndices(); - CellElementStencilTPFA::IndexContainerViewConstType const & sei = stencil.getElementIndices(); - CellElementStencilTPFA::WeightContainerViewConstType const & weights = stencil.getWeights(); - - auto presView = AccessorHelper< FULL >::template makeElementAccessor< 1 >( pres, - stencilSize, - seri[0], - sesri[0], - sei[0] ); - auto gravCoefView = AccessorHelper< FULL >::template makeElementAccessor< 1 >( gravCoef, - stencilSize, - seri[0], - sesri[0], - sei[0] ); - auto mobView = AccessorHelper< FULL >::template makeElementAccessor< 1 >( mob, - stencilSize, - seri[0], - sesri[0], - sei[0] ); - auto dMob_dPresView = AccessorHelper< FULL >::template makeElementAccessor< 1 >( dMob_dPres, - stencilSize, - seri[0], - sesri[0], - sei[0] ); - auto densView = AccessorHelper< FULL >::template makeElementAccessor< 2 >( dens, - stencilSize, - seri[0], - sesri[0], - sei[0], - 1 ); - auto dDens_dPresView = AccessorHelper< FULL >::template makeElementAccessor< 2 >( dDens_dPres, - stencilSize, - seri[0], - sesri[0], - sei[0], - 1 ); - - array1d< real64 > flux( numElems ); - array2d< real64 > fluxJacobian( numElems, stencilSize ); - - // transmissibility - real64 transmissibility[1][2]; - transmissibility[0][0] = weights[0][0]; - transmissibility[0][1] = weights[0][1]; - real64 dTrans_dPres[1][2] = {{0.0, 0.0}}; - - FluxKernel::compute( stencilSize, - seri[0], - sesri[0], - sei[0], - transmissibility, - dTrans_dPres, - presView.toNestedViewConst(), - gravCoefView.toNestedViewConst(), - densView.toNestedViewConst(), - dDens_dPresView.toNestedViewConst(), - mobView.toNestedViewConst(), - dMob_dPresView.toNestedViewConst(), - dt, - flux, - fluxJacobian ); - - real64 flux_et; - real64 dFlux_dP_et[stencilSize]; - - // compute etalon - computeFlux( weights[0], - pres, - gravCoef, - mob, - dMob_dPres, - dens, - dDens_dPres, - dt, - flux_et, - dFlux_dP_et ); - - EXPECT_DOUBLE_EQ( flux[0], flux_et ); - EXPECT_DOUBLE_EQ( flux[1], -flux_et ); - for( localIndex i = 0; i < stencilSize; ++i ) - { - EXPECT_DOUBLE_EQ( fluxJacobian[0][i], dFlux_dP_et[i] ); - EXPECT_DOUBLE_EQ( fluxJacobian[1][i], -dFlux_dP_et[i] ); - } -} - -TEST( SinglePhaseFVMKernels, fluxFull ) -{ - localIndex constexpr stencilSize = 2; - - - CellElementStencilTPFA stencil; - - localIndex elemReg[2] = {0, 1}; - localIndex elemSubReg[2] = {0, 0}; - localIndex elemIndex[2] = {1, 0}; - real64 weight[] = { 1e-12, -1e-12 }; - stencil.add( stencilSize, - elemReg, - elemSubReg, - elemIndex, - weight, - 0 ); - - - int constexpr NTEST = 3; - - // we keep these around for easy aggregate initialization - real64 const presData[NTEST][stencilSize] = { - { 1.1e+6, 2.1e+6 }, { 2.1e+6, 2.2e+6 }, { 2.1e+6, 2.1e+6 } - }; - real64 const gravCoefData[NTEST][stencilSize] = { - { 1e+3, 5e+2 }, { 1e+3, 1e+3 }, { 0.0, 1e+3 } - }; - real64 const mobData[NTEST][stencilSize] = { - { 1e+6, 2e+6 }, { 2e+6, 1e+6 }, { 2e+6, 5e+6 } - }; - real64 const dMob_dPresData[NTEST][stencilSize] = { - { 1e-6, 2e-6 }, { 1e-6, 2e-6 }, { 1e-6, 2e-6 } - }; - real64 const densData[NTEST][stencilSize] = { - { 1e+3, 2e+3 }, { 2e+3, 3e+3 }, { 2e+3, 1e+3 } - }; - real64 const dDens_dPresData[NTEST][stencilSize] = { - { 1e-6, 2e-6 }, { 2e-6, 3e-6 }, { 2e-6, 2e-6 } - }; - real64 const dt[NTEST] = { 1.0, 1e+5, 1e+8 }; - - - for( int i = 0; i < NTEST; ++i ) - { - SCOPED_TRACE( "Input # " + std::to_string( i ) ); - - testFluxKernel< true, 2 >( stencil, - presData[i], - gravCoefData[i], - mobData[i], - dMob_dPresData[i], - densData[i], - dDens_dPresData[i], - dt[i] ); - - } -} - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - - geos::basicSetup( argc, argv ); - - int const result = RUN_ALL_TESTS(); - - geos::basicCleanup(); - - return result; -} diff --git a/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp deleted file mode 100644 index 62f73daf746..00000000000 --- a/src/coreComponents/integrationTests/fluidFlowTests/testSinglePhaseMobilityKernel.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -// Source includes -#include "mainInterface/initialization.hpp" -#include "physicsSolvers/fluidFlow/kernels/singlePhase/MobilityKernel.hpp" - -// TPL includes -#include - -using namespace geos; -using namespace geos::singlePhaseBaseKernels; - -// Sphinx start after test mobility - -TEST( SinglePhaseBaseKernels, mobility ) -{ - int constexpr NTEST = 3; - - real64 const dens[NTEST] = { 800.0, 1000.0, 1500.0 }; - - real64 const dDens_dPres[NTEST] = { 1e-5, 1e-10, 0.0 }; - real64 const visc[NTEST] = { 5.0, 2.0, 1.0 }; - - real64 const dVisc_dPres[NTEST] = { 1e-7, 0.0, 0.0 }; - - for( int i = 0; i < NTEST; ++i ) - { - SCOPED_TRACE( "Input # " + std::to_string( i ) ); - - real64 mob; - real64 dMob_dPres; - MobilityKernel::compute( dens[i], visc[i], mob ); - MobilityKernel::compute_derivative( mob, dDens_dPres[i], visc[i], dVisc_dPres[i], dMob_dPres ); - - // compute etalon - real64 const mob_et = dens[i] / visc[i]; - real64 const dMob_dPres_et = mob_et * (dDens_dPres[i] / dens[i] - dVisc_dPres[i] / visc[i]); - - EXPECT_DOUBLE_EQ( mob, mob_et ); - EXPECT_DOUBLE_EQ( dMob_dPres, dMob_dPres_et ); - } -} - -// Sphinx end before test mobility - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - - geos::basicSetup( argc, argv ); - - int const result = RUN_ALL_TESTS(); - - geos::basicCleanup(); - - return result; -} diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index 534120d87e4..33113113f4c 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -3670,8 +3670,9 @@ Information output from lower logLevels is added with the desired log level +Frequency of pressure update is set in SinglePhase/CompositionalMultiphaseStatistics definition. +Setting cycleFrequency='1' will update the pressure every timestep, note that is a lagged property in constraint propertiesNote the event associated with the statists task must be entered before the solver event. +--> @@ -3944,6 +3945,10 @@ Information output from lower logLevels is added with the desired log level + + @@ -5110,6 +5115,60 @@ Local- Add jump stabilization on interior of macro elements--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5450,6 +5509,60 @@ Local- Add jump stabilization on interior of macro elements--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6234,6 +6347,19 @@ Information output from lower logLevels is added with the desired log level + + + + + + + + + + diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index 3ef47579ac4..b3819dee842 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -2682,17 +2682,17 @@ A field can represent a physical variable. (pressure, temperature, global compos - + - + - + - + - + - + From 2d33b3d8df63f7fd2412b56be4c756549d02f60f Mon Sep 17 00:00:00 2001 From: li97 Date: Thu, 18 Dec 2025 12:58:38 -0800 Subject: [PATCH 11/17] delete duplicate files during merge --- .../constitutiveTestHelpers.hpp | 163 --- .../testCapillaryPressure.cpp | 731 ----------- .../constitutiveTests/testDamage.cpp | 97 -- .../constitutiveTests/testRelPerm.cpp | 1111 ----------------- .../dataRepositoryTests/testObjectCatalog.cpp | 134 -- .../testWrapperHelpers.cpp | 246 ---- .../dataRepositoryTests/utils.hpp | 149 --- .../testFieldSpecificationsEnums.cpp | 40 - .../fileIOTests/CMakeLists.txt | 42 - .../fileIOTests/testHDFFile.cpp | 139 --- .../fileIOTests/testHDFParallelFile.cpp | 101 -- .../fileIOTests/testMemoryStats.cpp | 210 ---- .../finiteVolumeTests/CMakeLists.txt | 32 - .../testMimeticInnerProducts.cpp | 923 -------------- .../testLAIHelperFunctions.cpp | 227 ---- .../meshTests/testMeshEnums.cpp | 66 - .../integrationTests/toolchain/CMakeLists.txt | 24 - .../toolchain/testToolchain.cpp | 43 - .../virtualElementTests/CMakeLists.txt | 33 - .../testConformingVirtualElementOrder1.cpp | 374 ------ .../wellsTests/testWellEnums.cpp | 49 - 21 files changed, 4934 deletions(-) delete mode 100644 src/coreComponents/integrationTests/constitutiveTests/constitutiveTestHelpers.hpp delete mode 100644 src/coreComponents/integrationTests/constitutiveTests/testCapillaryPressure.cpp delete mode 100644 src/coreComponents/integrationTests/constitutiveTests/testDamage.cpp delete mode 100644 src/coreComponents/integrationTests/constitutiveTests/testRelPerm.cpp delete mode 100644 src/coreComponents/integrationTests/dataRepositoryTests/testObjectCatalog.cpp delete mode 100644 src/coreComponents/integrationTests/dataRepositoryTests/testWrapperHelpers.cpp delete mode 100644 src/coreComponents/integrationTests/dataRepositoryTests/utils.hpp delete mode 100644 src/coreComponents/integrationTests/fieldSpecificationTests/testFieldSpecificationsEnums.cpp delete mode 100644 src/coreComponents/integrationTests/fileIOTests/CMakeLists.txt delete mode 100644 src/coreComponents/integrationTests/fileIOTests/testHDFFile.cpp delete mode 100644 src/coreComponents/integrationTests/fileIOTests/testHDFParallelFile.cpp delete mode 100644 src/coreComponents/integrationTests/fileIOTests/testMemoryStats.cpp delete mode 100644 src/coreComponents/integrationTests/finiteVolumeTests/CMakeLists.txt delete mode 100644 src/coreComponents/integrationTests/finiteVolumeTests/testMimeticInnerProducts.cpp delete mode 100644 src/coreComponents/integrationTests/linearAlgebraTests/testLAIHelperFunctions.cpp delete mode 100644 src/coreComponents/integrationTests/meshTests/testMeshEnums.cpp delete mode 100644 src/coreComponents/integrationTests/toolchain/CMakeLists.txt delete mode 100644 src/coreComponents/integrationTests/toolchain/testToolchain.cpp delete mode 100644 src/coreComponents/integrationTests/virtualElementTests/CMakeLists.txt delete mode 100644 src/coreComponents/integrationTests/virtualElementTests/testConformingVirtualElementOrder1.cpp delete mode 100644 src/coreComponents/integrationTests/wellsTests/testWellEnums.cpp diff --git a/src/coreComponents/integrationTests/constitutiveTests/constitutiveTestHelpers.hpp b/src/coreComponents/integrationTests/constitutiveTests/constitutiveTestHelpers.hpp deleted file mode 100644 index e2ddfa05933..00000000000 --- a/src/coreComponents/integrationTests/constitutiveTests/constitutiveTestHelpers.hpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#pragma once - -// Source includes -#include "common/DataTypes.hpp" -#include "constitutive/ConstitutiveBase.hpp" -#include "constitutive/relativePermeability/RelativePermeabilitySelector.hpp" -#include "constitutive/capillaryPressure/CapillaryPressureSelector.hpp" -#include "functions/FunctionManager.hpp" -#include "functions/TableFunction.hpp" -#include "integrationTests/fluidFlowTests/testFlowUtils.hpp" - -// TPL includes -#include -#include - -namespace geos -{ -namespace testing -{ -void fillArray( array1d< real64_array > & arr, std::initializer_list< real64 > const & input_list ) -{ - arr.resize( 1 ); - arr[0].resize( input_list.size()); - int j = 0; - for( auto const & elt : input_list ) - arr[0][j++] = elt; - -} - -void fillArray( real64_array & arr, std::initializer_list< real64 > const & input_list ) -{ - arr.resize( input_list.size()); - int j = 0; - for( auto const & elt : input_list ) - arr[j++] = elt; - -} -void initializeTable( string const & tableName, - array1d< array1d< real64 > > const & coordinates, - array1d< real64 > const & values ) -{ - FunctionManager & functionManager = FunctionManager::getInstance(); - - TableFunction & table = - dynamicCast< TableFunction & >( *functionManager.createChild( TableFunction::catalogName(), tableName ) ); - table.setTableCoordinates( coordinates ); - table.setTableValues( values ); - table.reInitializeFunction(); - - table.setInterpolationMethod( TableFunction::InterpolationType::Linear ); -} - -template< typename MODEL, typename VAR, typename D_VAR_D_SAT > -void testNumericalDerivatives( dataRepository::Group & parent, - MODEL & model, - arraySlice1d< real64 const > const saturationInput, - real64 const perturbParameter, - real64 const relTol, - string const & varName, - VAR && varAccessor, - D_VAR_D_SAT && dVar_dSat_accessor ) -{ - localIndex const NP = model.numFluidPhases(); - auto const & phases = model.phaseNames(); - - // Copy input values into an array with expected layout - array2d< real64, compflow::LAYOUT_PHASE > saturationValues( 1, NP ); - for( integer i = 0; i < NP; ++i ) - { - saturationValues[0][i] = saturationInput[i]; - } - arraySlice1d< real64 const, compflow::USD_PHASE - 1 > const saturation = saturationValues[0]; - - // create a clone of the rel perm to run updates on - std::unique_ptr< constitutive::ConstitutiveBase > modelCopyPtr = model.deliverClone( "fluidCopy", &parent ); - MODEL & modelCopy = dynamicCast< MODEL & >( *modelCopyPtr ); - - model.allocateConstitutiveData( model.getParent(), 1 ); - modelCopy.allocateConstitutiveData( model.getParent(), 1 ); - - // auto to avoid having to spell out unknown layout permutations - auto const var = varAccessor( model ); - auto const dPhaseRelPerm_dSat = dVar_dSat_accessor( model ); - auto const varCopy = varAccessor( modelCopy ); - - // set the fluid state to current - constitutive::constitutiveUpdatePassThru( model, [&] ( auto & castedModel ) - { - typename TYPEOFREF( castedModel ) ::KernelWrapper relPermWrapper = castedModel.createKernelWrapper(); - relPermWrapper.update( 0, 0, saturation ); - } ); - - // update saturation and check derivatives - auto dPhaseRelPerm_dS = testing::invertLayout( dPhaseRelPerm_dSat, NP, NP ); - - array2d< real64, compflow::LAYOUT_PHASE > satNew( 1, NP ); - for( integer jp = 0; jp < NP; ++jp ) - { - real64 const dS = perturbParameter * (saturation[jp] + perturbParameter); - for( integer ip = 0; ip < NP; ++ip ) - { - satNew[0][ip] = saturation[ip]; - } - satNew[0][jp] += dS; - - constitutive::constitutiveUpdatePassThru( modelCopy, [&] ( auto & castedRelPerm ) - { - typename TYPEOFREF( castedRelPerm ) ::KernelWrapper relPermWrapper = castedRelPerm.createKernelWrapper(); - relPermWrapper.update( 0, 0, satNew[0] ); - } ); - - checkDerivative( varCopy.toSliceConst(), - var.toSliceConst(), - dPhaseRelPerm_dS[jp].toSliceConst(), - dS, - relTol, - varName, - "phaseVolFrac[" + phases[jp] + "]", - phases ); - } -} - -template< typename BASE > -class ConstitutiveTestBase : public ::testing::Test -{ -public: - ConstitutiveTestBase(): - m_node(), - m_parent( "parent", m_node ) - { - m_parent.resize( 1 ); - } - - void initialize( BASE & model ) - { - m_model = &model; - m_parent.initialize(); - m_parent.initializePostInitialConditions(); - } - -protected: - conduit::Node m_node; - dataRepository::Group m_parent; - BASE * m_model; -}; - -} // namespace testing -} // namespace geos diff --git a/src/coreComponents/integrationTests/constitutiveTests/testCapillaryPressure.cpp b/src/coreComponents/integrationTests/constitutiveTests/testCapillaryPressure.cpp deleted file mode 100644 index a91136ef04b..00000000000 --- a/src/coreComponents/integrationTests/constitutiveTests/testCapillaryPressure.cpp +++ /dev/null @@ -1,731 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -// Source includes -#include "constitutive/relativePermeability/unitTests/constitutiveTestHelpers.hpp" -#include "functions/FunctionManager.hpp" -#include "mainInterface/GeosxState.hpp" -#include "mainInterface/initialization.hpp" -#include "constitutive/capillaryPressure/CapillaryPressureFields.hpp" - -using namespace geos; -using namespace geos::testing; -using namespace geos::constitutive; -using namespace geos::constitutive::cappres; -using namespace geos::dataRepository; - -CapillaryPressureBase & makeBrooksCoreyCapPressureTwoPhase( string const & name, Group & parent ) -{ - BrooksCoreyCapillaryPressure & capPressure = parent.registerGroup< BrooksCoreyCapillaryPressure >( name ); - - string_array & phaseNames = capPressure.getReference< string_array >( CapillaryPressureBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 2 ); - phaseNames[0] = "water"; phaseNames[1] = "oil"; - - array1d< real64 > & phaseMinSat = capPressure.getReference< array1d< real64 > >( BrooksCoreyCapillaryPressure::viewKeyStruct::phaseMinVolumeFractionString() ); - phaseMinSat.resize( 2 ); - phaseMinSat[0] = 0.1; phaseMinSat[1] = 0.05; - - array1d< real64 > & phaseCapPressureExpInv = - capPressure.getReference< array1d< real64 > >( BrooksCoreyCapillaryPressure::viewKeyStruct::phaseCapPressureExponentInvString() ); - phaseCapPressureExpInv.resize( 2 ); - phaseCapPressureExpInv[0] = 2; phaseCapPressureExpInv[1] = 4; - - array1d< real64 > & phaseEntryPressure = capPressure.getReference< array1d< real64 > >( BrooksCoreyCapillaryPressure::viewKeyStruct::phaseEntryPressureString() ); - phaseEntryPressure.resize( 2 ); - phaseEntryPressure[0] = 1; phaseEntryPressure[1] = 1; - - real64 & capPressureEpsilon = capPressure.getReference< real64 >( BrooksCoreyCapillaryPressure::viewKeyStruct::capPressureEpsilonString() ); - capPressureEpsilon = 1e-4; - - capPressure.postInputInitializationRecursive(); - return capPressure; -} - - -CapillaryPressureBase & makeBrooksCoreyCapPressureThreePhase( string const & name, Group & parent ) -{ - BrooksCoreyCapillaryPressure & capPressure = parent.registerGroup< BrooksCoreyCapillaryPressure >( name ); - - string_array & phaseNames = capPressure.getReference< string_array >( CapillaryPressureBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 3 ); - phaseNames[0] = "water"; phaseNames[1] = "oil"; phaseNames[2] = "gas"; - - array1d< real64 > & phaseMinSat = capPressure.getReference< array1d< real64 > >( BrooksCoreyCapillaryPressure::viewKeyStruct::phaseMinVolumeFractionString() ); - phaseMinSat.resize( 3 ); - phaseMinSat[0] = 0.04; phaseMinSat[1] = 0.02; phaseMinSat[2] = 0.1; - - array1d< real64 > & phaseCapPressureExpInv = - capPressure.getReference< array1d< real64 > >( BrooksCoreyCapillaryPressure::viewKeyStruct::phaseCapPressureExponentInvString() ); - phaseCapPressureExpInv.resize( 3 ); - phaseCapPressureExpInv[0] = 2; phaseCapPressureExpInv[1] = -3; phaseCapPressureExpInv[2] = 2.5; - - array1d< real64 > & phaseEntryPressure = capPressure.getReference< array1d< real64 > >( BrooksCoreyCapillaryPressure::viewKeyStruct::phaseEntryPressureString() ); - phaseEntryPressure.resize( 3 ); - phaseEntryPressure[0] = 1; phaseEntryPressure[1] = -1; phaseEntryPressure[2] = 2; - - real64 & capPressureEpsilon = capPressure.getReference< real64 >( BrooksCoreyCapillaryPressure::viewKeyStruct::capPressureEpsilonString() ); - capPressureEpsilon = 1e-7; - - capPressure.postInputInitializationRecursive(); - return capPressure; -} - - -CapillaryPressureBase & makeVanGenuchtenCapPressureTwoPhase( string const & name, Group & parent ) -{ - VanGenuchtenCapillaryPressure & capPressure = parent.registerGroup< VanGenuchtenCapillaryPressure >( name ); - - string_array & phaseNames = capPressure.getReference< string_array >( CapillaryPressureBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 2 ); - phaseNames[0] = "oil"; phaseNames[1] = "gas"; - - array1d< real64 > & phaseMinSat = capPressure.getReference< array1d< real64 > >( VanGenuchtenCapillaryPressure::viewKeyStruct::phaseMinVolumeFractionString() ); - phaseMinSat.resize( 2 ); - phaseMinSat[0] = 0.04; phaseMinSat[1] = 0.1; - - array1d< real64 > & phaseCapPressureExpInv = capPressure.getReference< array1d< real64 > >( - VanGenuchtenCapillaryPressure::viewKeyStruct::phaseCapPressureExponentInvString() ); - phaseCapPressureExpInv.resize( 2 ); - phaseCapPressureExpInv[0] = 0.4; phaseCapPressureExpInv[1] = 0.5; - - array1d< real64 > & phaseCapPressureMultiplier = capPressure.getReference< array1d< real64 > >( - VanGenuchtenCapillaryPressure::viewKeyStruct::phaseCapPressureMultiplierString() ); - phaseCapPressureMultiplier.resize( 2 ); - phaseCapPressureMultiplier[0] = 0.5; phaseCapPressureMultiplier[1] = 1; - - real64 & capPressureEpsilon = capPressure.getReference< real64 >( VanGenuchtenCapillaryPressure::viewKeyStruct::capPressureEpsilonString() ); - capPressureEpsilon = 1e-4; - - capPressure.postInputInitializationRecursive(); - return capPressure; -} - -CapillaryPressureBase & makeVanGenuchtenCapPressureThreePhase( string const & name, Group & parent ) -{ - VanGenuchtenCapillaryPressure & capPressure = parent.registerGroup< VanGenuchtenCapillaryPressure >( name ); - - string_array & phaseNames = capPressure.getReference< string_array >( CapillaryPressureBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 3 ); - phaseNames[0] = "oil"; phaseNames[1] = "gas"; phaseNames[2] = "water"; - - array1d< real64 > & phaseMinSat = capPressure.getReference< array1d< real64 > >( VanGenuchtenCapillaryPressure::viewKeyStruct::phaseMinVolumeFractionString() ); - phaseMinSat.resize( 3 ); - phaseMinSat[0] = 0.04; phaseMinSat[1] = 0.1; phaseMinSat[2] = 0.; - - array1d< real64 > & phaseCapPressureExpInv = capPressure.getReference< array1d< real64 > >( - VanGenuchtenCapillaryPressure::viewKeyStruct::phaseCapPressureExponentInvString() ); - phaseCapPressureExpInv.resize( 3 ); - phaseCapPressureExpInv[0] = 0.33; phaseCapPressureExpInv[1] = 0.4; phaseCapPressureExpInv[ 2 ] = 0.5; - - array1d< real64 > & phaseCapPressureMultiplier = capPressure.getReference< array1d< real64 > >( - VanGenuchtenCapillaryPressure::viewKeyStruct::phaseCapPressureMultiplierString() ); - phaseCapPressureMultiplier.resize( 3 ); - phaseCapPressureMultiplier[0] = 0.5; phaseCapPressureMultiplier[1] = 1; phaseCapPressureMultiplier[2] = 0.2; - - real64 & capPressureEpsilon = capPressure.getReference< real64 >( VanGenuchtenCapillaryPressure::viewKeyStruct::capPressureEpsilonString() ); - capPressureEpsilon = 1e-4; - - capPressure.postInputInitializationRecursive(); - return capPressure; -} - -CapillaryPressureBase & makeTableCapPressureTwoPhase( string const & name, Group & parent ) -{ - FunctionManager & functionManager = FunctionManager::getInstance(); - - // 1) First, define the tables - - // 1D table, various interpolation methods - localIndex Naxis = 6; - - // Setup table - array1d< real64_array > coordinates; - coordinates.resize( 1 ); - coordinates[0].resize( Naxis ); - coordinates[0][0] = 0.22; - coordinates[0][1] = 0.3; - coordinates[0][2] = 0.5; - coordinates[0][3] = 0.6; - coordinates[0][4] = 0.8; - coordinates[0][5] = 1.0; - - real64_array values( Naxis ); - values[0] = 48263.3; - values[1] = 27579; - values[2] = 20684.3; - values[3] = 13789.5; - values[4] = 6894.76; - values[5] = 3204.28; - - TableFunction & table_w = dynamicCast< TableFunction & >( *functionManager.createChild( "TableFunction", "water_pc" ) ); - table_w.setTableCoordinates( coordinates, { units::Dimensionless } ); - table_w.setTableValues( values, units::Pressure ); - table_w.reInitializeFunction(); - - table_w.setInterpolationMethod( TableFunction::InterpolationType::Linear ); - - // 2) Then set up the constitutive model - - TableCapillaryPressure & capPressure = parent.registerGroup< TableCapillaryPressure >( name ); - - string_array & phaseNames = capPressure.getReference< string_array >( CapillaryPressureBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 2 ); - phaseNames[0] = "water"; phaseNames[1] = "gas"; - - auto & waterTableName = capPressure.getReference< string >( TableCapillaryPressure::viewKeyStruct::wettingNonWettingCapPresTableNameString() ); - waterTableName = "water_pc"; - - capPressure.postInputInitializationRecursive(); - capPressure.initialize(); // to test all the checks - return capPressure; -} - -CapillaryPressureBase & makeTableCapPressureThreePhase( string const & name, Group & parent ) -{ - FunctionManager & functionManager = FunctionManager::getInstance(); - - // 1) First, define the tables - - // 1D table, various interpolation methods - localIndex const Naxis = 6; - - // 1.a) First pair of phases (ow) - - // Setup table - array1d< real64_array > coordinates_w; - coordinates_w.resize( 1 ); - coordinates_w[0].resize( Naxis ); - coordinates_w[0][0] = 0.22; - coordinates_w[0][1] = 0.3; - coordinates_w[0][2] = 0.5; - coordinates_w[0][3] = 0.6; - coordinates_w[0][4] = 0.8; - coordinates_w[0][5] = 1.0; - - real64_array values_w( Naxis ); - values_w[0] = 48263.3; - values_w[1] = 27579; - values_w[2] = 20684.3; - values_w[3] = 13789.5; - values_w[4] = 6894.76; - values_w[5] = 3294.76; - - TableFunction & table_ow_w = dynamicCast< TableFunction & >( *functionManager.createChild( "TableFunction", "water_ow_pc" ) ); - table_ow_w.setTableCoordinates( coordinates_w, { units::Dimensionless } ); - table_ow_w.setTableValues( values_w, units::Pressure ); - table_ow_w.reInitializeFunction(); - - table_ow_w.setInterpolationMethod( TableFunction::InterpolationType::Linear ); - - // 1.a) Second pair of phases (og) - - array1d< real64_array > coordinates_g; - coordinates_g.resize( 1 ); - coordinates_g[0].resize( Naxis ); - coordinates_g[0][0] = 0.0; - coordinates_g[0][1] = 0.04; - coordinates_g[0][2] = 0.1; - coordinates_g[0][3] = 0.2; - coordinates_g[0][4] = 0.7; - coordinates_g[0][5] = 0.78; - - real64_array values_g( Naxis ); - values_g[0] = 0.0; - values_g[1] = 1723.689; - values_g[2] = 3447.38; - values_g[3] = 6894.76; - values_g[4] = 24131.7; - values_g[5] = 26889.6; - - TableFunction & table_og_g = dynamicCast< TableFunction & >( *functionManager.createChild( "TableFunction", "gas_og_pc" ) ); - table_og_g.setTableCoordinates( coordinates_g, { units::Dimensionless } ); - table_og_g.setTableValues( values_g, units::Pressure ); - table_og_g.reInitializeFunction(); - - table_og_g.setInterpolationMethod( TableFunction::InterpolationType::Linear ); - - // 2) Then set up the constitutive model - - TableCapillaryPressure & capPressure = parent.registerGroup< TableCapillaryPressure >( name ); - - string_array & phaseNames = capPressure.getReference< string_array >( CapillaryPressureBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 3 ); - phaseNames[0] = "oil"; phaseNames[1] = "gas"; phaseNames[2] = "water"; - - auto & waterTableName = capPressure.getReference< string >( TableCapillaryPressure::viewKeyStruct::wettingIntermediateCapPresTableNameString() ); - waterTableName = "water_ow_pc"; - - auto & gasTableName = capPressure.getReference< string >( TableCapillaryPressure::viewKeyStruct::nonWettingIntermediateCapPresTableNameString() ); - gasTableName = "gas_og_pc"; - - capPressure.postInputInitializationRecursive(); - capPressure.initialize(); // to test all the checks - return capPressure; -} - -CapillaryPressureBase & makeJFunctionCapPressureTwoPhase( string const & name, Group & parent ) -{ - FunctionManager & functionManager = FunctionManager::getInstance(); - - // 1) First, define the tables - - // 1D table, various interpolation methods - localIndex const Naxis = 10; - - // Setup table - array1d< real64_array > coordinates; - coordinates.resize( 1 ); - coordinates[0].resize( Naxis ); - - coordinates[0][0] = 0.2924; - coordinates[0][1] = 0.3639; - coordinates[0][2] = 0.4354; - coordinates[0][3] = 0.5068; - coordinates[0][4] = 0.5783; - coordinates[0][5] = 0.6498; - coordinates[0][6] = 0.7213; - coordinates[0][7] = 0.7927; - coordinates[0][8] = 0.8642; - coordinates[0][9] = 0.9357; - - real64_array values( Naxis ); - values[0] = 0.3772; - values[1] = 0.0908; - values[2] = 0.0607; - values[3] = 0.0468; - values[4] = 0.0381; - values[5] = 0.0318; - values[6] = 0.0267; - values[7] = 0.0222; - values[8] = 0.0178; - values[9] = 0.0127; - - - TableFunction & table_w = dynamicCast< TableFunction & >( *functionManager.createChild( "TableFunction", "water_jFunction" ) ); - table_w.setTableCoordinates( coordinates, { units::Dimensionless } ); - table_w.setTableValues( values, units::Dimensionless ); - table_w.reInitializeFunction(); - - table_w.setInterpolationMethod( TableFunction::InterpolationType::Linear ); - - // 2) Then set up the constitutive model - - JFunctionCapillaryPressure & capPressure = parent.registerGroup< JFunctionCapillaryPressure >( name ); - - string_array & phaseNames = capPressure.getReference< string_array >( CapillaryPressureBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 2 ); - phaseNames[0] = "water"; phaseNames[1] = "gas"; - - auto & waterTableName = capPressure.getReference< string >( JFunctionCapillaryPressure::viewKeyStruct::wettingNonWettingJFuncTableNameString() ); - waterTableName = "water_jFunction"; - - auto & surfaceTension = capPressure.getReference< real64 >( JFunctionCapillaryPressure::viewKeyStruct::wettingNonWettingSurfaceTensionString() ); - surfaceTension = 23.86955676433857e-3; - - auto & permeabilityDirection = - capPressure.getReference< JFunctionCapillaryPressure::PermeabilityDirection >( JFunctionCapillaryPressure::viewKeyStruct::permeabilityDirectionString() ); - permeabilityDirection = JFunctionCapillaryPressure::PermeabilityDirection::XY; - - capPressure.postInputInitializationRecursive(); - capPressure.initialize(); // to test all the checks - - return capPressure; -} - -CapillaryPressureBase & makeJFunctionCapPressureThreePhase( string const & name, Group & parent ) -{ - FunctionManager & functionManager = FunctionManager::getInstance(); - - // 1) First, define the tables - - // 1D table, various interpolation methods - localIndex const Naxis = 6; - - // 1.a) First pair of phases (ow) - - // Setup table - array1d< real64_array > coordinates_w; - coordinates_w.resize( 1 ); - coordinates_w[0].resize( Naxis ); - coordinates_w[0][0] = 0.22; - coordinates_w[0][1] = 0.3; - coordinates_w[0][2] = 0.5; - coordinates_w[0][3] = 0.6; - coordinates_w[0][4] = 0.8; - coordinates_w[0][5] = 1.0; - - real64_array values_w( Naxis ); - values_w[0] = 0.40203; - values_w[1] = 0.31311; - values_w[2] = 0.22423; - values_w[3] = 0.15011; - values_w[4] = 0.04224; - values_w[5] = 0.00603; - - TableFunction & table_ow_w = dynamicCast< TableFunction & >( *functionManager.createChild( "TableFunction", "water_ow_jFunction" ) ); - table_ow_w.setTableCoordinates( coordinates_w, { units::Dimensionless } ); - table_ow_w.setTableValues( values_w, units::Dimensionless ); - table_ow_w.reInitializeFunction(); - - table_ow_w.setInterpolationMethod( TableFunction::InterpolationType::Linear ); - - // 1.a) Second pair of phases (og) - - array1d< real64_array > coordinates_g; - coordinates_g.resize( 1 ); - coordinates_g[0].resize( Naxis ); - coordinates_g[0][0] = 0.0; - coordinates_g[0][1] = 0.04; - coordinates_g[0][2] = 0.1; - coordinates_g[0][3] = 0.2; - coordinates_g[0][4] = 0.7; - coordinates_g[0][5] = 0.78; - - real64_array values_g( Naxis ); - values_g[0] = 0.0; - values_g[1] = 0.02101; - values_g[2] = 0.11607; - values_g[3] = 0.19103; - values_g[4] = 0.21033; - values_g[5] = 0.27203; - - TableFunction & table_og_g = dynamicCast< TableFunction & >( *functionManager.createChild( "TableFunction", "gas_og_jFunction" ) ); - table_og_g.setTableCoordinates( coordinates_g, { units::Dimensionless } ); - table_og_g.setTableValues( values_g, units::Dimensionless ); - table_og_g.reInitializeFunction(); - - table_og_g.setInterpolationMethod( TableFunction::InterpolationType::Linear ); - - // 2) Then set up the constitutive model - - JFunctionCapillaryPressure & capPressure = parent.registerGroup< JFunctionCapillaryPressure >( name ); - - string_array & phaseNames = capPressure.getReference< string_array >( CapillaryPressureBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 3 ); - phaseNames[0] = "oil"; phaseNames[1] = "gas"; phaseNames[2] = "water"; - - auto & waterTableName = capPressure.getReference< string >( JFunctionCapillaryPressure::viewKeyStruct::wettingIntermediateJFuncTableNameString() ); - waterTableName = "water_ow_jFunction"; - - auto & gasTableName = capPressure.getReference< string >( JFunctionCapillaryPressure::viewKeyStruct::nonWettingIntermediateJFuncTableNameString() ); - gasTableName = "gas_og_jFunction"; - - auto & waterSurfaceTension = capPressure.getReference< real64 >( JFunctionCapillaryPressure::viewKeyStruct::wettingIntermediateSurfaceTensionString() ); - waterSurfaceTension = 23.86955676433857e-3; - - auto & gasSurfaceTension = capPressure.getReference< real64 >( JFunctionCapillaryPressure::viewKeyStruct::nonWettingIntermediateSurfaceTensionString() ); - gasSurfaceTension = 14.24643678933543e-3; - - auto & permeabilityDirection = - capPressure.getReference< JFunctionCapillaryPressure::PermeabilityDirection >( JFunctionCapillaryPressure::viewKeyStruct::permeabilityDirectionString() ); - permeabilityDirection = JFunctionCapillaryPressure::PermeabilityDirection::Z; - - capPressure.postInputInitializationRecursive(); - capPressure.initialize(); // to test all the checks - return capPressure; -} - - -class CapillaryPressureTest : public ConstitutiveTestBase< CapillaryPressureBase > -{ -public: - void test( arraySlice1d< real64 const > const sat, - real64 const eps, - real64 const tol ) - { - arrayView3d< real64 const, USD_CAPPRES > phaseCapPressure; - arrayView4d< real64 const, USD_CAPPRES_DS > dPhaseCapPressure_dPhaseVolFraction; - testNumericalDerivatives( m_parent, - *m_model, - sat, - eps, - tol, - "phaseCapPressure", - [&phaseCapPressure] ( CapillaryPressureBase & relPerm ) - { - phaseCapPressure = relPerm.phaseCapPressure(); - return phaseCapPressure[ 0 ][ 0 ]; - }, - [&dPhaseCapPressure_dPhaseVolFraction] ( CapillaryPressureBase & relPerm ) - { - dPhaseCapPressure_dPhaseVolFraction = relPerm.dPhaseCapPressure_dPhaseVolFraction(); - return dPhaseCapPressure_dPhaseVolFraction[ 0 ][ 0 ]; - } - ); - } -}; - -TEST_F( CapillaryPressureTest, numericalDerivatives_brooksCoreyCapPressureTwoPhase ) -{ - initialize( makeBrooksCoreyCapPressureTwoPhase( "capPressure", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.4; - real64 const endSat = 0.6; - real64 const dS = 1e-1; - - array1d< real64 > sat( 2 ); - - sat[0] = startSat; - sat[1] = 1.0-sat[0]; - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 1 - sat[0]; - } -} - - -TEST_F( CapillaryPressureTest, numericalDerivatives_brooksCoreyCapPressureThreePhase ) -{ - initialize( makeBrooksCoreyCapPressureThreePhase( "capPressure", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.4; - real64 const endSat = 0.6; - real64 const dS = 1e-1; - - array1d< real64 > sat( 3 ); - - sat[0] = startSat; - sat[1] = 0.5*(1-sat[0]); - sat[2] = 1.0-sat[0]-sat[1]; - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 0.5 * ( 1-sat[0] ); - sat[2] = 1.0 - sat[0] - sat[1]; - } -} - - -TEST_F( CapillaryPressureTest, numericalDerivatives_vanGenuchtenCapPressureTwoPhase ) -{ - initialize( makeVanGenuchtenCapPressureTwoPhase( "capPressure", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.4; - real64 const endSat = 0.6; - real64 const dS = 1e-1; - - array1d< real64 > sat( 2 ); - - sat[0] = startSat; - sat[1] = 1-sat[1]; - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 1 - sat[0]; - } - -} - - -TEST_F( CapillaryPressureTest, numericalDerivatives_vanGenuchtenCapPressureThreePhase ) -{ - initialize( makeVanGenuchtenCapPressureThreePhase( "capPressure", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.4; - real64 const endSat = 0.6; - real64 const dS = 1e-1; - - array1d< real64 > sat( 3 ); - - sat[0] = startSat; - sat[1] = 0.5*(1-sat[0]); - sat[2] = 1.0-sat[0]-sat[1]; - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 0.5*(1-sat[0]); - sat[2] = 1 - sat[0] - sat[1]; - } -} - - -TEST_F( CapillaryPressureTest, numericalDerivatives_tableCapPressureTwoPhase ) -{ - initialize( makeTableCapPressureTwoPhase( "capPressure", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.25; - real64 const endSat = 0.75; - real64 const dS = 1e-1; - - array1d< real64 > sat( 2 ); - sat[0] = startSat; sat[1] = 1-sat[0]; - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 1 - sat[0]; - } - -} - - -TEST_F( CapillaryPressureTest, numericalDerivatives_tableCapPressureThreePhase ) -{ - initialize( makeTableCapPressureThreePhase( "capPressure", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.25; - real64 const endSat = 0.75; - real64 const dS = 1e-1; - - array1d< real64 > sat( 3 ); - - sat[0] = startSat; - sat[1] = 0.5*(1-sat[0]); - sat[2] = 1.0-sat[0]-sat[1]; - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 0.5*(1-sat[0]); - sat[2] = 1 - sat[0] - sat[1]; - } -} - -TEST_F( CapillaryPressureTest, numericalDerivatives_jFunctionCapPressureTwoPhase ) -{ - initialize( makeJFunctionCapPressureTwoPhase( "capPressure", m_parent ) ); - - // here, we have to apply a special treatment to this test - // to make sure that the J-function multiplier is initialized using initializeRockState - // this requires calling allocateConstitutiveData in advance (it will be called again later, in the "test" function) - - // setup some values for porosity and permeability - array2d< real64 > porosity; - porosity.resize( 1, 1 ); - porosity[0][0] = 0.13496794266569806; - array3d< real64 > permeability; - permeability.resize( 1, 1, 3 ); - permeability[0][0][0] = 0.1722194e-15; - permeability[0][0][1] = 0.3423156e-15; - permeability[0][0][2] = 0.2324191e-15; - - // initialize the J-function multiplier (done on GPU if GPU is available) - m_model->allocateConstitutiveData( m_parent, 1 ); - m_model->initializeRockState( porosity.toViewConst(), permeability.toViewConst() ); - - // move the multiplier back to the CPU since the test is performed on the CPU - auto & jFuncMultiplier = - m_model->getReference< array2d< real64 > >( fields::cappres::jFuncMultiplier::key() ); - jFuncMultiplier.move( hostMemorySpace, false ); - - // we are ready to proceed to the test - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const start_sat = 0.3; - real64 const end_sat = 0.9; - real64 const dS = 1e-1; - array1d< real64 > sat( 2 ); - sat[0] = start_sat; sat[1] = 1-sat[0]; - while( sat[0] <= end_sat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 1 - sat[0]; - } - -} - -TEST_F( CapillaryPressureTest, numericalDerivatives_jFunctionCapPressureThreePhase ) -{ - initialize( makeJFunctionCapPressureThreePhase( "capPressure", m_parent ) ); - - // here, we have to apply a special treatment to this test - // to make sure that the J-function multiplier is initialized using initializeRockState - // this requires calling allocateConstitutiveData in advance (it will be called again later, in the "test" function) - - // setup some values for porosity and permeability - array2d< real64 > porosity; - porosity.resize( 1, 1 ); - porosity[0][0] = 0.03496794266569806; - array3d< real64 > permeability; - permeability.resize( 1, 1, 3 ); - permeability[0][0][0] = 0.3722194e-15; - permeability[0][0][1] = 0.4423156e-15; - permeability[0][0][2] = 0.2324191e-15; - - // initialize the J-function multiplier (done on the GPU if GPU is available) - m_model->allocateConstitutiveData( m_parent, 1 ); - m_model->initializeRockState( porosity.toViewConst(), permeability.toViewConst() ); - - // move the multiplier back to the CPU since the test is performed on the CPU - auto & jFuncMultiplier = - m_model->getReference< array2d< real64 > >( fields::cappres::jFuncMultiplier::key() ); - jFuncMultiplier.move( hostMemorySpace, false ); - - // we are ready to proceed to the test - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const start_sat = 0.25; - real64 const end_sat = 0.75; - real64 const dS = 1e-1; - array1d< real64 > sat( 3 ); - sat[0] = start_sat; - sat[1] = 0.5*(1-sat[0]); - sat[2] = 1.0-sat[0]-sat[1]; - while( sat[0] <= end_sat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 0.5*(1-sat[0]); - sat[2] = 1 - sat[0] - sat[1]; - } -} - - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - - geos::GeosxState state( geos::basicSetup( argc, argv ) ); - - int const result = RUN_ALL_TESTS(); - - geos::basicCleanup(); - - return result; -} diff --git a/src/coreComponents/integrationTests/constitutiveTests/testDamage.cpp b/src/coreComponents/integrationTests/constitutiveTests/testDamage.cpp deleted file mode 100644 index bde10d2cd48..00000000000 --- a/src/coreComponents/integrationTests/constitutiveTests/testDamage.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#include - -#include "constitutive/ConstitutiveManager.hpp" -#include "constitutive/solid/ElasticIsotropic.hpp" -#include "constitutive/solid/DamageSpectral.hpp" -#include "constitutive/solid/SolidUtilities.hpp" - -// Force inclusion of the .cpp file to ensure catalog registration -#include "constitutive/solid/DamageSpectral.cpp" - -#include "dataRepository/xmlWrapper.hpp" - -using namespace geos; -using namespace ::geos::constitutive; - -TEST( DamageTests, testDamageSpectral ) -{ - // create a model and test xml input - - conduit::Node node; - dataRepository::Group rootGroup( "root", node ); - ConstitutiveManager constitutiveManager( "constitutive", &rootGroup ); - - string const inputStream = - "" - " " - ""; - - xmlWrapper::xmlDocument xmlDocument; - xmlWrapper::xmlResult xmlResult = xmlDocument.loadString( inputStream ); - if( !xmlResult ) - { - GEOS_LOG_RANK_0( "XML parsed with errors!" ); - GEOS_LOG_RANK_0( "Error description: " << xmlResult.description()); - GEOS_LOG_RANK_0( "Error offset: " << xmlResult.offset ); - } - - xmlWrapper::xmlNode xmlConstitutiveNode = xmlDocument.getChild( "Constitutive" ); - constitutiveManager.processInputFileRecursive( xmlDocument, xmlConstitutiveNode ); - constitutiveManager.postInputInitializationRecursive(); - - localIndex constexpr numElem = 2; - localIndex constexpr numQuad = 4; - - dataRepository::Group disc( "discretization", &rootGroup ); - disc.resize( numElem ); - - DamageSpectral< ElasticIsotropic > & cm = constitutiveManager.getConstitutiveRelation< DamageSpectral< ElasticIsotropic > >( "shale" ); - cm.allocateConstitutiveData( disc, numQuad ); - - // confirm allocation sizes - - EXPECT_EQ( cm.size(), numElem ); - EXPECT_EQ( cm.numQuadraturePoints(), numQuad ); - - // use updates class to run a uniaxial load test - - DamageSpectral< ElasticIsotropic >::KernelWrapper cmw = cm.createKernelUpdates(); - - real64 strainIncrement[6] = {1e-4, 0, 0, 0, 0, 0}; - real64 timeIncrement =0; - real64 stress[6]{}; - real64 stiffness[6][6]{}; - - for( localIndex loadstep=0; loadstep < 50; ++loadstep ) - { - cmw.smallStrainUpdate( 0, 0, timeIncrement, strainIncrement, stress, stiffness ); - cm.saveConvergedState(); - } - - // we now use a finite-difference check of tangent stiffness to confirm - // the analytical form is working properly. - EXPECT_TRUE( SolidUtilities::checkSmallStrainStiffness( cmw, 0, 0, timeIncrement, strainIncrement ) ); -} diff --git a/src/coreComponents/integrationTests/constitutiveTests/testRelPerm.cpp b/src/coreComponents/integrationTests/constitutiveTests/testRelPerm.cpp deleted file mode 100644 index ce209d36699..00000000000 --- a/src/coreComponents/integrationTests/constitutiveTests/testRelPerm.cpp +++ /dev/null @@ -1,1111 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -// Source includes -#include "common/DataLayouts.hpp" -#include "constitutive/relativePermeability/unitTests/constitutiveTestHelpers.hpp" -#include "constitutive/relativePermeability/RelativePermeabilityFields.hpp" -#include "mainInterface/GeosxState.hpp" -#include "mainInterface/initialization.hpp" - -using namespace geos; -using namespace geos::testing; -using namespace geos::constitutive; -using namespace geos::constitutive::relperm; -using namespace geos::dataRepository; - -RelativePermeabilityBase & makeBrooksCoreyRelPerm( string const & name, Group & parent ) -{ - BrooksCoreyRelativePermeability & relPerm = parent.registerGroup< BrooksCoreyRelativePermeability >( name ); - - string_array & phaseNames = relPerm.getReference< string_array >( RelativePermeabilityBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 2 ); - phaseNames[0] = "oil"; phaseNames[1] = "gas"; - - array1d< real64 > & phaseMinSat = relPerm.getReference< array1d< real64 > >( BrooksCoreyRelativePermeability::viewKeyStruct::phaseMinVolumeFractionString() ); - phaseMinSat.resize( 2 ); - phaseMinSat[0] = 0.1; phaseMinSat[1] = 0.15; - - array1d< real64 > & phaseRelPermExp = relPerm.getReference< array1d< real64 > >( BrooksCoreyRelativePermeability::viewKeyStruct::phaseRelPermExponentString() ); - phaseRelPermExp.resize( 2 ); - phaseRelPermExp[0] = 2.0; phaseRelPermExp[1] = 2.0; - - array1d< real64 > & phaseRelPermMaxVal = relPerm.getReference< array1d< real64 > >( BrooksCoreyRelativePermeability::viewKeyStruct::phaseRelPermMaxValueString() ); - phaseRelPermMaxVal.resize( 2 ); - phaseRelPermMaxVal[0] = 0.8; phaseRelPermMaxVal[1] = 0.9; - - relPerm.postInputInitializationRecursive(); - return relPerm; -} - -RelativePermeabilityBase & makeBrooksCoreyBakerRelPermTwoPhase( string const & name, Group & parent ) -{ - BrooksCoreyBakerRelativePermeability & relPerm = parent.registerGroup< BrooksCoreyBakerRelativePermeability >( name ); - - string_array & phaseNames = relPerm.getReference< string_array >( RelativePermeabilityBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 2 ); - phaseNames[0] = "water"; phaseNames[1] = "oil"; - - array1d< real64 > & phaseMinSat = relPerm.getReference< array1d< real64 > >( BrooksCoreyBakerRelativePermeability::viewKeyStruct::phaseMinVolumeFractionString() ); - phaseMinSat.resize( 2 ); - phaseMinSat[0] = 0.03; phaseMinSat[1] = 0.01; - - array1d< real64 > & waterOilRelPermExp = relPerm.getReference< array1d< real64 > >( BrooksCoreyBakerRelativePermeability::viewKeyStruct::waterOilRelPermExponentString() ); - waterOilRelPermExp.resize( 2 ); - waterOilRelPermExp[0] = 1.9; waterOilRelPermExp[1] = 3.95; - - array1d< real64 > & waterOilRelPermMaxVal = - relPerm.getReference< array1d< real64 > >( BrooksCoreyBakerRelativePermeability::viewKeyStruct::waterOilRelPermMaxValueString() ); - waterOilRelPermMaxVal.resize( 2 ); - waterOilRelPermMaxVal[0] = 0.8; waterOilRelPermMaxVal[1] = 0.75; - - relPerm.postInputInitializationRecursive(); - return relPerm; -} - -RelativePermeabilityBase & makeBrooksCoreyBakerRelPermThreePhase( string const & name, Group & parent ) -{ - BrooksCoreyBakerRelativePermeability & relPerm = parent.registerGroup< BrooksCoreyBakerRelativePermeability >( name ); - - string_array & phaseNames = relPerm.getReference< string_array >( RelativePermeabilityBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 3 ); - phaseNames[0] = "oil"; phaseNames[1] = "gas"; phaseNames[2] = "water"; - - array1d< real64 > & phaseMinSat = relPerm.getReference< array1d< real64 > >( BrooksCoreyBakerRelativePermeability::viewKeyStruct::phaseMinVolumeFractionString() ); - phaseMinSat.resize( 3 ); - phaseMinSat[0] = 0.03; phaseMinSat[1] = 0.01; phaseMinSat[2] = 0.025; - - array1d< real64 > & waterOilRelPermExp = relPerm.getReference< array1d< real64 > >( BrooksCoreyBakerRelativePermeability::viewKeyStruct::waterOilRelPermExponentString() ); - waterOilRelPermExp.resize( 2 ); - waterOilRelPermExp[0] = 2.4; waterOilRelPermExp[1] = 1.5; - - array1d< real64 > & waterOilRelPermMaxVal = - relPerm.getReference< array1d< real64 > >( BrooksCoreyBakerRelativePermeability::viewKeyStruct::waterOilRelPermMaxValueString() ); - waterOilRelPermMaxVal.resize( 2 ); - waterOilRelPermMaxVal[0] = 0.9; waterOilRelPermMaxVal[1] = 0.65; - - array1d< real64 > & gasOilRelPermExp = relPerm.getReference< array1d< real64 > >( BrooksCoreyBakerRelativePermeability::viewKeyStruct::gasOilRelPermExponentString() ); - gasOilRelPermExp.resize( 2 ); - gasOilRelPermExp[0] = 1.9; gasOilRelPermExp[1] = 3.95; - - array1d< real64 > & gasOilRelPermMaxVal = relPerm.getReference< array1d< real64 > >( BrooksCoreyBakerRelativePermeability::viewKeyStruct::gasOilRelPermMaxValueString() ); - gasOilRelPermMaxVal.resize( 2 ); - gasOilRelPermMaxVal[0] = 0.8; gasOilRelPermMaxVal[1] = 0.95; - - relPerm.postInputInitializationRecursive(); - return relPerm; -} - -RelativePermeabilityBase & makeBrooksCoreyStone2RelPermThreePhase( string const & name, Group & parent ) -{ - BrooksCoreyStone2RelativePermeability & relPerm = parent.registerGroup< BrooksCoreyStone2RelativePermeability >( name ); - - string_array & phaseNames = relPerm.getReference< string_array >( RelativePermeabilityBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 3 ); - phaseNames[0] = "oil"; phaseNames[1] = "gas"; phaseNames[2] = "water"; - - array1d< real64 > & phaseMinSat = relPerm.getReference< array1d< real64 > >( BrooksCoreyStone2RelativePermeability::viewKeyStruct::phaseMinVolumeFractionString() ); - phaseMinSat.resize( 3 ); - phaseMinSat[0] = 0.03; phaseMinSat[1] = 0.01; phaseMinSat[2] = 0.025; - - array1d< real64 > & waterOilRelPermExp = relPerm.getReference< array1d< real64 > >( BrooksCoreyStone2RelativePermeability::viewKeyStruct::waterOilRelPermExponentString() ); - waterOilRelPermExp.resize( 2 ); - waterOilRelPermExp[0] = 2.4; waterOilRelPermExp[1] = 1.5; - - array1d< real64 > & waterOilRelPermMaxVal = - relPerm.getReference< array1d< real64 > >( BrooksCoreyStone2RelativePermeability::viewKeyStruct::waterOilRelPermMaxValueString() ); - waterOilRelPermMaxVal.resize( 2 ); - waterOilRelPermMaxVal[0] = 0.9; waterOilRelPermMaxVal[1] = 0.65; - - array1d< real64 > & gasOilRelPermExp = relPerm.getReference< array1d< real64 > >( BrooksCoreyStone2RelativePermeability::viewKeyStruct::gasOilRelPermExponentString() ); - gasOilRelPermExp.resize( 2 ); - gasOilRelPermExp[0] = 1.9; gasOilRelPermExp[1] = 3.95; - - array1d< real64 > & gasOilRelPermMaxVal = relPerm.getReference< array1d< real64 > >( BrooksCoreyStone2RelativePermeability::viewKeyStruct::gasOilRelPermMaxValueString() ); - gasOilRelPermMaxVal.resize( 2 ); - gasOilRelPermMaxVal[0] = 0.8; gasOilRelPermMaxVal[1] = 0.95; - - relPerm.postInputInitializationRecursive(); - return relPerm; -} - -RelativePermeabilityBase & makeVanGenuchtenBakerRelPermTwoPhase( string const & name, Group & parent ) -{ - VanGenuchtenBakerRelativePermeability & relPerm = parent.registerGroup< VanGenuchtenBakerRelativePermeability >( name ); - - string_array & phaseNames = relPerm.getReference< string_array >( RelativePermeabilityBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 2 ); - phaseNames[0] = "oil"; phaseNames[1] = "gas"; - - array1d< real64 > & phaseMinSat = relPerm.getReference< array1d< real64 > >( VanGenuchtenBakerRelativePermeability::viewKeyStruct::phaseMinVolumeFractionString() ); - phaseMinSat.resize( 2 ); - phaseMinSat[0] = 0.02; phaseMinSat[1] = 0.05; - - array1d< real64 > & gasOilRelPermExpInv = - relPerm.getReference< array1d< real64 > >( VanGenuchtenBakerRelativePermeability::viewKeyStruct::gasOilRelPermExponentInvString() ); - gasOilRelPermExpInv.resize( 2 ); - gasOilRelPermExpInv[0] = 1.7; gasOilRelPermExpInv[1] = 2.15; - - array1d< real64 > & gasOilRelPermMaxVal = relPerm.getReference< array1d< real64 > >( VanGenuchtenBakerRelativePermeability::viewKeyStruct::gasOilRelPermMaxValueString() ); - gasOilRelPermMaxVal.resize( 2 ); - gasOilRelPermMaxVal[0] = 0.5; gasOilRelPermMaxVal[1] = 0.75; - - relPerm.postInputInitializationRecursive(); - return relPerm; -} - -RelativePermeabilityBase & makeVanGenuchtenBakerRelPermThreePhase( string const & name, Group & parent ) -{ - VanGenuchtenBakerRelativePermeability & relPerm = parent.registerGroup< VanGenuchtenBakerRelativePermeability >( name ); - - string_array & phaseNames = relPerm.getReference< string_array >( RelativePermeabilityBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 3 ); - phaseNames[0] = "oil"; phaseNames[1] = "gas"; phaseNames[2] = "water"; - - array1d< real64 > & phaseMinSat = relPerm.getReference< array1d< real64 > >( VanGenuchtenBakerRelativePermeability::viewKeyStruct::phaseMinVolumeFractionString() ); - phaseMinSat.resize( 3 ); - phaseMinSat[0] = 0.03; phaseMinSat[1] = 0.01; phaseMinSat[2] = 0.025; - - array1d< real64 > & waterOilRelPermExpInv = relPerm.getReference< array1d< real64 > >( - VanGenuchtenBakerRelativePermeability::viewKeyStruct::waterOilRelPermExponentInvString() ); - waterOilRelPermExpInv.resize( 2 ); - waterOilRelPermExpInv[0] = 2.4; waterOilRelPermExpInv[1] = 2.5; - - array1d< real64 > & waterOilRelPermMaxVal = - relPerm.getReference< array1d< real64 > >( VanGenuchtenBakerRelativePermeability::viewKeyStruct::waterOilRelPermMaxValueString() ); - waterOilRelPermMaxVal.resize( 2 ); - waterOilRelPermMaxVal[0] = 0.9; waterOilRelPermMaxVal[1] = 0.75; - - array1d< real64 > & gasOilRelPermExpInv = - relPerm.getReference< array1d< real64 > >( VanGenuchtenBakerRelativePermeability::viewKeyStruct::gasOilRelPermExponentInvString() ); - gasOilRelPermExpInv.resize( 2 ); - gasOilRelPermExpInv[0] = 1.9; gasOilRelPermExpInv[1] = 3.95; - - array1d< real64 > & gasOilRelPermMaxVal = relPerm.getReference< array1d< real64 > >( BrooksCoreyBakerRelativePermeability::viewKeyStruct::gasOilRelPermMaxValueString() ); - gasOilRelPermMaxVal.resize( 2 ); - gasOilRelPermMaxVal[0] = 0.8; gasOilRelPermMaxVal[1] = 0.75; - - relPerm.postInputInitializationRecursive(); - return relPerm; -} - -RelativePermeabilityBase & makeVanGenuchtenStone2RelPermThreePhase( string const & name, Group & parent ) -{ - VanGenuchtenStone2RelativePermeability & relPerm = parent.registerGroup< VanGenuchtenStone2RelativePermeability >( name ); - - string_array & phaseNames = relPerm.getReference< string_array >( RelativePermeabilityBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 3 ); - phaseNames[0] = "oil"; phaseNames[1] = "gas"; phaseNames[2] = "water"; - - array1d< real64 > & phaseMinSat = relPerm.getReference< array1d< real64 > >( VanGenuchtenStone2RelativePermeability::viewKeyStruct::phaseMinVolumeFractionString() ); - phaseMinSat.resize( 3 ); - phaseMinSat[0] = 0.03; phaseMinSat[1] = 0.01; phaseMinSat[2] = 0.025; - - array1d< real64 > & waterOilRelPermExpInv = relPerm.getReference< array1d< real64 > >( - VanGenuchtenStone2RelativePermeability::viewKeyStruct::waterOilRelPermExponentInvString() ); - waterOilRelPermExpInv.resize( 2 ); - waterOilRelPermExpInv[0] = 2.4; waterOilRelPermExpInv[1] = 2.5; - - array1d< real64 > & waterOilRelPermMaxVal = - relPerm.getReference< array1d< real64 > >( VanGenuchtenStone2RelativePermeability::viewKeyStruct::waterOilRelPermMaxValueString() ); - waterOilRelPermMaxVal.resize( 2 ); - waterOilRelPermMaxVal[0] = 0.9; waterOilRelPermMaxVal[1] = 0.75; - - array1d< real64 > & gasOilRelPermExpInv = - relPerm.getReference< array1d< real64 > >( VanGenuchtenStone2RelativePermeability::viewKeyStruct::gasOilRelPermExponentInvString() ); - gasOilRelPermExpInv.resize( 2 ); - gasOilRelPermExpInv[0] = 1.9; gasOilRelPermExpInv[1] = 3.95; - - array1d< real64 > & gasOilRelPermMaxVal = relPerm.getReference< array1d< real64 > >( BrooksCoreyStone2RelativePermeability::viewKeyStruct::gasOilRelPermMaxValueString() ); - gasOilRelPermMaxVal.resize( 2 ); - gasOilRelPermMaxVal[0] = 0.8; gasOilRelPermMaxVal[1] = 0.75; - - relPerm.postInputInitializationRecursive(); - return relPerm; -} - -RelativePermeabilityBase & makeTableRelPermTwoPhase( string const & name, Group & parent ) -{ - // 1) First, define the tables (to values that matters for our use cases) - - // 1D table, various interpolation methods - localIndex Naxis = 41; - - // Setup table - array1d< real64_array > coordinates_w; - coordinates_w.resize( 1 ); - coordinates_w[0].resize( Naxis ); - - coordinates_w[0][0] = 3.000000e-1; - coordinates_w[0][1] = 3.175000e-1; - coordinates_w[0][2] = 3.350000e-1; - coordinates_w[0][3] = 3.525000e-1; - coordinates_w[0][4] = 3.700000e-1; - coordinates_w[0][5] = 3.875000e-1; - coordinates_w[0][6] = 4.050000e-1; - coordinates_w[0][7] = 4.225000e-1; - coordinates_w[0][8] = 4.400000e-1; - coordinates_w[0][9] = 4.575000e-1; - coordinates_w[0][10] = 4.750000e-1; - coordinates_w[0][11] = 4.925000e-1; - coordinates_w[0][12] = 5.100000e-1; - coordinates_w[0][13] = 5.275000e-1; - coordinates_w[0][14] = 5.450000e-1; - coordinates_w[0][15] = 5.625000e-1; - coordinates_w[0][16] = 5.800000e-1; - coordinates_w[0][17] = 5.975000e-1; - coordinates_w[0][18] = 6.150000e-1; - coordinates_w[0][19] = 6.325000e-1; - coordinates_w[0][20] = 6.500000e-1; - coordinates_w[0][21] = 6.675000e-1; - coordinates_w[0][22] = 6.850000e-1; - coordinates_w[0][23] = 7.025000e-1; - coordinates_w[0][24] = 7.200000e-1; - coordinates_w[0][25] = 7.375000e-1; - coordinates_w[0][26] = 7.550000e-1; - coordinates_w[0][27] = 7.725000e-1; - coordinates_w[0][28] = 7.900000e-1; - coordinates_w[0][29] = 8.054617e-1; - coordinates_w[0][30] = 8.209233e-1; - coordinates_w[0][31] = 8.404617e-1; - coordinates_w[0][32] = 8.600000e-1; - coordinates_w[0][33] = 8.775000e-1; - coordinates_w[0][34] = 8.950000e-1; - coordinates_w[0][35] = 9.125000e-1; - coordinates_w[0][36] = 9.300000e-1; - coordinates_w[0][37] = 9.475000e-1; - coordinates_w[0][38] = 9.650000e-1; - coordinates_w[0][39] = 9.825000e-1; - coordinates_w[0][40] = 1.000000; - - array1d< real64_array > coordinates_g; - coordinates_g.resize( 1 ); - coordinates_g[0].resize( Naxis ); - - coordinates_g[0][0] = 0.000000; - coordinates_g[0][1] = 1.750000e-2; - coordinates_g[0][2] = 3.500000e-2; - coordinates_g[0][3] = 5.250000e-2; - coordinates_g[0][4] = 7.000000e-2; - coordinates_g[0][5] = 8.750000e-2; - coordinates_g[0][6] = 1.050000e-1; - coordinates_g[0][7] = 1.225000e-1; - coordinates_g[0][8] = 1.400000e-1; - coordinates_g[0][9] = 1.595383e-1; - coordinates_g[0][10] = 1.790767e-1; - coordinates_g[0][11] = 1.945383e-1; - coordinates_g[0][12] = 2.100000e-1; - coordinates_g[0][13] = 2.275000e-1; - coordinates_g[0][14] = 2.450000e-1; - coordinates_g[0][15] = 2.625000e-1; - coordinates_g[0][16] = 2.800000e-1; - coordinates_g[0][17] = 2.975000e-1; - coordinates_g[0][18] = 3.150000e-1; - coordinates_g[0][19] = 3.325000e-1; - coordinates_g[0][20] = 3.500000e-1; - coordinates_g[0][21] = 3.675000e-1; - coordinates_g[0][22] = 3.850000e-1; - coordinates_g[0][23] = 4.025000e-1; - coordinates_g[0][24] = 4.200000e-1; - coordinates_g[0][25] = 4.375000e-1; - coordinates_g[0][26] = 4.550000e-1; - coordinates_g[0][27] = 4.725000e-1; - coordinates_g[0][28] = 4.900000e-1; - coordinates_g[0][29] = 5.075000e-1; - coordinates_g[0][30] = 5.250000e-1; - coordinates_g[0][31] = 5.425000e-1; - coordinates_g[0][32] = 5.600000e-1; - coordinates_g[0][33] = 5.775000e-1; - coordinates_g[0][34] = 5.950000e-1; - coordinates_g[0][35] = 6.125000e-1; - coordinates_g[0][36] = 6.300000e-1; - coordinates_g[0][37] = 6.475000e-1; - coordinates_g[0][38] = 6.650000e-1; - coordinates_g[0][39] = 6.825000e-1; - coordinates_g[0][40] = 7.000000e-1; - - real64_array values_w( Naxis ); - values_w[0] = 0.000000; - values_w[1] = 1.069690e-7; - values_w[2] = 1.523818e-6; - values_w[3] = 7.304599e-6; - values_w[4] = 2.242961e-5; - values_w[5] = 5.398050e-5; - values_w[6] = 1.113999e-4; - values_w[7] = 2.068239e-4; - values_w[8] = 3.554932e-4; - values_w[9] = 5.762517e-4; - values_w[10] = 8.921512e-4; - values_w[11] = 1.331180e-3; - values_w[12] = 1.927144e-3; - values_w[13] = 2.720726e-3; - values_w[14] = 3.760776e-3; - values_w[15] = 5.105868e-3; - values_w[16] = 6.826186e-3; - values_w[17] = 9.005830e-3; - values_w[18] = 1.174561e-2; - values_w[19] = 1.516648e-2; - values_w[20] = 1.941368e-2; - values_w[21] = 2.466185e-2; - values_w[22] = 3.112128e-2; - values_w[23] = 3.904542e-2; - values_w[24] = 4.874017e-2; - values_w[25] = 6.057494e-2; - values_w[26] = 7.499593e-2; - values_w[27] = 9.254174e-2; - values_w[28] = 1.138611e-1; - values_w[29] = 1.364565e-1; - values_w[30] = 1.632363e-1; - values_w[31] = 2.042135e-1; - values_w[32] = 2.547712e-1; - values_w[33] = 3.097943e-1; - values_w[34] = 3.755964e-1; - values_w[35] = 4.536528e-1; - values_w[36] = 5.451093e-1; - values_w[37] = 6.502388e-1; - values_w[38] = 7.674166e-1; - values_w[39] = 8.909226e-1; - values_w[40] = 1.000000; - - real64_array values_g( Naxis ); - values_g[0] = 0.000000; - values_g[1] = 8.885248e-4; - values_g[2] = 2.483741e-3; - values_g[3] = 4.583224e-3; - values_g[4] = 7.135315e-3; - values_g[5] = 1.012132e-2; - values_g[6] = 1.353719e-2; - values_g[7] = 1.738728e-2; - values_g[8] = 2.168159e-2; - values_g[9] = 2.701850e-2; - values_g[10] = 3.295183e-2; - values_g[11] = 3.808925e-2; - values_g[12] = 4.363513e-2; - values_g[13] = 5.042783e-2; - values_g[14] = 5.779578e-2; - values_g[15] = 6.577020e-2; - values_g[16] = 7.438478e-2; - values_g[17] = 8.367565e-2; - values_g[18] = 9.368138e-2; - values_g[19] = 1.044429e-1; - values_g[20] = 1.160032e-1; - values_g[21] = 1.284076e-1; - values_g[22] = 1.417029e-1; - values_g[23] = 1.559376e-1; - values_g[24] = 1.711607e-1; - values_g[25] = 1.874214e-1; - values_g[26] = 2.047679e-1; - values_g[27] = 2.232459e-1; - values_g[28] = 2.428968e-1; - values_g[29] = 2.637550e-1; - values_g[30] = 2.858446e-1; - values_g[31] = 3.091747e-1; - values_g[32] = 3.337331e-1; - values_g[33] = 3.594782e-1; - values_g[34] = 3.863263e-1; - values_g[35] = 4.141347e-1; - values_g[36] = 4.426735e-1; - values_g[37] = 4.715782e-1; - values_g[38] = 5.002513e-1; - values_g[39] = 5.275887e-1; - values_g[40] = 5.500000e-1; - - initializeTable( "water_swg", - coordinates_w, - values_w ); - initializeTable( "gas_swg", - coordinates_g, - values_g ); - - // 2) Then set up the constitutive model - - auto & relPerm = parent.registerGroup< TableRelativePermeability >( name ); - - auto & phaseNames = relPerm.getReference< string_array >( RelativePermeabilityBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 2 ); - phaseNames[0] = "water"; phaseNames[1] = "gas"; - - auto & waterOilTableNames = relPerm.getReference< string_array >( TableRelativePermeability::viewKeyStruct::wettingNonWettingRelPermTableNamesString() ); - waterOilTableNames.resize( 2 ); - waterOilTableNames[0] = "water_swg"; waterOilTableNames[1] = "gas_swg"; - - relPerm.postInputInitializationRecursive(); - relPerm.initialize(); // to test all the checks - return relPerm; -} - -RelativePermeabilityBase & makeTableRelPermHysteresisTwoPhase( string const & name, Group & parent ) -{ - // 1) First, define the tables (to values that matters for our use cases) - - // 1D table, various interpolation methods - localIndex Naxis = 41; - - // Setup table - array1d< real64_array > coordinates_w; - coordinates_w.resize( 1 ); - coordinates_w[0].resize( Naxis ); - - coordinates_w[0][0] = 3.000000e-1; - coordinates_w[0][1] = 3.175000e-1; - coordinates_w[0][2] = 3.350000e-1; - coordinates_w[0][3] = 3.525000e-1; - coordinates_w[0][4] = 3.700000e-1; - coordinates_w[0][5] = 3.875000e-1; - coordinates_w[0][6] = 4.050000e-1; - coordinates_w[0][7] = 4.225000e-1; - coordinates_w[0][8] = 4.400000e-1; - coordinates_w[0][9] = 4.575000e-1; - coordinates_w[0][10] = 4.750000e-1; - coordinates_w[0][11] = 4.925000e-1; - coordinates_w[0][12] = 5.100000e-1; - coordinates_w[0][13] = 5.275000e-1; - coordinates_w[0][14] = 5.450000e-1; - coordinates_w[0][15] = 5.625000e-1; - coordinates_w[0][16] = 5.800000e-1; - coordinates_w[0][17] = 5.975000e-1; - coordinates_w[0][18] = 6.150000e-1; - coordinates_w[0][19] = 6.325000e-1; - coordinates_w[0][20] = 6.500000e-1; - coordinates_w[0][21] = 6.675000e-1; - coordinates_w[0][22] = 6.850000e-1; - coordinates_w[0][23] = 7.025000e-1; - coordinates_w[0][24] = 7.200000e-1; - coordinates_w[0][25] = 7.375000e-1; - coordinates_w[0][26] = 7.550000e-1; - coordinates_w[0][27] = 7.725000e-1; - coordinates_w[0][28] = 7.900000e-1; - coordinates_w[0][29] = 8.054617e-1; - coordinates_w[0][30] = 8.209233e-1; - coordinates_w[0][31] = 8.404617e-1; - coordinates_w[0][32] = 8.600000e-1; - coordinates_w[0][33] = 8.775000e-1; - coordinates_w[0][34] = 8.950000e-1; - coordinates_w[0][35] = 9.125000e-1; - coordinates_w[0][36] = 9.300000e-1; - coordinates_w[0][37] = 9.475000e-1; - coordinates_w[0][38] = 9.650000e-1; - coordinates_w[0][39] = 9.825000e-1; - coordinates_w[0][40] = 1.000000; - - array1d< real64_array > coordinates_g; - coordinates_g.resize( 1 ); - coordinates_g[0].resize( Naxis ); - - coordinates_g[0][0] = 0.000000; - coordinates_g[0][1] = 1.750000e-2; - coordinates_g[0][2] = 3.500000e-2; - coordinates_g[0][3] = 5.250000e-2; - coordinates_g[0][4] = 7.000000e-2; - coordinates_g[0][5] = 8.750000e-2; - coordinates_g[0][6] = 1.050000e-1; - coordinates_g[0][7] = 1.225000e-1; - coordinates_g[0][8] = 1.400000e-1; - coordinates_g[0][9] = 1.595383e-1; - coordinates_g[0][10] = 1.790767e-1; - coordinates_g[0][11] = 1.945383e-1; - coordinates_g[0][12] = 2.100000e-1; - coordinates_g[0][13] = 2.275000e-1; - coordinates_g[0][14] = 2.450000e-1; - coordinates_g[0][15] = 2.625000e-1; - coordinates_g[0][16] = 2.800000e-1; - coordinates_g[0][17] = 2.975000e-1; - coordinates_g[0][18] = 3.150000e-1; - coordinates_g[0][19] = 3.325000e-1; - coordinates_g[0][20] = 3.500000e-1; - coordinates_g[0][21] = 3.675000e-1; - coordinates_g[0][22] = 3.850000e-1; - coordinates_g[0][23] = 4.025000e-1; - coordinates_g[0][24] = 4.200000e-1; - coordinates_g[0][25] = 4.375000e-1; - coordinates_g[0][26] = 4.550000e-1; - coordinates_g[0][27] = 4.725000e-1; - coordinates_g[0][28] = 4.900000e-1; - coordinates_g[0][29] = 5.075000e-1; - coordinates_g[0][30] = 5.250000e-1; - coordinates_g[0][31] = 5.425000e-1; - coordinates_g[0][32] = 5.600000e-1; - coordinates_g[0][33] = 5.775000e-1; - coordinates_g[0][34] = 5.950000e-1; - coordinates_g[0][35] = 6.125000e-1; - coordinates_g[0][36] = 6.300000e-1; - coordinates_g[0][37] = 6.475000e-1; - coordinates_g[0][38] = 6.650000e-1; - coordinates_g[0][39] = 6.825000e-1; - coordinates_g[0][40] = 7.000000e-1; - - real64_array drainageValues_w( Naxis ); - drainageValues_w[0] = 0.000000; - drainageValues_w[1] = 1.069690e-7; - drainageValues_w[2] = 1.523818e-6; - drainageValues_w[3] = 7.304599e-6; - drainageValues_w[4] = 2.242961e-5; - drainageValues_w[5] = 5.398050e-5; - drainageValues_w[6] = 1.113999e-4; - drainageValues_w[7] = 2.068239e-4; - drainageValues_w[8] = 3.554932e-4; - drainageValues_w[9] = 5.762517e-4; - drainageValues_w[10] = 8.921512e-4; - drainageValues_w[11] = 1.331180e-3; - drainageValues_w[12] = 1.927144e-3; - drainageValues_w[13] = 2.720726e-3; - drainageValues_w[14] = 3.760776e-3; - drainageValues_w[15] = 5.105868e-3; - drainageValues_w[16] = 6.826186e-3; - drainageValues_w[17] = 9.005830e-3; - drainageValues_w[18] = 1.174561e-2; - drainageValues_w[19] = 1.516648e-2; - drainageValues_w[20] = 1.941368e-2; - drainageValues_w[21] = 2.466185e-2; - drainageValues_w[22] = 3.112128e-2; - drainageValues_w[23] = 3.904542e-2; - drainageValues_w[24] = 4.874017e-2; - drainageValues_w[25] = 6.057494e-2; - drainageValues_w[26] = 7.499593e-2; - drainageValues_w[27] = 9.254174e-2; - drainageValues_w[28] = 1.138611e-1; - drainageValues_w[29] = 1.364565e-1; - drainageValues_w[30] = 1.632363e-1; - drainageValues_w[31] = 2.042135e-1; - drainageValues_w[32] = 2.547712e-1; - drainageValues_w[33] = 3.097943e-1; - drainageValues_w[34] = 3.755964e-1; - drainageValues_w[35] = 4.536528e-1; - drainageValues_w[36] = 5.451093e-1; - drainageValues_w[37] = 6.502388e-1; - drainageValues_w[38] = 7.674166e-1; - drainageValues_w[39] = 8.909226e-1; - drainageValues_w[40] = 1.000000; - - real64_array drainageValues_g( Naxis ); - drainageValues_g[0] = 0.000000; - drainageValues_g[1] = 8.885248e-4; - drainageValues_g[2] = 2.483741e-3; - drainageValues_g[3] = 4.583224e-3; - drainageValues_g[4] = 7.135315e-3; - drainageValues_g[5] = 1.012132e-2; - drainageValues_g[6] = 1.353719e-2; - drainageValues_g[7] = 1.738728e-2; - drainageValues_g[8] = 2.168159e-2; - drainageValues_g[9] = 2.701850e-2; - drainageValues_g[10] = 3.295183e-2; - drainageValues_g[11] = 3.808925e-2; - drainageValues_g[12] = 4.363513e-2; - drainageValues_g[13] = 5.042783e-2; - drainageValues_g[14] = 5.779578e-2; - drainageValues_g[15] = 6.577020e-2; - drainageValues_g[16] = 7.438478e-2; - drainageValues_g[17] = 8.367565e-2; - drainageValues_g[18] = 9.368138e-2; - drainageValues_g[19] = 1.044429e-1; - drainageValues_g[20] = 1.160032e-1; - drainageValues_g[21] = 1.284076e-1; - drainageValues_g[22] = 1.417029e-1; - drainageValues_g[23] = 1.559376e-1; - drainageValues_g[24] = 1.711607e-1; - drainageValues_g[25] = 1.874214e-1; - drainageValues_g[26] = 2.047679e-1; - drainageValues_g[27] = 2.232459e-1; - drainageValues_g[28] = 2.428968e-1; - drainageValues_g[29] = 2.637550e-1; - drainageValues_g[30] = 2.858446e-1; - drainageValues_g[31] = 3.091747e-1; - drainageValues_g[32] = 3.337331e-1; - drainageValues_g[33] = 3.594782e-1; - drainageValues_g[34] = 3.863263e-1; - drainageValues_g[35] = 4.141347e-1; - drainageValues_g[36] = 4.426735e-1; - drainageValues_g[37] = 4.715782e-1; - drainageValues_g[38] = 5.002513e-1; - drainageValues_g[39] = 5.275887e-1; - drainageValues_g[40] = 5.500000e-1; - - real64_array imbibitionValues_w( Naxis ); - imbibitionValues_w[0] = 0.000000e+00; - imbibitionValues_w[1] = 9.694414e-08; - imbibitionValues_w[2] = 1.389786e-06; - imbibitionValues_w[3] = 6.683601e-06; - imbibitionValues_w[4] = 2.056452e-05; - imbibitionValues_w[5] = 4.956378e-05; - imbibitionValues_w[6] = 1.024025e-04; - imbibitionValues_w[7] = 1.903088e-04; - imbibitionValues_w[8] = 3.274125e-04; - imbibitionValues_w[9] = 5.312305e-04; - imbibitionValues_w[10] = 8.232582e-04; - imbibitionValues_w[11] = 1.229689e-03; - imbibitionValues_w[12] = 1.782290e-03; - imbibitionValues_w[13] = 2.519464e-03; - imbibitionValues_w[14] = 3.487546e-03; - imbibitionValues_w[15] = 4.742375e-03; - imbibitionValues_w[16] = 6.351222e-03; - imbibitionValues_w[17] = 8.395131e-03; - imbibitionValues_w[18] = 1.097180e-02; - imbibitionValues_w[19] = 1.419912e-02; - imbibitionValues_w[20] = 1.821946e-02; - imbibitionValues_w[21] = 2.320510e-02; - imbibitionValues_w[22] = 2.936477e-02; - imbibitionValues_w[23] = 3.695197e-02; - imbibitionValues_w[24] = 4.627535e-02; - imbibitionValues_w[25] = 5.771200e-02; - imbibitionValues_w[26] = 7.172484e-02; - imbibitionValues_w[27] = 8.888631e-02; - imbibitionValues_w[28] = 1.099126e-01; - imbibitionValues_w[29] = 1.357180e-01; - imbibitionValues_w[30] = 1.675125e-01; - imbibitionValues_w[31] = 2.070136e-01; - imbibitionValues_w[32] = 2.570525e-01; - imbibitionValues_w[33] = 2.925846e-01; - imbibitionValues_w[34] = 3.388685e-01; - imbibitionValues_w[35] = 4.766042e-01; - imbibitionValues_w[36] = 6.143399e-01; - imbibitionValues_w[37] = 7.107549e-01; - imbibitionValues_w[38] = 8.071700e-01; - imbibitionValues_w[39] = 9.035850e-01; - imbibitionValues_w[40] = 1.000000e+00; - - real64_array imbibitionValues_g( Naxis ); - imbibitionValues_g[0] = 0.0; - imbibitionValues_g[1] = 0.0; - imbibitionValues_g[2] = 0.0; - imbibitionValues_g[3] = 0.0; - imbibitionValues_g[4] = 0.0; - imbibitionValues_g[5] = 0.0; - imbibitionValues_g[6] = 0.0; - imbibitionValues_g[7] = 5.152637e-4; - imbibitionValues_g[8] = 1.428207e-3; - imbibitionValues_g[9] = 3.657727e-3; - imbibitionValues_g[10] = 6.571357e-3; - imbibitionValues_g[11] = 1.012132e-2; - imbibitionValues_g[12] = 1.429788e-2; - imbibitionValues_g[13] = 1.910963e-2; - imbibitionValues_g[14] = 2.457655e-2; - imbibitionValues_g[15] = 3.072685e-2; - imbibitionValues_g[16] = 3.759556e-2; - imbibitionValues_g[17] = 4.522366e-2; - imbibitionValues_g[18] = 5.365776e-2; - imbibitionValues_g[19] = 6.294985e-2; - imbibitionValues_g[20] = 7.315719e-2; - imbibitionValues_g[21] = 8.434230e-2; - imbibitionValues_g[22] = 9.657278e-2; - imbibitionValues_g[23] = 1.099212e-1; - imbibitionValues_g[24] = 1.244648e-1; - imbibitionValues_g[25] = 1.402848e-1; - imbibitionValues_g[26] = 1.574657e-1; - imbibitionValues_g[27] = 1.760938e-1; - imbibitionValues_g[28] = 1.962552e-1; - imbibitionValues_g[29] = 2.180330e-1; - imbibitionValues_g[30] = 2.415032e-1; - imbibitionValues_g[31] = 2.667283e-1; - imbibitionValues_g[32] = 2.937494e-1; - imbibitionValues_g[33] = 3.225741e-1; - imbibitionValues_g[34] = 3.531589e-1; - imbibitionValues_g[35] = 3.853835e-1; - imbibitionValues_g[36] = 4.190112e-1; - imbibitionValues_g[37] = 4.536200e-1; - imbibitionValues_g[38] = 4.884681e-1; - imbibitionValues_g[39] = 5.221327e-1; - imbibitionValues_g[40] = 5.500000e-1; - - initializeTable( "drainageWater_swg", - coordinates_w, - drainageValues_w ); - initializeTable( "imbibitionWater_swg", - coordinates_w, - imbibitionValues_w ); - initializeTable( "drainageGas_swg", - coordinates_g, - drainageValues_g ); - initializeTable( "imbibitionGas_swg", - coordinates_g, - imbibitionValues_g ); - - // 2) Then set up the constitutive model - - auto & relPerm = parent.registerGroup< TableRelativePermeabilityHysteresis >( name ); - - auto & phaseNames = relPerm.getReference< string_array >( RelativePermeabilityBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 2 ); - phaseNames[0] = "water"; phaseNames[1] = "gas"; - - using keys = TableRelativePermeabilityHysteresis::viewKeyStruct; - - auto & drainageWaterGasTableNames = relPerm.getReference< string_array >( keys::drainageWettingNonWettingRelPermTableNamesString() ); - drainageWaterGasTableNames.resize( 2 ); - drainageWaterGasTableNames[0] = "drainageWater_swg"; drainageWaterGasTableNames[1] = "drainageGas_swg"; - - auto & imbibitionWaterTableName = relPerm.getReference< string >( keys::imbibitionWettingRelPermTableNameString() ); - imbibitionWaterTableName = "imbibitionWater_swg"; - - auto & imbibitionGasTableName = relPerm.getReference< string >( keys::imbibitionNonWettingRelPermTableNameString() ); - imbibitionGasTableName = "imbibitionGas_swg"; - - relPerm.allocateConstitutiveData( parent, 1 ); - relPerm.postInputInitializationRecursive(); - relPerm.initialize(); // to test all the checks - return relPerm; -} - - - -RelativePermeabilityBase & makeTableRelPermThreePhase( string const & name, Group & parent ) -{ - // 1) First, define the tables - - // 1D table, various interpolation methods - localIndex Naxis = 6; - - // 1.a) First pair of phases (ow) - - // Setup table - array1d< real64_array > coordinates; - coordinates.resize( 1 ); - coordinates[0].resize( Naxis ); - coordinates[0][0] = 0.0; - coordinates[0][1] = 0.11; - coordinates[0][2] = 0.23; - coordinates[0][3] = 0.54; - coordinates[0][4] = 0.85; - coordinates[0][5] = 1.0; - - real64_array values( Naxis ); - for( localIndex i = 0; i < coordinates[0].size(); ++i ) - { - values[i] = coordinates[0][i]*coordinates[0][i]; - } - - initializeTable( "water_swof", - coordinates, - values ); - initializeTable( "oil_swof", - coordinates, - values ); - - // 1.a) Second pair of phases (og) - - coordinates[0].resize( Naxis ); - coordinates[0][0] = 0.0; - coordinates[0][1] = 0.01; - coordinates[0][2] = 0.23; - coordinates[0][3] = 0.44; - coordinates[0][4] = 0.83; - coordinates[0][5] = 1.0; - - for( localIndex i = 0; i < coordinates[0].size(); ++i ) - { - values[i] = coordinates[0][i]*coordinates[0][i]*coordinates[0][i]; - } - - initializeTable( "gas_sgof", - coordinates, - values ); - initializeTable( "oil_sgof", - coordinates, - values ); - - // 2) Then set up the constitutive model - - auto & relPerm = parent.registerGroup< TableRelativePermeability >( name ); - - auto & interpolatorFlag = relPerm.getReference< ThreePhaseInterpolator >( - TableRelativePermeability::viewKeyStruct::threePhaseInterpolatorString() ); - interpolatorFlag = ThreePhaseInterpolator::STONEII; - - auto & phaseNames = relPerm.getReference< string_array >( RelativePermeabilityBase::viewKeyStruct::phaseNamesString() ); - phaseNames.resize( 3 ); - phaseNames[0] = "oil"; phaseNames[1] = "water"; phaseNames[2] = "gas"; - - auto & waterOilTableNames = relPerm.getReference< string_array >( TableRelativePermeability::viewKeyStruct::wettingIntermediateRelPermTableNamesString() ); - waterOilTableNames.resize( 2 ); - waterOilTableNames[0] = "water_swof"; waterOilTableNames[1] = "oil_swof"; - - auto & gasOilTableNames = relPerm.getReference< string_array >( TableRelativePermeability::viewKeyStruct::nonWettingIntermediateRelPermTableNamesString() ); - gasOilTableNames.resize( 2 ); - gasOilTableNames[0] = "gas_sgof"; gasOilTableNames[1] = "oil_sgof"; - - relPerm.postInputInitializationRecursive(); - relPerm.initialize(); // to test all the checks - return relPerm; -} - -class RelPermTest : public ConstitutiveTestBase< RelativePermeabilityBase > -{ -public: - void test( arraySlice1d< real64 const > const sat, - real64 const eps, - real64 const tol ) - { - arrayView3d< real64 const, USD_RELPERM > phaseRelPerm; - arrayView4d< real64 const, USD_RELPERM_DS > dPhaseRelPerm_dPhaseVolFraction; - testNumericalDerivatives( m_parent, - *m_model, - sat, - eps, - tol, - "phaseRelPerm", - [&phaseRelPerm] ( RelativePermeabilityBase & relPerm ) - { - phaseRelPerm = relPerm.phaseRelPerm(); - return phaseRelPerm[ 0 ][ 0 ]; - }, - [&dPhaseRelPerm_dPhaseVolFraction] ( RelativePermeabilityBase & relPerm ) - { - dPhaseRelPerm_dPhaseVolFraction = relPerm.dPhaseRelPerm_dPhaseVolFraction(); - return dPhaseRelPerm_dPhaseVolFraction[ 0 ][ 0 ]; - } - ); - } -}; - -TEST_F( RelPermTest, numericalDerivatives_brooksCoreyRelPerm ) -{ - initialize( makeBrooksCoreyRelPerm( "relPerm", m_parent ) ); - - array1d< real64 > sat( 2 ); - sat[0] = 0.7; - sat[1] = 0.3; - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - test( sat, eps, tol ); -} - -TEST_F( RelPermTest, numericalDerivatives_BrooksCoreyBakerRelPermTwoPhase ) -{ - initialize( makeBrooksCoreyBakerRelPermTwoPhase( "relPerm", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.3; - real64 const endSat = 0.7; - real64 const dS = 1e-1; - - array1d< real64 > sat( 2 ); - - sat[0] = startSat; - sat[1] = 1.0-sat[0]; - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 1-sat[0]; - } -} - -TEST_F( RelPermTest, numericalDerivatives_BrooksCoreyBakerRelPermThreePhase ) -{ - initialize( makeBrooksCoreyBakerRelPermThreePhase( "relPerm", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.3; - real64 const endSat = 0.7; - real64 const dS = 1e-1; - real64 const alpha = 0.4; - - array1d< real64 > sat( 3 ); - - sat[0] = startSat; - sat[1] = alpha*(1.0-sat[0]); - sat[2] = (1-alpha)*(1.0-sat[0]); - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = alpha *(1-sat[0]); - sat[2] = (1-alpha) *(1-sat[0]); - } -} - -TEST_F( RelPermTest, numericalDerivatives_BrooksCoreyStone2RelPermThreePhase ) -{ - initialize( makeBrooksCoreyStone2RelPermThreePhase( "relPerm", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.3; - real64 const endSat = 0.7; - real64 const dS = 1e-1; - real64 const alpha = 0.4; - - array1d< real64 > sat( 3 ); - - sat[0] = startSat; - sat[1] = alpha*(1.0-sat[0]); - sat[2] = (1-alpha)*(1.0-sat[0]); - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = alpha *(1-sat[0]); - sat[2] = (1-alpha) *(1-sat[0]); - } -} - -TEST_F( RelPermTest, numericalDerivatives_VanGenuchtenBakerRelPermTwoPhase ) -{ - initialize( makeVanGenuchtenBakerRelPermTwoPhase( "relPerm", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.3; - real64 const endSat = 0.7; - real64 const dS = 1e-1; - - array1d< real64 > sat( 2 ); - - sat[0] = startSat; - sat[1] = 1.0-sat[0]; - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 1-sat[0]; - } -} - -TEST_F( RelPermTest, numericalDerivatives_VanGenuchtenBakerRelPermThreePhase ) -{ - initialize( makeVanGenuchtenBakerRelPermThreePhase( "relPerm", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.3; - real64 const endSat = 0.7; - real64 const dS = 1e-1; - real64 const alpha = 0.4; - - array1d< real64 > sat( 3 ); - - sat[0] = startSat; - sat[1] = alpha*(1.0-sat[0]); - sat[2] = (1-alpha)*(1.0-sat[0]); - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = alpha *(1-sat[0]); - sat[2] = (1-alpha) *(1-sat[0]); - } -} - -TEST_F( RelPermTest, numericalDerivatives_TableRelPermTwoPhase ) -{ - initialize( makeTableRelPermTwoPhase( "relPerm", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.2; - real64 const endSat = 0.6; - real64 const dS = 1e-1; - - array1d< real64 > sat( 2 ); - - sat[0] = startSat; - sat[1] = 1.0-sat[0]; - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 1-sat[0]; - } -} - -TEST_F( RelPermTest, numericalDerivatives_TableRelPermThreePhase ) -{ - initialize( makeTableRelPermThreePhase( "relPerm", m_parent ) ); - - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.3; - real64 const endSat = 0.7; - real64 const dS = 1e-1; - real64 const alpha = 0.4; - - array1d< real64 > sat( 3 ); - - sat[0] = startSat; - sat[1] = alpha*(1.0-sat[0]); - sat[2] = (1-alpha)*(1.0-sat[0]); - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = alpha *(1-sat[0]); - sat[2] = (1-alpha) *(1-sat[0]); - } -} - -TEST_F( RelPermTest, numericalDerivatives_TableRelPermHysteresisTwoPhase ) -{ - initialize( makeTableRelPermHysteresisTwoPhase( "relPerm", m_parent ) ); - real64 const eps = std::sqrt( std::numeric_limits< real64 >::epsilon() ); - real64 const tol = 1e-4; - - real64 const startSat = 0.352; - real64 const endSat = 0.952; - real64 const dS = 2e-2; - - array1d< real64 > sat( 2 ); - array2d< real64, compflow::LAYOUT_PHASE > initSat( 1, 2 ); - - sat[0] = startSat; - sat[1] = 1.0-sat[0]; - initSat[0][0] = 0.6; - initSat[0][1] = 0.4; - - m_model->saveConvergedPhaseVolFractionState( initSat.toViewConst() ); - - // move the historical phase vol fraction back to the CPU since the test is performed on the CPU - auto & phaseMinHistoricalVolFraction = - m_model->getReference< array2d< real64, compflow::LAYOUT_PHASE > >( fields::relperm::phaseMinHistoricalVolFraction::key() ); - phaseMinHistoricalVolFraction.move( hostMemorySpace, false ); - auto & phaseMaxHistoricalVolFraction = - m_model->getReference< array2d< real64, compflow::LAYOUT_PHASE > >( fields::relperm::phaseMaxHistoricalVolFraction::key() ); - phaseMaxHistoricalVolFraction.move( hostMemorySpace, false ); - - while( sat[0] <= endSat ) - { - test( sat, eps, tol ); - sat[0] += dS; - sat[1] = 1-sat[0]; - } -} - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - - geos::GeosxState state( geos::basicSetup( argc, argv ) ); - - int const result = RUN_ALL_TESTS(); - - geos::basicCleanup(); - - return result; -} diff --git a/src/coreComponents/integrationTests/dataRepositoryTests/testObjectCatalog.cpp b/src/coreComponents/integrationTests/dataRepositoryTests/testObjectCatalog.cpp deleted file mode 100644 index 737981ea002..00000000000 --- a/src/coreComponents/integrationTests/dataRepositoryTests/testObjectCatalog.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#define OBJECTCATALOGVERBOSE 2 - -// Source includes -#include "dataRepository/ObjectCatalog.hpp" -#include "dataRepository/DataContext.hpp" -#include "common/logger/Logger.hpp" -#include "mainInterface/initialization.hpp" - -// TPL includes -#include - -using namespace LvArray; -using namespace geos; - -//START_SPHINX_BASE -class Base -{ -public: - Base( int & junk, double const & junk2 ) - { - GEOS_LOG( "calling Base constructor with arguments ("<; - static CatalogInterface::CatalogType & getCatalog() - { - static CatalogInterface::CatalogType catalog; - return catalog; - } - - virtual string getCatalogName() = 0; -}; -//STOP_SPHINX - -//START_SPHINX_DERIVED1 -class Derived1 : public Base -{ -public: - Derived1( int & junk, double const & junk2 ): - Base( junk, junk2 ) - { - GEOS_LOG( "calling Derived1 constructor with arguments ("< - derived1 = Base::CatalogInterface::factory( "derived1", context, - junk, junk2 ); - - // allocate a new Derived2 object - std::unique_ptr< Base > - derived2 = Base::CatalogInterface::factory( "derived2", context, - junk, junk2 ); - - EXPECT_STREQ( derived1->getCatalogName().c_str(), - Derived1::catalogName().c_str() ); - - EXPECT_STREQ( derived2->getCatalogName().c_str(), - Derived2::catalogName().c_str() ); - GEOS_LOG( "EXITING MAIN" ); -} -//STOP_SPHINX - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - - geos::basicSetup( argc, argv ); - - int const result = RUN_ALL_TESTS(); - - geos::basicCleanup(); - - return result; -} diff --git a/src/coreComponents/integrationTests/dataRepositoryTests/testWrapperHelpers.cpp b/src/coreComponents/integrationTests/dataRepositoryTests/testWrapperHelpers.cpp deleted file mode 100644 index a5956be0cf6..00000000000 --- a/src/coreComponents/integrationTests/dataRepositoryTests/testWrapperHelpers.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -// Source includes -#include "common/DataTypes.hpp" -#include "mainInterface/initialization.hpp" -#include "dataRepository/wrapperHelpers.hpp" -#include "utils.hpp" - -// TPL includes -#include - -// System includes -#include - - -namespace geos -{ -namespace dataRepository -{ -namespace testing -{ - -template< typename T > -void checkNoSizeMethod( T const & var ) -{ EXPECT_EQ( wrapperHelpers::size( var ), 1 ); } - -template< typename T > -void checkSizeMethod( T const & var ) -{ EXPECT_EQ( wrapperHelpers::size( var ), var.size() ); } - -template< typename T, int USD > -void checkAverageOverSecondDimHelper( ArrayView< T const, 2, USD > const & input, - ArrayView< T const, 1 > const & output ) -{ - for( localIndex i = 0; i < input.size( 0 ); ++i ) - { - T value {}; - for( localIndex j = 0; j < input.size( 1 ); ++j ) - { - value += input( i, j ); - } - - value /= input.size( 1 ); - EXPECT_EQ( value, output( i ) ); - } -} - -template< typename T, int USD > -void checkAverageOverSecondDimHelper( ArrayView< T const, 3, USD > const & input, - ArrayView< T const, 2 > const & output ) -{ - for( localIndex i = 0; i < input.size( 0 ); ++i ) - { - for( localIndex k = 0; k < input.size( 2 ); ++k ) - { - T value {}; - for( localIndex j = 0; j < input.size( 1 ); ++j ) - { - value += input( i, j, k ); - } - - value /= input.size( 1 ); - EXPECT_EQ( value, output( i, k ) ); - } - } -} - -template< typename T, int USD > -void checkAverageOverSecondDimHelper( ArrayView< T const, 4, USD > const & input, - ArrayView< T const, 3 > const & output ) -{ - for( localIndex i = 0; i < input.size( 0 ); ++i ) - { - for( localIndex k = 0; k < input.size( 2 ); ++k ) - { - for( localIndex l = 0; l < input.size( 3 ); ++l ) - { - T value {}; - for( localIndex j = 0; j < input.size( 1 ); ++j ) - { - value += input( i, j, k, l ); - } - - value /= input.size( 1 ); - EXPECT_EQ( value, output( i, k, l ) ); - } - } - } -} - - -TEST( wrapperHelpers, size ) -{ - checkNoSizeMethod( int() ); - checkNoSizeMethod( long() ); - checkNoSizeMethod( double() ); - checkNoSizeMethod( R1Tensor() ); - - checkSizeMethod( string( "hello" ) ); - checkSizeMethod( std::set< int > { 1, 2, 3 } ); - checkSizeMethod( stdVector< int > { 1, 2, 3 } ); - checkSizeMethod( std::array< int, 5 > {} ); - checkSizeMethod( array1d< int >( 5 ) ); - checkSizeMethod( array2d< int >( 5, 5 ) ); -} - -/// TODO: dataPtr -/// TODO: resize -/// TODO: resizeDefault -/// TODO: resizeDimensions -/// TODO: byteSizeOfElement -/// TODO: byteSize -/// TODO: numElementsFromByteSize -/// TODO: reserve -/// TODO: capacity - -using ArrayTypes = ::testing::Types< - array2d< int, RAJA::PERM_IJ > - , array2d< double, RAJA::PERM_JI > - , array3d< double, RAJA::PERM_IJK > - , array3d< int, RAJA::PERM_KJI > - , array4d< int, RAJA::PERM_IJKL > - , array4d< int, RAJA::PERM_LKJI > - , array4d< int, RAJA::PERM_KJLI > - >; - -template< typename ARRAY > -class PopulateMCArray : public ::testing::Test -{ -public: - static_assert( traits::is_array< ARRAY >, "T must be an LvArray::Array!" ); - using T = typename ARRAY::value_type; - - void test() - { - using ConduitType = typename conduitTypeInfo< T >::type; - constexpr int numComponentsPerValue = conduitTypeInfo< T >::numConduitValues; - - fill( m_array, 20 ); - - conduit::Node node; - wrapperHelpers::populateMCArray( m_array.toViewConst(), node, {} ); - - localIndex const numComponents = node.number_of_children(); - EXPECT_EQ( numComponents, numComponentsPerValue * m_array.size() / m_array.size( 0 ) ); - - stdVector< conduit::DataArray< ConduitType > > valuesFromNode; - for( localIndex i = 0; i < numComponents; ++i ) - { - EXPECT_TRUE( node.child( i ).is_data_external() ); - conduit::DataArray< ConduitType > const conduitArray = node.child( i ).value(); - ASSERT_EQ( conduitArray.number_of_elements(), m_array.size( 0 ) ); - valuesFromNode.push_back( conduitArray ); - } - - for( localIndex i = 0; i < m_array.size( 0 ); ++i ) - { - int curComponent = 0; - LvArray::forValuesInSlice( m_array[ i ], [&valuesFromNode, &curComponent, i]( T const & value ) - { - for( int j = 0; j < numComponentsPerValue; ++j ) - { - auto const valueOfComponent = *wrapperHelpers::internal::getPointerToComponent( value, j ); - EXPECT_EQ( valueOfComponent, valuesFromNode[ curComponent ][ i ] ); - ++curComponent; - } - } ); - } - } - -private: - ARRAY m_array; -}; - -TYPED_TEST_SUITE( PopulateMCArray, ArrayTypes, ); -TYPED_TEST( PopulateMCArray, test ) -{ - this->test(); -} - - -template< typename ARRAY > -class AverageOverSecondDim : public ::testing::Test -{ -public: - static_assert( traits::is_array< ARRAY >, "T must be an LvArray::Array!" ); - using T = typename ARRAY::value_type; - - static constexpr int NDIM = ARRAY::NDIM; - static_assert( NDIM >= 2, "Cannot average over a 1D array!" ); - - void test() - { - fill( m_array, 20 ); - - std::unique_ptr< Array< T, NDIM - 1 > > const output = wrapperHelpers::averageOverSecondDim( m_array.toViewConst() ); - - ASSERT_EQ( output->size( 0 ), m_array.size( 0 ) ); - - for( int i = 2; i < NDIM; ++i ) - { - ASSERT_EQ( output->size( i - 1 ), m_array.size( i ) ); - } - - checkAverageOverSecondDimHelper( m_array.toViewConst(), output->toViewConst() ); - } - -private: - ARRAY m_array; -}; - -TYPED_TEST_SUITE( AverageOverSecondDim, ArrayTypes, ); -TYPED_TEST( AverageOverSecondDim, test ) -{ - this->test(); -} - -} // namespace testing -} // namespace dataRepository -} // end namespace geos - -int main( int argc, char * argv[] ) -{ - testing::InitGoogleTest( &argc, argv ); - - geos::basicSetup( argc, argv ); - - int const result = RUN_ALL_TESTS(); - - geos::basicCleanup(); - - return result; -} diff --git a/src/coreComponents/integrationTests/dataRepositoryTests/utils.hpp b/src/coreComponents/integrationTests/dataRepositoryTests/utils.hpp deleted file mode 100644 index a28defdde6e..00000000000 --- a/src/coreComponents/integrationTests/dataRepositoryTests/utils.hpp +++ /dev/null @@ -1,149 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -/// Source includes -#include "common/DataTypes.hpp" - -/// TPL includes -#include - -/// System includes -#include - -namespace geos -{ -namespace dataRepository -{ -namespace testing -{ - -int rand( int const min, int const max ) -{ - static std::mt19937_64 gen; - return std::uniform_int_distribution< int >( min, max )( gen ); -} - -template< typename T > -void fill( T & val, localIndex ) -{ - val = rand( -100, 100 ); -} - -void fill( R1Tensor & val, localIndex ) -{ - for( int i = 0; i < 3; ++i ) - { - val[ i ] = rand( -100, 100 ); - } -} - -void fill( string & val, localIndex ) -{ - int const num = rand( -100, 100 ); - val = std::to_string( num ) + - string( " The rest of this is to avoid any small string optimizations. " ) + - std::to_string( 2 * num ); -} - -template< typename T, typename U > -void fill( std::pair< T, U > val, localIndex maxSize ) -{ - fill( val.first, maxSize ); - fill( val.second, maxSize ); -} - -template< typename T > -void fill( stdVector< T > & val, localIndex const maxSize ) -{ - val.resize( rand( 0, maxSize ) ); - for( T & v : val ) - { - fill( v, maxSize ); - } -} - -template< typename T, int NDIM, typename PERMUTATION > -void fill( Array< T, NDIM, PERMUTATION > & val, localIndex const maxSize ) -{ - localIndex dims[ NDIM ]; - for( int i = 0; i < NDIM; ++i ) - { - dims[ i ] = rand( 1, maxSize ); - } - - val.resize( NDIM, dims ); - - for( localIndex i = 0; i < val.size(); ++i ) - { - fill( val.data()[ i ], 1 ); - } -} - -template< typename T > -void fill( SortedArray< T > & val, localIndex const maxSize ) -{ - int const nVals = rand( 0, maxSize ); - for( int i = 0; i < nVals; ++i ) - { - T v; - fill( v, maxSize ); - val.insert( v ); - } -} - -template< typename K, typename V, typename SORTED > -void fill( mapBase< K, V, SORTED > & val, localIndex const maxSize ) -{ - int const nVals = rand( 0, maxSize ); - for( int i = 0; i < nVals; ++i ) - { - K k; - V v; - fill( k, maxSize ); - fill( v, maxSize ); - val[ k ] = v; - } -} - - -template< typename T > -void compare( T const & val, T const & valFromFile ) -{ EXPECT_EQ( val, valFromFile ); } - -template< typename T, int NDIM, typename PERMUTATION > -void compare( Array< T, NDIM, PERMUTATION > const & val, - Array< T, NDIM, PERMUTATION > const & valFromFile ) -{ - ASSERT_EQ( val.size(), valFromFile.size() ); - for( localIndex i = 0; i < val.size(); ++i ) - { - compare( val.data()[ i ], valFromFile.data()[ i ] ); - } -} - -template< typename T > -void compare( SortedArray< T > const & val, - SortedArray< T > const & valFromFile ) -{ - ASSERT_EQ( val.size(), valFromFile.size() ); - for( localIndex i = 0; i < val.size(); ++i ) - { - compare( val[ i ], valFromFile[ i ] ); - } -} - -} // namespace testing -} // namespace dataRepository -} // namespace geos diff --git a/src/coreComponents/integrationTests/fieldSpecificationTests/testFieldSpecificationsEnums.cpp b/src/coreComponents/integrationTests/fieldSpecificationTests/testFieldSpecificationsEnums.cpp deleted file mode 100644 index 0f800b4e8aa..00000000000 --- a/src/coreComponents/integrationTests/fieldSpecificationTests/testFieldSpecificationsEnums.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#include "fieldSpecification/TractionBoundaryCondition.hpp" - -#include - -using namespace geos; - -// The `ENUM_STRING` implementation relies on consistency between the order of the `enum`, -// and the order of the `string` array provided. Since this consistency is not enforced, it can be corrupted anytime. -// This unit test aims at preventing from this implicit relationship to bring a bug. - -TEST( TractionBoundaryConditionEnums, TractionType ) -{ - using EnumType = TractionBoundaryCondition::TractionType; - - ASSERT_EQ( "vector", toString( EnumType::vector ) ); - ASSERT_EQ( "normal", toString( EnumType::normal ) ); - ASSERT_EQ( "stress", toString( EnumType::stress ) ); -} - - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - return RUN_ALL_TESTS(); -} diff --git a/src/coreComponents/integrationTests/fileIOTests/CMakeLists.txt b/src/coreComponents/integrationTests/fileIOTests/CMakeLists.txt deleted file mode 100644 index 6dde82ba541..00000000000 --- a/src/coreComponents/integrationTests/fileIOTests/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -# Specify list of tests -set( geosx_fileio_tests - testHDFFile.cpp - testMemoryStats.cpp ) - -set( tplDependencyList ${parallelDeps} gtest ) - -set( dependencyList mainInterface ) - -geos_decorate_link_dependencies( LIST decoratedDependencies - DEPENDENCIES ${dependencyList} ) - -# Add gtest C++ based tests -foreach(test ${geosx_fileio_tests}) - get_filename_component( test_name ${test} NAME_WE ) - blt_add_executable( NAME ${test_name} - SOURCES ${test} - OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON ${decoratedDependencies} ${tplDependencyList} ) - - geos_add_test( NAME ${test_name} - COMMAND ${test_name} ) -endforeach() - -if ( ENABLE_MPI ) - - set(nranks 2) - - set( geosx_fileio_parallel_tests - testHDFParallelFile.cpp ) - foreach(test ${geosx_fileio_parallel_tests}) - get_filename_component( test_name ${test} NAME_WE ) - blt_add_executable( NAME ${test_name} - SOURCES ${test} - OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON ${decoratedDependencies} ${tplDependencyList} ) - - geos_add_test( NAME ${test_name} - COMMAND ${test_name} - NUM_MPI_TASKS ${nranks} ) - endforeach() -endif() diff --git a/src/coreComponents/integrationTests/fileIOTests/testHDFFile.cpp b/src/coreComponents/integrationTests/fileIOTests/testHDFFile.cpp deleted file mode 100644 index ea44608f06a..00000000000 --- a/src/coreComponents/integrationTests/fileIOTests/testHDFFile.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#include "fileIO/timeHistory/HDFHistoryIO.hpp" -#include "fileIO/timeHistory/HDFFile.hpp" -#include "mainInterface/initialization.hpp" -#include "dataRepository/BufferOpsDevice.hpp" - -#include - -using namespace geos; - -TEST( testHDFIO, HDFFile ) -{ - GEOS_MARK_FUNCTION; - HDFFile file( "empty", true, false, MPI_COMM_GEOS ); - hid_t file_id = H5Fcreate( "empty", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); - H5Fclose( file_id ); -} - -TEST( testHDFIO, SingleValueHistory ) -{ - string filename( "single_value" ); - HistoryMetadata spec( "Time History", 1, std::type_index( typeid(real64))); - - real64 time = 0.0; - HDFHistoryIO io( filename, spec ); - io.init( true ); - for( localIndex tidx = 0; tidx < 100; ++tidx ) - { - time += 0.333; - buffer_unit_type * buffer = io.getBufferHead( ); - memcpy( buffer, &time, sizeof(real64)); - } - io.write( ); -} - -TEST( testHDFIO, ArrayHistory ) -{ - srand( time( NULL )); - - { - string filename( "array1d_history" ); - Array< real64, 1 > arr( 4096 ); - real64 count = 0.0; - forValuesInSlice( arr.toSlice(), [&count]( real64 & value ) - { - value = count++; - } ); - - HistoryMetadata spec = getHistoryMetadata( "Array1d History", arr.toViewConst( ), 1 ); - HDFHistoryIO io( filename, spec ); - io.init( true ); - - buffer_unit_type * buffer = io.getBufferHead( ); - parallelDeviceEvents packEvents; - bufferOps::PackDataDevice< true >( buffer, arr.toViewConst( ), packEvents ); - waitAllDeviceEvents( packEvents ); - - io.write( ); - - //read and check the data using hdf api - // remove( filename.c_str() ); - } - { - string filename( "array2d_history" ); - Array< real64, 2 > arr( 1024, 4 ); - real64 count = 0.0; - forValuesInSlice( arr.toSlice(), [&count]( real64 & value ) - { - value = count++; - } ); - - HistoryMetadata spec = getHistoryMetadata( "Array2d History", arr.toViewConst( ), 4 ); - HDFHistoryIO io( filename, spec ); - io.init( true ); - - buffer_unit_type * buffer = io.getBufferHead( ); - parallelDeviceEvents packEvents; - bufferOps::PackDataDevice< true >( buffer, arr.toViewConst( ), packEvents ); - waitAllDeviceEvents( packEvents ); - - io.write( ); - - //read and check the data using hdf api - // remove( filename.c_str() ); - } -} - -TEST( testHDFIO, IdxArrayHistory ) -{ - srand( time( NULL )); - { - string filename( "array1d_idx_history" ); - Array< localIndex, 1 > idx( 256 ); - Array< real64, 2 > arr( 1024, 4 ); - real64 count = 0.0; - forValuesInSlice( arr.toSlice(), [&count]( real64 & value ) - { - value = count++; - } ); - forValuesInSlice( idx.toSlice(), []( localIndex & value ) - { - value = rand() % 1024; - } ); - - HistoryMetadata spec = getHistoryMetadata( "Array1d Idx History", arr.toViewConst( ), 4, idx.size( )); - HDFHistoryIO io( filename, spec ); - io.init( true ); - - buffer_unit_type * buffer = io.getBufferHead( ); - parallelDeviceEvents packEvents; - bufferOps::PackDataByIndexDevice< true >( buffer, arr.toViewConst( ), idx.toViewConst( ), packEvents ); - waitAllDeviceEvents( packEvents ); - - io.write( ); - } -} - -int main( int ac, char * av[] ) -{ - ::testing::InitGoogleTest( &ac, av ); - geos::basicSetup( ac, av ); - int const result = RUN_ALL_TESTS(); - geos::basicCleanup(); - return result; -} diff --git a/src/coreComponents/integrationTests/fileIOTests/testHDFParallelFile.cpp b/src/coreComponents/integrationTests/fileIOTests/testHDFParallelFile.cpp deleted file mode 100644 index a447019d854..00000000000 --- a/src/coreComponents/integrationTests/fileIOTests/testHDFParallelFile.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#include "fileIO/timeHistory/HDFHistoryIO.hpp" -#include "common/TimingMacros.hpp" -#include "mainInterface/initialization.hpp" - -#include - -using namespace geos; - -TEST( testHDFIO_parallel, SingleValueHistory ) -{ - GEOS_MARK_FUNCTION; - string filename( "single_value_parallel" ); - HistoryMetadata spec( "Time History", 1, std::type_index( typeid(real64))); - - int rank = MpiWrapper::commRank( ); - - HDFHistoryIO io( filename, spec ); - io.init( true ); - real64 val = 0.0; - for( localIndex tidx = 0; tidx < 100; ++tidx ) - { - val += 0.5 * (rank+1); - buffer_unit_type * buffer = io.getBufferHead( ); - memcpy( buffer, &val, sizeof(real64)); - } - - io.write( ); - io.compressInFile(); -} - - -TEST( testHDFIO_parallel, DynamicHistory ) -{ - GEOS_MARK_FUNCTION; - string filename( "dynamic_parallel" ); - HistoryMetadata singleItemSpec( "some_real", 1, std::type_index( typeid(real64))); - - int rnk = MpiWrapper::commRank( ); - - HDFHistoryIO io( filename, singleItemSpec ); - io.init( true ); - real64 val = 0.0; - for( localIndex tidx = 0; tidx < 4; ++tidx ) - { - val += 0.5 * ( rnk + 1 ); - if( ( rnk + tidx ) % 2 == 0 ) - { - io.updateCollectingCount( 1 ); - buffer_unit_type * buffer = io.getBufferHead( ); - memcpy( buffer, &val, sizeof(real64)); - } - else - { - io.updateCollectingCount( 0 ); - io.getBufferHead( ); - } - } - io.write( ); - val = 0.0; - for( localIndex tidx = 0; tidx < 8; ++tidx ) - { - val += 0.5 * ( rnk + 1 ); - if( ( rnk + tidx ) % 2 == 1 ) - { - io.updateCollectingCount( 1 ); - buffer_unit_type * buffer = io.getBufferHead( ); - memcpy( buffer, &val, sizeof(real64) ); - } - else - { - io.updateCollectingCount( 0 ); - io.getBufferHead( ); - } - } - io.write( ); - io.compressInFile(); -} - -int main( int ac, char * av[] ) -{ - ::testing::InitGoogleTest( &ac, av ); - geos::basicSetup( ac, av ); - int const result = RUN_ALL_TESTS(); - geos::basicCleanup(); - return result; -} diff --git a/src/coreComponents/integrationTests/fileIOTests/testMemoryStats.cpp b/src/coreComponents/integrationTests/fileIOTests/testMemoryStats.cpp deleted file mode 100644 index b07a30431a2..00000000000 --- a/src/coreComponents/integrationTests/fileIOTests/testMemoryStats.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#include "mainInterface/ProblemManager.hpp" -#include "mainInterface/initialization.hpp" -#include "mainInterface/GeosxState.hpp" -#include "fileIO/Outputs/MemoryStatsOutput.hpp" -#include "codingUtilities/Parsing.hpp" -#include "common/format/table/TableFormatter.hpp" - -#include - -using namespace geos; - -static const string basicXml = - R"xml( - - - - - - - - - - - - - - - )xml"; -static const string basicSimXml = - R"xml( - - - - - - - - - - - - - - - - - - - - - - )xml"; - -static const string memOutputPath = "/Outputs/memoryOutput"; -static const string memOutputFileName = "MemoryStats_umpireStats.csv"; - -CommandLineOptions g_commandLineOptions; - -// Test if a CSV has been effectively output because of MemoryStatsOutput task execution. -// (This test could be extended to check more memory pools depending on the platform, but may need -// to run a simulation) -TEST( testXML, testMemoryCSVOutput ) -{ - // setup - GeosxState state( std::make_unique< CommandLineOptions >( g_commandLineOptions ) ); - ProblemManager & problem = state.getProblemManager(); - problem.parseInputString( basicXml ); - problem.problemSetup(); - - // do a MemoryStats test output with a dummy entry - integer const dummyCycle = 123456; - string const dummyCycleStr = std::to_string( dummyCycle ); - MemoryStatsOutput & memOutput = problem.getGroupByPath< MemoryStatsOutput >( memOutputPath ); - memOutput.execute( 0.0, 0.0, dummyCycle, 0, 0.0, problem.getDomainPartition() ); - - // read the CSV output (parseFile() will throw if no CSV is generated) - std::vector< string > csvLines; - { - std::ifstream is( memOutputFileName ); - EXPECT_TRUE( is.good() ); - string line; - while( std::getline( is, line ) ) - { - csvLines.emplace_back( line ); - } - } - - auto const findCSVMemoryEntry = [=]( string_view cycleStr, string_view memSpaceName ) -> bool { - for( string const & csvLine : csvLines ) - { - std::vector< string > const lineEntries = stringutilities::tokenize( csvLine, - TableCSVFormatter::m_separator, - false ); - EXPECT_GT( lineEntries.size(), 3 ); - if( lineEntries[0] == cycleStr && lineEntries[2] == memSpaceName ) - { // we found the line coresponding to the given cycle & memory-space - return true; - } - } - return false; - }; - EXPECT_TRUE( findCSVMemoryEntry( dummyCycleStr, "HOST" ) ); -} - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - g_commandLineOptions = *geos::basicSetup( argc, argv ); - - int const result = RUN_ALL_TESTS(); - - basicCleanup(); - return result; -} diff --git a/src/coreComponents/integrationTests/finiteVolumeTests/CMakeLists.txt b/src/coreComponents/integrationTests/finiteVolumeTests/CMakeLists.txt deleted file mode 100644 index d809c09d7c3..00000000000 --- a/src/coreComponents/integrationTests/finiteVolumeTests/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Specify list of tests -set( gtest_geosx_tests - testMimeticInnerProducts.cpp ) - -set( tplDependencyList ${parallelDeps} gtest ) - -set( dependencyList mainInterface ) - -geos_decorate_link_dependencies( LIST decoratedDependencies - DEPENDENCIES ${dependencyList} ) - -# Add gtest C++ based tests -foreach(test ${gtest_geosx_tests}) - get_filename_component( test_name ${test} NAME_WE ) - blt_add_executable( NAME ${test_name} - SOURCES ${test} - OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON ${decoratedDependencies} ${tplDependencyList} ) - - # Guard to prevent GCC (version 8) from giving warnings due - # to some sort of possible conversion from int to long unsigned. - # See also discussion here: https://github.com/GEOS-DEV/LvArray/pull/250 - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.3.1) - target_compile_options(${test_name} PRIVATE "-Wno-stringop-overflow") - endif() - endif() - - geos_add_test( NAME ${test_name} - COMMAND ${test_name} ) - -endforeach() diff --git a/src/coreComponents/integrationTests/finiteVolumeTests/testMimeticInnerProducts.cpp b/src/coreComponents/integrationTests/finiteVolumeTests/testMimeticInnerProducts.cpp deleted file mode 100644 index b00f24fc4e3..00000000000 --- a/src/coreComponents/integrationTests/finiteVolumeTests/testMimeticInnerProducts.cpp +++ /dev/null @@ -1,923 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -// Source includes -#include "codingUtilities/UnitTestUtilities.hpp" -#include "common/logger/Logger.hpp" -#include "finiteVolume/mimeticInnerProducts/MimeticInnerProductBase.hpp" -#include "finiteVolume/mimeticInnerProducts/TPFAInnerProduct.hpp" -#include "finiteVolume/mimeticInnerProducts/QuasiTPFAInnerProduct.hpp" -#include "finiteVolume/mimeticInnerProducts/SimpleInnerProduct.hpp" -#include "finiteVolume/mimeticInnerProducts/BdVLMInnerProduct.hpp" -#include "mainInterface/initialization.hpp" -#include "mesh/FaceManager.hpp" -#include "mesh/utilities/ComputationalGeometry.hpp" - -// TPL includes -#include - -using namespace geos; -using namespace geos::mimeticInnerProduct; -using namespace geos::computationalGeometry; -using namespace geos::testing; - -struct InnerProductType -{ - static constexpr integer TPFA = 0; - static constexpr integer QUASI_TPFA = 1; - static constexpr integer QUASI_TPFA_WITH_MULTIPLIERS = 2; - static constexpr integer SIMPLE = 3; - static constexpr integer SIMPLE_WITH_MULTIPLIERS = 4; - static constexpr integer BDVLM = 5; - static constexpr integer BDVLM_WITH_MULTIPLIERS = 6; -}; - -void compareTransmissibilityMatrices( arraySlice2d< real64 const > const & transMatrix, - arraySlice2d< real64 const > const & transMatrixRef ) -{ - for( localIndex ifaceLoc = 0; ifaceLoc < transMatrix.size( 0 ); ++ifaceLoc ) - { - for( localIndex jfaceLoc = 0; jfaceLoc < transMatrix.size( 1 ); ++jfaceLoc ) - { - checkRelativeError( transMatrix( ifaceLoc, jfaceLoc ), - transMatrixRef( ifaceLoc, jfaceLoc ), - 1e-15 ); - } - } -} - -void computeVolumeAndCenter( array2d< real64, nodes::REFERENCE_POSITION_PERM > const & nodePosition, - array1d< localIndex > const & toNodes, - real64 ( & elemCenter )[3], - real64 & elemVolume ) -{ - localIndex const numNodes = toNodes.size(); - - GEOS_ERROR_IF( numNodes != 8 && numNodes != 4, - "This number of nodes is not supported in the test yet" ); - - LvArray::tensorOps::fill< 3 >( elemCenter, 0.0 ); - - if( numNodes == 8 ) - { - real64 Xlocal[8][3]; - for( integer a = 0; a < numNodes; ++a ) - { - Xlocal[a][0] = nodePosition( toNodes( a ), 0 ); - Xlocal[a][1] = nodePosition( toNodes( a ), 1 ); - Xlocal[a][2] = nodePosition( toNodes( a ), 2 ); - LvArray::tensorOps::add< 3 >( elemCenter, Xlocal[a] ); - } - elemVolume = computationalGeometry::hexahedronVolume( Xlocal ); - } - else if( numNodes == 4 ) - { - real64 Xlocal[4][3]; - for( integer a = 0; a < numNodes; ++a ) - { - Xlocal[a][0] = nodePosition( toNodes( a ), 0 ); - Xlocal[a][1] = nodePosition( toNodes( a ), 1 ); - Xlocal[a][2] = nodePosition( toNodes( a ), 2 ); - LvArray::tensorOps::add< 3 >( elemCenter, Xlocal[a] ); - } - elemVolume = computationalGeometry::tetrahedronVolume( Xlocal ); - } - LvArray::tensorOps::scale< 3 >( elemCenter, 1.0 / numNodes ); -} - -void makeHexa( array2d< real64, nodes::REFERENCE_POSITION_PERM > & nodePosition, - FaceManager::NodeMapType & faceToNodes, - array1d< localIndex > & elemToFaces, - real64 ( & elemCenter )[3], - real64 & elemVolume, - real64 ( & elemPerm )[3], - real64 & lengthTolerance, - integer const ipType, - arraySlice2d< real64 > const & transMatrixRef ) -{ - localIndex constexpr numNodes = 8; - localIndex constexpr numFaces = 6; - localIndex constexpr numNodesPerFace = 4; - - lengthTolerance = 1.73205e-8; - - elemPerm[ 0 ] = 1e-12; - elemPerm[ 1 ] = 2e-12; - elemPerm[ 2 ] = 3e-12; - - // elem-to-faces map - elemToFaces.resize( numFaces ); - elemToFaces( 0 ) = 1; - elemToFaces( 1 ) = 2; - elemToFaces( 2 ) = 0; - elemToFaces( 3 ) = 5; - elemToFaces( 4 ) = 4; - elemToFaces( 5 ) = 3; - - // face-to-nodes map - faceToNodes.resize( numFaces ); - for( localIndex iface = 0; iface < numFaces; ++iface ) - { - faceToNodes.resizeArray( iface, numNodesPerFace ); - } - faceToNodes( 0, 0 ) = 0; - faceToNodes( 0, 1 ) = 1; - faceToNodes( 0, 2 ) = 3; - faceToNodes( 0, 3 ) = 2; - faceToNodes( 1, 0 ) = 0; - faceToNodes( 1, 1 ) = 4; - faceToNodes( 1, 2 ) = 5; - faceToNodes( 1, 3 ) = 1; - faceToNodes( 2, 0 ) = 0; - faceToNodes( 2, 1 ) = 2; - faceToNodes( 2, 2 ) = 6; - faceToNodes( 2, 3 ) = 4; - faceToNodes( 3, 0 ) = 1; - faceToNodes( 3, 1 ) = 5; - faceToNodes( 3, 2 ) = 7; - faceToNodes( 3, 3 ) = 3; - faceToNodes( 4, 0 ) = 6; - faceToNodes( 4, 1 ) = 2; - faceToNodes( 4, 2 ) = 3; - faceToNodes( 4, 3 ) = 7; - faceToNodes( 5, 0 ) = 4; - faceToNodes( 5, 1 ) = 6; - faceToNodes( 5, 2 ) = 7; - faceToNodes( 5, 3 ) = 5; - - // node position - nodePosition.resize( numNodes, 3 ); - nodePosition( 0, 0 ) = 0; - nodePosition( 0, 1 ) = 0; - nodePosition( 0, 2 ) = 0; - nodePosition( 1, 0 ) = 0.75; - nodePosition( 1, 1 ) = 0; - nodePosition( 1, 2 ) = 1; - nodePosition( 2, 0 ) = 0; - nodePosition( 2, 1 ) = 1; - nodePosition( 2, 2 ) = 0; - nodePosition( 3, 0 ) = 0.75; - nodePosition( 3, 1 ) = 1; - nodePosition( 3, 2 ) = 1; - nodePosition( 4, 0 ) = 1; - nodePosition( 4, 1 ) = 0; - nodePosition( 4, 2 ) = 0; - nodePosition( 5, 0 ) = 1.75; - nodePosition( 5, 1 ) = 0; - nodePosition( 5, 2 ) = 1; - nodePosition( 6, 0 ) = 1; - nodePosition( 6, 1 ) = 1; - nodePosition( 6, 2 ) = 0; - nodePosition( 7, 0 ) = 1.75; - nodePosition( 7, 1 ) = 1; - nodePosition( 7, 2 ) = 1; - - array1d< localIndex > toNodes; - toNodes.resize( numNodes ); - toNodes( 0 ) = 0; - toNodes( 1 ) = 4; - toNodes( 2 ) = 2; - toNodes( 3 ) = 6; - toNodes( 4 ) = 1; - toNodes( 5 ) = 5; - toNodes( 6 ) = 3; - toNodes( 7 ) = 7; - - computeVolumeAndCenter( nodePosition, - toNodes, - elemCenter, - elemVolume ); - - // reference transmissibility matrix computed with MRST - if( ipType == InnerProductType::TPFA ) - { - transMatrixRef( 0, 0 ) = 4e-12; - transMatrixRef( 1, 1 ) = 3.84e-12; - transMatrixRef( 2, 2 ) = 2e-12; - transMatrixRef( 3, 3 ) = 2e-12; - transMatrixRef( 4, 4 ) = 4e-12; - transMatrixRef( 5, 5 ) = 3.84e-12; - } - else if( ipType == InnerProductType::QUASI_TPFA ) - { - transMatrixRef( 0, 0 ) = 4e-12; - - transMatrixRef( 1, 1 ) = 6e-12; - transMatrixRef( 1, 2 ) = -2.250e-12; - transMatrixRef( 1, 3 ) = 2.250e-12; - - transMatrixRef( 2, 1 ) = -2.225e-12; - transMatrixRef( 2, 2 ) = 5.375e-12; - transMatrixRef( 2, 5 ) = 2.225e-12; - - transMatrixRef( 3, 1 ) = 2.25e-12; - transMatrixRef( 3, 3 ) = 5.375e-12; - transMatrixRef( 3, 5 ) = -2.25e-12; - - transMatrixRef( 4, 4 ) = 4e-12; - - transMatrixRef( 5, 2 ) = 2.25e-12; - transMatrixRef( 5, 5 ) = 6e-12; - transMatrixRef( 5, 3 ) = -2.25e-12; - } - else if( ipType == InnerProductType::QUASI_TPFA_WITH_MULTIPLIERS ) - { - transMatrixRef( 0, 0 ) = 4.00e-12; - - transMatrixRef( 1, 1 ) = 4.817e-12; - transMatrixRef( 1, 2 ) = -1.829e-12; - transMatrixRef( 1, 3 ) = 0.094e-12; - transMatrixRef( 1, 5 ) = 0.851e-12; - - transMatrixRef( 2, 1 ) = -1.829e-12; - transMatrixRef( 2, 2 ) = 3.991e-12; - transMatrixRef( 2, 3 ) = 0.008e-12; - transMatrixRef( 2, 5 ) = 1.315e-12; - - transMatrixRef( 3, 1 ) = 0.094e-12; - transMatrixRef( 3, 2 ) = 0.008e-12; - transMatrixRef( 3, 3 ) = 0.213e-12; - transMatrixRef( 3, 5 ) = -0.068e-12; - - transMatrixRef( 4, 4 ) = 4e-12; - - transMatrixRef( 5, 1 ) = 0.851e-12; - transMatrixRef( 5, 2 ) = 1.315e-12; - transMatrixRef( 5, 5 ) = 3.703e-12; - transMatrixRef( 5, 3 ) = -0.068e-12; - } - else if( ipType == InnerProductType::SIMPLE ) - { - transMatrixRef( 0, 0 ) = 8e-12; - transMatrixRef( 0, 4 ) = 4e-12; - - transMatrixRef( 1, 1 ) = 9e-12; - transMatrixRef( 1, 2 ) = -2.250e-12; - transMatrixRef( 1, 3 ) = 2.250e-12; - transMatrixRef( 1, 5 ) = 3.e-12; - - transMatrixRef( 2, 1 ) = -2.225e-12; - transMatrixRef( 2, 2 ) = 12.06e-12; - transMatrixRef( 2, 3 ) = 6.69e-12; - transMatrixRef( 2, 5 ) = 2.25e-12; - - transMatrixRef( 3, 1 ) = 2.25e-12; - transMatrixRef( 3, 2 ) = 6.69e-12, - transMatrixRef( 3, 3 ) = 12.06e-12; - transMatrixRef( 3, 5 ) = -2.25e-12; - - transMatrixRef( 4, 4 ) = 8e-12; - transMatrixRef( 4, 0 ) = 4e-12; - - transMatrixRef( 5, 1 ) = 3e-12; - transMatrixRef( 5, 2 ) = 2.25e-12; - transMatrixRef( 5, 5 ) = 9e-12; - transMatrixRef( 5, 3 ) = -2.25e-12; - } - else if( ipType == InnerProductType::SIMPLE_WITH_MULTIPLIERS ) - { - transMatrixRef( 0, 0 ) = 8e-12; - transMatrixRef( 0, 4 ) = 4e-12; - - transMatrixRef( 1, 1 ) = 7.494e-12; - transMatrixRef( 1, 2 ) = -2.757e-12; - transMatrixRef( 1, 3 ) = 0.066e-12; - transMatrixRef( 1, 5 ) = 2.530e-12; - - transMatrixRef( 2, 1 ) = -2.757e-12; - transMatrixRef( 2, 2 ) = 5.499e-12; - transMatrixRef( 2, 3 ) = 0.088e-12; - transMatrixRef( 2, 5 ) = 1.548e-12; - - transMatrixRef( 3, 1 ) = 0.066e-12; - transMatrixRef( 3, 2 ) = 0.088e-12; - transMatrixRef( 3, 3 ) = 0.218e-12; - transMatrixRef( 3, 5 ) = -0.037e-12; - - transMatrixRef( 4, 4 ) = 8e-12; - transMatrixRef( 4, 0 ) = 4e-12; - - transMatrixRef( 5, 1 ) = 2.53e-12; - transMatrixRef( 5, 2 ) = 1.548e-12; - transMatrixRef( 5, 5 ) = 5.317e-12; - transMatrixRef( 5, 3 ) = -0.037e-12; - - } - else if( ipType == InnerProductType::BDVLM ) - { - transMatrixRef( 0, 0 ) = 4.240e-12; - transMatrixRef( 0, 4 ) = 0.240e-12; - - transMatrixRef( 1, 1 ) = 5.240e-12; - transMatrixRef( 1, 2 ) = -2.250e-12; - transMatrixRef( 1, 3 ) = 2.250e-12; - transMatrixRef( 1, 5 ) = -0.760e-12; - - transMatrixRef( 2, 1 ) = -2.225e-12; - transMatrixRef( 2, 2 ) = 6.187e-12; - transMatrixRef( 2, 3 ) = 0.812e-12; - transMatrixRef( 2, 5 ) = 2.25e-12; - - transMatrixRef( 3, 1 ) = 2.250e-12; - transMatrixRef( 3, 2 ) = 0.812e-12; - transMatrixRef( 3, 3 ) = 6.187e-12; - transMatrixRef( 3, 5 ) = -2.225e-12; - - transMatrixRef( 4, 4 ) = 4.240e-12; - transMatrixRef( 4, 0 ) = 0.240e-12; - - transMatrixRef( 5, 1 ) = -0.760e-12; - transMatrixRef( 5, 2 ) = 2.25e-12; - transMatrixRef( 5, 5 ) = 5.240e-12; - transMatrixRef( 5, 3 ) = -2.225e-12; - } - else if( ipType == InnerProductType::BDVLM_WITH_MULTIPLIERS ) - { - transMatrixRef( 0, 0 ) = 4.240e-12; - transMatrixRef( 0, 4 ) = 0.240e-12; - - transMatrixRef( 1, 1 ) = 4.179e-12; - transMatrixRef( 1, 2 ) = -1.924e-12; - transMatrixRef( 1, 3 ) = 0.082e-12; - transMatrixRef( 1, 5 ) = 0.233e-12; - - transMatrixRef( 2, 1 ) = -1.924e-12; - transMatrixRef( 2, 2 ) = 4.364e-12; - transMatrixRef( 2, 3 ) = 0.029e-12; - transMatrixRef( 2, 5 ) = 1.489e-12; - - transMatrixRef( 3, 1 ) = 0.082e-12; - transMatrixRef( 3, 2 ) = 0.029e-12; - transMatrixRef( 3, 3 ) = 0.214e-12; - transMatrixRef( 3, 5 ) = -0.064e-12; - - transMatrixRef( 4, 4 ) = 4.240e-12; - transMatrixRef( 4, 0 ) = 0.240e-12; - - transMatrixRef( 5, 1 ) = 0.233e-12; - transMatrixRef( 5, 2 ) = 1.489e-12; - transMatrixRef( 5, 5 ) = 3.288e-12; - transMatrixRef( 5, 3 ) = -0.064e-12; - } -} - - -void makeTetra( array2d< real64, nodes::REFERENCE_POSITION_PERM > & nodePosition, - FaceManager::NodeMapType & faceToNodes, - array1d< localIndex > & elemToFaces, - real64 ( & elemCenter )[3], - real64 & elemVolume, - real64 ( & elemPerm )[3], - real64 & lengthTolerance, - integer const ipType, - arraySlice2d< real64 > const & transMatrixRef ) -{ - localIndex constexpr numNodes = 4; - localIndex constexpr numFaces = 4; - localIndex constexpr numNodesPerFace = 3; - - lengthTolerance = 1.73205e-8; - - elemPerm[ 0 ] = 1e-12; - elemPerm[ 1 ] = 2e-12; - elemPerm[ 2 ] = 3e-12; - - // elem-to-faces map - elemToFaces.resize( numFaces ); - elemToFaces( 0 ) = 0; - elemToFaces( 1 ) = 1; - elemToFaces( 2 ) = 2; - elemToFaces( 3 ) = 3; - - // face-to-nodes map - faceToNodes.resize( numFaces ); - for( localIndex iface = 0; iface < numFaces; ++iface ) - { - faceToNodes.resizeArray( iface, numNodesPerFace ); - } - faceToNodes( 0, 0 ) = 0; - faceToNodes( 0, 1 ) = 1; - faceToNodes( 0, 2 ) = 2; - faceToNodes( 1, 0 ) = 0; - faceToNodes( 1, 1 ) = 1; - faceToNodes( 1, 2 ) = 3; - faceToNodes( 2, 0 ) = 1; - faceToNodes( 2, 1 ) = 2; - faceToNodes( 2, 2 ) = 3; - faceToNodes( 3, 0 ) = 2; - faceToNodes( 3, 1 ) = 0; - faceToNodes( 3, 2 ) = 3; - - // node position - nodePosition.resize( numNodes, 3 ); - nodePosition( 0, 0 ) = 0; - nodePosition( 0, 1 ) = 0; - nodePosition( 0, 2 ) = 0; - nodePosition( 1, 0 ) = 1; - nodePosition( 1, 1 ) = 0; - nodePosition( 1, 2 ) = 0; - nodePosition( 2, 0 ) = 0; - nodePosition( 2, 1 ) = 1; - nodePosition( 2, 2 ) = 0; - nodePosition( 3, 0 ) = 0; - nodePosition( 3, 1 ) = 0; - nodePosition( 3, 2 ) = 3; - - array1d< localIndex > toNodes; - toNodes.resize( numNodes ); - toNodes( 0 ) = 0; - toNodes( 1 ) = 1; - toNodes( 2 ) = 2; - toNodes( 3 ) = 3; - - computeVolumeAndCenter( nodePosition, - toNodes, - elemCenter, - elemVolume ); - - // reference transmissibility matrix computed with MRST - - if( ipType == InnerProductType::TPFA ) - { - transMatrixRef( 0, 0 ) = 1.952e-12; - transMatrixRef( 1, 1 ) = 5.684e-12; - transMatrixRef( 2, 2 ) = 9.818e-12; - transMatrixRef( 3, 3 ) = 2.842e-12; - } - else if( ipType == InnerProductType::QUASI_TPFA ) - { - transMatrixRef( 0, 0 ) = 5.25e-12; - transMatrixRef( 0, 1 ) = 3.75e-12; - transMatrixRef( 0, 2 ) = 2.25e-12; - transMatrixRef( 0, 3 ) = 3.75e-12; - - transMatrixRef( 1, 0 ) = 3.75e-12; - transMatrixRef( 1, 1 ) = 12.75e-12; - transMatrixRef( 1, 2 ) = -5.25e-12; - transMatrixRef( 1, 3 ) = 3.75e-12; - - transMatrixRef( 2, 0 ) = 2.25e-12; - transMatrixRef( 2, 1 ) = -5.25e-12; - transMatrixRef( 2, 2 ) = 18.75e-12; - transMatrixRef( 2, 3 ) = -0.75e-12; - - transMatrixRef( 3, 0 ) = 3.75e-12; - transMatrixRef( 3, 1 ) = 3.75e-12; - transMatrixRef( 3, 2 ) = -0.75e-12; - transMatrixRef( 3, 3 ) = 8.25e-12; - } - else if( ipType == InnerProductType::SIMPLE ) - { - transMatrixRef( 0, 0 ) = 6.21e-12; - transMatrixRef( 0, 1 ) = 4.71e-12; - transMatrixRef( 0, 2 ) = 3.21e-12; - transMatrixRef( 0, 3 ) = 4.71e-12; - - transMatrixRef( 1, 0 ) = 4.71e-12; - transMatrixRef( 1, 1 ) = 13.71e-12; - transMatrixRef( 1, 2 ) = -4.29e-12; - transMatrixRef( 1, 3 ) = 4.71e-12; - - transMatrixRef( 2, 0 ) = 3.21e-12; - transMatrixRef( 2, 1 ) = -4.29e-12; - transMatrixRef( 2, 2 ) = 19.71e-12; - transMatrixRef( 2, 3 ) = 0.21e-12; - - transMatrixRef( 3, 0 ) = 4.71e-12; - transMatrixRef( 3, 1 ) = 4.71e-12; - transMatrixRef( 3, 2 ) = 0.21e-12; - transMatrixRef( 3, 3 ) = 9.21e-12; - } - else if( ipType == InnerProductType::BDVLM ) - { - transMatrixRef( 0, 0 ) = 2.99e-12; - transMatrixRef( 0, 1 ) = 1.49e-12; - transMatrixRef( 0, 2 ) = -0.01e-12; - transMatrixRef( 0, 3 ) = 1.49e-12; - - transMatrixRef( 1, 0 ) = 1.49e-12; - transMatrixRef( 1, 1 ) = 10.49e-12; - transMatrixRef( 1, 2 ) = -7.51e-12; - transMatrixRef( 1, 3 ) = 1.49e-12; - - transMatrixRef( 2, 0 ) = -0.01e-12; - transMatrixRef( 2, 1 ) = -7.51e-12; - transMatrixRef( 2, 2 ) = 16.49e-12; - transMatrixRef( 2, 3 ) = -3.01e-12; - - transMatrixRef( 3, 0 ) = 1.49e-12; - transMatrixRef( 3, 1 ) = 1.49e-12; - transMatrixRef( 3, 2 ) = -3.01e-12; - transMatrixRef( 3, 3 ) = 5.99e-12; - - } -} - - -TEST( testMimeticInnerProducts, TPFA_hexa ) -{ - localIndex constexpr NF = 6; - - array2d< real64, nodes::REFERENCE_POSITION_PERM > nodePosition; - FaceManager::NodeMapType faceToNodes; - array1d< localIndex > elemToFaces; - real64 elemCenter[3]; - real64 elemPerm[3]; - real64 elemVolume = 0; - real64 lengthTolerance = 0; - stackArray2d< real64, NF *NF > transMatrixRef( NF, NF ); - - makeHexa( nodePosition, - faceToNodes, - elemToFaces, - elemCenter, - elemVolume, - elemPerm, - lengthTolerance, - InnerProductType::TPFA, - transMatrixRef ); - - stackArray2d< real64, NF *NF > transMatrix( NF, NF ); - array1d< real64 > transMultiplier( NF ); - transMultiplier.setValues< parallelHostPolicy >( 1.0 ); - - stackArray1d< real64, 3 > center( 3 ); - center[0] = elemCenter[0]; - center[1] = elemCenter[1]; - center[2] = elemCenter[2]; - real64 const perm[ 3 ] = { elemPerm[0], elemPerm[1], elemPerm[2] }; - - TPFAInnerProduct::compute< NF >( nodePosition.toViewConst(), - transMultiplier.toViewConst(), - faceToNodes.toViewConst(), - elemToFaces.toSliceConst(), - center, - elemVolume, - perm, - lengthTolerance, - transMatrix.toSlice() ); - - compareTransmissibilityMatrices( transMatrix, transMatrixRef ); -} - - -TEST( testMimeticInnerProducts, QTPFA_hexa ) -{ - localIndex constexpr NF = 6; - - array2d< real64, nodes::REFERENCE_POSITION_PERM > nodePosition; - FaceManager::NodeMapType faceToNodes; - array1d< localIndex > elemToFaces; - real64 elemCenter[3]; - real64 elemPerm[3]; - real64 elemVolume = 0; - real64 lengthTolerance = 0; - stackArray2d< real64, NF *NF > transMatrixRef( NF, NF ); - - makeHexa( nodePosition, - faceToNodes, - elemToFaces, - elemCenter, - elemVolume, - elemPerm, - lengthTolerance, - InnerProductType::QUASI_TPFA_WITH_MULTIPLIERS, - transMatrixRef ); - - stackArray2d< real64, NF *NF > transMatrix( NF, NF ); - array1d< real64 > transMultiplier( NF ); - transMultiplier.setValues< parallelHostPolicy >( 1.0 ); - transMultiplier[0] = 0.9; - transMultiplier[5] = 0.1; - transMultiplier[3] = 0.8; - - stackArray1d< real64, 3 > center( 3 ); - center[0] = elemCenter[0]; - center[1] = elemCenter[1]; - center[2] = elemCenter[2]; - real64 const perm[ 3 ] = { elemPerm[0], elemPerm[1], elemPerm[2] }; - - QuasiTPFAInnerProduct::compute< NF >( nodePosition.toViewConst(), - transMultiplier.toViewConst(), - faceToNodes.toViewConst(), - elemToFaces.toSliceConst(), - center, - elemVolume, - perm, - lengthTolerance, - transMatrix.toSlice() ); - - compareTransmissibilityMatrices( transMatrix, transMatrixRef ); -} - -TEST( testMimeticInnerProducts, Simple_hexa ) -{ - localIndex constexpr NF = 6; - - array2d< real64, nodes::REFERENCE_POSITION_PERM > nodePosition; - FaceManager::NodeMapType faceToNodes; - array1d< localIndex > elemToFaces; - real64 elemCenter[3] = { 0.0 }; - real64 elemPerm[3] = { 0.0 }; - real64 elemVolume = 0; - real64 lengthTolerance = 0; - stackArray2d< real64, NF *NF > transMatrixRef( NF, NF ); - - makeHexa( nodePosition, - faceToNodes, - elemToFaces, - elemCenter, - elemVolume, - elemPerm, - lengthTolerance, - InnerProductType::SIMPLE_WITH_MULTIPLIERS, - transMatrixRef ); - - stackArray2d< real64, NF *NF > transMatrix( NF, NF ); - array1d< real64 > transMultiplier( NF ); - transMultiplier.setValues< parallelHostPolicy >( 1.0 ); - transMultiplier[0] = 0.9; - transMultiplier[5] = 0.1; - transMultiplier[3] = 0.8; - - stackArray1d< real64, 3 > center( 3 ); - center[0] = elemCenter[0]; - center[1] = elemCenter[1]; - center[2] = elemCenter[2]; - real64 const perm[ 3 ] = { elemPerm[0], elemPerm[1], elemPerm[2] }; - - SimpleInnerProduct::compute< NF >( nodePosition.toViewConst(), - transMultiplier.toViewConst(), - faceToNodes.toViewConst(), - elemToFaces.toSliceConst(), - center, - elemVolume, - perm, - lengthTolerance, - transMatrix.toSlice() ); - - compareTransmissibilityMatrices( transMatrix, transMatrixRef ); -} - -TEST( testMimeticInnerProducts, BdVLM_hexa ) -{ - localIndex constexpr NF = 6; - - array2d< real64, nodes::REFERENCE_POSITION_PERM > nodePosition; - FaceManager::NodeMapType faceToNodes; - array1d< localIndex > elemToFaces; - real64 elemCenter[3] = { 0.0 }; - real64 elemPerm[3] = { 0.0 }; - real64 elemVolume = 0; - real64 lengthTolerance = 0; - stackArray2d< real64, NF *NF > transMatrixRef( NF, NF ); - - makeHexa( nodePosition, - faceToNodes, - elemToFaces, - elemCenter, - elemVolume, - elemPerm, - lengthTolerance, - InnerProductType::BDVLM_WITH_MULTIPLIERS, - transMatrixRef ); - - stackArray2d< real64, NF *NF > transMatrix( NF, NF ); - array1d< real64 > transMultiplier( NF ); - transMultiplier.setValues< parallelHostPolicy >( 1.0 ); - transMultiplier[0] = 0.9; - transMultiplier[5] = 0.1; - transMultiplier[3] = 0.8; - - - stackArray1d< real64, 3 > center( 3 ); - center[0] = elemCenter[0]; - center[1] = elemCenter[1]; - center[2] = elemCenter[2]; - real64 const perm[ 3 ] = { elemPerm[0], elemPerm[1], elemPerm[2] }; - - BdVLMInnerProduct::compute< NF >( nodePosition.toViewConst(), - transMultiplier.toViewConst(), - faceToNodes.toViewConst(), - elemToFaces.toSliceConst(), - center, - elemVolume, - perm, - lengthTolerance, - transMatrix.toSlice() ); - - compareTransmissibilityMatrices( transMatrix, transMatrixRef ); -} - - -TEST( testMimeticInnerProducts, TPFA_tetra ) -{ - localIndex constexpr NF = 4; - - array2d< real64, nodes::REFERENCE_POSITION_PERM > nodePosition; - FaceManager::NodeMapType faceToNodes; - array1d< localIndex > elemToFaces; - real64 elemCenter[3]; - real64 elemPerm[3]; - real64 elemVolume = 0; - real64 lengthTolerance = 0; - stackArray2d< real64, NF *NF > transMatrixRef( NF, NF ); - - makeTetra( nodePosition, - faceToNodes, - elemToFaces, - elemCenter, - elemVolume, - elemPerm, - lengthTolerance, - InnerProductType::TPFA, - transMatrixRef ); - - stackArray2d< real64, NF *NF > transMatrix( NF, NF ); - array1d< real64 > transMultiplier( NF ); - transMultiplier.setValues< parallelHostPolicy >( 1.0 ); - - stackArray1d< real64, 3 > center( 3 ); - center[0] = elemCenter[0]; - center[1] = elemCenter[1]; - center[2] = elemCenter[2]; - real64 const perm[ 3 ] = { elemPerm[0], elemPerm[1], elemPerm[2] }; - - TPFAInnerProduct::compute< NF >( nodePosition.toViewConst(), - transMultiplier.toViewConst(), - faceToNodes.toViewConst(), - elemToFaces.toSliceConst(), - center, - elemVolume, - perm, - lengthTolerance, - transMatrix.toSlice() ); - - compareTransmissibilityMatrices( transMatrix, transMatrixRef ); -} - - -TEST( testMimeticInnerProducts, QTPFA_tetra ) -{ - localIndex constexpr NF = 4; - - array2d< real64, nodes::REFERENCE_POSITION_PERM > nodePosition; - FaceManager::NodeMapType faceToNodes; - array1d< localIndex > elemToFaces; - real64 elemCenter[3]; - real64 elemPerm[3]; - real64 elemVolume = 0; - real64 lengthTolerance = 0; - stackArray2d< real64, NF *NF > transMatrixRef( NF, NF ); - - makeTetra( nodePosition, - faceToNodes, - elemToFaces, - elemCenter, - elemVolume, - elemPerm, - lengthTolerance, - InnerProductType::QUASI_TPFA, - transMatrixRef ); - - stackArray2d< real64, NF *NF > transMatrix( NF, NF ); - array1d< real64 > transMultiplier( NF ); - transMultiplier.setValues< parallelHostPolicy >( 1.0 ); - - stackArray1d< real64, 3 > center( 3 ); - center[0] = elemCenter[0]; - center[1] = elemCenter[1]; - center[2] = elemCenter[2]; - real64 const perm[ 3 ] = { elemPerm[0], elemPerm[1], elemPerm[2] }; - - QuasiTPFAInnerProduct::compute< NF >( nodePosition.toViewConst(), - transMultiplier.toViewConst(), - faceToNodes.toViewConst(), - elemToFaces.toSliceConst(), - center, - elemVolume, - perm, - lengthTolerance, - transMatrix.toSlice() ); - - compareTransmissibilityMatrices( transMatrix, transMatrixRef ); -} - -TEST( testMimeticInnerProducts, Simple_tetra ) -{ - localIndex constexpr NF = 4; - - array2d< real64, nodes::REFERENCE_POSITION_PERM > nodePosition; - FaceManager::NodeMapType faceToNodes; - array1d< localIndex > elemToFaces; - real64 elemCenter[3] = { 0.0 }; - real64 elemPerm[3] = { 0.0 }; - real64 elemVolume = 0; - real64 lengthTolerance = 0; - stackArray2d< real64, NF *NF > transMatrixRef( NF, NF ); - - makeTetra( nodePosition, - faceToNodes, - elemToFaces, - elemCenter, - elemVolume, - elemPerm, - lengthTolerance, - InnerProductType::SIMPLE, - transMatrixRef ); - - stackArray2d< real64, NF *NF > transMatrix( NF, NF ); - array1d< real64 > transMultiplier( NF ); - transMultiplier.setValues< parallelHostPolicy >( 1.0 ); - - stackArray1d< real64, 3 > center( 3 ); - center[0] = elemCenter[0]; - center[1] = elemCenter[1]; - center[2] = elemCenter[2]; - real64 const perm[ 3 ] = { elemPerm[0], elemPerm[1], elemPerm[2] }; - - SimpleInnerProduct::compute< NF >( nodePosition.toViewConst(), - transMultiplier.toViewConst(), - faceToNodes.toViewConst(), - elemToFaces.toSliceConst(), - center, - elemVolume, - perm, - lengthTolerance, - transMatrix.toSlice() ); - - compareTransmissibilityMatrices( transMatrix, transMatrixRef ); -} - -TEST( testMimeticInnerProducts, BdVLMtetra ) -{ - localIndex constexpr NF = 4; - - array2d< real64, nodes::REFERENCE_POSITION_PERM > nodePosition; - FaceManager::NodeMapType faceToNodes; - array1d< localIndex > elemToFaces; - real64 elemCenter[3] = { 0.0 }; - real64 elemPerm[3] = { 0.0 }; - real64 elemVolume = 0; - real64 lengthTolerance = 0; - stackArray2d< real64, NF *NF > transMatrixRef( NF, NF ); - - makeTetra( nodePosition, - faceToNodes, - elemToFaces, - elemCenter, - elemVolume, - elemPerm, - lengthTolerance, - InnerProductType::BDVLM, - transMatrixRef ); - - stackArray2d< real64, NF *NF > transMatrix( NF, NF ); - array1d< real64 > transMultiplier( NF ); - transMultiplier.setValues< parallelHostPolicy >( 1.0 ); - - stackArray1d< real64, 3 > center( 3 ); - center[0] = elemCenter[0]; - center[1] = elemCenter[1]; - center[2] = elemCenter[2]; - real64 const perm[ 3 ] = { elemPerm[0], elemPerm[1], elemPerm[2] }; - - BdVLMInnerProduct::compute< NF >( nodePosition.toViewConst(), - transMultiplier.toViewConst(), - faceToNodes.toViewConst(), - elemToFaces.toSliceConst(), - center, - elemVolume, - perm, - lengthTolerance, - transMatrix.toSlice() ); - - compareTransmissibilityMatrices( transMatrix, transMatrixRef ); -} - - - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - - geos::basicSetup( argc, argv ); - - int const result = RUN_ALL_TESTS(); - - geos::basicCleanup(); - - return result; -} diff --git a/src/coreComponents/integrationTests/linearAlgebraTests/testLAIHelperFunctions.cpp b/src/coreComponents/integrationTests/linearAlgebraTests/testLAIHelperFunctions.cpp deleted file mode 100644 index 64eb5c027b5..00000000000 --- a/src/coreComponents/integrationTests/linearAlgebraTests/testLAIHelperFunctions.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -/** - * @file testLAIHelperFunctions.cpp - */ - -#include "common/DataTypes.hpp" -#include "linearAlgebra/DofManager.hpp" -#include "linearAlgebra/utilities/LAIHelperFunctions.hpp" -#include "mainInterface/initialization.hpp" -#include "mainInterface/ProblemManager.hpp" -#include "mesh/DomainPartition.hpp" -#include "mesh/MeshManager.hpp" -#include "mesh/mpiCommunications/CommunicationTools.hpp" -#include "mainInterface/GeosxState.hpp" -#include "integrationTests/linearAlgebraTests/testDofManagerUtils.hpp" - -#include - -using namespace geos; - -char const * xmlInput = - R"xml( - - - - - - - - - )xml"; - -template< typename LAI > -class LAIHelperFunctionsTest : public ::testing::Test -{ -protected: - - using Base = ::testing::Test; - - LAIHelperFunctionsTest(): - Base(), - state( std::make_unique< CommandLineOptions >() ) - { - geos::testing::setupProblemFromXML( &state.getProblemManager(), xmlInput ); - mesh = &state.getProblemManager().getDomainPartition().getMeshBody( 0 ).getBaseDiscretization(); - } - - GeosxState state; - MeshLevel * mesh; -}; - -TYPED_TEST_SUITE_P( LAIHelperFunctionsTest ); - -void assembleGlobalIndexVector( arrayView1d< globalIndex const > const & localToGlobal, - arrayView1d< integer const > const & ghostRank, - arrayView1d< globalIndex const > const & dofNumber, - globalIndex const rankOffset, - integer const numDofPerPoint, - arrayView1d< real64 > const & values ) -{ - forAll< geos::parallelDevicePolicy<> >( dofNumber.size(), [=] GEOS_HOST_DEVICE ( localIndex const k ) - { - if( dofNumber[k] >= 0 && ghostRank[k] < 0 ) - { - for( localIndex c = 0; c < numDofPerPoint; ++c ) - { - values[dofNumber[k] - rankOffset + c] = static_cast< real64 >( localToGlobal[k] * numDofPerPoint + c ); - } - } - } ); -} - -TYPED_TEST_P( LAIHelperFunctionsTest, nodalVectorPermutation ) -{ - using Matrix = typename TypeParam::ParallelMatrix; - using Vector = typename TypeParam::ParallelVector; - - DomainPartition & domain = getGlobalState().getProblemManager().getDomainPartition(); - MeshLevel & meshLevel = domain.getMeshBody( 0 ).getBaseDiscretization(); - NodeManager const & nodeManager = meshLevel.getNodeManager(); - - string const fieldName = "nodalVariable"; - integer constexpr numDofPerNode = 3; - - DofManager dofManager( "test" ); - dofManager.setDomain( domain ); - - stdVector< DofManager::FieldSupport > regions; - DofManager::FieldSupport region = { "mesh1", "Level0", {"region1"} }; - regions.emplace_back( region ); - - dofManager.addField( "nodalVariable", FieldLocation::Node, 3, regions ); - dofManager.addCoupling( "nodalVariable", "nodalVariable", DofManager::Connector::Elem ); - dofManager.reorderByRank(); - - Vector nodalVariable; - nodalVariable.create( dofManager.numLocalDofs(), MPI_COMM_GEOS ); - globalIndex const rankOffset = dofManager.rankOffset(); - - arrayView1d< real64 > const nodalVariableView = nodalVariable.open(); - assembleGlobalIndexVector( nodeManager.localToGlobalMap(), - nodeManager.ghostRank(), - nodeManager.getReference< globalIndex_array >( dofManager.getKey( fieldName ) ), - rankOffset, - numDofPerNode, - nodalVariableView ); - nodalVariable.close(); - - Matrix permutationMatrix; - LAIHelperFunctions::createPermutationMatrix( nodeManager, - numDofPerNode, - dofManager.getKey( fieldName ), - permutationMatrix ); - Vector permutedVector = LAIHelperFunctions::permuteVector( nodalVariable, permutationMatrix ); - - // After permutation, the vector should become an increasing sequence of numbers - arrayView1d< real64 const > permutedValues = permutedVector.values(); - forAll< serialPolicy >( permutedValues.size(), [=]( localIndex const i ) - { - EXPECT_EQ( permutedValues[i], rankOffset + i ); - } ); -} - -TYPED_TEST_P( LAIHelperFunctionsTest, cellCenteredVectorPermutation ) -{ - using Matrix = typename TypeParam::ParallelMatrix; - using Vector = typename TypeParam::ParallelVector; - - DomainPartition & domain = getGlobalState().getProblemManager().getDomainPartition(); - MeshLevel & meshLevel = domain.getMeshBody( 0 ).getBaseDiscretization(); - ElementRegionManager const & elemManager = meshLevel.getElemManager(); - - string const fieldName = "cellCenteredVariable"; - integer constexpr numDofPerCell = 3; - - DofManager dofManager( "test" ); - dofManager.setDomain( domain ); - - stdVector< DofManager::FieldSupport > regions; - DofManager::FieldSupport region = { "mesh1", "Level0", {"region1"} }; - regions.emplace_back( region ); - - dofManager.addField( fieldName, FieldLocation::Elem, numDofPerCell, regions ); - dofManager.addCoupling( fieldName, fieldName, DofManager::Connector::Face ); - dofManager.reorderByRank(); - - Vector cellCenteredVariable; - cellCenteredVariable.create( dofManager.numLocalDofs(), MPI_COMM_GEOS ); - globalIndex const rankOffset = dofManager.rankOffset(); - - arrayView1d< real64 > const cellCenteredVariableView = cellCenteredVariable.open(); - elemManager.forElementSubRegions< ElementSubRegionBase >( [&]( ElementSubRegionBase const & elementSubRegion ) - { - assembleGlobalIndexVector( elementSubRegion.localToGlobalMap(), - elementSubRegion.ghostRank(), - elementSubRegion.getReference< globalIndex_array >( dofManager.getKey( fieldName ) ), - rankOffset, - numDofPerCell, - cellCenteredVariableView ); - } ); - cellCenteredVariable.close(); - - Matrix permutationMatrix; - LAIHelperFunctions::createPermutationMatrix( elemManager, - numDofPerCell, - dofManager.getKey( fieldName ), - permutationMatrix ); - Vector permutedVector = LAIHelperFunctions::permuteVector( cellCenteredVariable, permutationMatrix ); - - // After permutation, the vector should become an increasing sequence of numbers - arrayView1d< real64 const > permutedValues = permutedVector.values(); - forAll< serialPolicy >( permutedValues.size(), [=]( localIndex const i ) - { - EXPECT_EQ( permutedValues[i], rankOffset + i ); - } ); -} - -REGISTER_TYPED_TEST_SUITE_P( LAIHelperFunctionsTest, - nodalVectorPermutation, - cellCenteredVectorPermutation ); - -#ifdef GEOS_USE_TRILINOS -INSTANTIATE_TYPED_TEST_SUITE_P( Trilinos, LAIHelperFunctionsTest, TrilinosInterface, ); -#endif - -#ifdef GEOS_USE_HYPRE -INSTANTIATE_TYPED_TEST_SUITE_P( Hypre, LAIHelperFunctionsTest, HypreInterface, ); -#endif - -#ifdef GEOS_USE_PETSC -INSTANTIATE_TYPED_TEST_SUITE_P( Petsc, LAIHelperFunctionsTest, PetscInterface, ); -#endif - -/** - * @function main - * @brief Main function to setup the GEOSX environment, read the xml file and run all cases. - */ -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - geos::basicSetup( argc, argv ); - int const result = RUN_ALL_TESTS(); - geos::basicCleanup(); - return result; -} diff --git a/src/coreComponents/integrationTests/meshTests/testMeshEnums.cpp b/src/coreComponents/integrationTests/meshTests/testMeshEnums.cpp deleted file mode 100644 index b014e193437..00000000000 --- a/src/coreComponents/integrationTests/meshTests/testMeshEnums.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#include "mesh/ElementType.hpp" -#include "mesh/SurfaceElementRegion.hpp" - -#include - -using namespace geos; - -// The `ENUM_STRING` implementation relies on consistency between the order of the `enum`, -// and the order of the `string` array provided. Since this consistency is not enforced, it can be corrupted anytime. -// This unit test aims at preventing from this implicit relationship to bring a bug. - -TEST( MeshEnums, ElementType ) -{ - using EnumType = ElementType; - - ASSERT_EQ( "Vertex", toString( EnumType::Vertex ) ); - ASSERT_EQ( "BEAM", toString( EnumType::Line ) ); - ASSERT_EQ( "C2D3", toString( EnumType::Triangle ) ); - ASSERT_EQ( "C2D4", toString( EnumType::Quadrilateral ) ); - ASSERT_EQ( "Polygon", toString( EnumType::Polygon ) ); - ASSERT_EQ( "C3D4", toString( EnumType::Tetrahedron ) ); - ASSERT_EQ( "C3D5", toString( EnumType::Pyramid ) ); - ASSERT_EQ( "C3D6", toString( EnumType::Wedge ) ); - ASSERT_EQ( "C3D8", toString( EnumType::Hexahedron ) ); - ASSERT_EQ( "PentagonalPrism", toString( EnumType::Prism5 ) ); - ASSERT_EQ( "HexagonalPrism", toString( EnumType::Prism6 ) ); - ASSERT_EQ( "HeptagonalPrism", toString( EnumType::Prism7 ) ); - ASSERT_EQ( "OctagonalPrism", toString( EnumType::Prism8 ) ); - ASSERT_EQ( "NonagonalPrism", toString( EnumType::Prism9 ) ); - ASSERT_EQ( "DecagonalPrism", toString( EnumType::Prism10 ) ); - ASSERT_EQ( "HendecagonalPrism", toString( EnumType::Prism11 ) ); - ASSERT_EQ( "Polyhedron", toString( EnumType::Polyhedron ) ); - - ASSERT_EQ( numElementTypes(), 17 ); -} - - -TEST( MeshEnums, SurfaceSubRegionType ) -{ - using EnumType = SurfaceElementRegion::SurfaceSubRegionType; - - ASSERT_EQ( "faceElement", toString( EnumType::faceElement ) ); - ASSERT_EQ( "embeddedElement", toString( EnumType::embeddedElement ) ); -} - - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - return RUN_ALL_TESTS(); -} diff --git a/src/coreComponents/integrationTests/toolchain/CMakeLists.txt b/src/coreComponents/integrationTests/toolchain/CMakeLists.txt deleted file mode 100644 index e8b25319ad9..00000000000 --- a/src/coreComponents/integrationTests/toolchain/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Specify list of tests -set( gtest_geosx_tests testToolchain.cpp ) - -# NOTE: we explicitly depend on internal libraries in order to check for the spurious addition of -DNDEBUG flag -set( dependencyList ${parallelDeps} physicsSolvers ) -set( tplDependencyList ${parallelDeps} gtest HDF5::HDF5 optionparser ) -geos_decorate_link_dependencies( LIST decoratedDependencies - DEPENDENCIES ${dependencyList} ) - -# Add gtest C++ based tests -foreach(test ${gtest_geosx_tests}) - get_filename_component( test_name ${test} NAME_WE ) - - blt_add_executable( NAME ${test_name} - SOURCES ${test} - OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON ${decoratedDependencies} ${tplDependencyList} ) - - geos_add_test( NAME ${test_name} - COMMAND ${test_name} ) - - # NOTE: we explicitly depend on internal headers in order to check for the spurious addition of -DNDEBUG flag - target_include_directories( ${test_name} PUBLIC ${CMAKE_SOURCE_DIR}/coreComponents ) -endforeach() diff --git a/src/coreComponents/integrationTests/toolchain/testToolchain.cpp b/src/coreComponents/integrationTests/toolchain/testToolchain.cpp deleted file mode 100644 index 5bb8eb0ccc5..00000000000 --- a/src/coreComponents/integrationTests/toolchain/testToolchain.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#include "common/GeosxConfig.hpp" -#include - -TEST( Toolchain, NDEBUGfromTPls ) -{ - /* - * This test guards against spurious propagation of -DNDEBUG preprocessor flag - * (HDF5 from the TPLs in our case), which has the bogus effect of disabling LvArray assertions: - * we check that we are in RelWithDebInfo or Release build type when NDEBUG is defined and in Debug - * configuration when NDEBUG is not defined: thus, LvArray assertions remain in Debug builds. - */ - bool constexpr isDebug = std::string_view( GEOS_CMAKE_BUILD_TYPE ) == std::string_view( "Debug" ); - -#ifdef NDEBUG - ASSERT_FALSE( isDebug ); // RelWithDebInfo or Release builds only -#else - ASSERT_TRUE( isDebug ); // Debug builds only -#endif -} - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - - int const result = RUN_ALL_TESTS(); - - return result; -} diff --git a/src/coreComponents/integrationTests/virtualElementTests/CMakeLists.txt b/src/coreComponents/integrationTests/virtualElementTests/CMakeLists.txt deleted file mode 100644 index 0d99a9b63ca..00000000000 --- a/src/coreComponents/integrationTests/virtualElementTests/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -# Specify list of tests -set( testSources - testConformingVirtualElementOrder1.cpp ) - -set( tplDependencyList ${parallelDeps} gtest ) - -set( dependencyList mainInterface ) - -geos_decorate_link_dependencies( LIST decoratedDependencies - DEPENDENCIES ${dependencyList} ) - - -# Add gtest C++ based tests -foreach(test ${testSources}) - get_filename_component( test_name ${test} NAME_WE ) - blt_add_executable( NAME ${test_name} - SOURCES ${test} - OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON ${decoratedDependencies} ${tplDependencyList} ) - - geos_add_test( NAME ${test_name} - COMMAND ${test_name} ) - - if( ( NOT ${ENABLE_CUDA} ) AND ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) ) - set_target_properties(${test_name} PROPERTIES COMPILE_FLAGS "-Wno-everything") - endif() - -endforeach() - -if ( ENABLE_CUDA ) -#blt_add_target_compile_flags( TO testShapeFunctionKernel -# FLAGS "--maxrregcount=64") -endif() diff --git a/src/coreComponents/integrationTests/virtualElementTests/testConformingVirtualElementOrder1.cpp b/src/coreComponents/integrationTests/virtualElementTests/testConformingVirtualElementOrder1.cpp deleted file mode 100644 index 266ce88d436..00000000000 --- a/src/coreComponents/integrationTests/virtualElementTests/testConformingVirtualElementOrder1.cpp +++ /dev/null @@ -1,374 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -// Source includes -#include "mainInterface/initialization.hpp" -#include "mainInterface/ProblemManager.hpp" -#include "finiteElement/elementFormulations/ConformingVirtualElementOrder1.hpp" -#include "mesh/DomainPartition.hpp" -#include "mainInterface/GeosxState.hpp" -#include "mesh/MeshManager.hpp" -#include "codingUtilities/UnitTestUtilities.hpp" - -// TPL includes -#include "gtest/gtest.h" - -using namespace geos; -using namespace finiteElement; -using namespace geos::testing; - -CommandLineOptions g_commandLineOptions; -constexpr real64 absTol = geos::testing::DEFAULT_ABS_TOL; -constexpr real64 relTol = geos::testing::DEFAULT_REL_TOL*10; - -template< typename VEM > -GEOS_HOST_DEVICE -static void checkIntegralMeanConsistency( FiniteElementBase const & feBase, - typename VEM::StackVariables const & stack, - real64 & sumBasisFunctions ) -{ - static constexpr localIndex - maxSupportPoints = VEM::maxSupportPoints; - real64 basisFunctionsIntegralMean[maxSupportPoints]; - VEM::calcN( 0, stack, basisFunctionsIntegralMean ); - sumBasisFunctions = 0; - for( localIndex iBasisFun = 0; - iBasisFun < feBase.template numSupportPoints< VEM >( stack ); ++iBasisFun ) - { - sumBasisFunctions += basisFunctionsIntegralMean[iBasisFun]; - } -} - -template< typename VEM > -GEOS_HOST_DEVICE -static void -checkIntegralMeanDerivativesConsistency( FiniteElementBase const & feBase, - typename VEM::StackVariables const & stack, - real64 & sumXDerivatives, - real64 & sumYDerivatives, - real64 & sumZDerivatives ) -{ - static constexpr localIndex - maxSupportPoints = VEM::maxSupportPoints; - real64 const dummy[VEM::numNodes][3] { { 0.0 } }; - localIndex const k = 0; - for( localIndex q = 0; q < VEM::numQuadraturePoints; ++q ) - { - real64 basisDerivativesIntegralMean[maxSupportPoints][3]{}; - feBase.template getGradN< VEM >( k, q, dummy, stack, basisDerivativesIntegralMean ); - sumXDerivatives = 0; sumYDerivatives = 0; sumZDerivatives = 0; - for( localIndex iBasisFun = 0; - iBasisFun < feBase.template numSupportPoints< VEM >( stack ); - ++iBasisFun ) - { - sumXDerivatives += basisDerivativesIntegralMean[iBasisFun][0]; - sumYDerivatives += basisDerivativesIntegralMean[iBasisFun][1]; - sumZDerivatives += basisDerivativesIntegralMean[iBasisFun][2]; - } - } -} - -template< typename VEM > -GEOS_HOST_DEVICE -static void -checkStabilizationMatrixConsistency ( arrayView2d< real64 const, - nodes::REFERENCE_POSITION_USD > const & nodesCoords, - localIndex const & cellIndex, - traits::ViewTypeConst< CellElementSubRegion::NodeMapType > const & cellToNodes, - arrayView2d< real64 const > const & cellCenters, - FiniteElementBase const & feBase, - typename VEM::StackVariables const & stack, - arraySlice1d< real64 > & stabTimeMonomialDofsNorm ) -{ - static constexpr localIndex - maxSupportPoints = VEM::maxSupportPoints; - localIndex const numCellPoints = cellToNodes[cellIndex].size(); - - real64 cellDiameter = 0; - for( localIndex numVertex = 0; numVertex < numCellPoints; ++numVertex ) - { - for( localIndex numOthVertex = 0; numOthVertex < numVertex; ++numOthVertex ) - { - real64 vertDiff[ 3 ]{}; - LvArray::tensorOps::copy< 3 >( vertDiff, nodesCoords[cellToNodes( cellIndex, numVertex )] ); - LvArray::tensorOps::subtract< 3 >( vertDiff, - nodesCoords[cellToNodes( cellIndex, numOthVertex )] ); - real64 const candidateDiameter = LvArray::tensorOps::l2NormSquared< 3 >( vertDiff ); - if( cellDiameter < candidateDiameter ) - { - cellDiameter = candidateDiameter; - } - } - } - cellDiameter = LvArray::math::sqrt< real64 >( cellDiameter ); - real64 const invCellDiameter = 1.0/cellDiameter; - - stackArray2d< real64, 3*VEM::numNodes > monomialVemDofs( 3, numCellPoints ); - for( localIndex numVertex = 0; numVertex < numCellPoints; ++numVertex ) - { - for( localIndex pos = 0; pos < 3; ++pos ) - monomialVemDofs[ pos ][ numVertex ] = invCellDiameter* - (nodesCoords( cellToNodes( cellIndex, numVertex ), pos ) - cellCenters( cellIndex, pos )); - } - - stackArray1d< real64, VEM::numNodes > stabTimeMonomialDofs( numCellPoints ); - real64 stabilizationMatrix[maxSupportPoints][maxSupportPoints]{}; - feBase.template addGradGradStabilizationMatrix< VEM, 1, false >( stack, - - stabilizationMatrix ); - stabTimeMonomialDofsNorm( 0 ) = 0.0; - for( localIndex i = 0; i < numCellPoints; ++i ) - { - stabTimeMonomialDofs( i ) = 0.0; - stabTimeMonomialDofsNorm( 0 ) = 0.0; - for( localIndex j = 0; j < numCellPoints; ++j ) - { - stabTimeMonomialDofs( i ) += stabilizationMatrix[ i ][ j ]; - } - stabTimeMonomialDofsNorm( 0 ) += stabTimeMonomialDofs( i ) * stabTimeMonomialDofs( i ); - } - - for( localIndex monomInd = 0; monomInd < 3; ++monomInd ) - { - stabTimeMonomialDofsNorm( monomInd+1 ) = 0; - for( localIndex i = 0; i < numCellPoints; ++i ) - { - stabTimeMonomialDofs( i ) = 0.0; - for( localIndex j = 0; j < numCellPoints; ++j ) - { - stabTimeMonomialDofs( i ) += stabilizationMatrix[ i ][ j ] * monomialVemDofs( monomInd, j ); - } - stabTimeMonomialDofsNorm( monomInd+1 ) += stabTimeMonomialDofs( i ) * stabTimeMonomialDofs( i ); - } - } - -} - -template< typename VEM > -GEOS_HOST_DEVICE -static void checkSumOfQuadratureWeights( typename VEM::StackVariables stack, - real64 & sumOfQuadratureWeights ) -{ - static constexpr localIndex - maxSupportPoints = VEM::maxSupportPoints; - sumOfQuadratureWeights = 0.0; - real64 const dummy[maxSupportPoints][3]{}; - for( localIndex q = 0; q < VEM::numQuadraturePoints; ++q ) - { - real64 const weight = VEM::transformedQuadratureWeight( q, dummy, stack ); - sumOfQuadratureWeights += weight; - } -} - -template< localIndex MAXCELLNODES, localIndex MAXFACENODES > -static void testCellsInMeshLevel( MeshLevel const & mesh ) -{ - // Get managers. - ElementRegionManager const & elementManager = mesh.getElemManager(); - CellElementRegion const & cellRegion = - elementManager.getRegion< CellElementRegion >( 0 ); - CellElementSubRegion const & cellSubRegion = - cellRegion.getSubRegion< CellElementSubRegion >( 0 ); - NodeManager const & nodeManager = mesh.getNodeManager(); - FaceManager const & faceManager = mesh.getFaceManager(); - EdgeManager const & edgeManager = mesh.getEdgeManager(); - - // Get geometric properties to be passed as inputs. - arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > nodesCoords = - nodeManager.referencePosition(); - traits::ViewTypeConst< CellElementSubRegion::NodeMapType > const & cellToNodeMap = cellSubRegion.nodeList(); - arrayView2d< real64 const > cellCenters = cellSubRegion.getElementCenter(); - arrayView1d< real64 const > cellVolumes = cellSubRegion.getElementVolume(); - - // Allocate and fill a VEM::MeshData struct. - using VEM = ConformingVirtualElementOrder1< MAXCELLNODES, MAXFACENODES >; - typename VEM::template MeshData< CellElementSubRegion > meshData; - FiniteElementBase::initialize< VEM >( nodeManager, edgeManager, - faceManager, cellSubRegion, - meshData ); - - // Arrays that store quantities to be tested. - localIndex const numCells = cellSubRegion.getElementVolume().size(); - array1d< real64 > sumBasisFunctions( numCells ), sumXDerivatives( numCells ), - sumYDerivatives( numCells ), sumZDerivatives( numCells ), sumOfQuadWeights( numCells ); - array2d< real64 > stabTimeMonomialDofsNorm( numCells, 4 ); - - // Get views of test arrays - arrayView1d< real64 > sumBasisFunctionsView = sumBasisFunctions.toView(), - sumXDerivativesView = sumXDerivatives.toView(), - sumYDerivativesView = sumYDerivatives.toView(), - sumZDerivativesView = sumZDerivatives.toView(), - sumOfQuadWeightsView = sumOfQuadWeights.toView(); - arrayView2d< real64 > stabTimeMonomialDofsNormView = stabTimeMonomialDofsNorm.toView(); - - // Loop over cells on the device. - forAll< geos::parallelDevicePolicy< > >( numCells, [=] GEOS_HOST_DEVICE - ( localIndex const cellIndex ) - { - typename VEM::StackVariables stack; - VEM virtualElement; - virtualElement.template setup< VEM >( cellIndex, meshData, stack ); - - checkIntegralMeanConsistency< VEM >( virtualElement, stack, - sumBasisFunctionsView( cellIndex ) ); - checkIntegralMeanDerivativesConsistency< VEM >( virtualElement, stack, - sumXDerivativesView( cellIndex ), - sumYDerivativesView( cellIndex ), - sumZDerivativesView( cellIndex ) - ); - arraySlice1d< real64 > thisCellStabTimeMonomialDofs = stabTimeMonomialDofsNormView[cellIndex]; - checkStabilizationMatrixConsistency< VEM >( nodesCoords, cellIndex, cellToNodeMap, - cellCenters, virtualElement, stack, - thisCellStabTimeMonomialDofs ); - checkSumOfQuadratureWeights< VEM >( stack, sumOfQuadWeightsView( cellIndex ) ); - } ); - - // Perform checks. - forAll< serialPolicy >( numCells, [=] ( localIndex const cellIndex ) - { - checkRelativeError( sumXDerivativesView( cellIndex ), 0.0, relTol, absTol, - "Sum of integral means of x-derivatives of basis functions" ); - checkRelativeError( sumYDerivativesView( cellIndex ), 0.0, relTol, absTol, - "Sum of integral means of y-derivatives of basis functions" ); - checkRelativeError( sumZDerivativesView( cellIndex ), 0.0, relTol, absTol, - "Sum of integral means of z-derivatives of basis functions" ); - checkRelativeError( sumBasisFunctionsView( cellIndex ), 1.0, relTol, absTol, - "Sum of integral means of basis functions" ); - for( localIndex monomInd = 0; monomInd < 4; ++monomInd ) - { - string const name = "Product of stabilization matrix and degrees of freedom of monomial " + std::to_string( monomInd ); - checkRelativeError( stabTimeMonomialDofsNormView( cellIndex, monomInd ), 0.0, relTol, absTol, - name ); - } - checkRelativeError( sumOfQuadWeightsView( cellIndex ), cellVolumes( cellIndex ), relTol, absTol, - "Sum of quadrature weights" ); - } ); -} - -TEST( ConformingVirtualElementOrder1, hexahedra ) -{ - string const inputStream= - "" - " " - " " - " " - " " - " " - " " - ""; - - xmlWrapper::xmlDocument inputFile; - xmlWrapper::xmlResult xmlResult = inputFile.loadString( inputStream ); - if( !xmlResult ) - { - GEOS_LOG_RANK_0( "XML parsed with errors!" ); - GEOS_LOG_RANK_0( "Error description: " << xmlResult.description()); - GEOS_LOG_RANK_0( "Error offset: " << xmlResult.offset ); - } - xmlWrapper::xmlNode xmlProblemNode = inputFile.getChild( dataRepository::keys::ProblemManager ); - - GeosxState state( std::make_unique< CommandLineOptions >( g_commandLineOptions ) ); - - ProblemManager & problemManager = state.getProblemManager(); - problemManager.processInputFileRecursive( inputFile, xmlProblemNode ); - - // Open mesh levels - DomainPartition & domain = problemManager.getDomainPartition(); - MeshManager & meshManager = problemManager.getGroup< MeshManager >( problemManager.groupKeys - .meshManager ); - meshManager.generateMeshLevels( domain ); - MeshLevel & mesh = domain.getMeshBody( 0 ).getBaseDiscretization(); - ElementRegionManager & elementManager = mesh.getElemManager(); - xmlWrapper::xmlNode topLevelNode = xmlProblemNode.child( elementManager.getName().c_str() ); - elementManager.processInputFileRecursive( inputFile, topLevelNode ); - elementManager.postInputInitializationRecursive(); - problemManager.problemSetup(); - - // Test computed projectors for all cells in MeshLevel - testCellsInMeshLevel< 10, 6 >( mesh ); -} - -TEST( ConformingVirtualElementOrder1, wedges ) -{ - string const inputStream= - "" - " " - " " - " " - " " - " " - " " - ""; - xmlWrapper::xmlDocument inputFile; - xmlWrapper::xmlResult xmlResult = inputFile.loadString( inputStream ); - if( !xmlResult ) - { - GEOS_LOG_RANK_0( "XML parsed with errors!" ); - GEOS_LOG_RANK_0( "Error description: " << xmlResult.description()); - GEOS_LOG_RANK_0( "Error offset: " << xmlResult.offset ); - } - xmlWrapper::xmlNode xmlProblemNode = inputFile.getChild( dataRepository::keys::ProblemManager ); - - GeosxState state( std::make_unique< CommandLineOptions >( g_commandLineOptions ) ); - - ProblemManager & problemManager = state.getProblemManager(); - problemManager.processInputFileRecursive( inputFile, xmlProblemNode ); - - // Open mesh levels - DomainPartition & domain = problemManager.getDomainPartition(); - MeshManager & meshManager = problemManager.getGroup< MeshManager > - ( problemManager.groupKeys.meshManager ); - meshManager.generateMeshLevels( domain ); - MeshLevel & mesh = domain.getMeshBody( 0 ).getBaseDiscretization(); - ElementRegionManager & elementManager = mesh.getElemManager(); - xmlWrapper::xmlNode topLevelNode = xmlProblemNode.child( elementManager.getName().c_str() ); - elementManager.processInputFileRecursive( inputFile, topLevelNode ); - elementManager.postInputInitializationRecursive(); - problemManager.problemSetup(); - - // Test computed projectors for all cells in MeshLevel - testCellsInMeshLevel< 8, 9 >( mesh ); -} - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - g_commandLineOptions = *geos::basicSetup( argc, argv ); - int const result = RUN_ALL_TESTS(); - geos::basicCleanup(); - return result; -} diff --git a/src/coreComponents/integrationTests/wellsTests/testWellEnums.cpp b/src/coreComponents/integrationTests/wellsTests/testWellEnums.cpp deleted file mode 100644 index 27b318e4511..00000000000 --- a/src/coreComponents/integrationTests/wellsTests/testWellEnums.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * ------------------------------------------------------------------------------------------------------------ - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC - * Copyright (c) 2018-2024 TotalEnergies - * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University - * Copyright (c) 2023-2024 Chevron - * Copyright (c) 2019- GEOS/GEOSX Contributors - * All rights reserved - * - * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. - * ------------------------------------------------------------------------------------------------------------ - */ - -#include "physicsSolvers/fluidFlow/wells/WellControls.hpp" - -#include - -using namespace geos; - -// The `ENUM_STRING` implementation relies on consistency between the order of the `enum`, -// and the order of the `string` array provided. Since this consistency is not enforced, it can be corrupted anytime. -// This unit test aims at preventing from this implicit relationship to bring a bug. - -TEST( WellControlsEnums, Type ) -{ - using EnumType = WellControls::Type; - - ASSERT_EQ( "producer", toString( EnumType::PRODUCER ) ); - ASSERT_EQ( "injector", toString( EnumType::INJECTOR ) ); -} - - -TEST( WellControlsEnums, Control ) -{ - using EnumType = WellControls::Control; - - ASSERT_EQ( "BHP", toString( EnumType::BHP ) ); - ASSERT_EQ( "phaseVolRate", toString( EnumType::PHASEVOLRATE ) ); - ASSERT_EQ( "totalVolRate", toString( EnumType::TOTALVOLRATE ) ); -} - - -int main( int argc, char * * argv ) -{ - ::testing::InitGoogleTest( &argc, argv ); - return RUN_ALL_TESTS(); -} From 8de8e7548cb15682d2b29ce7670e5f1e4dd1969d Mon Sep 17 00:00:00 2001 From: li97 Date: Thu, 18 Dec 2025 16:29:38 -0800 Subject: [PATCH 12/17] correct kirchhoff stress --- .../solid/ElasticIsotropicFiniteStrain.hpp | 12 +---- .../ImplicitFiniteStrainQuasiStatic.hpp | 54 ++++++++++++++++--- .../ImplicitFiniteStrainQuasiStatic_impl.hpp | 33 +++++++++--- 3 files changed, 76 insertions(+), 23 deletions(-) diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp index 3c6a147be1a..01e310677e2 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp @@ -177,10 +177,6 @@ void ElasticIsotropicFiniteStrainUpdates::computeMaterialTangentColumn( real64 dtau_voigt[6] = {}; real64 deltaTau[3][3] = {}; LvArray::tensorOps::Ri_eq_AijBj<6, 6>(dtau_voigt, dtau_dEe, deltaEe); - // scale back - dtau_voigt[3] *= 0.5; - dtau_voigt[4] *= 0.5; - dtau_voigt[5] *= 0.5; LvArray::tensorOps::symmetricToDense<3>(deltaTau, dtau_voigt); // deltaTau * F^-T @@ -198,10 +194,6 @@ void ElasticIsotropicFiniteStrainUpdates::finiteStrainNoStateUpdate_StressOnly(l { this->smallStrainNoStateUpdate_StressOnly(k, q, totalElasticStrain, kirchhoffStress); - // scale back - kirchhoffStress[3] *= 0.5; - kirchhoffStress[4] *= 0.5; - kirchhoffStress[5] *= 0.5; LvArray::tensorOps::Rij_eq_symAikBjk<3>(firstPiolaStress, kirchhoffStress, fInv); } @@ -216,7 +208,7 @@ void ElasticIsotropicFiniteStrainUpdates::finiteStrainUpdate_StressOnly(localInd real64 kirchhoffStress[6] = {}; finiteStrainNoStateUpdate_StressOnly(k, q, totalElasticStrain, fInv, firstPiolaStress, kirchhoffStress); - // Can only save the symmetric kirchhoff stress right now, the shear stress compoenents are scaled back by 0.5 + // Can only save the symmetric kirchhoff stress right now LvArray::tensorOps::copy<6>(m_oldStress[k][q], m_newStress[k][q]); LvArray::tensorOps::copy<6>(m_newStress[k][q], kirchhoffStress); } @@ -329,7 +321,7 @@ void ElasticIsotropicFiniteStrainUpdates::finiteStrainUpdate(localIndex const k, real64 kirchhoffStress[6] = {}; finiteStrainNoStateUpdate(k, q, elasticDeformGrad, firstPiolaStress, kirchhoffStress, stiffness); - // Can only save the symmetric kirchhoff stress right now, the shear stress compoenents are scaled back by 0.5 + // Can only save the symmetric kirchhoff stress right now LvArray::tensorOps::copy<6>(m_oldStress[k][q], m_newStress[k][q]); LvArray::tensorOps::copy<6>(m_newStress[k][q], kirchhoffStress); } diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp index 69a6b9cc913..b44f218ded7 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp @@ -17,8 +17,8 @@ * @file ImplicitFiniteStrainQuasistatic.hpp */ -#ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_HPP_ -#define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_HPP_ +#ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITESTRAINQUASISTATIC_HPP_ +#define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITESTRAINQUASISTATIC_HPP_ #include "finiteElement/kernelInterface/ImplicitKernelBase.hpp" #include "physicsSolvers/solidMechanics/SolidMechanicsFields.hpp" @@ -123,7 +123,7 @@ class ImplicitFiniteStrainQuasiStatic : real64 uhat_local[numNodesPerElem][numDofPerTrialSupportPoint]; /// Stack storage for the constitutive stiffness at a quadrature point. - real64 constitutiveStiffness[ 6 ][ 6 ]; + real64 constitutiveStiffness[ 9 ][ 9 ]; }; //***************************************************************************** @@ -165,7 +165,7 @@ class ImplicitFiniteStrainQuasiStatic : * @param stress The stress array. */ GEOS_HOST_DEVICE inline constexpr - void operator() ( real64 (& stress)[6] ) + void operator() ( real64 (& stress)[3][3] ) { GEOS_UNUSED_VAR( stress ); } @@ -186,7 +186,49 @@ class ImplicitFiniteStrainQuasiStatic : void quadraturePointKernel(localIndex const k, localIndex const q, StackVariables & stack, STRESS_MODIFIER && stressModifier = NoOpFunctors{}) const; -} + /** + * @copydoc geos::finiteElement::ImplicitKernelBase::complete + */ + GEOS_HOST_DEVICE + inline + real64 complete( localIndex const k, + StackVariables & stack ) const; + + /** + * @copydoc geos::finiteElement::KernelBase::kernelLaunch + */ + template< typename POLICY, + typename KERNEL_TYPE > + static real64 + kernelLaunch( localIndex const numElems, + KERNEL_TYPE const & kernelComponent ); + +protected: + /// The array containing the nodal position array. + arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const m_X; + + /// The rank-global displacement array. + arrayView2d< real64 const, nodes::TOTAL_DISPLACEMENT_USD > const m_disp; + + /// The rank-global incremental displacement array. + arrayView2d< real64 const, nodes::INCR_DISPLACEMENT_USD > const m_uhat; + + /// The gravity vector. + real64 const m_gravityVector[3]; + + /// The rank global density + arrayView2d< real64 const > const m_density; + +}; + +/// The factory used to construct a QuasiStatic kernel. +using QuasiStaticFactory = finiteElement::KernelFactory< ImplicitFiniteStrainQuasiStatic, + arrayView1d< globalIndex const > const, + globalIndex, + CRSMatrixView< real64, globalIndex const > const, + arrayView1d< real64 > const, + real64 const, + real64 const (&)[3] >; } // namespace solidMechanicsLagrangianFEMKernels @@ -194,4 +236,4 @@ class ImplicitFiniteStrainQuasiStatic : #include "finiteElement/kernelInterface/SparsityKernelBase.hpp" -#endif // GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_HPP_ \ No newline at end of file +#endif // GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITESTRAINQUASISTATIC_HPP_ \ No newline at end of file diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp index 14e8471e8fd..2e463550830 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp @@ -17,8 +17,8 @@ * @file ImplicitFinitStrainQuasiStatic_impl.hpp */ -#ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_IMPL_HPP_ -#define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_IMPL_HPP_ +#ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITESTRAINQUASISTATIC_IMPL_HPP_ +#define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITESTRAINQUASISTATIC_IMPL_HPP_ #include "ImplicitFinitStrainQuasiStatic.hpp" namespace geos @@ -85,9 +85,8 @@ void ImplicitFiniteStrainQuasiStatic real64 dNdX[numNodesPerElem][3]; real64 const detJxW = m_finiteElementSpace.template getGradN(k, q, stack.xLocal, stack.feStack, dNdX); - real64 stress[6] = {0}; - - typename CONSTITUTIVE_TYPE::KernelWrapper::DiscretizationOps stiffness; + real64 stress[3][3] = { {0} }; + real64 stiffness[9][9] = { {0} }; real64 dUhatdX[3][3] = { {0} }; real64 dUdX[3][3] = { {0} }; @@ -101,11 +100,31 @@ void ImplicitFiniteStrainQuasiStatic LvArray::tensorOps::add<3, 3>(F, dUhatdX); LvArray::tensorOps::addIdentity< 3 >(F, 1.0); - m_constitutiveUpdate.finiteStrainUpdate(k, q, m_dt, F, stress, stiffness); + m_constitutiveUpdate.finiteStrainUpdate(k, q, F, stress, stiffness); + + stressModifier(stress); + + for (localIndex i = 0; i < 3; ++i) { + for (localIndex j = 0; j < 3; ++j) { + stress[i][j] *= -detJxW; + } + } + + real64 const gravityForce[3] = { m_gravityVector[0] * m_density( k, q )* detJxW, + m_gravityVector[1] * m_density( k, q )* detJxW, + m_gravityVector[2] * m_density( k, q )* detJxW }; + + real64 N[numNodesPerElem]; + FE_TYPE::calcN( q, stack.feStack, N ); + FE_TYPE::plusGradNajAijPlusNaFi( dNdX, + stress, + N, + gravityForce, + reinterpret_cast< real64 (&)[numNodesPerElem][3] >(stack.localResidual) ); } } // namespace solidMechanicsLagrangianFEMKernels } // namespace geos -#endif // GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITSTRAINQUASISTATIC_IMPL_HPP_ \ No newline at end of file +#endif // GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITESTRAINQUASISTATIC_IMPL_HPP_ \ No newline at end of file From 91638f22269aafa9f7007064b31aad898183a7a5 Mon Sep 17 00:00:00 2001 From: li97 Date: Wed, 7 Jan 2026 12:25:42 -0800 Subject: [PATCH 13/17] finite strain kernel compiled --- .../constitutive/CMakeLists.txt | 1 + .../solid/ElasticIsotropicFiniteStrain.hpp | 23 ++++-- .../SolidModelDiscretizationOpsFullTensor.hpp | 78 +++++++++++++++++++ .../solidMechanics/CMakeLists.txt | 1 + .../SolidMechanicsLagrangianFEM.cpp | 2 + .../solidMechanics/kernelSpecs.json | 24 ++++++ .../ImplicitFiniteStrainQuasiStatic.hpp | 20 ++--- .../ImplicitFiniteStrainQuasiStatic_impl.hpp | 67 +++++++++++++--- ...csImplicitFiniteStrainKernels.cpp.template | 38 +++++++++ .../solidMechanics/kernels/policies.hpp.in | 1 + 10 files changed, 230 insertions(+), 25 deletions(-) create mode 100644 src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullTensor.hpp create mode 100644 src/coreComponents/physicsSolvers/solidMechanics/kernels/SolidMechanicsImplicitFiniteStrainKernels.cpp.template diff --git a/src/coreComponents/constitutive/CMakeLists.txt b/src/coreComponents/constitutive/CMakeLists.txt index 363397f49ba..edb22149788 100644 --- a/src/coreComponents/constitutive/CMakeLists.txt +++ b/src/coreComponents/constitutive/CMakeLists.txt @@ -204,6 +204,7 @@ set( constitutive_headers solid/SolidModelDiscretizationOpsIsotropic.hpp solid/SolidModelDiscretizationOpsTransverseIsotropic.hpp solid/SolidModelDiscretizationOpsOrthotropic.hpp + solid/SolidModelDiscretizationOpsFullTensor.hpp solid/CeramicDamage.hpp solid/SolidFields.hpp solid/porosity/PorosityFields.hpp diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp index 01e310677e2..66ec7b5e117 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp @@ -22,7 +22,7 @@ #include "ElasticIsotropic.hpp" #include "PropertyConversions.hpp" -#include "SolidModelDiscretizationOpsFullyAnisotropic.hpp" +#include "SolidModelDiscretizationOpsFullTensor.hpp" #include "LvArray/src/tensorOps.hpp" namespace geos{ @@ -64,10 +64,7 @@ class ElasticIsotropicFiniteStrainUpdates : public ElasticIsotropicUpdates ElasticIsotropicFiniteStrainUpdates & operator=( ElasticIsotropicFiniteStrainUpdates && ) = delete; /// Use the uncompressed version of the stiffness bilinear form - using DiscretizationOps = SolidModelDiscretizationOpsFullyAnisotropic; - - // // Bring in base implementations to prevent hiding warnings - // using ElasticIsotropicUpdates::smallStrainNoStateUpdate; + using DiscretizationOps = SolidModelDiscretizationOpsFullTensor; // returns first Piola-Kirchhoff stress which is asymmetric GEOS_HOST_DEVICE @@ -98,6 +95,12 @@ class ElasticIsotropicFiniteStrainUpdates : public ElasticIsotropicUpdates real64 (&firstPiolaStress)[3][3], real64 (&stiffness)[9][9]) const; + GEOS_HOST_DEVICE + void finiteStrainUpdate(localIndex const k, localIndex const q, + real64 const (&elasticDeformGrad)[3][3], + real64 (&firstPiolaStress)[3][3], + DiscretizationOps & stiffness) const; + GEOS_HOST_DEVICE void computeLogElasticStrain(real64 const (&elasticDeformGrad)[3][3], real64 (&elasticStrain)[6], @@ -326,6 +329,16 @@ void ElasticIsotropicFiniteStrainUpdates::finiteStrainUpdate(localIndex const k, LvArray::tensorOps::copy<6>(m_newStress[k][q], kirchhoffStress); } +GEOS_HOST_DEVICE +inline +void ElasticIsotropicFiniteStrainUpdates::finiteStrainUpdate(localIndex const k, localIndex const q, + real64 const (&elasticDeformGrad)[3][3], + real64 (&firstPiolaStress)[3][3], + DiscretizationOps & stiffness) const +{ + finiteStrainUpdate(k, q, elasticDeformGrad, firstPiolaStress, stiffness.m_c); +} + /** * @class ElasticIsotropicFiniteStrain * diff --git a/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullTensor.hpp b/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullTensor.hpp new file mode 100644 index 00000000000..e985c816af2 --- /dev/null +++ b/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullTensor.hpp @@ -0,0 +1,78 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +/** + * @file SolidModelDiscretizationOpsFullTensor.hpp + */ + +#ifndef GEOS_CONSTITUTIVE_SOLID_SOLIDMODELDISCRETIAZTIONOPSFULLTENSOR_HPP_ +#define GEOS_CONSTITUTIVE_SOLID_SOLIDMODELDISCRETIAZTIONOPSFULLTENSOR_HPP_ + +#include "SolidModelDiscretizationOps.hpp" + +namespace geos +{ +namespace constitutive +{ + +struct SolidModelDiscretizationOpsFullTensor : public SolidModelDiscretizationOps +{ + template< int NUM_SUPPORT_POINTS, + typename BASIS_GRADIENT > + GEOS_HOST_DEVICE + void BTDB( BASIS_GRADIENT const & gradN, + real64 const & detJxW, + real64 ( &elementStiffness )[NUM_SUPPORT_POINTS*3][NUM_SUPPORT_POINTS*3] ); + + GEOS_HOST_DEVICE + inline + void scaleParams( real64 const scale ) + { + LvArray::tensorOps::scale< 9, 9 >( m_c, scale ); + } + + real64 m_c[9][9]; +}; + +template< int NUM_SUPPORT_POINTS, + typename BASIS_GRADIENT > +GEOS_HOST_DEVICE +inline +void SolidModelDiscretizationOpsFullTensor::BTDB( BASIS_GRADIENT const & gradN, + real64 const & detJxW, + real64 (& elementStiffness)[NUM_SUPPORT_POINTS *3][NUM_SUPPORT_POINTS *3] ) +{ + real64 B[9][NUM_SUPPORT_POINTS * 3]; + + for (int a = 0; a < NUM_SUPPORT_POINTS; ++a) { + for (int i = 0; i < 3; ++i) { + int col = 3 * a + i; + for (int j = 0; j < 3; ++j) { + int row = 3 * i + j; + B[row][col] = gradN[a][j]; + } + } + } + + real64 DB[9][NUM_SUPPORT_POINTS * 3]; + LvArray::tensorOps::Rij_eq_AikBkj<9, NUM_SUPPORT_POINTS * 3, 9>(DB, m_c, B); + LvArray::tensorOps::Rij_eq_AkiBkj(elementStiffness, B, DB); + LvArray::tensorOps::scale(elementStiffness, detJxW); +} + +} // namespace constitutive +} // namespace geos + +#endif /* GEOS_CONSTITUTIVE_SOLID_SOLIDMODELDISCRETIAZTIONOPSFULLTENSOR_HPP_ */ \ No newline at end of file diff --git a/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt b/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt index e764b38398d..4a8d25eeb37 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt +++ b/src/coreComponents/physicsSolvers/solidMechanics/CMakeLists.txt @@ -84,6 +84,7 @@ set( kernelTemplateFileList "" ) list( APPEND kernelTemplateFileList kernels/SolidMechanicsKernels.cpp.template + kernels/SolidMechanicsImplicitFiniteStrainKernels.cpp.template kernels/SolidMechanicsFixedStressThermoPoromechanicsKernels.cpp.template ) diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp index 18e7714e97d..496baf50c7e 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp @@ -22,6 +22,7 @@ #include "SolidMechanicsLagrangianFEM.hpp" #include "kernels/ImplicitSmallStrainNewmark.hpp" #include "kernels/ImplicitSmallStrainQuasiStatic.hpp" +#include "kernels/ImplicitFiniteStrainQuasiStatic.hpp" #include "kernels/ExplicitSmallStrain.hpp" #include "kernels/ExplicitFiniteStrain.hpp" #include "kernels/FixedStressThermoPoromechanics.hpp" @@ -47,6 +48,7 @@ #include "physicsSolvers/LogLevelsInfo.hpp" #include "physicsSolvers/solidMechanics/kernels/SolidMechanicsKernelsDispatchTypeList.hpp" +#include "physicsSolvers/solidMechanics/kernels/SolidMechanicsImplicitFiniteStrainKernelsDispatchTypeList.hpp" #include "physicsSolvers/solidMechanics/kernels/SolidMechanicsFixedStressThermoPoromechanicsKernelsDispatchTypeList.hpp" #include "physicsSolvers/fluidFlow/FlowSolverBase.hpp" diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernelSpecs.json b/src/coreComponents/physicsSolvers/solidMechanics/kernelSpecs.json index 9eb41224111..13edef0b6a8 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/kernelSpecs.json +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernelSpecs.json @@ -74,6 +74,30 @@ "CellElementSubRegion#ElasticIsotropic#H1_Prism11_VEM_Gauss1" ] }, + "SolidMechanicsImplicitFiniteStrainKernels": { + "vars": [ "SUBREGION_TYPE", "CONSTITUTIVE_TYPE", "FE_TYPE" ], + "constants": [ + [ "ImplicitFiniteStrainQuasiStaticPolicy", "geos::parallelDevicePolicy< GEOS_BLOCK_SIZE >" ] + ], + "combinations": { + "SUBREGION_TYPE": [ + "CellElementSubRegion" + ], + "CONSTITUTIVE_TYPE": [ + "ElasticIsotropicFiniteStrain" + ], + "FE_TYPE": [ + "H1_Hexahedron_Lagrange1_GaussLegendre2", + "H1_Wedge_Lagrange1_Gauss6", + "H1_Tetrahedron_Lagrange1_Gauss1", + "H1_Tetrahedron_Lagrange1_Gauss5", + "H1_Tetrahedron_Lagrange1_Gauss14", + "H1_Pyramid_Lagrange1_Gauss5" + ] + }, + "explicit": [] + }, + "SolidMechanicsFixedStressThermoPoromechanicsKernels": { "vars": [ "SUBREGION_TYPE", diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp index b44f218ded7..71b89af9ada 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic.hpp @@ -85,7 +85,7 @@ class ImplicitFiniteStrainQuasiStatic : ImplicitFiniteStrainQuasiStatic(NodeManager const & nodeManager, EdgeManager const & edgeManager, FaceManager const & faceManager, localIndex const targetRegionIndex, SUBREGION_TYPE const & elementSubRegion, FE_TYPE const & finiteElementSpace, - CONSTITUTIVE_TYPE const & inputConstitutiveType, arrayView1d const inputDofNumber, + CONSTITUTIVE_TYPE & inputConstitutiveType, arrayView1d const inputDofNumber, globalIndex const rankOffset, CRSMatrixView const inputMatrix, arrayView1d const inputRhs, real64 const inputDt, real64 const (&inputGravityVector)[3]); @@ -138,7 +138,6 @@ class ImplicitFiniteStrainQuasiStatic : GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables & stack) const; - /// Hanyu: this may need to be implemented change Mandel stress to first PK /** * @brief Internal struct to provide no-op defaults used in the inclusion * of lambda functions into kernel component functions. @@ -221,14 +220,15 @@ class ImplicitFiniteStrainQuasiStatic : }; -/// The factory used to construct a QuasiStatic kernel. -using QuasiStaticFactory = finiteElement::KernelFactory< ImplicitFiniteStrainQuasiStatic, - arrayView1d< globalIndex const > const, - globalIndex, - CRSMatrixView< real64, globalIndex const > const, - arrayView1d< real64 > const, - real64 const, - real64 const (&)[3] >; +/// The factory used to construct a ImplicitFiniteStrainQuasiStatic kernel. +using ImplicitFiniteStrainQuasiStaticFactory = + finiteElement::KernelFactory< ImplicitFiniteStrainQuasiStatic, + arrayView1d< globalIndex const > const, + globalIndex, + CRSMatrixView< real64, globalIndex const > const, + arrayView1d< real64 > const, + real64 const, + real64 const (&)[3] >; } // namespace solidMechanicsLagrangianFEMKernels diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp index 2e463550830..165ff679e65 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp @@ -20,7 +20,7 @@ #ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITESTRAINQUASISTATIC_IMPL_HPP_ #define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITESTRAINQUASISTATIC_IMPL_HPP_ -#include "ImplicitFinitStrainQuasiStatic.hpp" +#include "ImplicitFiniteStrainQuasiStatic.hpp" namespace geos { @@ -28,10 +28,11 @@ namespace solidMechanicsLagrangianFEMKernels { template -ImplicitFiniteStrainQuasis :: ImplicitFinitStrainQuasiStatic( +ImplicitFiniteStrainQuasiStatic :: ImplicitFiniteStrainQuasiStatic( + NodeManager const & nodeManager, EdgeManager const & edgeManager, FaceManager const & faceManager, localIndex const targetRegionIndex, SUBREGION_TYPE const & elementSubRegion, FE_TYPE const & finiteElementSpace, - CONSTITUTIVE_TYPE const & inputConstitutiveType, arrayView1d const inputDofNumber, + CONSTITUTIVE_TYPE & inputConstitutiveType, arrayView1d const inputDofNumber, globalIndex const rankOffset, CRSMatrixView const inputMatrix, arrayView1d const inputRhs, real64 const inputDt, real64 const (&inputGravityVector)[3]) : Base(nodeManager, edgeManager, faceManager, targetRegionIndex, elementSubRegion, finiteElementSpace, @@ -54,7 +55,7 @@ void ImplicitFiniteStrainQuasiStatic localIndex const numSupportPoints = m_finiteElementSpace.template numSupportPoints(stack.feStack); stack.numRows = 3 * numSupportPoints; - stack.numRows = stack.numRows; + stack.numCols = stack.numRows; for (localIndex a = 0; a < numSupportPoints; ++a) { @@ -63,12 +64,12 @@ void ImplicitFiniteStrainQuasiStatic for (int i = 0; i < numDofPerTestSupportPoint; ++i) { #if defined(CALC_FEM_SHAPE_IN_KERNEL) - stack.xLocal[ a ][ i ] = m_X[ localNodeIndex ][ i ]; + stack.xLocal[a][i] = m_X[localNodeIndex][i]; #endif - stack.u_local[ a ][i] = m_disp[ localNodeIndex ][i]; - stack.uhat_local[ a ][i] = m_uhat[ localNodeIndex ][i]; - stack.localRowDofIndex[a*3+i] = m_dofNumber[localNodeIndex]+i; - stack.localColDofIndex[a*3+i] = m_dofNumber[localNodeIndex]+i; + stack.u_local[a][i] = m_disp[localNodeIndex][i]; + stack.uhat_local[a][i] = m_uhat[localNodeIndex][i]; + stack.localRowDofIndex[a * 3 + i] = m_dofNumber[localNodeIndex] + i; + stack.localColDofIndex[a * 3 + i] = m_dofNumber[localNodeIndex] + i; } } @@ -86,7 +87,8 @@ void ImplicitFiniteStrainQuasiStatic real64 const detJxW = m_finiteElementSpace.template getGradN(k, q, stack.xLocal, stack.feStack, dNdX); real64 stress[3][3] = { {0} }; - real64 stiffness[9][9] = { {0} }; + // real64 stiffness[9][9] = { {0} }; + typename CONSTITUTIVE_TYPE::KernelWrapper::DiscretizationOps stiffness; real64 dUhatdX[3][3] = { {0} }; real64 dUdX[3][3] = { {0} }; @@ -121,6 +123,51 @@ void ImplicitFiniteStrainQuasiStatic N, gravityForce, reinterpret_cast< real64 (&)[numNodesPerElem][3] >(stack.localResidual) ); + + stiffness.template BTDB(dNdX, -detJxW, stack.localJacobian); +} + +template +GEOS_HOST_DEVICE +GEOS_FORCE_INLINE +real64 ImplicitFiniteStrainQuasiStatic::complete( + localIndex const k, StackVariables & stack) const +{ + GEOS_UNUSED_VAR( k ); + real64 maxForce = 0; + + localIndex const numSupportPoints = m_finiteElementSpace.template numSupportPoints< FE_TYPE >( stack.feStack ); + + // #pragma unroll + for( int localNode = 0; localNode < numSupportPoints; ++localNode ) + { + // #pragma unroll + for( int dim = 0; dim < numDofPerTestSupportPoint; ++dim ) + { + localIndex const dof = LvArray::integerConversion< localIndex >( stack.localRowDofIndex[ numDofPerTestSupportPoint * localNode + dim ] - m_dofRankOffset ); + if( dof < 0 || dof >= m_matrix.numRows() ) + continue; + m_matrix.template addToRowBinarySearchUnsorted< parallelDeviceAtomic >( dof, + stack.localRowDofIndex, + stack.localJacobian[ numDofPerTestSupportPoint * localNode + dim ], + stack.numRows ); + + RAJA::atomicAdd< parallelDeviceAtomic >( &m_rhs[ dof ], stack.localResidual[ numDofPerTestSupportPoint * localNode + dim ] ); + maxForce = fmax( maxForce, fabs( stack.localResidual[ numDofPerTestSupportPoint * localNode + dim ] ) ); + } + } + + return maxForce; +} + +template +template +GEOS_FORCE_INLINE +real64 +ImplicitFiniteStrainQuasiStatic::kernelLaunch(localIndex const numElems, + KERNEL_TYPE const & kernelComponent) +{ + return Base::template kernelLaunch< POLICY, KERNEL_TYPE >( numElems, kernelComponent ); } } // namespace solidMechanicsLagrangianFEMKernels diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/SolidMechanicsImplicitFiniteStrainKernels.cpp.template b/src/coreComponents/physicsSolvers/solidMechanics/kernels/SolidMechanicsImplicitFiniteStrainKernels.cpp.template new file mode 100644 index 00000000000..231e328c807 --- /dev/null +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/SolidMechanicsImplicitFiniteStrainKernels.cpp.template @@ -0,0 +1,38 @@ +/* + * ------------------------------------------------------------------------------------------------------------ + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC + * Copyright (c) 2018-2024 TotalEnergies + * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University + * Copyright (c) 2023-2024 Chevron + * Copyright (c) 2019- GEOS/GEOSX Contributors + * All rights reserved + * + * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. + * ------------------------------------------------------------------------------------------------------------ + */ + +#include "physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp" + +using ImplicitFiniteStrainQuasiStaticPolicy = @ImplicitFiniteStrainQuasiStaticPolicy@; + +#define INSTANTIATION( NAME )\ +template class NAME < @SUBREGION_TYPE@, @CONSTITUTIVE_TYPE@, @FE_TYPE@ >; \ +template real64 NAME < @SUBREGION_TYPE@, @CONSTITUTIVE_TYPE@, @FE_TYPE@ >::kernelLaunch< NAME##Policy, \ + NAME < @SUBREGION_TYPE@, @CONSTITUTIVE_TYPE@, @FE_TYPE@ > > \ + ( localIndex const, \ + NAME < @SUBREGION_TYPE@, @CONSTITUTIVE_TYPE@, @FE_TYPE@ > const & ); \ + + +namespace geos +{ +using namespace constitutive; +using namespace finiteElement; +namespace solidMechanicsLagrangianFEMKernels +{ + INSTANTIATION( ImplicitFiniteStrainQuasiStatic ) +} +} + +#undef INSTANTIATION diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/policies.hpp.in b/src/coreComponents/physicsSolvers/solidMechanics/kernels/policies.hpp.in index c14654cf0c7..cf8eb3fba33 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/kernels/policies.hpp.in +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/policies.hpp.in @@ -21,6 +21,7 @@ using ExplicitFiniteStrainPolicy = @ExplicitFiniteStrainPolicy@; using FixedStressThermoPoromechanicsPolicy = @FixedStressThermoPoromechanicsPolicy@; using ImplicitSmallStrainNewmarkPolicy = @ImplicitSmallStrainNewmarkPolicy@; using ImplicitSmallStrainQuasiStaticPolicy = @ImplicitSmallStrainQuasiStaticPolicy@; +using ImplicitFiniteStrainQuasiStaticPolicy = @ImplicitFiniteStrainQuasiStaticPolicy@; #endif /* GEOS_CORECOMPONENTS_PHYSICSSOLVERSE_SOLIDMECHANICS_KERNELS_CONFIG_HPP */ From c1854de390d7cac44cec065c4e27219df7af0eda Mon Sep 17 00:00:00 2001 From: li97 Date: Thu, 15 Jan 2026 15:23:32 -0800 Subject: [PATCH 14/17] solution converged --- .../SolidModelDiscretizationOpsFullTensor.hpp | 13 +++-- .../SolidMechanicsLagrangianFEM.cpp | 55 +++++++++++++------ .../ImplicitFiniteStrainQuasiStatic_impl.hpp | 2 +- 3 files changed, 48 insertions(+), 22 deletions(-) diff --git a/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullTensor.hpp b/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullTensor.hpp index e985c816af2..4b9e5c21325 100644 --- a/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullTensor.hpp +++ b/src/coreComponents/constitutive/solid/SolidModelDiscretizationOpsFullTensor.hpp @@ -52,9 +52,9 @@ GEOS_HOST_DEVICE inline void SolidModelDiscretizationOpsFullTensor::BTDB( BASIS_GRADIENT const & gradN, real64 const & detJxW, - real64 (& elementStiffness)[NUM_SUPPORT_POINTS *3][NUM_SUPPORT_POINTS *3] ) + real64 (& elementStiffness)[NUM_SUPPORT_POINTS * 3][NUM_SUPPORT_POINTS * 3] ) { - real64 B[9][NUM_SUPPORT_POINTS * 3]; + real64 B[9][NUM_SUPPORT_POINTS * 3] = { {0} }; for (int a = 0; a < NUM_SUPPORT_POINTS; ++a) { for (int i = 0; i < 3; ++i) { @@ -67,12 +67,15 @@ void SolidModelDiscretizationOpsFullTensor::BTDB( BASIS_GRADIENT const & gradN, } real64 DB[9][NUM_SUPPORT_POINTS * 3]; + real64 elmat[NUM_SUPPORT_POINTS * 3][NUM_SUPPORT_POINTS * 3]; + LvArray::tensorOps::Rij_eq_AikBkj<9, NUM_SUPPORT_POINTS * 3, 9>(DB, m_c, B); - LvArray::tensorOps::Rij_eq_AkiBkj(elementStiffness, B, DB); - LvArray::tensorOps::scale(elementStiffness, detJxW); + LvArray::tensorOps::Rij_eq_AkiBkj(elmat, B, DB); + LvArray::tensorOps::scale(elmat, detJxW); + LvArray::tensorOps::add(elementStiffness, elmat); } } // namespace constitutive } // namespace geos -#endif /* GEOS_CONSTITUTIVE_SOLID_SOLIDMODELDISCRETIAZTIONOPSFULLTENSOR_HPP_ */ \ No newline at end of file +#endif /* GEOS_CONSTITUTIVE_SOLID_SOLIDMODELDISCRETIAZTIONOPSFULLTENSOR_HPP_ */ diff --git a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp index 496baf50c7e..1d1d4b9e5cf 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp @@ -1014,14 +1014,25 @@ void SolidMechanicsLagrangianFEM::setSparsityPattern( DomainPartition & domain, arrayView1d< globalIndex const > const dofNumber = nodeManager.getReference< globalIndex_array >( dofManager.getKey( solidMechanics::totalDisplacement::key() ) ); - finiteElement:: - fillSparsity< CellElementSubRegion, - solidMechanicsLagrangianFEMKernels::ImplicitSmallStrainQuasiStatic >( mesh, - regionNames, - getDiscretizationName(), - dofNumber, - dofManager.rankOffset(), - pattern ); + if (m_strainTheory == 0) { + finiteElement:: + fillSparsity< CellElementSubRegion, + solidMechanicsLagrangianFEMKernels::ImplicitSmallStrainQuasiStatic >( mesh, + regionNames, + getDiscretizationName(), + dofNumber, + dofManager.rankOffset(), + pattern ); + } else if (m_strainTheory == 1) { + finiteElement:: + fillSparsity< CellElementSubRegion, + solidMechanicsLagrangianFEMKernels::ImplicitFiniteStrainQuasiStatic >( mesh, + regionNames, + getDiscretizationName(), + dofNumber, + dofManager.rankOffset(), + pattern ); + } } ); @@ -1142,14 +1153,26 @@ void SolidMechanicsLagrangianFEM::assembleSystem( real64 const GEOS_UNUSED_PARAM { if( m_timeIntegrationOption == TimeIntegrationOption::QuasiStatic ) { - m_maxForce = assemblyLaunch< SolidMechanicsKernelsDispatchTypeList, - solidMechanicsLagrangianFEMKernels::QuasiStaticFactory >( mesh, - dofManager, - regionNames, - viewKeyStruct::solidMaterialNamesString(), - localMatrix, - localRhs, - dt ); + if (m_strainTheory == 0) { + m_maxForce = assemblyLaunch< SolidMechanicsKernelsDispatchTypeList, + solidMechanicsLagrangianFEMKernels::QuasiStaticFactory >( mesh, + dofManager, + regionNames, + viewKeyStruct::solidMaterialNamesString(), + localMatrix, + localRhs, + dt ); + } else if (m_strainTheory == 1) { + m_maxForce = + assemblyLaunch< SolidMechanicsImplicitFiniteStrainKernelsDispatchTypeList, + solidMechanicsLagrangianFEMKernels::ImplicitFiniteStrainQuasiStaticFactory >( mesh, + dofManager, + regionNames, + viewKeyStruct::solidMaterialNamesString(), + localMatrix, + localRhs, + dt ); + } } else if( m_timeIntegrationOption == TimeIntegrationOption::ImplicitDynamic ) { diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp index 165ff679e65..5f037423fe1 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp @@ -174,4 +174,4 @@ ImplicitFiniteStrainQuasiStatic::ker } // namespace geos -#endif // GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITESTRAINQUASISTATIC_IMPL_HPP_ \ No newline at end of file +#endif // GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_IMPLCITFINITESTRAINQUASISTATIC_IMPL_HPP_ From b0b707054f2a9640ed6ec5a17113017b74316254 Mon Sep 17 00:00:00 2001 From: li97 Date: Thu, 22 Jan 2026 09:12:03 -0800 Subject: [PATCH 15/17] add finite strain cases --- .../elasticFiniteStrain_cornerPress.xml | 149 ++++++++++++++++++ .../elasticFiniteStrain_uniaxialPress.xml | 148 +++++++++++++++++ .../solid/ElasticIsotropicFiniteStrain.hpp | 2 +- .../constitutive/solid/SolidUtilities.hpp | 2 +- .../ImplicitFiniteStrainQuasiStatic_impl.hpp | 1 - 5 files changed, 299 insertions(+), 3 deletions(-) create mode 100644 inputFiles/solidMechanics/elasticFiniteStrain_cornerPress.xml create mode 100644 inputFiles/solidMechanics/elasticFiniteStrain_uniaxialPress.xml diff --git a/inputFiles/solidMechanics/elasticFiniteStrain_cornerPress.xml b/inputFiles/solidMechanics/elasticFiniteStrain_cornerPress.xml new file mode 100644 index 00000000000..edb837cdd4a --- /dev/null +++ b/inputFiles/solidMechanics/elasticFiniteStrain_cornerPress.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/inputFiles/solidMechanics/elasticFiniteStrain_uniaxialPress.xml b/inputFiles/solidMechanics/elasticFiniteStrain_uniaxialPress.xml new file mode 100644 index 00000000000..2c78fb8bc57 --- /dev/null +++ b/inputFiles/solidMechanics/elasticFiniteStrain_uniaxialPress.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp index 66ec7b5e117..dd17bc4869d 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp @@ -423,4 +423,4 @@ class ElasticIsotropicFiniteStrain : public ElasticIsotropic } // namespace geos -#endif /* GEOS_CONSTITUTIVE_SOLID_ELASTICISOTROPIC_HPP_ */ \ No newline at end of file +#endif /* GEOS_CONSTITUTIVE_SOLID_ELASTICISOTROPIC_HPP_ */ diff --git a/src/coreComponents/constitutive/solid/SolidUtilities.hpp b/src/coreComponents/constitutive/solid/SolidUtilities.hpp index 5da0903867b..bd76289436b 100644 --- a/src/coreComponents/constitutive/solid/SolidUtilities.hpp +++ b/src/coreComponents/constitutive/solid/SolidUtilities.hpp @@ -209,7 +209,7 @@ struct SolidUtilities { for( localIndex i = 0; i < 9; ++i ) { - for( localIndex j = 0; j < 6; ++j ) + for( localIndex j = 0; j < 9; ++j ) { // printf( "[%12.5e vs %12.5e] ", stiffnessFD[i][j], stiffness[i][j] ); printf( "%12.5e ", fabs(stiffnessFD[i][j] - stiffness[i][j]) ); diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp index 5f037423fe1..43f5dc66779 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitFiniteStrainQuasiStatic_impl.hpp @@ -87,7 +87,6 @@ void ImplicitFiniteStrainQuasiStatic real64 const detJxW = m_finiteElementSpace.template getGradN(k, q, stack.xLocal, stack.feStack, dNdX); real64 stress[3][3] = { {0} }; - // real64 stiffness[9][9] = { {0} }; typename CONSTITUTIVE_TYPE::KernelWrapper::DiscretizationOps stiffness; real64 dUhatdX[3][3] = { {0} }; From 39d707483589a28ccb6b27321b2af49393293f0d Mon Sep 17 00:00:00 2001 From: li97 Date: Thu, 22 Jan 2026 11:48:46 -0800 Subject: [PATCH 16/17] fix gcc compiler --- .../solid/ElasticIsotropicFiniteStrain.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp index dd17bc4869d..1439464400a 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicFiniteStrain.hpp @@ -110,10 +110,10 @@ class ElasticIsotropicFiniteStrainUpdates : public ElasticIsotropicUpdates private: GEOS_HOST_DEVICE - void computeMaterialTangentColumn(real64 const (&deltaFe)[3][3], real64 const (&deltaCe)[6], - real64 const (&M_hat)[6], real64 const (&Q)[3][3], - real64 const (&Q_T)[3][3], real64 const (&dtau_dEe)[6][6], - real64 const (&fInvT)[3][3], real64 (&deltaP_mat)[3][3]) const; + void computeMaterialTangentColumn(real64 const (&deltaCe)[6], real64 const (&M_hat)[6], + real64 const (&Q)[3][3], real64 const (&Q_T)[3][3], + real64 const (&dtau_dEe)[6][6], real64 const (&fInvT)[3][3], + real64 (&deltaP_mat)[3][3]) const; }; GEOS_HOST_DEVICE @@ -152,9 +152,9 @@ void ElasticIsotropicFiniteStrainUpdates::computeLogElasticStrain( GEOS_HOST_DEVICE inline void ElasticIsotropicFiniteStrainUpdates::computeMaterialTangentColumn( - real64 const (&deltaFe)[3][3], real64 const (&deltaCe)[6], real64 const (&M_hat)[6], - real64 const (&Q)[3][3], real64 const (&Q_T)[3][3], real64 const (&dtau_dEe)[6][6], - real64 const (&fInvT)[3][3], real64 (&deltaP_mat)[3][3]) const + real64 const (&deltaCe)[6], real64 const (&M_hat)[6], real64 const (&Q)[3][3], + real64 const (&Q_T)[3][3], real64 const (&dtau_dEe)[6][6], real64 const (&fInvT)[3][3], + real64 (&deltaP_mat)[3][3]) const { // Q^T * deltaCe * Q real64 deltaCe_hat[6] = {}; @@ -285,7 +285,7 @@ void ElasticIsotropicFiniteStrainUpdates::finiteStrainNoStateUpdate(localIndex c // material tangent real64 deltaP_mat[3][3] = {}; - computeMaterialTangentColumn(deltaFe, deltaCe, M_hat, eigenVectors, eigenVectorsT, smallStrainStiffness, fInvT, deltaP_mat); + computeMaterialTangentColumn(deltaCe, M_hat, eigenVectors, eigenVectorsT, smallStrainStiffness, fInvT, deltaP_mat); // geometric tangent real64 deltaP_geo[3][3] = {}; From e6cabf0baf4294b86776eb153219be349755af58 Mon Sep 17 00:00:00 2001 From: li97 Date: Thu, 22 Jan 2026 12:07:06 -0800 Subject: [PATCH 17/17] clean up unused variables --- src/coreComponents/constitutive/solid/SolidUtilities.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/constitutive/solid/SolidUtilities.hpp b/src/coreComponents/constitutive/solid/SolidUtilities.hpp index bd76289436b..9f2dd4601a2 100644 --- a/src/coreComponents/constitutive/solid/SolidUtilities.hpp +++ b/src/coreComponents/constitutive/solid/SolidUtilities.hpp @@ -187,7 +187,7 @@ struct SolidUtilities solid.finiteStrainUpdate(0, 0, elasticDeformGrad, firstPiolaStress, stiffness); real64 stiffnessFD[9][9] = {}; - SolidUtilities::computeFiniteStrainFiniteDifferenceStiffness(solid, 0, 0, elasticDeformGrad, stiffnessFD); + SolidUtilities::computeFiniteStrainFiniteDifferenceStiffness(solid, k, q, elasticDeformGrad, stiffnessFD); real64 error = 0; real64 norm = 0;