-
Notifications
You must be signed in to change notification settings - Fork 89
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
fix: Use aperture table in poromechanics with conforming fractures #3194
Merged
Merged
Changes from 6 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
adbd3c2
decouple debug matrix output from logLevel
c036976
Merge remote-tracking branch 'origin/develop' into pt/write-matrix
65fa11a
victor's suggestions
ffea8de
debug contact
06c5d84
Merge branch 'develop' into pt/debug-contact
paveltomin d7df1f0
code style and remove debug
1ba9393
Update SolidMechanicsLagrangeContact.cpp
paveltomin 194602b
Update SinglePhasePoromechanicsConformingFractures.cpp
paveltomin 2950eaa
Update SolidMechanicsLagrangeContact.cpp
paveltomin c678634
fix build
f244566
Merge branch 'develop' into pt/debug-contact
paveltomin 7577b5d
last update
3da4a7e
fix
ce6c22f
Merge branch 'develop' into pt/debug-contact
paveltomin 8bf8e02
Merge branch 'develop' into pt/debug-contact
paveltomin dd88474
fix
1a0347c
Merge branch 'pt/debug-contact' of https://github.com/GEOS-DEV/GEOS i…
dcf2308
build fix
5f22591
fix edfm
d9b7330
revert and try another way
d5ddb7f
build fix
b12f753
this should work
47e17f1
Update SurfaceElementSubRegion.hpp
paveltomin 8c7a8d6
one last try
90923b9
Merge branch 'pt/debug-contact' of https://github.com/GEOS-DEV/GEOS i…
fa97b6a
revert and give up
3839b4a
Update SinglePhaseBase.cpp
paveltomin 45b2ca0
Update SinglePhaseBase.cpp
paveltomin 17dc67e
revert
3b5fc93
Merge branch 'pt/debug-contact' of https://github.com/GEOS-DEV/GEOS i…
cae43ba
Update HydrofractureSolver.cpp
paveltomin e5ba0ce
Merge branch 'develop' into pt/debug-contact
paveltomin 07a4d1d
Update .integrated_tests.yaml
paveltomin 59f42d2
Update BASELINE_NOTES.md
paveltomin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,6 +252,13 @@ void SolidMechanicsLagrangeContact::computeTolerances( DomainPartition & domain | |
{ | ||
GEOS_MARK_FUNCTION; | ||
|
||
real64 minNormalTractionTolerance( 1e10 ); | ||
real64 maxNormalTractionTolerance( -1e10 ); | ||
real64 minNormalDisplacementTolerance( 1e10 ); | ||
real64 maxNormalDisplacementTolerance( -1e10 ); | ||
real64 minSlidingTolerance( 1e10 ); | ||
real64 maxSlidingTolerance( -1e10 ); | ||
|
||
forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, | ||
MeshLevel & mesh, | ||
arrayView1d< string const > const & ) | ||
|
@@ -301,6 +308,13 @@ void SolidMechanicsLagrangeContact::computeTolerances( DomainPartition & domain | |
arrayView1d< real64 > const & slidingTolerance = | ||
subRegion.getReference< array1d< real64 > >( viewKeyStruct::slidingToleranceString() ); | ||
|
||
RAJA::ReduceMin< ReducePolicy< parallelHostPolicy >, real64 > minSubRegionNormalTractionTolerance( 1e10 ); | ||
RAJA::ReduceMax< ReducePolicy< parallelHostPolicy >, real64 > maxSubRegionNormalTractionTolerance( -1e10 ); | ||
RAJA::ReduceMin< ReducePolicy< parallelHostPolicy >, real64 > minSubRegionNormalDisplacementTolerance( 1e10 ); | ||
RAJA::ReduceMax< ReducePolicy< parallelHostPolicy >, real64 > maxSubRegionNormalDisplacementTolerance( -1e10 ); | ||
RAJA::ReduceMin< ReducePolicy< parallelHostPolicy >, real64 > minSubRegionSlidingTolerance( 1e10 ); | ||
RAJA::ReduceMax< ReducePolicy< parallelHostPolicy >, real64 > maxSubRegionSlidingTolerance( -1e10 ); | ||
|
||
forAll< parallelHostPolicy >( subRegion.size(), [=] ( localIndex const kfe ) | ||
{ | ||
if( ghostRank[kfe] < 0 ) | ||
|
@@ -384,15 +398,36 @@ void SolidMechanicsLagrangeContact::computeTolerances( DomainPartition & domain | |
LvArray::tensorOps::scale< 3, 3 >( rotatedInvStiffApprox, area ); | ||
|
||
// Finally, compute tolerances for the given fracture element | ||
|
||
normalDisplacementTolerance[kfe] = rotatedInvStiffApprox[ 0 ][ 0 ] * averageYoungModulus / 2.e+7; | ||
minSubRegionNormalDisplacementTolerance.min( normalDisplacementTolerance[kfe] ); | ||
maxSubRegionNormalDisplacementTolerance.max( normalDisplacementTolerance[kfe] ); | ||
|
||
slidingTolerance[kfe] = sqrt( rotatedInvStiffApprox[ 1 ][ 1 ] * rotatedInvStiffApprox[ 1 ][ 1 ] + | ||
rotatedInvStiffApprox[ 2 ][ 2 ] * rotatedInvStiffApprox[ 2 ][ 2 ] ) * averageYoungModulus / 2.e+7; | ||
minSubRegionSlidingTolerance.min( slidingTolerance[kfe] ); | ||
maxSubRegionSlidingTolerance.max( slidingTolerance[kfe] ); | ||
|
||
normalTractionTolerance[kfe] = 1.0 / 2.0 * averageConstrainedModulus / averageBoxSize0 * normalDisplacementTolerance[kfe]; | ||
minSubRegionNormalTractionTolerance.min( normalTractionTolerance[kfe] ); | ||
maxSubRegionNormalTractionTolerance.max( normalTractionTolerance[kfe] ); | ||
} | ||
} ); | ||
|
||
minNormalDisplacementTolerance = std::min( minNormalDisplacementTolerance, minSubRegionNormalDisplacementTolerance.get() ); | ||
maxNormalDisplacementTolerance = std::max( maxNormalDisplacementTolerance, maxSubRegionNormalDisplacementTolerance.get() ); | ||
minSlidingTolerance = std::min( minSlidingTolerance, minSubRegionSlidingTolerance.get() ); | ||
maxSlidingTolerance = std::max( maxSlidingTolerance, maxSubRegionSlidingTolerance.get() ); | ||
minNormalTractionTolerance = std::min( minNormalTractionTolerance, minSubRegionNormalTractionTolerance.get() ); | ||
maxNormalTractionTolerance = std::max( maxNormalTractionTolerance, maxSubRegionNormalTractionTolerance.get() ); | ||
} | ||
} ); | ||
} ); | ||
|
||
GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{}: normal displacement tolerance = [{}, {}], sliding tolerance = [{}, {}], normal traction tolerance = [{}, {}]", | ||
this->getName(), minNormalDisplacementTolerance, maxNormalDisplacementTolerance, | ||
minSlidingTolerance, maxSlidingTolerance, | ||
minNormalTractionTolerance, maxNormalTractionTolerance ) ); | ||
} | ||
|
||
void SolidMechanicsLagrangeContact::resetStateToBeginningOfStep( DomainPartition & domain ) | ||
|
@@ -562,7 +597,7 @@ void SolidMechanicsLagrangeContact::assembleSystem( real64 const time, | |
|
||
assembleContact( domain, dofManager, localMatrix, localRhs ); | ||
|
||
// for sequenatial: add (fixed) pressure force contribution into residual (no derivatives) | ||
// for sequential: add (fixed) pressure force contribution into residual (no derivatives) | ||
if( m_isFixedStressPoromechanicsUpdate ) | ||
{ | ||
forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &, | ||
|
@@ -585,10 +620,13 @@ void SolidMechanicsLagrangeContact::assembleContact( DomainPartition & domain, | |
{ | ||
/// assemble Kut | ||
assembleForceResidualDerivativeWrtTraction( mesh, regionNames, dofManager, localMatrix, localRhs ); | ||
// std::cout << "assembleForceResidualDerivativeWrtTraction RHS " << localRhs[96609] << std::endl; | ||
/// assemble Ktu, Ktt blocks. | ||
assembleTractionResidualDerivativeWrtDisplacementAndTraction( mesh, regionNames, dofManager, localMatrix, localRhs ); | ||
// std::cout << "assembleTractionResidualDerivativeWrtDisplacementAndTraction RHS " << localRhs[96609] << std::endl; | ||
/// assemble stabilization | ||
assembleStabilization( mesh, domain.getNumericalMethodManager(), dofManager, localMatrix, localRhs ); | ||
// std::cout << "assembleStabilization RHS " << localRhs[96609] << std::endl; | ||
} ); | ||
} | ||
|
||
|
@@ -715,6 +753,12 @@ real64 SolidMechanicsLagrangeContact::calculateContactResidualNorm( DomainPartit | |
arrayView1d< integer const > const & fractureState = subRegion.getField< contact::fractureState >(); | ||
arrayView1d< real64 const > const & area = subRegion.getElementArea(); | ||
|
||
// string const & contactRelationName = subRegion.template getReference< string >( viewKeyStruct::contactRelationNameString() ); | ||
// ContactBase const & contact = getConstitutiveModel< ContactBase >( subRegion, contactRelationName ); | ||
// | ||
// constitutiveUpdatePassThru( contact, [&] ( auto & castedContact ) | ||
// { | ||
|
||
RAJA::ReduceSum< parallelHostReduce, real64 > stickSum( 0.0 ); | ||
RAJA::ReduceSum< parallelHostReduce, real64 > slipSum( 0.0 ); | ||
RAJA::ReduceMax< parallelHostReduce, real64 > slipMax( 0.0 ); | ||
|
@@ -764,6 +808,7 @@ real64 SolidMechanicsLagrangeContact::calculateContactResidualNorm( DomainPartit | |
slipNormalizer = LvArray::math::max( slipNormalizer, slipMax.get()); | ||
openResidual += openSum.get(); | ||
openNormalizer = LvArray::math::max( openNormalizer, openMax.get()); | ||
// } ); | ||
} ); | ||
} ); | ||
|
||
|
@@ -1763,6 +1808,8 @@ void SolidMechanicsLagrangeContact::assembleStabilization( MeshLevel const & mes | |
nDof[1 - kf] ); | ||
} | ||
|
||
//if(l ocalRow==96609) | ||
//std::cout << "stab " <<localRhs[localRow + idof] << " " << rhs[idof] << std::endl; | ||
// residual | ||
RAJA::atomicAdd( parallelHostAtomic{}, &localRhs[localRow + idof], rhs[idof] ); | ||
} | ||
|
@@ -1896,20 +1943,24 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai | |
if( ghostRank[kfe] < 0 ) | ||
{ | ||
integer const originalFractureState = fractureState[kfe]; | ||
if( originalFractureState == contact::FractureState::Open ) | ||
if( originalFractureState == FractureState::Open ) | ||
{ | ||
if( dispJump[kfe][0] > -normalDisplacementTolerance[kfe] ) | ||
{ | ||
fractureState[kfe] = contact::FractureState::Open; | ||
} | ||
else | ||
if( dispJump[kfe][0] <= -normalDisplacementTolerance[kfe] ) | ||
{ | ||
fractureState[kfe] = contact::FractureState::Stick; | ||
fractureState[kfe] = FractureState::Stick; | ||
if( getLogLevel() >= 3 ) | ||
GEOS_LOG( GEOS_FMT( "{}: {} -> {}: dispJump = {}, normalDisplacementTolerance = {}", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it would be better to avoid this logging inside the cell loop. |
||
kfe, originalFractureState, fractureState[kfe], | ||
dispJump[kfe][0], normalDisplacementTolerance[kfe] ) ); | ||
} | ||
} | ||
else if( traction[kfe][0] > normalTractionTolerance[kfe] ) | ||
{ | ||
fractureState[kfe] = contact::FractureState::Open; | ||
fractureState[kfe] = FractureState::Open; | ||
if( getLogLevel() >= 3 ) | ||
GEOS_LOG( GEOS_FMT( "{}: {} -> {}: traction = {}, normalTractionTolerance = {}", | ||
kfe, originalFractureState, fractureState[kfe], | ||
traction[kfe][0], normalTractionTolerance[kfe] ) ); | ||
} | ||
else | ||
{ | ||
|
@@ -1920,29 +1971,33 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai | |
contactWrapper.computeLimitTangentialTractionNorm( traction[kfe][0], | ||
dLimitTangentialTractionNorm_dTraction ); | ||
|
||
if( originalFractureState == contact::FractureState::Stick && currentTau >= limitTau ) | ||
if( originalFractureState == FractureState::Stick && currentTau >= limitTau ) | ||
{ | ||
currentTau *= (1.0 - m_slidingCheckTolerance); | ||
} | ||
else if( originalFractureState != contact::FractureState::Stick && currentTau <= limitTau ) | ||
else if( originalFractureState != FractureState::Stick && currentTau <= limitTau ) | ||
{ | ||
currentTau *= (1.0 + m_slidingCheckTolerance); | ||
} | ||
if( currentTau > limitTau ) | ||
{ | ||
if( originalFractureState == contact::FractureState::Stick ) | ||
if( originalFractureState == FractureState::Stick ) | ||
{ | ||
fractureState[kfe] = contact::FractureState::NewSlip; | ||
fractureState[kfe] = FractureState::NewSlip; | ||
} | ||
else | ||
{ | ||
fractureState[kfe] = contact::FractureState::Slip; | ||
fractureState[kfe] = FractureState::Slip; | ||
} | ||
} | ||
else | ||
{ | ||
fractureState[kfe] = contact::FractureState::Stick; | ||
fractureState[kfe] = FractureState::Stick; | ||
} | ||
if( getLogLevel() >= 3 && fractureState[kfe] != originalFractureState ) | ||
GEOS_LOG( GEOS_FMT( "{}: {} -> {}: currentTau = {}, limitTau = {}", | ||
kfe, originalFractureState, fractureState[kfe], | ||
currentTau, limitTau ) ); | ||
} | ||
|
||
changed += faceArea[kfe] * !compareFractureStates( originalFractureState, fractureState[kfe] ); | ||
|
@@ -1964,21 +2019,23 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai | |
// and total area of fracture elements | ||
totalArea = MpiWrapper::sum( totalArea ); | ||
|
||
GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( " {}: changed area {} out of {}", getName(), changedArea, totalArea ) ); | ||
|
||
// Assume converged if changed area is below certain fraction of total area | ||
return changedArea <= m_nonlinearSolverParameters.m_configurationTolerance * totalArea; | ||
} | ||
|
||
bool SolidMechanicsLagrangeContact::isFractureAllInStickCondition( DomainPartition const & domain ) const | ||
{ | ||
globalIndex numStick, numSlip, numOpen; | ||
globalIndex numStick, numNewSlip, numSlip, numOpen; | ||
forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &, | ||
MeshLevel const & mesh, | ||
arrayView1d< string const > const & ) | ||
{ | ||
computeFractureStateStatistics( mesh, numStick, numSlip, numOpen ); | ||
computeFractureStateStatistics( mesh, numStick, numNewSlip, numSlip, numOpen ); | ||
} ); | ||
|
||
return ( ( numSlip + numOpen ) == 0 ); | ||
return ( ( numNewSlip + numSlip + numOpen ) == 0 ); | ||
} | ||
|
||
real64 SolidMechanicsLagrangeContact::setNextDt( real64 const & currentDt, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just to avoid gcc warnings