Skip to content

Commit 66a6bf8

Browse files
fix: Change strain and stress names (#212)
1 parent e5045e9 commit 66a6bf8

3 files changed

Lines changed: 17 additions & 22 deletions

File tree

geos-processing/src/geos/processing/post_processing/GeomechanicsCalculator.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
- The initial porosity named "porosityInitial"
3535
- The delta of pressure named "deltaPressure"
3636
- The density named "density"
37-
- The effective stress named "stressEffective"
37+
- The average stress named "averageStress"
3838
- The initial effective stress named "stressEffectiveInitial"
3939
- The pressure named "pressure"
4040
@@ -125,10 +125,10 @@
125125
PRESSURE: AttributeEnum = GeosMeshOutputsEnum.PRESSURE
126126
DELTA_PRESSURE: AttributeEnum = GeosMeshOutputsEnum.DELTA_PRESSURE
127127
DENSITY: AttributeEnum = GeosMeshOutputsEnum.ROCK_DENSITY
128-
STRESS_EFFECTIVE: AttributeEnum = GeosMeshOutputsEnum.STRESS_EFFECTIVE
128+
AVERAGE_STRESS: AttributeEnum = GeosMeshOutputsEnum.AVERAGE_STRESS
129129
STRESS_EFFECTIVE_T0: AttributeEnum = PostProcessingOutputsEnum.STRESS_EFFECTIVE_INITIAL
130130
MANDATORY_PROPERTIES: tuple[ AttributeEnum, ...] = ( POROSITY, POROSITY_T0, PRESSURE, DELTA_PRESSURE, DENSITY,
131-
STRESS_EFFECTIVE, STRESS_EFFECTIVE_T0 )
131+
AVERAGE_STRESS, STRESS_EFFECTIVE_T0 )
132132

133133
# Basic properties:
134134
BIOT_COEFFICIENT: AttributeEnum = PostProcessingOutputsEnum.BIOT_COEFFICIENT
@@ -141,15 +141,15 @@
141141
STRESS_TOTAL_T0: AttributeEnum = PostProcessingOutputsEnum.STRESS_TOTAL_INITIAL
142142
STRESS_TOTAL_RATIO_REAL: AttributeEnum = PostProcessingOutputsEnum.STRESS_TOTAL_RATIO_REAL
143143
LITHOSTATIC_STRESS: AttributeEnum = PostProcessingOutputsEnum.LITHOSTATIC_STRESS
144-
STRAIN_ELASTIC: AttributeEnum = PostProcessingOutputsEnum.STRAIN_ELASTIC
144+
AVERAGE_STRAIN: AttributeEnum = PostProcessingOutputsEnum.AVERAGE_STRAIN
145145
STRESS_TOTAL_DELTA: AttributeEnum = PostProcessingOutputsEnum.STRESS_TOTAL_DELTA
146146
RSP_REAL: AttributeEnum = PostProcessingOutputsEnum.RSP_REAL
147147
RSP_OED: AttributeEnum = PostProcessingOutputsEnum.RSP_OED
148148
STRESS_EFFECTIVE_RATIO_OED: AttributeEnum = PostProcessingOutputsEnum.STRESS_EFFECTIVE_RATIO_OED
149149
BASIC_PROPERTIES: tuple[ AttributeEnum,
150150
...] = ( BIOT_COEFFICIENT, COMPRESSIBILITY, COMPRESSIBILITY_OED, COMPRESSIBILITY_REAL,
151151
SPECIFIC_GRAVITY, STRESS_EFFECTIVE_RATIO_REAL, STRESS_TOTAL, STRESS_TOTAL_T0,
152-
STRESS_TOTAL_RATIO_REAL, LITHOSTATIC_STRESS, STRAIN_ELASTIC, STRESS_TOTAL_DELTA,
152+
STRESS_TOTAL_RATIO_REAL, LITHOSTATIC_STRESS, AVERAGE_STRAIN, STRESS_TOTAL_DELTA,
153153
RSP_REAL, RSP_OED, STRESS_EFFECTIVE_RATIO_OED )
154154

