Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Configuration loop acceleration for SolidMechanicsLagrangeContact #3349

Open
wants to merge 91 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
130bb87
dPerm_dDispJump added to ConstantPermeability model
sohailwaziri Jul 17, 2024
0edfafa
print statements added for debugging
sohailwaziri Jul 23, 2024
0162130
print statements and fix for accumulation term in SinglePhasePoromech…
sohailwaziri Aug 12, 2024
f6370c1
modifications to fracture update in Coulomb contact and printing stat…
sohailwaziri Aug 19, 2024
86c00dc
comment print statements
sohailwaziri Aug 19, 2024
1c92ab8
fix a bug in updating m_elasticslip which was updated each newton in …
Guotong-Ren Aug 26, 2024
243c182
more print statements
sohailwaziri Aug 26, 2024
fc8e3fc
print statements added to check that previousDispJump is constant ins…
sohailwaziri Aug 28, 2024
c27f80e
local aitken acceleration of yield
sohailwaziri Sep 4, 2024
43f89f9
new additions to penalty method for edfm-efem
sohailwaziri Sep 10, 2024
9f635d0
just saving
sohailwaziri Sep 11, 2024
d4d5e3d
Added Nicola's mgr strategy for SinglePhasePoromechanicsConformingFra…
sohailwaziri Sep 11, 2024
3aa7ae9
just saving
sohailwaziri Sep 12, 2024
8bb1057
Merge remote-tracking branch 'origin/develop' into swaziri/experimental
Sep 23, 2024
e1c39fc
remove debug and clarify merging
Sep 23, 2024
be65f14
Update SolidMechanicsLagrangeContact.cpp
paveltomin Sep 23, 2024
766728c
Update SolidMechanicsLagrangeContact.cpp
paveltomin Sep 23, 2024
8924a70
code style
Sep 23, 2024
1dc1c13
Merge branch 'swaziri/experimental' of https://github.com/GEOS-DEV/GE…
Sep 23, 2024
1ff4c7c
Merge branch 'swaziri/experimental' into swaziri/configLoop_acceleration
Sep 23, 2024
7cd3012
remove debug and code style
Sep 23, 2024
3de2ded
more clean up
Sep 23, 2024
5a4cf02
build fix
Sep 23, 2024
66d6019
Update SinglePhaseBase.cpp
paveltomin Sep 24, 2024
3604693
this should do
Sep 24, 2024
568cd91
pull out m_plasticSlip and m_slip from updates
Sep 24, 2024
515f297
revert what is not necessary
Sep 24, 2024
437bd4d
code style
Sep 24, 2024
6b73437
Merge branch 'swaziri/experimental' into swaziri/configLoop_acceleration
paveltomin Sep 24, 2024
deef4e9
small cleanup
Sep 24, 2024
df4f854
refactor a bit
Sep 24, 2024
5cb6867
Update SolidMechanicsLagrangeContact.cpp
paveltomin Sep 24, 2024
9d18ae4
Update SolidMechanicsLagrangeContact.cpp
paveltomin Sep 24, 2024
634d987
Update SolidMechanicsLagrangeContact.cpp
paveltomin Sep 24, 2024
5584670
Update SolidMechanicsLagrangeContact.cpp
paveltomin Sep 24, 2024
222e754
Update SolidMechanicsLagrangeContact.cpp
paveltomin Sep 24, 2024
5bbe4a0
Merge branch 'swaziri/experimental' into swaziri/configLoop_acceleration
paveltomin Sep 24, 2024
307ab03
Merge remote-tracking branch 'origin/develop' into swaziri/experimental
Nov 11, 2024
a599f70
EDFM bugfixes, part of #3348
Nov 11, 2024
29f29d7
Merge branch 'pt/edfm-sohail-bugfix' into swaziri/experimental
paveltomin Nov 11, 2024
4f5753c
Update SinglePhasePoromechanicsEFEM_impl.hpp
paveltomin Nov 11, 2024
4192292
Update SinglePhasePoromechanicsEFEM_impl.hpp
paveltomin Nov 11, 2024
c733455
revert
Nov 11, 2024
56f641e
Merge branch 'swaziri/experimental' of https://github.com/GEOS-DEV/GE…
Nov 11, 2024
280cdd8
Merge remote-tracking branch 'origin/swaziri/experimental' into swazi…
Nov 11, 2024
f41e051
fix sign directly in computeLimitTangentialTractionNorm
Nov 12, 2024
922951b
code style
Nov 12, 2024
1456769
Merge branch 'develop' into pt/edfm-sohail-bugfix
paveltomin Nov 13, 2024
1c28f29
Update CoulombFriction.hpp
paveltomin Nov 14, 2024
37ea618
Merge branch 'pt/edfm-sohail-bugfix' into swaziri/experimental
paveltomin Nov 14, 2024
0bffafb
Merge branch 'develop' into pt/edfm-sohail-bugfix
paveltomin Nov 14, 2024
78a90da
Update .integrated_tests.yaml
paveltomin Nov 14, 2024
4cfc999
Update BASELINE_NOTES.md
paveltomin Nov 14, 2024
63920c7
Merge branch 'develop' into pt/edfm-sohail-bugfix
paveltomin Nov 14, 2024
a7736cb
Merge branch 'pt/edfm-sohail-bugfix' into swaziri/experimental
paveltomin Nov 15, 2024
0b3cad5
make that case running
Nov 15, 2024
701a258
code style
Nov 15, 2024
6cd5f0b
Merge branch 'develop' into pt/edfm-sohail-bugfix
paveltomin Nov 17, 2024
029bd07
make default aperture consistent with table
Nov 19, 2024
36a3ed2
Merge branch 'pt/edfm-sohail-bugfix' into swaziri/experimental
paveltomin Nov 19, 2024
d35fdf2
Merge branch 'develop' into swaziri/experimental
paveltomin Nov 21, 2024
e5bed8c
Merge branch 'develop' into swaziri/experimental
paveltomin Nov 21, 2024
5f9a154
Update ExponentialDecayPermeability_edfm_base.xml
paveltomin Nov 21, 2024
40075dd
Update src/coreComponents/physicsSolvers/contact/SolidMechanicsLagran…
paveltomin Nov 22, 2024
677319c
Merge branch 'develop' into swaziri/experimental
paveltomin Nov 22, 2024
7cf8111
Matteo's comments
Nov 22, 2024
08e0c0c
Update SolidMechanicsLagrangeContact.cpp
paveltomin Nov 22, 2024
d831ac0
Update SolidMechanicsLagrangeContact.cpp
paveltomin Nov 22, 2024
5d0065a
Update SolidMechanicsLagrangeContact.cpp
paveltomin Nov 22, 2024
eba5a61
move elastic slip update to the end of time step
Nov 23, 2024
f98207d
Merge branch 'swaziri/experimental' of https://github.com/GEOS-DEV/GE…
Nov 23, 2024
9d39b2d
Update CoulombFriction.hpp
paveltomin Nov 23, 2024
d2b4de9
one last thing
Nov 23, 2024
0fba6ed
Merge branch 'swaziri/experimental' of https://github.com/GEOS-DEV/GE…
Nov 23, 2024
6360d92
Update src/coreComponents/physicsSolvers/contact/SolidMechanicsEmbedd…
paveltomin Nov 25, 2024
4458126
Merge branch 'develop' into swaziri/experimental
paveltomin Nov 27, 2024
8f29c5b
Merge branch 'swaziri/experimental' into swaziri/configLoop_acceleration
paveltomin Nov 27, 2024
7354345
minor changes
Nov 27, 2024
c169ece
Merge branch 'develop' into swaziri/experimental
paveltomin Nov 28, 2024
0a42e72
bug fix
paveltomin Nov 28, 2024
f72951b
Merge branch 'swaziri/experimental' into swaziri/configLoop_acceleration
paveltomin Nov 28, 2024
49ceff0
Merge branch 'develop' into swaziri/configLoop_acceleration
paveltomin Dec 2, 2024
f4686d8
Merge branch 'develop' into swaziri/configLoop_acceleration
paveltomin Dec 20, 2024
1a45f32
crash fix
Dec 20, 2024
e8f7ac2
Merge branch 'develop' into swaziri/configLoop_acceleration
paveltomin Jan 8, 2025
fc85724
Merge branch 'develop' into swaziri/configLoop_acceleration
paveltomin Jan 13, 2025
72be641
Merge branch 'develop' into swaziri/configLoop_acceleration
paveltomin Jan 16, 2025
596dd55
Merge branch 'develop' into swaziri/configLoop_acceleration
paveltomin Jan 22, 2025
61ae1b5
Merge branch 'develop' into swaziri/configLoop_acceleration
paveltomin Jan 28, 2025
861d9d4
Merge branch 'develop' into swaziri/configLoop_acceleration
paveltomin Feb 6, 2025
8d013ca
Merge remote-tracking branch 'origin/develop' into swaziri/configLoop…
Feb 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ real64 PhysicsSolverBase::nonlinearImplicitStep( real64 const & time_n,

if( isNewtonConverged )
{
isConfigurationLoopConverged = updateConfiguration( domain );
isConfigurationLoopConverged = updateConfiguration( domain, configurationLoopIter );

if( isConfigurationLoopConverged )
{
Expand Down Expand Up @@ -1334,7 +1334,8 @@ void PhysicsSolverBase::updateState( DomainPartition & GEOS_UNUSED_PARAM( domain
GEOS_ERROR( "PhysicsSolverBase::updateState called!. Should be overridden." );
}

bool PhysicsSolverBase::updateConfiguration( DomainPartition & GEOS_UNUSED_PARAM( domain ) )
bool PhysicsSolverBase::updateConfiguration( DomainPartition & GEOS_UNUSED_PARAM( domain ),
integer const GEOS_UNUSED_PARAM( configurationLoopIter ) )
{
return true;
}
Expand Down
4 changes: 3 additions & 1 deletion src/coreComponents/physicsSolvers/PhysicsSolverBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,11 @@ class PhysicsSolverBase : public ExecutableGroup
/**
* @brief updates the configuration (if needed) based on the state after a converged Newton loop.
* @param domain the domain containing the mesh and fields
* @param configurationLoopIter current configuration iteration number
* @return a bool that states whether the configuration used to solve the nonlinear loop is still valid or not.
*/
virtual bool updateConfiguration( DomainPartition & domain );
virtual bool updateConfiguration( DomainPartition & domain,
integer configurationLoopIter );

/**
* @brief
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,13 @@ class CoupledSolver : public PhysicsSolverBase
return isConverged;
}

virtual bool updateConfiguration( DomainPartition & domain ) override
virtual bool updateConfiguration( DomainPartition & domain,
integer const configurationLoopIter ) override
{
bool result = true;
forEachArgInTuple( m_solvers, [&]( auto & solver, auto )
{
result &= solver->updateConfiguration( domain );
result &= solver->updateConfiguration( domain, configurationLoopIter );
} );
return result;
}
Expand Down Expand Up @@ -689,7 +690,9 @@ class CoupledSolver : public PhysicsSolverBase
}

if( m_nonlinearSolverParameters.m_nonlinearAccelerationType != NonlinearSolverParameters::NonlinearAccelerationType::None )
{
validateNonlinearAcceleration();
}
}

virtual void validateNonlinearAcceleration()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,8 @@ void SolidMechanicsAugmentedLagrangianContact::updateState( DomainPartition & do
GEOS_UNUSED_VAR( domain );
}

bool SolidMechanicsAugmentedLagrangianContact::updateConfiguration( DomainPartition & domain )
bool SolidMechanicsAugmentedLagrangianContact::updateConfiguration( DomainPartition & domain,
integer const GEOS_UNUSED_PARAM( configurationLoopIter ) )
{
GEOS_MARK_FUNCTION;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class SolidMechanicsAugmentedLagrangianContact : public ContactSolverBase

void updateState( DomainPartition & domain ) override final;

virtual bool updateConfiguration( DomainPartition & domain ) override final;
virtual bool updateConfiguration( DomainPartition & domain,
integer configurationLoopIter ) override final;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,8 @@ void SolidMechanicsEmbeddedFractures::updateState( DomainPartition & domain )
} );
}

bool SolidMechanicsEmbeddedFractures::updateConfiguration( DomainPartition & domain )
bool SolidMechanicsEmbeddedFractures::updateConfiguration( DomainPartition & domain,
integer const GEOS_UNUSED_PARAM( configurationLoopIter ) )
{
int hasConfigurationConverged = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class SolidMechanicsEmbeddedFractures : public ContactSolverBase
real64 const dt,
DomainPartition & domain );

virtual bool updateConfiguration( DomainPartition & domain ) override final;
virtual bool updateConfiguration( DomainPartition & domain,
integer configurationLoopIter ) override final;

bool useStaticCondensation() const { return m_useStaticCondensation; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ SolidMechanicsLagrangeContact::SolidMechanicsLagrangeContact( const string & nam
setApplyDefaultValue( 1.0 ).
setDescription( "It be used to increase the scale of the stabilization entries. A value < 1.0 results in larger entries in the stabilization matrix." );

registerWrapper( viewKeyStruct::useLocalYieldAccelerationString(), &m_useLocalYieldAcceleration ).
setInputFlag( InputFlags::OPTIONAL ).
setApplyDefaultValue( 0 ).
setDescription( "Flag to enable local acceleration for yield (to accelerate configuration loop convergence)." );

addLogLevel< logInfo::Configuration >();
}

Expand Down Expand Up @@ -187,6 +192,11 @@ void SolidMechanicsLagrangeContact::initializePreSubGroups()
} );
}

if( m_useLocalYieldAcceleration )
{
GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: local yield acceleration enabled", getName() ) );
}

}

void SolidMechanicsLagrangeContact::setupSystem( DomainPartition & domain,
Expand All @@ -208,6 +218,11 @@ void SolidMechanicsLagrangeContact::setupSystem( DomainPartition & domain,
{
createPreconditioner( domain );
}

if( m_useLocalYieldAcceleration )
{
initializeAccelerationVariables( domain );
}
}

void SolidMechanicsLagrangeContact::implicitStepSetup( real64 const & time_n,
Expand Down Expand Up @@ -2218,7 +2233,8 @@ bool SolidMechanicsLagrangeContact::resetConfigurationToDefault( DomainPartition
return false;
}

bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domain )
bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domain,
integer const configurationLoopIter )
{
GEOS_MARK_FUNCTION;

Expand Down Expand Up @@ -2277,6 +2293,7 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai
else if( traction[kfe][0] > normalTractionTolerance[kfe] )
{
fractureState[kfe] = FractureState::Open;

if( getLogLevel() >= 10 )
GEOS_LOG( GEOS_FMT( "{}: {} -> {}: traction = {}, normalTractionTolerance = {}",
kfe, originalFractureState, fractureState[kfe],
Expand All @@ -2291,6 +2308,9 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai
frictionWrapper.computeLimitTangentialTractionNorm( traction[kfe][0],
dLimitTangentialTractionNorm_dTraction );

// store to use in acceleration when enabled
real64 const currentTau_unscaled = currentTau;

if( originalFractureState == FractureState::Stick && currentTau >= limitTau )
{
currentTau *= (1.0 - m_slidingCheckTolerance);
Expand All @@ -2313,6 +2333,11 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai
else
{
fractureState[kfe] = FractureState::Stick;

if( m_useLocalYieldAcceleration )
{
tryLocalYieldAcceleration( configurationLoopIter, kfe, currentTau_unscaled, limitTau, currentTau, fractureState[kfe] );
}
}
if( getLogLevel() >= 10 && fractureState[kfe] != originalFractureState )
GEOS_LOG( GEOS_FMT( "{}: {} -> {}: currentTau = {}, limitTau = {}",
Expand Down Expand Up @@ -2345,6 +2370,90 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai
return changedArea <= m_nonlinearSolverParameters.m_configurationTolerance * totalArea;
}

void SolidMechanicsLagrangeContact::tryLocalYieldAcceleration( integer const configurationLoopIter,
localIndex const kfe,
real64 const currentTau_unscaled,
real64 const limitTau,
real64 const currentTau,
integer & fractureState )
{
using namespace fields::contact;

if( configurationLoopIter == 0 )
{
m_x0[kfe] = currentTau_unscaled - limitTau;
}
else if( configurationLoopIter == 1 )
{
m_x1_tilde[kfe] = currentTau_unscaled - limitTau;
m_x1[kfe] = m_x1_tilde[kfe];
m_omega0[kfe] = 1.0;
}
else
{
// only apply acceleration if within a fraction of the limitTau
real64 acceleration_buffer = (limitTau - currentTau) / limitTau;

if( acceleration_buffer > 0.1 / (configurationLoopIter - 1) )
{
// do not apply acceleration, just update previous values
m_x0[kfe] = m_x1_tilde[kfe];
m_x1_tilde[kfe] = currentTau_unscaled - limitTau;
m_x1[kfe] = m_x1_tilde[kfe];
}
else
{
// apply acceleration
m_x2_tilde[kfe] = currentTau_unscaled - limitTau;

m_omega1[kfe] = -1.0 * m_omega0[kfe] * (m_x1_tilde[kfe] - m_x0[kfe]) / ((m_x1_tilde[kfe] - m_x0[kfe]) - (m_x2_tilde[kfe] - m_x1[kfe]));

m_x2[kfe] = (1.0 - m_omega1[kfe]) * m_x1[kfe] + m_omega1[kfe] * m_x2_tilde[kfe];

real64 acc_currentTau_unscaled = m_x2[kfe] + limitTau;
real64 acc_currentTau_scaled = acc_currentTau_unscaled * (1.0 - m_slidingCheckTolerance);

if( acc_currentTau_scaled > limitTau )
{
fractureState = FractureState::NewSlip;
}
else
{
m_x0[kfe] = m_x1[kfe];
m_x1[kfe] = m_x2[kfe];
m_x1_tilde[kfe] = m_x2_tilde[kfe];
m_omega0[kfe] = m_omega1[kfe];
}
}
}
}

void SolidMechanicsLagrangeContact::initializeAccelerationVariables( DomainPartition & domain )
{
// calculate total number of face elements
localIndex total_size = 0;
forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &,
MeshLevel & mesh,
arrayView1d< string const > const & regionNames )
{
ElementRegionManager & elemManager = mesh.getElemManager();
elemManager.forElementSubRegions< FaceElementSubRegion >( regionNames, [&]( localIndex const,
FaceElementSubRegion & subRegion )
{
total_size += subRegion.size();
} );
} );

// allocate arrays
m_x0.resize( total_size );
m_x1.resize( total_size );
m_x1_tilde.resize( total_size );
m_x2.resize( total_size );
m_x2_tilde.resize( total_size );
m_omega0.resize( total_size );
m_omega1.resize( total_size );
}

bool SolidMechanicsLagrangeContact::isFractureAllInStickCondition( DomainPartition const & domain ) const
{
globalIndex numStick, numNewSlip, numSlip, numOpen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ class SolidMechanicsLagrangeContact : public ContactSolverBase

bool resetConfigurationToDefault( DomainPartition & domain ) const override final;

bool updateConfiguration( DomainPartition & domain ) override final;
bool updateConfiguration( DomainPartition & domain,
integer configurationLoopIter ) override final;

bool isFractureAllInStickCondition( DomainPartition const & domain ) const;

Expand Down Expand Up @@ -206,8 +207,29 @@ class SolidMechanicsLagrangeContact : public ContactSolverBase
constexpr static char const * transMultiplierString() { return "penaltyStiffnessTransMultiplier"; }

constexpr static char const * stabilizationScalingCoefficientString() { return "stabilizationScalingCoefficient"; }

constexpr static char const * useLocalYieldAccelerationString() { return "useLocalYieldAcceleration"; }
};

/// Member variables and functions needed for yield acceleration. Naming convention follows ( Jiang & Tchelepi, 2019 )
array1d< real64 > m_x0; // Accelerated variable @ outer iteration v ( two iterations ago )
array1d< real64 > m_x1; // Accelerated variable @ outer iteration v + 1 ( previous iteration )
array1d< real64 > m_x1_tilde; // Unaccelerated variable @ outer iteration v + 1 ( previous iteration )
array1d< real64 > m_x2; // Accelerated variable @ outer iteration v + 2 ( current iteration )
array1d< real64 > m_x2_tilde; // Unaccelerated variable @ outer iteration v + 1 ( current iteration )
array1d< real64 > m_omega0; // Old relaxation factor
array1d< real64 > m_omega1; // New relaxation factor
integer m_useLocalYieldAcceleration; // flag for applying acceleration to yield

void initializeAccelerationVariables( DomainPartition & domain );

void tryLocalYieldAcceleration( integer configurationLoopIter,
localIndex kfe,
real64 currentTau_unscaled,
real64 limitTau,
real64 currentTau,
integer & fractureState );

};

} /* namespace geos */
Expand Down
Loading