Skip to content

Commit 6c82021

Browse files
paveltominPavel Tomin
andauthored
fix: Use aperture table in poromechanics with conforming fractures (#3194)
* decouple debug matrix output from logLevel * Update SolidMechanicsLagrangeContact.cpp * Update SinglePhasePoromechanicsConformingFractures.cpp * Update SolidMechanicsLagrangeContact.cpp * Update SurfaceElementSubRegion.hpp * Update SinglePhaseBase.cpp * Update HydrofractureSolver.cpp * Update .integrated_tests.yaml * Update BASELINE_NOTES.md --------- Co-authored-by: Pavel Tomin <“[email protected]”>
1 parent a3b438d commit 6c82021

13 files changed

+160
-102
lines changed

.integrated_tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
baselines:
22
bucket: geosx
3-
baseline: integratedTests/baseline_integratedTests-pr3006-5860-947a907
3+
baseline: integratedTests/baseline_integratedTests-pr3194-6060-e5ba0ce
44

55
allow_fail:
66
all: ''

BASELINE_NOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,26 @@ This file is designed to track changes to the integrated test baselines.
66
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.
77
These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD).
88

9+
PR #3194 (2024-07-10)
10+
======================
11+
Use aperture table in poromechanics with conforming fractures. Rebaseline the corresponding cases.
12+
13+
914
PR #3006 (2024-07-01)
1015
======================
1116
Added baselines for new tests. Relaxing tolerances for singlePhasePoromechanics_FaultModel_smoke.
1217

18+
1319
PR #3196 (2024-06-28)
1420
======================
1521
Added isLaggingFractureStencilWeightsUpdate to hydrofracture solve. Rebaseline because of the new input.
1622

23+
1724
PR #3177 (2024-06-28)
1825
======================
1926
Added logLevel to TimeHistoryOutput. Rebaseline because of the new input flag.
2027

28+
2129
PR #3181 (2024-06-25)
2230
======================
2331
Decouple debug matrix output from logLevel. Rebaseline because of the new input flag.

src/coreComponents/physicsSolvers/contact/ContactSolverBase.cpp

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,20 @@ void ContactSolverBase::setFractureRegions( dataRepository::Group const & meshBo
122122

123123
void ContactSolverBase::computeFractureStateStatistics( MeshLevel const & mesh,
124124
globalIndex & numStick,
125+
globalIndex & numNewSlip,
125126
globalIndex & numSlip,
126127
globalIndex & numOpen ) const
127128
{
128129
ElementRegionManager const & elemManager = mesh.getElemManager();
129130

130-
array1d< globalIndex > localCounter( 3 );
131+
array1d< globalIndex > localCounter( 4 );
131132

132133
elemManager.forElementSubRegions< SurfaceElementSubRegion >( [&]( SurfaceElementSubRegion const & subRegion )
133134
{
134135
arrayView1d< integer const > const & ghostRank = subRegion.ghostRank();
135136
arrayView1d< integer const > const & fractureState = subRegion.getField< fields::contact::fractureState >();
136137

137-
RAJA::ReduceSum< parallelHostReduce, localIndex > stickCount( 0 ), slipCount( 0 ), openCount( 0 );
138+
RAJA::ReduceSum< parallelHostReduce, localIndex > stickCount( 0 ), newSlipCount( 0 ), slipCount( 0 ), openCount( 0 );
138139
forAll< parallelHostPolicy >( subRegion.size(), [=] ( localIndex const kfe )
139140
{
140141
if( ghostRank[kfe] < 0 )
@@ -147,6 +148,10 @@ void ContactSolverBase::computeFractureStateStatistics( MeshLevel const & mesh,
147148
break;
148149
}
149150
case FractureState::NewSlip:
151+
{
152+
newSlipCount += 1;
153+
break;
154+
}
150155
case FractureState::Slip:
151156
{
152157
slipCount += 1;
@@ -162,40 +167,43 @@ void ContactSolverBase::computeFractureStateStatistics( MeshLevel const & mesh,
162167
} );
163168

164169
localCounter[0] += stickCount.get();
165-
localCounter[1] += slipCount.get();
166-
localCounter[2] += openCount.get();
170+
localCounter[1] += newSlipCount.get();
171+
localCounter[2] += slipCount.get();
172+
localCounter[3] += openCount.get();
167173
} );
168174

169-
array1d< globalIndex > totalCounter( 3 );
175+
array1d< globalIndex > totalCounter( 4 );
170176

171177
MpiWrapper::allReduce( localCounter.data(),
172178
totalCounter.data(),
173-
3,
179+
4,
174180
MPI_SUM,
175181
MPI_COMM_GEOSX );
176182

177-
numStick = totalCounter[0];
178-
numSlip = totalCounter[1];
179-
numOpen = totalCounter[2];
183+
numStick = totalCounter[0];
184+
numNewSlip = totalCounter[1];
185+
numSlip = totalCounter[2];
186+
numOpen = totalCounter[3];
180187
}
181188

182189
void ContactSolverBase::outputConfigurationStatistics( DomainPartition const & domain ) const
183190
{
184191
if( getLogLevel() >=1 )
185192
{
186193
globalIndex numStick = 0;
194+
globalIndex numNewSlip = 0;
187195
globalIndex numSlip = 0;
188196
globalIndex numOpen = 0;
189197

190198
forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &,
191199
MeshLevel const & mesh,
192200
arrayView1d< string const > const & )
193201
{
194-
computeFractureStateStatistics( mesh, numStick, numSlip, numOpen );
202+
computeFractureStateStatistics( mesh, numStick, numNewSlip, numSlip, numOpen );
195203

196204
GEOS_LOG_RANK_0( GEOS_FMT( " Number of element for each fracture state:"
197-
" stick: {:12} | slip: {:12} | open: {:12}",
198-
numStick, numSlip, numOpen ) );
205+
" stick: {:12} | new slip: {:12} | slip: {:12} | open: {:12}",
206+
numStick, numNewSlip, numSlip, numOpen ) );
199207
} );
200208
}
201209
}