155155
# Advanced properties:
@@ -396,7 +396,7 @@ def setMandatoryPropertyValue( self: Self, name: str, value: npt.NDArray[ np.flo
396396
self._deltaPressure = value
397397
elif name == DENSITY.attributeName:
398398
self._density = value
399-
elif name == STRESS_EFFECTIVE.attributeName:
399+
elif name == AVERAGE_STRESS.attributeName:
400400
self._effectiveStress = value
401401
elif name == STRESS_EFFECTIVE_T0.attributeName:
402402
self._effectiveStressT0 = value
@@ -590,7 +590,7 @@ def getBasicPropertyValue( self: Self, name: str ) -> npt.NDArray[ np.float64 ]
590590
# TODO: lithostatic stress calculation is deactivated until the formula is not fixed
591591
# elif name == LITHOSTATIC_STRESS.attributeName:
592592
# return self.lithostaticStress
593-
elif name == STRAIN_ELASTIC.attributeName:
593+
elif name == AVERAGE_STRAIN.attributeName:
594594
return self.elasticStrain
595595
elif name == STRESS_TOTAL_DELTA.attributeName:
596596
return self.deltaTotalStress
@@ -1076,7 +1076,7 @@ def _computeTotalStresses( self: Self ) -> None:
10761076
self._basicProperties.biotCoefficient,
10771077
STRESS_TOTAL )
10781078
else:
1079-
mess = f"{ STRESS_TOTAL.attributeName } has not been computed, geomechanics property { STRESS_EFFECTIVE.attributeName } or { BIOT_COEFFICIENT.attributeName } are missing."
1079+
mess = f"{ STRESS_TOTAL.attributeName } has not been computed, geomechanics property { AVERAGE_STRESS.attributeName } or { BIOT_COEFFICIENT.attributeName } are missing."
10801080
raise AttributeError( mess )
10811081

10821082
# Compute the total stress ratio.
@@ -1175,19 +1175,19 @@ def _computeElasticStrain( self: Self ) -> None:
11751175
if self._mandatoryProperties.effectiveStress is not None and self._mandatoryProperties.effectiveStressT0 is not None:
11761176
deltaEffectiveStress = self._mandatoryProperties.effectiveStress - self._mandatoryProperties.effectiveStressT0
11771177

1178-
if not isAttributeInObject( self.output, STRAIN_ELASTIC.attributeName, STRAIN_ELASTIC.piece ):
1178+
if not isAttributeInObject( self.output, AVERAGE_STRAIN.attributeName, AVERAGE_STRAIN.piece ):
11791179
if self.computeYoungPoisson:
11801180
self._basicProperties.elasticStrain = fcts.elasticStrainFromBulkShear(
11811181
deltaEffectiveStress, self._elasticModuli.bulkModulus, self._elasticModuli.shearModulus )
11821182
else:
11831183
self._basicProperties.elasticStrain = fcts.elasticStrainFromYoungPoisson(
11841184
deltaEffectiveStress, self._elasticModuli.youngModulus, self._elasticModuli.poissonRatio )
1185-
self._attributesToCreate.append( STRAIN_ELASTIC )
1185+
self._attributesToCreate.append( AVERAGE_STRAIN )
11861186
else:
1187-
self._basicProperties.totalStressT0 = getArrayInObject( self.output, STRAIN_ELASTIC.attributeName,
1188-
STRAIN_ELASTIC.piece )
1187+
self._basicProperties.totalStressT0 = getArrayInObject( self.output, AVERAGE_STRAIN.attributeName,
1188+
AVERAGE_STRAIN.piece )
11891189
self.logger.warning(
1190-
f"{ STRAIN_ELASTIC.attributeName } is already on the mesh, it has not been computed by the filter."
1190+
f"{ AVERAGE_STRAIN.attributeName } is already on the mesh, it has not been computed by the filter."
11911191
)
11921192

11931193
return

geos-pv/src/geos/pv/plugins/post_processing/PVMohrCirclePlot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ def _createMohrCirclesAtTimeStep(
799799
"""
800800
# Get effective stress array
801801
stressArray: npt.NDArray[ np.float64 ] = getArrayInObject( mesh,
802-
GeosMeshOutputsEnum.STRESS_EFFECTIVE.attributeName,
802+
GeosMeshOutputsEnum.AVERAGE_STRESS.attributeName,
803803
Piece.CELLS )
804804
# Get stress convention
805805
stressConvention = StressConventionEnum.GEOS_STRESS_CONVENTION if self.useGeosStressConvention else StressConventionEnum.COMMON_STRESS_CONVENTION

geos-utils/src/geos/utils/GeosOutputsConstants.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ class GeosMeshSuffixEnum( Enum ):
8989

9090
# rock attributes suffix
9191
DENSITY_SUFFIX = "_density"
92-
STRESS_SUFFIX = "_stress"
93-
STRAIN_SUFFIX = "strain"
9492
PERMEABILITY_SUFFIX = "_permeability"
9593
POROSITY_SUFFIX = "_porosity"
9694
POROSITY_INIT_SUFFIX = "_initialPorosity"
@@ -157,7 +155,7 @@ class GeosMeshOutputsEnum( AttributeEnum ):
157155
BULK_MODULUS = ( "bulkModulus", 1, Piece.CELLS )
158156
GRAIN_BULK_MODULUS = ( "bulkModulusGrains", 1, Piece.CELLS )
159157
SHEAR_MODULUS = ( "shearModulus", 1, Piece.CELLS )
160-
STRESS_EFFECTIVE = ( "stressEffective", 6, Piece.CELLS )
158+
AVERAGE_STRESS = ( "averageStress", 6, Piece.CELLS )
161159
TOTAL_DISPLACEMENT = ( "totalDisplacement", 4, Piece.POINTS )
162160

163161
TRACTION = ( "traction", 3, Piece.CELLS )
@@ -202,7 +200,7 @@ class PostProcessingOutputsEnum( AttributeEnum ):
202200
STRESS_TOTAL_INITIAL = ( "stressTotalInitial", 6, Piece.CELLS )
203201
STRESS_TOTAL_RATIO_REAL = ( "stressTotalRatio_real", 1, Piece.CELLS )
204202
STRESS_TOTAL_DELTA = ( "deltaStressTotal", 6, Piece.CELLS )
205-
STRAIN_ELASTIC = ( "strainElastic", 6, Piece.CELLS )
203+
AVERAGE_STRAIN = ( "averageStrain", 6, Piece.CELLS )
206204
RSP_OED = ( "rsp_oed", 1, Piece.CELLS )
207205
RSP_REAL = ( "rsp_real", 6, Piece.CELLS )
208206

@@ -233,7 +231,6 @@ def __init__( self: Self, phaseType: str, attributes: tuple[ str, ...] ) -> None
233231
"Rock",
234232
(
235233
GeosMeshSuffixEnum.DENSITY_SUFFIX.value,
236-
GeosMeshSuffixEnum.STRESS_SUFFIX.value,
237234
GeosMeshSuffixEnum.PERMEABILITY_SUFFIX.value,
238235
GeosMeshSuffixEnum.POROSITY_SUFFIX.value,
239236
GeosMeshSuffixEnum.POROSITY_INIT_SUFFIX.value,
@@ -299,15 +296,13 @@ def getRockSuffixRenaming() -> dict[ str, str ]:
299296
"""
300297
return {
301298
GeosMeshSuffixEnum.DENSITY_SUFFIX.value: GeosMeshOutputsEnum.ROCK_DENSITY.attributeName,
302-
GeosMeshSuffixEnum.STRESS_SUFFIX.value: GeosMeshOutputsEnum.STRESS_EFFECTIVE.attributeName,
303299
GeosMeshSuffixEnum.PERMEABILITY_SUFFIX.value: GeosMeshOutputsEnum.PERMEABILITY.attributeName,
304300
GeosMeshSuffixEnum.POROSITY_SUFFIX.value: GeosMeshOutputsEnum.POROSITY.attributeName,
305301
GeosMeshSuffixEnum.POROSITY_REF_SUFFIX.value: GeosMeshOutputsEnum.POROSITY_INI.attributeName,
306302
GeosMeshSuffixEnum.BULK_MODULUS_SUFFIX.value: GeosMeshOutputsEnum.BULK_MODULUS.attributeName,
307303
GeosMeshSuffixEnum.SHEAR_MODULUS_SUFFIX.value: GeosMeshOutputsEnum.SHEAR_MODULUS.attributeName,
308304
GeosMeshSuffixEnum.GRAIN_BULK_MODULUS_SUFFIX.value: GeosMeshOutputsEnum.GRAIN_BULK_MODULUS.attributeName,
309305
GeosMeshSuffixEnum.BIOT_COEFFICIENT_SUFFIX.value: PostProcessingOutputsEnum.BIOT_COEFFICIENT.attributeName,
310-
GeosMeshSuffixEnum.STRAIN_SUFFIX.value: PostProcessingOutputsEnum.STRAIN_ELASTIC.attributeName,
311306
}
312307

313308

@@ -319,7 +314,7 @@ def getAttributeToTransferFromInitialTime() -> dict[ str, str ]:
319314
names are values
320315
"""
321316
return {
322-
GeosMeshOutputsEnum.STRESS_EFFECTIVE.attributeName:
317+
GeosMeshOutputsEnum.AVERAGE_STRESS.attributeName:
323318
PostProcessingOutputsEnum.STRESS_EFFECTIVE_INITIAL.attributeName,
324319
GeosMeshOutputsEnum.SHEAR_MODULUS.attributeName:
325320
PostProcessingOutputsEnum.SHEAR_MODULUS_INITIAL.attributeName,

0 commit comments

Comments
 (0)