Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- The initial porosity named "porosityInitial"
- The delta of pressure named "deltaPressure"
- The density named "density"
- The effective stress named "stressEffective"
- The average stress named "averageStress"
- The initial effective stress named "stressEffectiveInitial"
- The pressure named "pressure"

Expand Down Expand Up @@ -125,10 +125,10 @@
PRESSURE: AttributeEnum = GeosMeshOutputsEnum.PRESSURE
DELTA_PRESSURE: AttributeEnum = GeosMeshOutputsEnum.DELTA_PRESSURE
DENSITY: AttributeEnum = GeosMeshOutputsEnum.ROCK_DENSITY
STRESS_EFFECTIVE: AttributeEnum = GeosMeshOutputsEnum.STRESS_EFFECTIVE
AVERAGE_STRESS: AttributeEnum = GeosMeshOutputsEnum.AVERAGE_STRESS
STRESS_EFFECTIVE_T0: AttributeEnum = PostProcessingOutputsEnum.STRESS_EFFECTIVE_INITIAL
MANDATORY_PROPERTIES: tuple[ AttributeEnum, ...] = ( POROSITY, POROSITY_T0, PRESSURE, DELTA_PRESSURE, DENSITY,
STRESS_EFFECTIVE, STRESS_EFFECTIVE_T0 )
AVERAGE_STRESS, STRESS_EFFECTIVE_T0 )

# Basic properties:
BIOT_COEFFICIENT: AttributeEnum = PostProcessingOutputsEnum.BIOT_COEFFICIENT
Expand All @@ -141,15 +141,15 @@
STRESS_TOTAL_T0: AttributeEnum = PostProcessingOutputsEnum.STRESS_TOTAL_INITIAL
STRESS_TOTAL_RATIO_REAL: AttributeEnum = PostProcessingOutputsEnum.STRESS_TOTAL_RATIO_REAL
LITHOSTATIC_STRESS: AttributeEnum = PostProcessingOutputsEnum.LITHOSTATIC_STRESS
STRAIN_ELASTIC: AttributeEnum = PostProcessingOutputsEnum.STRAIN_ELASTIC
AVERAGE_STRAIN: AttributeEnum = PostProcessingOutputsEnum.AVERAGE_STRAIN
STRESS_TOTAL_DELTA: AttributeEnum = PostProcessingOutputsEnum.STRESS_TOTAL_DELTA
RSP_REAL: AttributeEnum = PostProcessingOutputsEnum.RSP_REAL
RSP_OED: AttributeEnum = PostProcessingOutputsEnum.RSP_OED
STRESS_EFFECTIVE_RATIO_OED: AttributeEnum = PostProcessingOutputsEnum.STRESS_EFFECTIVE_RATIO_OED
BASIC_PROPERTIES: tuple[ AttributeEnum,
...] = ( BIOT_COEFFICIENT, COMPRESSIBILITY, COMPRESSIBILITY_OED, COMPRESSIBILITY_REAL,
SPECIFIC_GRAVITY, STRESS_EFFECTIVE_RATIO_REAL, STRESS_TOTAL, STRESS_TOTAL_T0,
STRESS_TOTAL_RATIO_REAL, LITHOSTATIC_STRESS, STRAIN_ELASTIC, STRESS_TOTAL_DELTA,
STRESS_TOTAL_RATIO_REAL, LITHOSTATIC_STRESS, AVERAGE_STRAIN, STRESS_TOTAL_DELTA,
RSP_REAL, RSP_OED, STRESS_EFFECTIVE_RATIO_OED )

