Skip to content

Commit 005ccf8

Browse files
authored
refactor: fix creation of mass handling. (#3215)
1 parent 52e0ade commit 005ccf8

File tree

10 files changed

+143
-128
lines changed

10 files changed

+143
-128
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-pr3233-6393-534ac25
3+
baseline: integratedTests/baseline_integratedTests-pr3215-6396-9b43cc8
44

55
allow_fail:
66
all: ''

BASELINE_NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ 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 #3215 (2024-07-23)
10+
======================
11+
Changed the default value for massCreation and name of the wrapper.
12+
13+
914
PR #3194 (2024-07-22)
1015
======================
1116
Check pore volume for all element types, also check that default aperture > 0. Rebaseline for modified tests. No real results change.
1217

18+
1319
PR #3213 (2024-07-12)
1420
======================
1521
Added baselines for new tests on Dirichlet boundary conditions for multiphase flow.

src/coreComponents/mesh/SurfaceElementRegion.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,8 @@ localIndex SurfaceElementRegion::addToFractureMesh( real64 const time_np1,
106106

107107
arrayView1d< real64 > const ruptureTime = subRegion.getField< fields::ruptureTime >();
108108

109-
arrayView1d< real64 > const creationMass = subRegion.getReference< real64_array >( FaceElementSubRegion::viewKeyStruct::creationMassString() );
110-
111109
arrayView2d< real64 const > const faceCenter = faceManager->faceCenter();
112110
arrayView2d< real64 > const elemCenter = subRegion.getElementCenter();
113-
arrayView1d< real64 const > const elemArea = subRegion.getElementArea().toViewConst();
114111

115112
arrayView1d< integer > const subRegionGhostRank = subRegion.ghostRank();
116113

@@ -212,8 +209,6 @@ localIndex SurfaceElementRegion::addToFractureMesh( real64 const time_np1,
212209

213210
subRegion.calculateSingleElementGeometricQuantities( kfe, faceManager->faceArea() );
214211

215-
creationMass[kfe] *= elemArea[kfe];
216-
217212
// update the sets
218213
for( auto const & setIter : faceManager->sets().wrappers() )
219214
{

src/coreComponents/mesh/SurfaceElementSubRegion.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ SurfaceElementSubRegion::SurfaceElementSubRegion( string const & name,
5959
setPlotLevel( PlotLevel::NOPLOT ).
6060
setDescription( "A map of face element local indices to the cell local indices" );
6161

62-
registerWrapper< real64_array >( viewKeyStruct::creationMassString() ).
63-
setApplyDefaultValue( 0.0 ).
64-
setPlotLevel( dataRepository::PlotLevel::LEVEL_1 ).
65-
setDescription( "The amount of remaining mass that was introduced when the SurfaceElement was created." );
66-
6762
registerField( fields::elementAperture{}, &m_elementAperture );
6863

6964
registerField( fields::elementArea{}, &m_elementArea );

src/coreComponents/mesh/SurfaceElementSubRegion.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,6 @@ class SurfaceElementSubRegion : public ElementSubRegionBase
277277
/// @return Face element to cell indices map string.
278278
static constexpr char const * surfaceElementsToCellIndexString() { return "fractureElementsToCellIndices"; }
279279

280-
/// @return Mass creation string.
281-
constexpr static char const * creationMassString() { return "creationMass"; }
282-
283280
/// @return surface element to parent plane string.
284281
constexpr static char const * surfaceElementToParentPlaneString() { return "surfaceElementToParentPlane"; }
285282
};

src/coreComponents/physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,14 @@ DECLARE_FIELD( energy_n,
273273
WRITE_AND_READ,
274274
"Energy at the previous converged time step" );
275275

276+
DECLARE_FIELD( massCreated,
277+
"massCreated",
278+
array1d< real64 >,
279+
0,
280+
LEVEL_1,
281+
WRITE_AND_READ,
282+
"The amount of remaining mass that was introduced when the SurfaceElement was created." );
283+
276284
}
277285

278286
}

src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBase.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,20 @@ void SinglePhaseBase::registerDataOnMesh( Group & meshBodies )
9696
subRegion.registerField< fields::flow::mass >( getName() );
9797
subRegion.registerField< fields::flow::mass_n >( getName() );
9898

99+
99100
if( m_isThermal )
100101
{
101102
subRegion.registerField< dMobility_dTemperature >( getName() );
102103
}
103104
} );
104105