src/coreComponents/physicsSolvers/contact/ContactSolverBase.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class ContactSolverBase : public SolidMechanicsLagrangianFEM
6262

6363
void computeFractureStateStatistics( MeshLevel const & mesh,
6464
globalIndex & numStick,
65+
globalIndex & numNewSlip,
6566
globalIndex & numSlip,
6667
globalIndex & numOpen ) const;
6768

src/coreComponents/physicsSolvers/contact/SolidMechanicsALMKernels.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,8 @@ struct ComputeRotationMatricesKernel
406406
forAll< POLICY >( size, [=] GEOS_HOST_DEVICE ( localIndex const k )
407407
{
408408

409-
localIndex const & f0 = elemsToFaces[k][0];
410-
localIndex const & f1 = elemsToFaces[k][1];
409+
localIndex const f0 = elemsToFaces[k][0];
410+
localIndex const f1 = elemsToFaces[k][1];
411411

412412
real64 Nbar[3];
413413
Nbar[0] = faceNormal[f0][0] - faceNormal[f1][0];

src/coreComponents/physicsSolvers/contact/SolidMechanicsLagrangeContact.cpp

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,13 @@ void SolidMechanicsLagrangeContact::computeTolerances( DomainPartition & domain
253253
{
254254
GEOS_MARK_FUNCTION;
255255

256+
real64 minNormalTractionTolerance( 1e10 );
257+
real64 maxNormalTractionTolerance( -1e10 );
258+
real64 minNormalDisplacementTolerance( 1e10 );
259+
real64 maxNormalDisplacementTolerance( -1e10 );
260+
real64 minSlidingTolerance( 1e10 );
261+
real64 maxSlidingTolerance( -1e10 );
262+
256263
forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &,
257264
MeshLevel & mesh,
258265
arrayView1d< string const > const & )
@@ -302,6 +309,13 @@ void SolidMechanicsLagrangeContact::computeTolerances( DomainPartition & domain
302309
arrayView1d< real64 > const & slidingTolerance =
303310
subRegion.getReference< array1d< real64 > >( viewKeyStruct::slidingToleranceString() );
304311

312+
RAJA::ReduceMin< ReducePolicy< parallelHostPolicy >, real64 > minSubRegionNormalTractionTolerance( 1e10 );
313+
RAJA::ReduceMax< ReducePolicy< parallelHostPolicy >, real64 > maxSubRegionNormalTractionTolerance( -1e10 );
314+
RAJA::ReduceMin< ReducePolicy< parallelHostPolicy >, real64 > minSubRegionNormalDisplacementTolerance( 1e10 );
315+
RAJA::ReduceMax< ReducePolicy< parallelHostPolicy >, real64 > maxSubRegionNormalDisplacementTolerance( -1e10 );
316+
RAJA::ReduceMin< ReducePolicy< parallelHostPolicy >, real64 > minSubRegionSlidingTolerance( 1e10 );
317+
RAJA::ReduceMax< ReducePolicy< parallelHostPolicy >, real64 > maxSubRegionSlidingTolerance( -1e10 );
318+
305319
forAll< parallelHostPolicy >( subRegion.size(), [=] ( localIndex const kfe )
306320
{
307321
if( ghostRank[kfe] < 0 )
@@ -385,15 +399,36 @@ void SolidMechanicsLagrangeContact::computeTolerances( DomainPartition & domain
385399
LvArray::tensorOps::scale< 3, 3 >( rotatedInvStiffApprox, area );
386400

387401
// Finally, compute tolerances for the given fracture element
402+
388403
normalDisplacementTolerance[kfe] = rotatedInvStiffApprox[ 0 ][ 0 ] * averageYoungModulus / 2.e+7;
404+
minSubRegionNormalDisplacementTolerance.min( normalDisplacementTolerance[kfe] );
405+
maxSubRegionNormalDisplacementTolerance.max( normalDisplacementTolerance[kfe] );
406+
389407
slidingTolerance[kfe] = sqrt( rotatedInvStiffApprox[ 1 ][ 1 ] * rotatedInvStiffApprox[ 1 ][ 1 ] +
390408
rotatedInvStiffApprox[ 2 ][ 2 ] * rotatedInvStiffApprox[ 2 ][ 2 ] ) * averageYoungModulus / 2.e+7;
409+
minSubRegionSlidingTolerance.min( slidingTolerance[kfe] );
410+
maxSubRegionSlidingTolerance.max( slidingTolerance[kfe] );
411+
391412
normalTractionTolerance[kfe] = 1.0 / 2.0 * averageConstrainedModulus / averageBoxSize0 * normalDisplacementTolerance[kfe];
413+
minSubRegionNormalTractionTolerance.min( normalTractionTolerance[kfe] );
414+
maxSubRegionNormalTractionTolerance.max( normalTractionTolerance[kfe] );
392415
}
393416
} );
417+
418+
minNormalDisplacementTolerance = std::min( minNormalDisplacementTolerance, minSubRegionNormalDisplacementTolerance.get() );
419+
maxNormalDisplacementTolerance = std::max( maxNormalDisplacementTolerance, maxSubRegionNormalDisplacementTolerance.get() );
420+
minSlidingTolerance = std::min( minSlidingTolerance, minSubRegionSlidingTolerance.get() );
421+
maxSlidingTolerance = std::max( maxSlidingTolerance, maxSubRegionSlidingTolerance.get() );
422+
minNormalTractionTolerance = std::min( minNormalTractionTolerance, minSubRegionNormalTractionTolerance.get() );
423+
maxNormalTractionTolerance = std::max( maxNormalTractionTolerance, maxSubRegionNormalTractionTolerance.get() );
394424
}
395425
} );
396426
} );
427+
428+
GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( "{}: normal displacement tolerance = [{}, {}], sliding tolerance = [{}, {}], normal traction tolerance = [{}, {}]",
429+
this->getName(), minNormalDisplacementTolerance, maxNormalDisplacementTolerance,
430+
minSlidingTolerance, maxSlidingTolerance,
431+
minNormalTractionTolerance, maxNormalTractionTolerance ) );
397432
}
398433

