Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into cusini/refactor/se…
Browse files Browse the repository at this point in the history
…parate-friction-and-aperture
  • Loading branch information
CusiniM committed Jul 1, 2024
2 parents 6072e5b + 32b28b4 commit 0463ec5
Show file tree
Hide file tree
Showing 56 changed files with 942 additions and 440 deletions.
2 changes: 1 addition & 1 deletion .integrated_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
baselines:
bucket: geosx
baseline: integratedTests/baseline_integratedTests-pr3177-5828-eabb935
baseline: integratedTests/baseline_integratedTests-pr3196-5835-6563552

allow_fail:
all: ''
Expand Down
4 changes: 4 additions & 0 deletions BASELINE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This file is designed to track changes to the integrated test baselines.
Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining.
These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD).

PR #3196 (2024-06-28)
======================
Added isLaggingFractureStencilWeightsUpdate to hydrofracture solve. Rebaseline because of the new input.

PR #3177 (2024-06-28)
======================
Added logLevel to TimeHistoryOutput. Rebaseline because of the new input flag.
Expand Down
3 changes: 2 additions & 1 deletion src/coreComponents/mesh/FaceElementSubRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ buildCollocatedEdgeBuckets( std::map< globalIndex, globalIndex > const & referen
arrayView2d< localIndex const > const edgeToNodes )
{
GEOS_ASSERT_EQ( edgeToNodes.size( 1 ), 2 );
static constexpr std::string_view nodeNotFound = "Internal error when trying to access the reference collocated node for global node {}.";

// Checks if the node `gni` is handled as a collocated node on the curren rank.
auto hasCollocatedNode = [&]( globalIndex const gni ) -> bool
Expand Down Expand Up @@ -526,6 +525,8 @@ buildCollocatedEdgeBuckets( std::map< globalIndex, globalIndex > const & referen
std::map< std::pair< globalIndex, globalIndex >, std::set< localIndex > > collocatedEdgeBuckets;
for( auto const & p: edgesIds )
{
static constexpr std::string_view nodeNotFound = "Internal error when trying to access the reference collocated node for global node {}.";

std::pair< globalIndex, globalIndex > const & nodes = p.first;
localIndex const & edge = p.second;

Expand Down
3 changes: 0 additions & 3 deletions src/coreComponents/physicsSolvers/SolverBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,6 @@ class SolverBase : public ExecutableGroup
* names set.
*/
virtual void setConstitutiveNamesCallSuper( ElementSubRegionBase & subRegion ) const { GEOS_UNUSED_VAR( subRegion ); }
virtual void setConstitutiveNamesCallSuper( ParticleSubRegionBase & subRegion ) const { GEOS_UNUSED_VAR( subRegion ); } // particle
// overload

template< typename BASETYPE = constitutive::ConstitutiveBase, typename LOOKUP_TYPE >
static BASETYPE const & getConstitutiveModel( dataRepository::Group const & dataGroup, LOOKUP_TYPE const & key );
Expand Down Expand Up @@ -840,7 +838,6 @@ class SolverBase : public ExecutableGroup
* names set.
*/
virtual void setConstitutiveNames( ElementSubRegionBase & subRegion ) const { GEOS_UNUSED_VAR( subRegion ); }
virtual void setConstitutiveNames( ParticleSubRegionBase & subRegion ) const { GEOS_UNUSED_VAR( subRegion ); } // particle overload

bool solveNonlinearSystem( real64 const & time_n,
real64 const & dt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ FlowSolverBase::FlowSolverBase( string const & name,
m_isThermal( 0 ),
m_keepFlowVariablesConstantDuringInitStep( 0 ),
m_isFixedStressPoromechanicsUpdate( false ),
m_isJumpStabilized( false )
m_isJumpStabilized( false ),
m_isLaggingFractureStencilWeightsUpdate( 0 )
{
this->registerWrapper( viewKeyStruct::isThermalString(), &m_isThermal ).
setApplyDefaultValue( 0 ).
Expand Down Expand Up @@ -754,6 +755,8 @@ void FlowSolverBase::prepareStencilWeights( DomainPartition & domain ) const
FiniteVolumeManager const & fvManager = numericalMethodManager.getFiniteVolumeManager();
FluxApproximationBase const & fluxApprox = fvManager.getFluxApproximation( getDiscretizationName() );
ElementRegionManager::ElementViewAccessor< arrayView1d< real64 const > > hydraulicAperture =
m_isLaggingFractureStencilWeightsUpdate ?
mesh.getElemManager().constructViewAccessor< array1d< real64 >, arrayView1d< real64 const > >( fields::flow::aperture0::key() ) :
mesh.getElemManager().constructViewAccessor< array1d< real64 >, arrayView1d< real64 const > >( fields::flow::hydraulicAperture::key() );

fluxApprox.forStencils< SurfaceElementStencil, FaceElementToCellStencil, EmbeddedSurfaceToCellStencil >( mesh, [&]( auto & stencil )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ class FlowSolverBase : public SolverBase

virtual bool checkSequentialSolutionIncrements( DomainPartition & domain ) const override;

void enableLaggingFractureStencilWeightsUpdate(){ m_isLaggingFractureStencilWeightsUpdate = 1; };

protected:

/**
Expand Down Expand Up @@ -228,6 +230,8 @@ class FlowSolverBase : public SolverBase
private:
virtual void setConstitutiveNames( ElementSubRegionBase & subRegion ) const override;

// flag to determine whether or not to apply lagging update for the fracture stencil weights
integer m_isLaggingFractureStencilWeightsUpdate;

};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ HydrofractureSolver< POROMECHANICS_SOLVER >::HydrofractureSolver( const string &
setApplyDefaultValue( 0 ).
setInputFlag( InputFlags::OPTIONAL );

registerWrapper( viewKeyStruct::isLaggingFractureStencilWeightsUpdateString(), &m_isLaggingFractureStencilWeightsUpdate ).
setApplyDefaultValue( 0 ).
setInputFlag( InputFlags::OPTIONAL ).
setDescription( "Flag to determine whether or not to apply lagging update for the fracture stencil weights. " );

m_numResolves[0] = 0;

// This may need to be different depending on whether poroelasticity is on or not.
Expand Down Expand Up @@ -112,6 +117,11 @@ void HydrofractureSolver< POROMECHANICS_SOLVER >::registerDataOnMesh( dataReposi
} );
} );
#endif

if( m_isLaggingFractureStencilWeightsUpdate )
{
flowSolver()->enableLaggingFractureStencilWeightsUpdate();
}
}

template< typename POROMECHANICS_SOLVER >
Expand Down Expand Up @@ -848,13 +858,19 @@ void HydrofractureSolver< POROMECHANICS_SOLVER >::updateState( DomainPartition &

Base::updateState( domain );

// remove the contribution of the hydraulic aperture from the stencil weights
flowSolver()->prepareStencilWeights( domain );
if( !m_isLaggingFractureStencilWeightsUpdate )
{
// remove the contribution of the hydraulic aperture from the stencil weights
flowSolver()->prepareStencilWeights( domain );
}

updateHydraulicApertureAndFracturePermeability( domain );

// update the stencil weights using the updated hydraulic aperture
flowSolver()->updateStencilWeights( domain );
if( !m_isLaggingFractureStencilWeightsUpdate )
{
// update the stencil weights using the updated hydraulic aperture
flowSolver()->updateStencilWeights( domain );
}

forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &,
MeshLevel & mesh,
Expand All @@ -872,6 +888,23 @@ void HydrofractureSolver< POROMECHANICS_SOLVER >::updateState( DomainPartition &
} );
}

template< typename POROMECHANICS_SOLVER >
void HydrofractureSolver< POROMECHANICS_SOLVER >::implicitStepComplete( real64 const & time_n,
real64 const & dt,
DomainPartition & domain )
{
Base::implicitStepComplete( time_n, dt, domain );

if( m_isLaggingFractureStencilWeightsUpdate )
{
// remove the contribution of the hydraulic aperture from the stencil weights
flowSolver()->prepareStencilWeights( domain );

// update the stencil weights using the updated hydraulic aperture
flowSolver()->updateStencilWeights( domain );
}
}

template< typename POROMECHANICS_SOLVER >
real64 HydrofractureSolver< POROMECHANICS_SOLVER >::setNextDt( real64 const & currentDt,
DomainPartition & domain )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ class HydrofractureSolver : public POROMECHANICS_SOLVER

virtual void updateState( DomainPartition & domain ) override final;

virtual void implicitStepComplete( real64 const & time_n,
real64 const & dt,
DomainPartition & domain ) override final;

/**@}*/

void updateHydraulicApertureAndFracturePermeability( DomainPartition & domain );
Expand Down Expand Up @@ -170,6 +174,8 @@ class HydrofractureSolver : public POROMECHANICS_SOLVER

constexpr static char const * useQuasiNewtonString() { return "useQuasiNewton"; }

static constexpr char const * isLaggingFractureStencilWeightsUpdateString() { return "isLaggingFractureStencilWeightsUpdate"; }

#ifdef GEOSX_USE_SEPARATION_COEFFICIENT
constexpr static char const * separationCoeff0String() { return "separationCoeff0"; }
constexpr static char const * apertureAtFailureString() { return "apertureAtFailure"; }
Expand Down Expand Up @@ -243,6 +249,9 @@ class HydrofractureSolver : public POROMECHANICS_SOLVER

integer m_useQuasiNewton; // use Quasi-Newton (see https://arxiv.org/abs/2111.00264)

// flag to determine whether or not to apply lagging update for the fracture stencil weights
integer m_isLaggingFractureStencilWeightsUpdate;

};

ENUM_STRINGS( HydrofractureSolver< SinglePhasePoromechanics< SinglePhaseBase > >::InitializationType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,7 @@ void SolidMechanicsMPM::registerDataOnMesh( Group & meshBodies )
[&]( localIndex const,
ParticleSubRegionBase & subRegion )
{
setConstitutiveNamesCallSuper( subRegion );
setConstitutiveNames( subRegion );
setParticlesConstitutiveNames( subRegion );
} );
}

Expand Down Expand Up @@ -1966,10 +1965,8 @@ void SolidMechanicsMPM::solverProfilingIf( std::string label, bool condition )
}
}

void SolidMechanicsMPM::setConstitutiveNamesCallSuper( ParticleSubRegionBase & subRegion ) const
void SolidMechanicsMPM::setParticlesConstitutiveNames( ParticleSubRegionBase & subRegion ) const
{
SolverBase::setConstitutiveNamesCallSuper( subRegion );

subRegion.registerWrapper< string >( viewKeyStruct::solidMaterialNamesString() ).
setPlotLevel( PlotLevel::NOPLOT ).
setRestartFlags( RestartFlags::NO_WRITE ).
Expand All @@ -1980,11 +1977,6 @@ void SolidMechanicsMPM::setConstitutiveNamesCallSuper( ParticleSubRegionBase & s
GEOS_ERROR_IF( solidMaterialName.empty(), GEOS_FMT( "SolidBase model not found on subregion {}", subRegion.getName() ) );
}

void SolidMechanicsMPM::setConstitutiveNames( ParticleSubRegionBase & subRegion ) const
{
GEOS_UNUSED_VAR( subRegion );
}

real64 SolidMechanicsMPM::computeNeighborList( ParticleManager & particleManager )
{
// Time this function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,6 @@ class SolidMechanicsMPM : public SolverBase
protected:
virtual void postProcessInput() override final;

virtual void setConstitutiveNamesCallSuper( ParticleSubRegionBase & subRegion ) const override;

std::vector< array2d< localIndex > > m_mappedNodes; // mappedNodes[subregion index][particle index][node index]. dims = {# of subregions,
// # of particles, # of nodes a particle on the subregion maps to}
std::vector< array2d< real64 > > m_shapeFunctionValues; // mappedNodes[subregion][particle][nodal shape function value]. dims = {# of
Expand Down Expand Up @@ -457,7 +455,7 @@ class SolidMechanicsMPM : public SolverBase
}
};

virtual void setConstitutiveNames( ParticleSubRegionBase & subRegion ) const override;
void setParticlesConstitutiveNames( ParticleSubRegionBase & subRegion ) const;
};

ENUM_STRINGS( SolidMechanicsMPM::TimeIntegrationOption,
Expand Down
1 change: 1 addition & 0 deletions src/coreComponents/schema/docs/AcousticElasticSEM.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ initialDt real64 1e+99 Initial time-step value re
logLevel integer 0 Log level
name groupName required A name is required for any non-unique nodes
targetRegions groupNameRef_array required Allowable regions that the solver may be applied to. Note that this does not indicate that the solver will be applied to these regions, only that allocation will occur such that the solver may be applied to these regions. The decision about what regions this solver will beapplied to rests in the EventManager.
writeLinearSystem integer 0 Write matrix, rhs, solution to screen ( = 1) or file ( = 2).
LinearSolverParameters node unique :ref:`XML_LinearSolverParameters`
NonlinearSolverParameters node unique :ref:`XML_NonlinearSolverParameters`
========================= ================== ======== ========================================================================================================================================================================================================================================================================================================================
Expand Down
Loading

0 comments on commit 0463ec5

Please sign in to comment.