106+
elemManager.forElementSubRegions< SurfaceElementSubRegion >( regionNames,
107+
[&]( localIndex const,
108+
SurfaceElementSubRegion & subRegion )
109+
{
110+
subRegion.registerField< fields::flow::massCreated >( getName() );
111+
} );
112+
105113
FaceManager & faceManager = mesh.getFaceManager();
106114
{
107115
faceManager.registerField< facePressure >( getName() );
@@ -463,14 +471,8 @@ void SinglePhaseBase::initializePostInitialConditionsPreSubGroups()
463471
{
464472
region.forElementSubRegions< FaceElementSubRegion >( [&]( FaceElementSubRegion & subRegion )
465473
{
466-
ConstitutiveBase & fluid = getConstitutiveModel( subRegion, subRegion.getReference< string >( viewKeyStruct::fluidNamesString() ) );
467-
real64 const defaultDensity = getFluidProperties( fluid ).defaultDensity;
468-
469474
subRegion.getWrapper< real64_array >( fields::flow::hydraulicAperture::key() ).
470475
setApplyDefaultValue( region.getDefaultAperture() );
471-
472-
subRegion.getWrapper< real64_array >( FaceElementSubRegion::viewKeyStruct::creationMassString() ).
473-
setApplyDefaultValue( defaultDensity * region.getDefaultAperture() );
474476
} );
475477
} );
476478

@@ -792,7 +794,7 @@ void SinglePhaseBase::implicitStepComplete( real64 const & time,
792794
{
793795
arrayView1d< integer const > const elemGhostRank = subRegion.ghostRank();
794796
arrayView1d< real64 const > const volume = subRegion.getElementVolume();
795-
arrayView1d< real64 > const creationMass = subRegion.getReference< real64_array >( FaceElementSubRegion::viewKeyStruct::creationMassString() );
797+
arrayView1d< real64 > const creationMass = subRegion.getField< fields::flow::massCreated >();
796798

797799
SingleFluidBase const & fluid =
798800
getConstitutiveModel< SingleFluidBase >( subRegion, subRegion.template getReference< string >( viewKeyStruct::fluidNamesString() ) );

src/coreComponents/physicsSolvers/fluidFlow/SinglePhaseBaseKernels.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ class SurfaceElementBasedAssemblyKernel : public ElementBasedAssemblyKernel< Sur
356356
CRSMatrixView< real64, globalIndex const > const & localMatrix,
357357
arrayView1d< real64 > const & localRhs )
358358
: Base( rankOffset, dofKey, subRegion, fluid, solid, localMatrix, localRhs )
359-
, m_creationMass( subRegion.getReference< array1d< real64 > >( SurfaceElementSubRegion::viewKeyStruct::creationMassString() ) )
359+
, m_creationMass( subRegion.getField< fields::flow::massCreated >() )
360360
{}
361361

362362
/**

src/coreComponents/physicsSolvers/fluidFlow/ThermalSinglePhaseBaseKernels.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ class SurfaceElementBasedAssemblyKernel : public ElementBasedAssemblyKernel< Sur
332332
CRSMatrixView< real64, globalIndex const > const & localMatrix,
333333
arrayView1d< real64 > const & localRhs )
334334
: Base( rankOffset, dofKey, subRegion, fluid, solid, localMatrix, localRhs ),
335-
m_creationMass( subRegion.getReference< array1d< real64 > >( SurfaceElementSubRegion::viewKeyStruct::creationMassString() ) )
335+
m_creationMass( subRegion.getField< fields::flow::massCreated >() )
336336
{}
337337

338338
/**

0 commit comments

Comments
 (0)