399434
void SolidMechanicsLagrangeContact::resetStateToBeginningOfStep( DomainPartition & domain )
@@ -586,7 +621,7 @@ void SolidMechanicsLagrangeContact::assembleSystem( real64 const time,
586621

587622
assembleContact( domain, dofManager, localMatrix, localRhs );
588623

589-
// for sequenatial: add (fixed) pressure force contribution into residual (no derivatives)
624+
// for sequential: add (fixed) pressure force contribution into residual (no derivatives)
590625
if( m_isFixedStressPoromechanicsUpdate )
591626
{
592627
forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &,
@@ -2221,20 +2256,24 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai
22212256
if( ghostRank[kfe] < 0 )
22222257
{
22232258
integer const originalFractureState = fractureState[kfe];
2224-
if( originalFractureState == contact::FractureState::Open )
2259+
if( originalFractureState == FractureState::Open )
22252260
{
2226-
if( dispJump[kfe][0] > -normalDisplacementTolerance[kfe] )
2261+
if( dispJump[kfe][0] <= -normalDisplacementTolerance[kfe] )
22272262
{
2228-
fractureState[kfe] = contact::FractureState::Open;
2229-
}
2230-
else
2231-
{
2232-
fractureState[kfe] = contact::FractureState::Stick;
2263+
fractureState[kfe] = FractureState::Stick;
2264+
if( getLogLevel() >= 10 )
2265+
GEOS_LOG( GEOS_FMT( "{}: {} -> {}: dispJump = {}, normalDisplacementTolerance = {}",
2266+
kfe, originalFractureState, fractureState[kfe],
2267+
dispJump[kfe][0], normalDisplacementTolerance[kfe] ) );
22332268
}
22342269
}
22352270
else if( traction[kfe][0] > normalTractionTolerance[kfe] )
22362271
{
2237-
fractureState[kfe] = contact::FractureState::Open;
2272+
fractureState[kfe] = FractureState::Open;
2273+
if( getLogLevel() >= 10 )
2274+
GEOS_LOG( GEOS_FMT( "{}: {} -> {}: traction = {}, normalTractionTolerance = {}",
2275+
kfe, originalFractureState, fractureState[kfe],
2276+
traction[kfe][0], normalTractionTolerance[kfe] ) );
22382277
}
22392278
else
22402279
{
@@ -2245,29 +2284,33 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai
22452284
contactWrapper.computeLimitTangentialTractionNorm( traction[kfe][0],
22462285
dLimitTangentialTractionNorm_dTraction );
22472286

2248-
if( originalFractureState == contact::FractureState::Stick && currentTau >= limitTau )
2287+
if( originalFractureState == FractureState::Stick && currentTau >= limitTau )
22492288
{
22502289
currentTau *= (1.0 - m_slidingCheckTolerance);
22512290
}
2252-
else if( originalFractureState != contact::FractureState::Stick && currentTau <= limitTau )
2291+
else if( originalFractureState != FractureState::Stick && currentTau <= limitTau )
22532292
{
22542293
currentTau *= (1.0 + m_slidingCheckTolerance);
22552294
}
22562295
if( currentTau > limitTau )
22572296
{
2258-
if( originalFractureState == contact::FractureState::Stick )
2297+
if( originalFractureState == FractureState::Stick )
22592298
{
2260-
fractureState[kfe] = contact::FractureState::NewSlip;
2299+
fractureState[kfe] = FractureState::NewSlip;
22612300
}
22622301
else
22632302
{
2264-
fractureState[kfe] = contact::FractureState::Slip;
2303+
fractureState[kfe] = FractureState::Slip;
22652304
}
22662305
}
22672306
else
22682307
{
2269-
fractureState[kfe] = contact::FractureState::Stick;
2308+
fractureState[kfe] = FractureState::Stick;
22702309
}
2310+
if( getLogLevel() >= 10 && fractureState[kfe] != originalFractureState )
2311+
GEOS_LOG( GEOS_FMT( "{}: {} -> {}: currentTau = {}, limitTau = {}",
2312+
kfe, originalFractureState, fractureState[kfe],
2313+
currentTau, limitTau ) );
22712314
}
22722315

22732316
changed += faceArea[kfe] * !compareFractureStates( originalFractureState, fractureState[kfe] );
@@ -2289,21 +2332,23 @@ bool SolidMechanicsLagrangeContact::updateConfiguration( DomainPartition & domai
22892332
// and total area of fracture elements
22902333
totalArea = MpiWrapper::sum( totalArea );
22912334

2335+
GEOS_LOG_LEVEL_RANK_0( 2, GEOS_FMT( " {}: changed area {} out of {}", getName(), changedArea, totalArea ) );
2336+
22922337
// Assume converged if changed area is below certain fraction of total area
22932338
return changedArea <= m_nonlinearSolverParameters.m_configurationTolerance * totalArea;
22942339
}
22952340

22962341
bool SolidMechanicsLagrangeContact::isFractureAllInStickCondition( DomainPartition const & domain ) const
22972342
{
2298-
globalIndex numStick, numSlip, numOpen;
2343+
globalIndex numStick, numNewSlip, numSlip, numOpen;
22992344
forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&] ( string const &,
23002345
MeshLevel const & mesh,
23012346
arrayView1d< string const > const & )
23022347
{
2303-
computeFractureStateStatistics( mesh, numStick, numSlip, numOpen );
2348+
computeFractureStateStatistics( mesh, numStick, numNewSlip, numSlip, numOpen );
23042349
} );
23052350

2306-
return ( ( numSlip + numOpen ) == 0 );
2351+
return ( ( numNewSlip + numSlip + numOpen ) == 0 );
23072352
}
23082353

23092354
real64 SolidMechanicsLagrangeContact::setNextDt( real64 const & currentDt,

src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseBase.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,9 +2585,6 @@ void CompositionalMultiphaseBase::updateState( DomainPartition & domain )
25852585
{
25862586
GEOS_MARK_FUNCTION;
25872587

2588-
if( m_keepFlowVariablesConstantDuringInitStep )
2589-
return;
2590-
25912588
real64 maxDeltaPhaseVolFrac = 0.0;
25922589
forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &,
25932590
MeshLevel & mesh,

src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBase.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,6 @@ void FlowSolverBase::registerDataOnMesh( Group & meshBodies )
185185
subRegion.registerField< fields::flow::hydraulicAperture >( getName() ).
186186
setApplyDefaultValue( faceRegion.getDefaultAperture() );
187187

188-
subRegion.registerField< fields::flow::minimumHydraulicAperture >( getName() ).
189-
setApplyDefaultValue( faceRegion.getDefaultAperture() );
190-
191188
} );
192189

193190
FaceManager & faceManager = mesh.getFaceManager();

src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,6 @@ DECLARE_FIELD( hydraulicAperture,
168168
WRITE_AND_READ,
169169
"Hydraulic aperture" );
170170

171-
DECLARE_FIELD( minimumHydraulicAperture,
172-
"minimumHydraulicAperture",
173-
array1d< real64 >,
174-
0,
175-
LEVEL_0,
176-
WRITE_AND_READ,
177-
"minimum value of the hydraulic aperture" );
178-
179171
DECLARE_FIELD( gravityCoefficient,
180172
"gravityCoefficient",
181173
array1d< real64 >,

src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -750,12 +750,13 @@ void SinglePhaseBase::implicitStepComplete( real64 const & time,
750750
singlePhaseBaseKernels::StatisticsKernel::
751751
saveDeltaPressure( subRegion.size(), pres, initPres, deltaPres );
752752

753-
arrayView1d< real64 const > const dVol = subRegion.getField< fields::flow::deltaVolume >();
753+
arrayView1d< real64 > const dVol = subRegion.getField< fields::flow::deltaVolume >();
754754
arrayView1d< real64 > const vol = subRegion.getReference< array1d< real64 > >( CellElementSubRegion::viewKeyStruct::elementVolumeString() );
755755

756756
forAll< parallelDevicePolicy<> >( subRegion.size(), [=] GEOS_HOST_DEVICE ( localIndex const ei )
757757
{
758758
vol[ei] += dVol[ei];
759+
dVol[ei] = 0.0;
759760
} );
760761

761762
SingleFluidBase const & fluid =
@@ -803,7 +804,7 @@ void SinglePhaseBase::implicitStepComplete( real64 const & time,
803804
if( volume[ei] * density_n[ei][0] > 1.1 * creationMass[ei] )
804805
{
805806
creationMass[ei] *= 0.75;
806-
if( creationMass[ei]<1.0e-20 )
807+
if( creationMass[ei] < 1.0e-20 )
807808
{
808809
creationMass[ei] = 0.0;
809810
}
@@ -1255,9 +1256,6 @@ void SinglePhaseBase::updateState( DomainPartition & domain )
12551256
{
12561257
GEOS_MARK_FUNCTION;
12571258

1258-
if( m_keepFlowVariablesConstantDuringInitStep )
1259-
return;
1260-
12611259
forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &,
12621260
MeshLevel & mesh,
12631261
arrayView1d< string const > const & regionNames )

0 commit comments

Comments
 (0)