# Advanced properties:
Expand Down Expand Up @@ -396,7 +396,7 @@ def setMandatoryPropertyValue( self: Self, name: str, value: npt.NDArray[ np.flo
self._deltaPressure = value
elif name == DENSITY.attributeName:
self._density = value
elif name == STRESS_EFFECTIVE.attributeName:
elif name == AVERAGE_STRESS.attributeName:
self._effectiveStress = value
elif name == STRESS_EFFECTIVE_T0.attributeName:
self._effectiveStressT0 = value
Expand Down Expand Up @@ -590,7 +590,7 @@ def getBasicPropertyValue( self: Self, name: str ) -> npt.NDArray[ np.float64 ]
# TODO: lithostatic stress calculation is deactivated until the formula is not fixed
# elif name == LITHOSTATIC_STRESS.attributeName:
# return self.lithostaticStress
elif name == STRAIN_ELASTIC.attributeName:
elif name == AVERAGE_STRAIN.attributeName:
return self.elasticStrain
elif name == STRESS_TOTAL_DELTA.attributeName:
return self.deltaTotalStress
Expand Down Expand Up @@ -1076,7 +1076,7 @@ def _computeTotalStresses( self: Self ) -> None:
self._basicProperties.biotCoefficient,
STRESS_TOTAL )
else:
mess = f"{ STRESS_TOTAL.attributeName } has not been computed, geomechanics property { STRESS_EFFECTIVE.attributeName } or { BIOT_COEFFICIENT.attributeName } are missing."
mess = f"{ STRESS_TOTAL.attributeName } has not been computed, geomechanics property { AVERAGE_STRESS.attributeName } or { BIOT_COEFFICIENT.attributeName } are missing."
raise AttributeError( mess )

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

if not isAttributeInObject( self.output, STRAIN_ELASTIC.attributeName, STRAIN_ELASTIC.piece ):
if not isAttributeInObject( self.output, AVERAGE_STRAIN.attributeName, AVERAGE_STRAIN.piece ):
if self.computeYoungPoisson:
self._basicProperties.elasticStrain = fcts.elasticStrainFromBulkShear(
deltaEffectiveStress, self._elasticModuli.bulkModulus, self._elasticModuli.shearModulus )
else:
self._basicProperties.elasticStrain = fcts.elasticStrainFromYoungPoisson(
deltaEffectiveStress, self._elasticModuli.youngModulus, self._elasticModuli.poissonRatio )
self._attributesToCreate.append( STRAIN_ELASTIC )
self._attributesToCreate.append( AVERAGE_STRAIN )
else:
self._basicProperties.totalStressT0 = getArrayInObject( self.output, STRAIN_ELASTIC.attributeName,
STRAIN_ELASTIC.piece )
self._basicProperties.totalStressT0 = getArrayInObject( self.output, AVERAGE_STRAIN.attributeName,
AVERAGE_STRAIN.piece )
self.logger.warning(
f"{ STRAIN_ELASTIC.attributeName } is already on the mesh, it has not been computed by the filter."
f"{ AVERAGE_STRAIN.attributeName } is already on the mesh, it has not been computed by the filter."
)

return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ def _createMohrCirclesAtTimeStep(
"""
# Get effective stress array
stressArray: npt.NDArray[ np.float64 ] = getArrayInObject( mesh,
GeosMeshOutputsEnum.STRESS_EFFECTIVE.attributeName,
GeosMeshOutputsEnum.AVERAGE_STRESS.attributeName,
Piece.CELLS )
# Get stress convention
stressConvention = StressConventionEnum.GEOS_STRESS_CONVENTION if self.useGeosStressConvention else StressConventionEnum.COMMON_STRESS_CONVENTION
Expand Down
11 changes: 3 additions & 8 deletions geos-utils/src/geos/utils/GeosOutputsConstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ class GeosMeshSuffixEnum( Enum ):

# rock attributes suffix
DENSITY_SUFFIX = "_density"
STRESS_SUFFIX = "_stress"
STRAIN_SUFFIX = "strain"
PERMEABILITY_SUFFIX = "_permeability"
POROSITY_SUFFIX = "_porosity"
POROSITY_INIT_SUFFIX = "_initialPorosity"
Expand Down Expand Up @@ -157,7 +155,7 @@ class GeosMeshOutputsEnum( AttributeEnum ):
BULK_MODULUS = ( "bulkModulus", 1, Piece.CELLS )
GRAIN_BULK_MODULUS = ( "bulkModulusGrains", 1, Piece.CELLS )
SHEAR_MODULUS = ( "shearModulus", 1, Piece.CELLS )
STRESS_EFFECTIVE = ( "stressEffective", 6, Piece.CELLS )
AVERAGE_STRESS = ( "averageStress", 6, Piece.CELLS )
TOTAL_DISPLACEMENT = ( "totalDisplacement", 4, Piece.POINTS )

TRACTION = ( "traction", 3, Piece.CELLS )
Expand Down Expand Up @@ -202,7 +200,7 @@ class PostProcessingOutputsEnum( AttributeEnum ):
STRESS_TOTAL_INITIAL = ( "stressTotalInitial", 6, Piece.CELLS )
STRESS_TOTAL_RATIO_REAL = ( "stressTotalRatio_real", 1, Piece.CELLS )
STRESS_TOTAL_DELTA = ( "deltaStressTotal", 6, Piece.CELLS )
STRAIN_ELASTIC = ( "strainElastic", 6, Piece.CELLS )
AVERAGE_STRAIN = ( "averageStrain", 6, Piece.CELLS )
RSP_OED = ( "rsp_oed", 1, Piece.CELLS )
RSP_REAL = ( "rsp_real", 6, Piece.CELLS )

Expand Down Expand Up @@ -233,7 +231,6 @@ def __init__( self: Self, phaseType: str, attributes: tuple[ str, ...] ) -> None
"Rock",
(
GeosMeshSuffixEnum.DENSITY_SUFFIX.value,
GeosMeshSuffixEnum.STRESS_SUFFIX.value,
GeosMeshSuffixEnum.PERMEABILITY_SUFFIX.value,
GeosMeshSuffixEnum.POROSITY_SUFFIX.value,
GeosMeshSuffixEnum.POROSITY_INIT_SUFFIX.value,
Expand Down Expand Up @@ -299,15 +296,13 @@ def getRockSuffixRenaming() -> dict[ str, str ]:
"""
return {
GeosMeshSuffixEnum.DENSITY_SUFFIX.value: GeosMeshOutputsEnum.ROCK_DENSITY.attributeName,
GeosMeshSuffixEnum.STRESS_SUFFIX.value: GeosMeshOutputsEnum.STRESS_EFFECTIVE.attributeName,
GeosMeshSuffixEnum.PERMEABILITY_SUFFIX.value: GeosMeshOutputsEnum.PERMEABILITY.attributeName,
GeosMeshSuffixEnum.POROSITY_SUFFIX.value: GeosMeshOutputsEnum.POROSITY.attributeName,
GeosMeshSuffixEnum.POROSITY_REF_SUFFIX.value: GeosMeshOutputsEnum.POROSITY_INI.attributeName,
GeosMeshSuffixEnum.BULK_MODULUS_SUFFIX.value: GeosMeshOutputsEnum.BULK_MODULUS.attributeName,
GeosMeshSuffixEnum.SHEAR_MODULUS_SUFFIX.value: GeosMeshOutputsEnum.SHEAR_MODULUS.attributeName,
GeosMeshSuffixEnum.GRAIN_BULK_MODULUS_SUFFIX.value: GeosMeshOutputsEnum.GRAIN_BULK_MODULUS.attributeName,
GeosMeshSuffixEnum.BIOT_COEFFICIENT_SUFFIX.value: PostProcessingOutputsEnum.BIOT_COEFFICIENT.attributeName,
GeosMeshSuffixEnum.STRAIN_SUFFIX.value: PostProcessingOutputsEnum.STRAIN_ELASTIC.attributeName,
}


Expand All @@ -319,7 +314,7 @@ def getAttributeToTransferFromInitialTime() -> dict[ str, str ]:
names are values
"""
return {
GeosMeshOutputsEnum.STRESS_EFFECTIVE.attributeName:
GeosMeshOutputsEnum.AVERAGE_STRESS.attributeName:
PostProcessingOutputsEnum.STRESS_EFFECTIVE_INITIAL.attributeName,
GeosMeshOutputsEnum.SHEAR_MODULUS.attributeName:
PostProcessingOutputsEnum.SHEAR_MODULUS_INITIAL.attributeName,
Expand Down