From 905f327b15996126457d4d8a3c58221e064949de Mon Sep 17 00:00:00 2001 From: Romain Baville Date: Fri, 23 Jan 2026 15:47:27 +0100 Subject: [PATCH 1/2] Change strain and stress name --- geos-utils/src/geos/utils/GeosOutputsConstants.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/geos-utils/src/geos/utils/GeosOutputsConstants.py b/geos-utils/src/geos/utils/GeosOutputsConstants.py index dc2aba8d..9d1974e1 100644 --- a/geos-utils/src/geos/utils/GeosOutputsConstants.py +++ b/geos-utils/src/geos/utils/GeosOutputsConstants.py @@ -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" @@ -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 ) + STRESS_EFFECTIVE = ( "averageStress", 6, Piece.CELLS ) TOTAL_DISPLACEMENT = ( "totalDisplacement", 4, Piece.POINTS ) TRACTION = ( "traction", 3, Piece.CELLS ) @@ -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 ) + STRAIN_ELASTIC = ( "averageStrain", 6, Piece.CELLS ) RSP_OED = ( "rsp_oed", 1, Piece.CELLS ) RSP_REAL = ( "rsp_real", 6, Piece.CELLS ) @@ -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, @@ -299,7 +296,6 @@ 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, @@ -307,7 +303,6 @@ def getRockSuffixRenaming() -> dict[ str, str ]: 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, } From d6076bb8911af36c161ec727371dd597b2f13bfb Mon Sep 17 00:00:00 2001 From: Romain Baville Date: Tue, 27 Jan 2026 08:25:54 +0100 Subject: [PATCH 2/2] Update stress and strain CONSTANT name --- .../post_processing/GeomechanicsCalculator.py | 26 +++++++++---------- .../post_processing/PVMohrCirclePlot.py | 2 +- .../src/geos/utils/GeosOutputsConstants.py | 6 ++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/geos-processing/src/geos/processing/post_processing/GeomechanicsCalculator.py b/geos-processing/src/geos/processing/post_processing/GeomechanicsCalculator.py index d5eba251..0e89e6c2 100644 --- a/geos-processing/src/geos/processing/post_processing/GeomechanicsCalculator.py +++ b/geos-processing/src/geos/processing/post_processing/GeomechanicsCalculator.py @@ -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" @@ -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 @@ -141,7 +141,7 @@ 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 @@ -149,7 +149,7 @@ 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: @@ -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 @@ -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 @@ -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. @@ -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 diff --git a/geos-pv/src/geos/pv/plugins/post_processing/PVMohrCirclePlot.py b/geos-pv/src/geos/pv/plugins/post_processing/PVMohrCirclePlot.py index 49423dca..3fd6e48f 100644 --- a/geos-pv/src/geos/pv/plugins/post_processing/PVMohrCirclePlot.py +++ b/geos-pv/src/geos/pv/plugins/post_processing/PVMohrCirclePlot.py @@ -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 diff --git a/geos-utils/src/geos/utils/GeosOutputsConstants.py b/geos-utils/src/geos/utils/GeosOutputsConstants.py index 9d1974e1..2eb89314 100644 --- a/geos-utils/src/geos/utils/GeosOutputsConstants.py +++ b/geos-utils/src/geos/utils/GeosOutputsConstants.py @@ -155,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 = ( "averageStress", 6, Piece.CELLS ) + AVERAGE_STRESS = ( "averageStress", 6, Piece.CELLS ) TOTAL_DISPLACEMENT = ( "totalDisplacement", 4, Piece.POINTS ) TRACTION = ( "traction", 3, Piece.CELLS ) @@ -200,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 = ( "averageStrain", 6, Piece.CELLS ) + AVERAGE_STRAIN = ( "averageStrain", 6, Piece.CELLS ) RSP_OED = ( "rsp_oed", 1, Piece.CELLS ) RSP_REAL = ( "rsp_real", 6, Piece.CELLS ) @@ -314,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,