From 0d75919cda04990ccf534aa3a151f610b8f03c17 Mon Sep 17 00:00:00 2001 From: Fan Fei Date: Fri, 3 Oct 2025 12:35:49 -0700 Subject: [PATCH 1/2] initial commit to enable anelastic strain --- .../constitutive/solid/CeramicDamage.hpp | 17 ++++-- .../constitutive/solid/DelftEgg.hpp | 16 ++++-- .../constitutive/solid/DruckerPrager.hpp | 17 ++++-- .../solid/DruckerPragerExtended.hpp | 16 ++++-- .../constitutive/solid/ElasticIsotropic.hpp | 48 ++++++++++++++-- .../ElasticIsotropicPressureDependent.hpp | 20 +++++-- .../constitutive/solid/ElasticOrthotropic.hpp | 16 ++++-- .../solid/ElasticTransverseIsotropic.hpp | 16 ++++-- .../constitutive/solid/ModifiedCamClay.hpp | 17 ++++-- .../constitutive/solid/PerfectlyPlastic.hpp | 16 ++++-- .../constitutive/solid/SolidBase.cpp | 19 +++++++ .../constitutive/solid/SolidBase.hpp | 57 ++++++++++++++++++- .../constitutive/solid/SolidFields.hpp | 8 +++ .../ImplicitSmallStrainQuasiStatic.hpp | 8 ++- .../ImplicitSmallStrainQuasiStatic_impl.hpp | 4 +- 15 files changed, 248 insertions(+), 47 deletions(-) diff --git a/src/coreComponents/constitutive/solid/CeramicDamage.hpp b/src/coreComponents/constitutive/solid/CeramicDamage.hpp index ae1a9775be6..42a6d976379 100644 --- a/src/coreComponents/constitutive/solid/CeramicDamage.hpp +++ b/src/coreComponents/constitutive/solid/CeramicDamage.hpp @@ -67,8 +67,11 @@ class CeramicDamageUpdates : public ElasticIsotropicUpdates * @param[in] bulkModulus The ArrayView holding the bulk modulus data for each element. * @param[in] shearModulus The ArrayView holding the shear modulus data for each element. * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. + * @param[in] anelasticStrainMagnitude The ArrayView holding the anelastic strain magnitude data for each element. * @param[in] newStress The ArrayView holding the new stress data for each quadrature point. * @param[in] oldStress The ArrayView holding the old stress data for each quadrature point. + * @param[in] disableInelasticity Flag to disable plasticity for inelastic models + * @param[in] enableAnelasticStrain Flag to enable stress modification due to anelastic strain */ CeramicDamageUpdates( arrayView2d< real64 > const & damage, arrayView2d< real64 > const & jacobian, @@ -80,10 +83,12 @@ class CeramicDamageUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + arrayView1d< real64 const > const & anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, - bool const & disableInelasticity ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, disableInelasticity, enableAnelasticStrain ), m_damage( damage ), m_jacobian( jacobian ), m_lengthScale( lengthScale ), @@ -472,9 +477,11 @@ class CeramicDamage : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -498,9 +505,11 @@ class CeramicDamage : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } diff --git a/src/coreComponents/constitutive/solid/DelftEgg.hpp b/src/coreComponents/constitutive/solid/DelftEgg.hpp index 167301468f0..7f1688f4502 100644 --- a/src/coreComponents/constitutive/solid/DelftEgg.hpp +++ b/src/coreComponents/constitutive/solid/DelftEgg.hpp @@ -54,9 +54,11 @@ class DelftEggUpdates : public ElasticIsotropicUpdates * @param[in] bulkModulus The ArrayView holding the bulk modulus data for each element. * @param[in] shearModulus The ArrayView holding the shear modulus data for each element. * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. + * @param[in] anelasticStrainMagnitude The ArrayView holding the anelastic strain magnitude data for each element. * @param[in] newStress The ArrayView holding the new stress data for each quadrature point. * @param[in] oldStress The ArrayView holding the old stress data from the previous converged state for each point * @param[in] disableInelasticity Flag to disable plastic response + * @param[in] enableAnelasticStrain Flag to enable stress modification due to anelastic strain */ DelftEggUpdates( arrayView1d< real64 const > const & recompressionIndex, arrayView1d< real64 const > const & virginCompressionIndex, @@ -67,10 +69,12 @@ class DelftEggUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + arrayView1d< real64 const > const & anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, - const bool & disableInelasticity ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + const bool & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, disableInelasticity, enableAnelasticStrain ), m_recompressionIndex( recompressionIndex ), m_virginCompressionIndex( virginCompressionIndex ), m_cslSlope( cslSlope ), @@ -524,9 +528,11 @@ class DelftEgg : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -549,9 +555,11 @@ class DelftEgg : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.hpp b/src/coreComponents/constitutive/solid/DruckerPrager.hpp index e59494d7b06..f9627730cb5 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.hpp @@ -53,8 +53,11 @@ class DruckerPragerUpdates : public ElasticIsotropicUpdates * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. * @param[in] shearModulus The ArrayView holding the shear modulus data for each element. * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. + * @param[in] anelasticStrainMagnitude The ArrayView holding the anelastic strain magnitude data for each element. * @param[in] newStress The ArrayView holding the new stress data for each quadrature point. * @param[in] oldStress The ArrayView holding the old stress data for each quadrature point. + * @param[in] disableInelasticity Flag to disable plasticity for inelastic models + * @param[in] enableAnelasticStrain Flag to enable stress modification due to anelastic strain */ DruckerPragerUpdates( arrayView1d< real64 const > const & friction, arrayView1d< real64 const > const & dilation, @@ -64,10 +67,12 @@ class DruckerPragerUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + arrayView1d< real64 const > const & anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, - bool const & disableInelasticity ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, disableInelasticity, enableAnelasticStrain ), m_friction( friction ), m_dilation( dilation ), m_hardening( hardening ), @@ -410,9 +415,11 @@ class DruckerPrager : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -434,9 +441,11 @@ class DruckerPrager : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp index dc79394677f..27fca639b00 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp @@ -46,7 +46,9 @@ class DruckerPragerExtendedUpdates : public ElasticIsotropicUpdates * @param[in] bulkModulus The ArrayView holding the bulk modulus data for each element. * @param[in] shearModulus The ArrayView holding the shear modulus data for each element. * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. + * @param[in] anelasticStrainMagnitude The ArrayView holding the anelastic strain magnitude data for each element. * @param[in] stress The ArrayView holding the stress data for each quadrature point. + * @param[in] enableAnelasticStrain Flag to enable stress modification due to anelastic strain */ DruckerPragerExtendedUpdates( arrayView1d< real64 const > const & initialFriction, arrayView1d< real64 const > const & residualFriction, @@ -58,10 +60,12 @@ class DruckerPragerExtendedUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + arrayView1d< real64 const > const & anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, - bool const & disableInelasticity ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, disableInelasticity, enableAnelasticStrain ), m_initialFriction( initialFriction ), m_residualFriction( residualFriction ), m_dilationRatio( dilationRatio ), @@ -441,9 +445,11 @@ class DruckerPragerExtended : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -467,9 +473,11 @@ class DruckerPragerExtended : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp index a6663232fe8..b2f327c7014 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp @@ -46,17 +46,21 @@ class ElasticIsotropicUpdates : public SolidBaseUpdates * @param[in] bulkModulus The ArrayView holding the bulk modulus data for each element. * @param[in] shearModulus The ArrayView holding the shear modulus data for each element. * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. + * @param[in] anelasticStrainMagnitude The ArrayView holding the anelastic strain magnitude data for each element. * @param[in] newStress The ArrayView holding the new stress data for each quadrature point. * @param[in] oldStress The ArrayView holding the old stress data for each quadrature point. * @param[in] disableInelasticity Flag to disable plasticity for inelastic models + * @param[in] enableAnelasticStrain Flag to enable stress modification due to anelastic strain */ ElasticIsotropicUpdates( arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + arrayView1d< real64 const > const & anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, - const bool & disableInelasticity ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity ), + const bool & disableInelasticity, + const integer & enableAnelasticStrain ): + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainMagnitude, enableAnelasticStrain ), m_bulkModulus( bulkModulus ), m_shearModulus( shearModulus ) {} @@ -157,6 +161,11 @@ class ElasticIsotropicUpdates : public SolidBaseUpdates localIndex const q, real64 beta ) const override; + GEOS_HOST_DEVICE + virtual void stressModificationByAnelasticStain( localIndex const k, + localIndex const q, + real64 ( &stressModifier )[6] ) const override; + // TODO: confirm hyper stress/strain measures before activatiing /* @@ -374,6 +383,29 @@ void ElasticIsotropicUpdates::viscousStateUpdate( localIndex const k, GEOS_UNUSED_VAR( beta ); } +GEOS_HOST_DEVICE +GEOS_FORCE_INLINE +void ElasticIsotropicUpdates::stressModificationByAnelasticStain( localIndex const k, + localIndex const q, + real64 ( & stressModifier )[6] ) const +{ + if( m_enableAnelasticStrain == 0 ) + { + return; + } + + real64 const anelasticStrainDirection[6] = { 0.0, 1.0, 0.0, + 0.0, 0.0, 0.0 }; // To make it an input + + real64 anelasticStrain[6]; + for( integer i = 0; i < 6; ++i ) + { + anelasticStrain[i] = getAnelasticStrainMagnitude( k ) * anelasticStrainDirection[i]; + } + + smallStrainNoStateUpdate_StressOnly( k, q, anelasticStrain, stressModifier ); +} + // TODO: need to confirm stress / strain measures before activating hyper inferface /* @@ -533,18 +565,22 @@ class ElasticIsotropic : public SolidBase return ElasticIsotropicUpdates( m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } else // for "no state" updates, pass empty views to avoid transfer of stress data to device { return ElasticIsotropicUpdates( m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD >(), arrayView3d< real64, solid::STRESS_USD >(), - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } } @@ -563,9 +599,11 @@ class ElasticIsotropic : public SolidBase m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } protected: diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp index 8db58f1ed5b..bc2698928d0 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -49,19 +49,23 @@ class ElasticIsotropicPressureDependentUpdates : public SolidBaseUpdates * @param[in] recompressionIndex The ArrayView holding the recompression index data for each element. * @param[in] shearModulus The ArrayView holding the shear modulus data for each element. * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. + * @param[in] anelasticStrainMagnitude The ArrayView holding the anelastic strain magnitude data for each element. * @param[in] newStress The ArrayView holding the new stress data for each quadrature point. * @param[in] oldStress The ArrayView holding the old stress data from the previous converged step for each quadrature point. * @param[in] disableInelasticity Flag to disable plastic response for inelastic models + * @param[in] enableAnelasticStrain Flag to enable stress modification due to anelastic strain */ ElasticIsotropicPressureDependentUpdates( real64 const & refPressure, real64 const & refStrainVol, arrayView1d< real64 const > const & recompressionIndex, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + arrayView1d< real64 const > const & anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, - bool const & disableInelasticity ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainMagnitude, enableAnelasticStrain ), m_refPressure( refPressure ), m_refStrainVol( refStrainVol ), m_recompressionIndex( recompressionIndex ), @@ -583,9 +587,11 @@ class ElasticIsotropicPressureDependent : public SolidBase m_recompressionIndex, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } else // for "no state" updates, pass empty views to avoid transfer of stress data to device { @@ -594,9 +600,11 @@ class ElasticIsotropicPressureDependent : public SolidBase m_recompressionIndex, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD >(), arrayView3d< real64, solid::STRESS_USD >(), - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } } @@ -617,9 +625,11 @@ class ElasticIsotropicPressureDependent : public SolidBase m_recompressionIndex, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } diff --git a/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp b/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp index e3f9075a73b..daa28c22435 100644 --- a/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp +++ b/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp @@ -52,9 +52,11 @@ class ElasticOrthotropicUpdates : public SolidBaseUpdates * @param[in] c55 The 55 component of the Voigt stiffness tensor. * @param[in] c66 The 66 component of the Voigt stiffness tensor. * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. + * @param[in] anelasticStrainMagnitude The ArrayView holding the anelastic strain magnitude data for each element. * @param[in] newStress The ArrayView holding the new stress data for each point. * @param[in] oldStress The ArrayView holding the old stress data for each point. * @param[in] disableInelasticity Flag to disable plastic response for inelastic models. + * @param[in] enableAnelasticStrain Flag to enable stress modification due to anelastic strain */ ElasticOrthotropicUpdates( arrayView1d< real64 const > const & c11, arrayView1d< real64 const > const & c12, @@ -66,10 +68,12 @@ class ElasticOrthotropicUpdates : public SolidBaseUpdates arrayView1d< real64 const > const & c55, arrayView1d< real64 const > const & c66, arrayView1d< real64 const > const & thermalExpansionCoefficient, + arrayView1d< real64 const > const & anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, - bool const & disableInelasticity ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainMagnitude, enableAnelasticStrain ), m_c11( c11 ), m_c12( c12 ), m_c13( c13 ), @@ -737,9 +741,11 @@ class ElasticOrthotropic : public SolidBase m_c55, m_c66, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -764,9 +770,11 @@ class ElasticOrthotropic : public SolidBase m_c55, m_c66, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } protected: diff --git a/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp b/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp index b402a3fe816..9ea651a2ea2 100644 --- a/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp +++ b/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp @@ -50,9 +50,11 @@ class ElasticTransverseIsotropicUpdates : public SolidBaseUpdates * @param[in] c44 The 44 component of the Voigt stiffness tensor. * @param[in] c66 The 66 component of the Voigt stiffness tensor. * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. + * @param[in] anelasticStrainMagnitude The ArrayView holding the anelastic strain magnitude data for each element. * @param[in] newStress The ArrayView holding the new stress data for each point. * @param[in] oldStress The ArrayView holding the old stress data for each point. * @param[in] disableInelasticity Flag to disable plastic response for inelastic models. + * @param[in] enableAnelasticStrain Flag to enable stress modification due to anelastic strain */ ElasticTransverseIsotropicUpdates( arrayView1d< real64 const > const & c11, arrayView1d< real64 const > const & c13, @@ -60,10 +62,12 @@ class ElasticTransverseIsotropicUpdates : public SolidBaseUpdates arrayView1d< real64 const > const & c44, arrayView1d< real64 const > const & c66, arrayView1d< real64 const > const & thermalExpansionCoefficient, + arrayView1d< real64 const > const & anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, - bool const & disableInelasticity ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainMagnitude, enableAnelasticStrain ), m_c11( c11 ), m_c13( c13 ), m_c33( c33 ), @@ -593,9 +597,11 @@ class ElasticTransverseIsotropic : public SolidBase m_c44, m_c66, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -616,9 +622,11 @@ class ElasticTransverseIsotropic : public SolidBase m_c44, m_c66, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } protected: diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp index 93b0d7da7e7..e65788616eb 100644 --- a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp +++ b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp @@ -54,10 +54,12 @@ class ModifiedCamClayUpdates : public ElasticIsotropicPressureDependentUpdates * for each quadrature point. * @param[in] shearModulus The ArrayView holding the shear modulus data for each element. * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. + * @param[in] anelasticStrainMagnitude The ArrayView holding the anelastic strain magnitude data for each element. * @param[in] newstress The ArrayView holding the new stress data for each quadrature point. * @param[in] oldstress The ArrayView holding the old stress data from the previous converged state for each quadrature * point. * @param[in] disableInelasticity Flag to disable plastic response/ + * @param[in] enableAnelasticStrain Flag to enable stress modification due to anelastic strain */ ModifiedCamClayUpdates( real64 const & refPressure, real64 const & refStrainVol, @@ -68,10 +70,13 @@ class ModifiedCamClayUpdates : public ElasticIsotropicPressureDependentUpdates arrayView2d< real64 > const & oldPreConsolidationPressure, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + arrayView1d< real64 const > const & anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, - bool const & disableInelasticity ): - ElasticIsotropicPressureDependentUpdates( refPressure, refStrainVol, recompressionIndex, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicPressureDependentUpdates( refPressure, refStrainVol, recompressionIndex, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_virginCompressionIndex( virginCompressionIndex ), m_cslSlope( cslSlope ), m_newPreConsolidationPressure( newPreConsolidationPressure ), @@ -535,9 +540,11 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent m_oldPreConsolidationPressure, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -560,9 +567,11 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent m_oldPreConsolidationPressure, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } protected: diff --git a/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp b/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp index 019ffcb0b9b..77412caf82e 100644 --- a/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp +++ b/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp @@ -48,17 +48,21 @@ class PerfectlyPlasticUpdates : public ElasticIsotropicUpdates * @param[in] bulkModulus The ArrayView holding the bulk modulus data for each element. * @param[in] shearModulus The ArrayView holding the shear modulus data for each element. * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. + * @param[in] anelasticStrainMagnitude The ArrayView holding the anelastic strain magnitude data for each element. * @param[in] newStress The ArrayView holding the new stress data for each quadrature point. * @param[in] oldStress The ArrayView holding the old stress data for each quadrature point. + * @param[in] enableAnelasticStrain Flag to enable stress modification due to anelastic strain */ PerfectlyPlasticUpdates( arrayView1d< real64 const > const & yieldStress, arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + arrayView1d< real64 const > const & anelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, - bool const & disableInelasticity ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, disableInelasticity, enableAnelasticStrain ), m_yieldStress( yieldStress ) {} @@ -281,9 +285,11 @@ class PerfectlyPlastic : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -301,9 +307,11 @@ class PerfectlyPlastic : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } diff --git a/src/coreComponents/constitutive/solid/SolidBase.cpp b/src/coreComponents/constitutive/solid/SolidBase.cpp index 1e1a4dce868..75f3f1683de 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.cpp +++ b/src/coreComponents/constitutive/solid/SolidBase.cpp @@ -40,6 +40,16 @@ SolidBase::SolidBase( string const & name, Group * const parent ): setInputFlag( InputFlags::OPTIONAL ). setDescription( "Default Linear Thermal Expansion Coefficient of the Solid Rock Frame" ); + registerWrapper( viewKeyStruct::defaultAnelasticStrainMagnitudeString(), &m_defaultAnelasticStrainMagnitude ). + setApplyDefaultValue( 0.0 ). + setInputFlag( InputFlags::OPTIONAL ). + setDescription( "Default anelastic strain magnitude" ); + + registerWrapper( viewKeyStruct::enableAnelasticStrainString(), &m_enableAnelasticStrain ). + setApplyDefaultValue( 0 ). + setInputFlag( InputFlags::OPTIONAL ). + setDescription( "Whether to enable stress modification due to anelastic strain. Can be 0 or 1" ); + // register fields string const voightLabels[6] = { "XX", "YY", "ZZ", "YZ", "XZ", "XY" }; @@ -53,6 +63,8 @@ SolidBase::SolidBase( string const & name, Group * const parent ): registerField< fields::solid::density >( &m_density ); registerField< fields::solid::thermalExpansionCoefficient >( &m_thermalExpansionCoefficient ); + + registerField< fields::solid::anelasticStrainMagnitude >( &m_anelasticStrainMagnitude ); } @@ -63,6 +75,13 @@ void SolidBase::postInputInitialization() getField< fields::solid::thermalExpansionCoefficient >(). setApplyDefaultValue( m_defaultThermalExpansionCoefficient ); + + getField< fields::solid::anelasticStrainMagnitude >(). + setApplyDefaultValue( m_defaultAnelasticStrainMagnitude ); + + GEOS_ERROR_IF( m_enableAnelasticStrain == 0 && m_defaultAnelasticStrainMagnitude > 0.0, + getDataContext() << ": enableAnelasticStrain flag must be 1 if a nonzero" + " AnelasticStrainMagnitude is used" ); } diff --git a/src/coreComponents/constitutive/solid/SolidBase.hpp b/src/coreComponents/constitutive/solid/SolidBase.hpp index f21092d7a61..45f3d7e2d91 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.hpp +++ b/src/coreComponents/constitutive/solid/SolidBase.hpp @@ -55,15 +55,21 @@ class SolidBaseUpdates * @param[in] oldStress The old stress data from the constitutive model class. * @param[in] thermalExpansionCoefficient The ArrayView holding the thermal expansion coefficient data for each element. * @param[in] disableInelasticity Flag to disable inelastic response + * @param[in] anelasticStrainMagnitude The ArrayView holding the anelastic strain magnitude data for each element. + * @param[in] enableAnelasticStrain Flag to enable stress modification due to anelastic strain */ SolidBaseUpdates( arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, arrayView1d< real64 const > const & thermalExpansionCoefficient, - const bool & disableInelasticity ): + const bool & disableInelasticity, + arrayView1d< real64 const > const & anelasticStrainMagnitude, + const integer enableAnelasticStrain ): m_newStress( newStress ), m_oldStress( oldStress ), m_thermalExpansionCoefficient( thermalExpansionCoefficient ), - m_disableInelasticity ( disableInelasticity ) + m_disableInelasticity ( disableInelasticity ), + m_anelasticStrainMagnitude( anelasticStrainMagnitude ), + m_enableAnelasticStrain( enableAnelasticStrain ) {} /// Deleted default constructor @@ -101,6 +107,12 @@ class SolidBaseUpdates /// Flag to disable inelasticity const bool m_disableInelasticity; + /// The anelastic strain magnitude (i.e. chemistry, electrochemistry, etc.) + arrayView1d< real64 const > const m_anelasticStrainMagnitude; + + /// Flag to enable stress modification due to anelastic strain + const integer m_enableAnelasticStrain; + /** * @brief Get bulkModulus * @param[in] k Element index. @@ -126,6 +138,17 @@ class SolidBaseUpdates return m_thermalExpansionCoefficient[k]; } + /** + * @brief Get anelasticStrainMagnitude + * @param[in] k Element index. + * @return the nelasticStrainMagnitude of element k + */ + GEOS_HOST_DEVICE + real64 getAnelasticStrainMagnitude( localIndex const k ) const + { + return m_anelasticStrainMagnitude[k]; + } + /** * @brief Get shear modulus * @param[in] k Element index. @@ -371,6 +394,22 @@ class SolidBaseUpdates GEOS_ERROR( "viscousStateUpdate() not implemented for this model" ); } + /** + * @brief Calculate the stress modifier due to anelastic strain + * + * @param[out] stress New stress value (Cauchy stress) + */ + GEOS_HOST_DEVICE + virtual void stressModificationByAnelasticStain( localIndex const k, + localIndex const q, + real64 ( & stressModifier )[6] ) const + { + GEOS_UNUSED_VAR( k ); + GEOS_UNUSED_VAR( q ); + GEOS_UNUSED_VAR( stressModifier ); + GEOS_ERROR( "stressModificationByAnelasticStain() not implemented for this model" ); + } + /** * @brief Return the strain energy density at a given material point * @@ -571,6 +610,10 @@ class SolidBase : public constitutive::ConstitutiveBase static constexpr char const * defaultDensityString() { return "defaultDensity"; } // Default drained linear thermal expansion coefficient key static constexpr char const * defaultThermalExpansionCoefficientString() { return "defaultDrainedLinearTEC"; } + // Default anelastic strain magnitude key + static constexpr char const * defaultAnelasticStrainMagnitudeString() { return "defaultAnelasticStrainMagnitude"; } + // Enable stress modification due to anelastic strain key + static constexpr char const * enableAnelasticStrainString() { return "enableAnelasticStrain"; } }; /// Save state data in preparation for next timestep @@ -698,6 +741,16 @@ class SolidBase : public constitutive::ConstitutiveBase /// Flag to disable inelasticity (plasticity, damage, etc.) bool m_disableInelasticity = false; + + /// The anelastic strain magnitude (i.e. chemistry, electrochemistry, etc.) + array1d< real64 > m_anelasticStrainMagnitude; + + /// The default value of the anelastic strain magnitude + real64 m_defaultAnelasticStrainMagnitude; + + /// Flag to enable stress modification due to anelastic strain + integer m_enableAnelasticStrain; + }; } // namespace constitutive diff --git a/src/coreComponents/constitutive/solid/SolidFields.hpp b/src/coreComponents/constitutive/solid/SolidFields.hpp index a9d37e3db9b..86f28b8e138 100644 --- a/src/coreComponents/constitutive/solid/SolidFields.hpp +++ b/src/coreComponents/constitutive/solid/SolidFields.hpp @@ -420,6 +420,14 @@ DECLARE_FIELD( dInternalEnergy_dTemperature, WRITE_AND_READ, "Derivative of the solid internal energy w.r.t. temperature [J/(m^3.K)]" ); +DECLARE_FIELD( anelasticStrainMagnitude, + "anelasticStrainMagnitude", + array1d< real64 >, + 0, + LEVEL_0, + WRITE_AND_READ, + "Anelastic strain magnitude (i.e. chemistry, electrochemistry, etc.)" ); + } } diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitSmallStrainQuasiStatic.hpp b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitSmallStrainQuasiStatic.hpp index 0e9bcf87b18..c998fe55e0f 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitSmallStrainQuasiStatic.hpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitSmallStrainQuasiStatic.hpp @@ -184,11 +184,15 @@ class ImplicitSmallStrainQuasiStatic : * @brief operator() no-op used for modifying the stress tensor prior to * integrating the divergence to produce nodal forces. * @param stress The stress array. + * @param stressModification The stressModification array. */ GEOS_HOST_DEVICE inline constexpr - void operator() ( real64 (& stress)[6] ) + void operator() ( real64 (& stress)[6], real64 const (&stressModification)[6] ) { - GEOS_UNUSED_VAR( stress ); + for( localIndex i = 0; i < 6; ++i ) + { + stress[i] -= stressModification[i]; + } } }; diff --git a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitSmallStrainQuasiStatic_impl.hpp b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitSmallStrainQuasiStatic_impl.hpp index 12753ab393f..b29a1d9d47e 100644 --- a/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitSmallStrainQuasiStatic_impl.hpp +++ b/src/coreComponents/physicsSolvers/solidMechanics/kernels/ImplicitSmallStrainQuasiStatic_impl.hpp @@ -124,14 +124,16 @@ void ImplicitSmallStrainQuasiStatic< SUBREGION_TYPE, CONSTITUTIVE_TYPE, FE_TYPE real64 strainInc[6] = {0}; real64 stress[6] = {0}; + real64 stressModifierAnelasticStrain[6] = {0}; typename CONSTITUTIVE_TYPE::KernelWrapper::DiscretizationOps stiffness; FE_TYPE::symmetricGradient( dNdX, stack.uhat_local, strainInc ); m_constitutiveUpdate.smallStrainUpdate( k, q, m_dt, strainInc, stress, stiffness ); + m_constitutiveUpdate.stressModificationByAnelasticStain( k, q, stressModifierAnelasticStrain ); - stressModifier( stress ); + stressModifier( stress, stressModifierAnelasticStrain ); // #pragma unroll for( localIndex i=0; i<6; ++i ) { From 4d36d9a815fe9c640e9de96864442130b653aa79 Mon Sep 17 00:00:00 2001 From: Fan Fei Date: Tue, 7 Oct 2025 08:37:14 -0700 Subject: [PATCH 2/2] make anelastic strain increasing with time --- .../constitutive/solid/CeramicDamage.hpp | 15 +++++--- .../constitutive/solid/DelftEgg.hpp | 15 +++++--- .../constitutive/solid/DruckerPrager.hpp | 15 +++++--- .../solid/DruckerPragerExtended.hpp | 15 +++++--- .../constitutive/solid/ElasticIsotropic.hpp | 23 +++++++++---- .../ElasticIsotropicPressureDependent.hpp | 19 ++++++++--- .../constitutive/solid/ElasticOrthotropic.hpp | 15 +++++--- .../solid/ElasticTransverseIsotropic.hpp | 15 +++++--- .../constitutive/solid/ModifiedCamClay.hpp | 15 +++++--- .../constitutive/solid/PerfectlyPlastic.hpp | 15 +++++--- .../constitutive/solid/SolidBase.cpp | 17 +++++++--- .../constitutive/solid/SolidBase.hpp | 34 ++++++++++++------- .../constitutive/solid/SolidFields.hpp | 22 ++++++++++-- 13 files changed, 172 insertions(+), 63 deletions(-) diff --git a/src/coreComponents/constitutive/solid/CeramicDamage.hpp b/src/coreComponents/constitutive/solid/CeramicDamage.hpp index 42a6d976379..14765786d62 100644 --- a/src/coreComponents/constitutive/solid/CeramicDamage.hpp +++ b/src/coreComponents/constitutive/solid/CeramicDamage.hpp @@ -83,12 +83,15 @@ class CeramicDamageUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, - arrayView1d< real64 const > const & anelasticStrainMagnitude, + arrayView1d< real64 const > const & anelasticStrainIncrement, + arrayView1d< real64 > const & newAnelasticStrainMagnitude, + arrayView1d< real64 > const & oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, bool const & disableInelasticity, const integer & enableAnelasticStrain ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, disableInelasticity, enableAnelasticStrain ), + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_damage( damage ), m_jacobian( jacobian ), m_lengthScale( lengthScale ), @@ -477,7 +480,9 @@ class CeramicDamage : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, @@ -505,7 +510,9 @@ class CeramicDamage : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, diff --git a/src/coreComponents/constitutive/solid/DelftEgg.hpp b/src/coreComponents/constitutive/solid/DelftEgg.hpp index 7f1688f4502..03a37055b5b 100644 --- a/src/coreComponents/constitutive/solid/DelftEgg.hpp +++ b/src/coreComponents/constitutive/solid/DelftEgg.hpp @@ -69,12 +69,15 @@ class DelftEggUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, - arrayView1d< real64 const > const & anelasticStrainMagnitude, + arrayView1d< real64 const > const & anelasticStrainIncrement, + arrayView1d< real64 > const & newAnelasticStrainMagnitude, + arrayView1d< real64 > const & oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, const bool & disableInelasticity, const integer & enableAnelasticStrain ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, disableInelasticity, enableAnelasticStrain ), + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_recompressionIndex( recompressionIndex ), m_virginCompressionIndex( virginCompressionIndex ), m_cslSlope( cslSlope ), @@ -528,7 +531,9 @@ class DelftEgg : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, @@ -555,7 +560,9 @@ class DelftEgg : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, diff --git a/src/coreComponents/constitutive/solid/DruckerPrager.hpp b/src/coreComponents/constitutive/solid/DruckerPrager.hpp index f9627730cb5..645c7cd1255 100644 --- a/src/coreComponents/constitutive/solid/DruckerPrager.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPrager.hpp @@ -67,12 +67,15 @@ class DruckerPragerUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, - arrayView1d< real64 const > const & anelasticStrainMagnitude, + arrayView1d< real64 const > const & anelasticStrainIncrement, + arrayView1d< real64 > const & newAnelasticStrainMagnitude, + arrayView1d< real64 > const & oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, bool const & disableInelasticity, const integer & enableAnelasticStrain ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, disableInelasticity, enableAnelasticStrain ), + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_friction( friction ), m_dilation( dilation ), m_hardening( hardening ), @@ -415,7 +418,9 @@ class DruckerPrager : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, @@ -441,7 +446,9 @@ class DruckerPrager : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, diff --git a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp index 27fca639b00..6829dc18f42 100644 --- a/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp +++ b/src/coreComponents/constitutive/solid/DruckerPragerExtended.hpp @@ -60,12 +60,15 @@ class DruckerPragerExtendedUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, - arrayView1d< real64 const > const & anelasticStrainMagnitude, + arrayView1d< real64 const > const & anelasticStrainIncrement, + arrayView1d< real64 > const & newAnelasticStrainMagnitude, + arrayView1d< real64 > const & oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, bool const & disableInelasticity, const integer & enableAnelasticStrain ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, disableInelasticity, enableAnelasticStrain ), + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_initialFriction( initialFriction ), m_residualFriction( residualFriction ), m_dilationRatio( dilationRatio ), @@ -445,7 +448,9 @@ class DruckerPragerExtended : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, @@ -473,7 +478,9 @@ class DruckerPragerExtended : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp index b2f327c7014..c0c68aea4aa 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp @@ -55,12 +55,15 @@ class ElasticIsotropicUpdates : public SolidBaseUpdates ElasticIsotropicUpdates( arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, - arrayView1d< real64 const > const & anelasticStrainMagnitude, + arrayView1d< real64 const > const & anelasticStrainIncrement, + arrayView1d< real64 > const & newAnelasticStrainMagnitude, + arrayView1d< real64 > const & oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, const bool & disableInelasticity, const integer & enableAnelasticStrain ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainMagnitude, enableAnelasticStrain ), + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, + enableAnelasticStrain ), m_bulkModulus( bulkModulus ), m_shearModulus( shearModulus ) {} @@ -397,10 +400,12 @@ void ElasticIsotropicUpdates::stressModificationByAnelasticStain( localIndex con real64 const anelasticStrainDirection[6] = { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0 }; // To make it an input + m_newAnelasticStrainMagnitude[k] = m_oldAnelasticStrainMagnitude[k] + getAnelasticStrainIncrement( k ); + real64 anelasticStrain[6]; for( integer i = 0; i < 6; ++i ) { - anelasticStrain[i] = getAnelasticStrainMagnitude( k ) * anelasticStrainDirection[i]; + anelasticStrain[i] = m_newAnelasticStrainMagnitude[k] * anelasticStrainDirection[i]; } smallStrainNoStateUpdate_StressOnly( k, q, anelasticStrain, stressModifier ); @@ -565,7 +570,9 @@ class ElasticIsotropic : public SolidBase return ElasticIsotropicUpdates( m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, @@ -576,7 +583,9 @@ class ElasticIsotropic : public SolidBase return ElasticIsotropicUpdates( m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD >(), arrayView3d< real64, solid::STRESS_USD >(), m_disableInelasticity, @@ -599,7 +608,9 @@ class ElasticIsotropic : public SolidBase m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, diff --git a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp index bc2698928d0..0f228494f44 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -60,12 +60,15 @@ class ElasticIsotropicPressureDependentUpdates : public SolidBaseUpdates arrayView1d< real64 const > const & recompressionIndex, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, - arrayView1d< real64 const > const & anelasticStrainMagnitude, + arrayView1d< real64 const > const & anelasticStrainIncrement, + arrayView1d< real64 > const & newAnelasticStrainMagnitude, + arrayView1d< real64 > const & oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, bool const & disableInelasticity, const integer & enableAnelasticStrain ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainMagnitude, enableAnelasticStrain ), + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, + enableAnelasticStrain ), m_refPressure( refPressure ), m_refStrainVol( refStrainVol ), m_recompressionIndex( recompressionIndex ), @@ -587,7 +590,9 @@ class ElasticIsotropicPressureDependent : public SolidBase m_recompressionIndex, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, @@ -600,7 +605,9 @@ class ElasticIsotropicPressureDependent : public SolidBase m_recompressionIndex, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD >(), arrayView3d< real64, solid::STRESS_USD >(), m_disableInelasticity, @@ -625,7 +632,9 @@ class ElasticIsotropicPressureDependent : public SolidBase m_recompressionIndex, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, diff --git a/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp b/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp index daa28c22435..9a613a80193 100644 --- a/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp +++ b/src/coreComponents/constitutive/solid/ElasticOrthotropic.hpp @@ -68,12 +68,15 @@ class ElasticOrthotropicUpdates : public SolidBaseUpdates arrayView1d< real64 const > const & c55, arrayView1d< real64 const > const & c66, arrayView1d< real64 const > const & thermalExpansionCoefficient, - arrayView1d< real64 const > const & anelasticStrainMagnitude, + arrayView1d< real64 const > const & anelasticStrainIncrement, + arrayView1d< real64 > const & newAnelasticStrainMagnitude, + arrayView1d< real64 > const & oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, bool const & disableInelasticity, const integer & enableAnelasticStrain ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainMagnitude, enableAnelasticStrain ), + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, + enableAnelasticStrain ), m_c11( c11 ), m_c12( c12 ), m_c13( c13 ), @@ -741,7 +744,9 @@ class ElasticOrthotropic : public SolidBase m_c55, m_c66, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, @@ -770,7 +775,9 @@ class ElasticOrthotropic : public SolidBase m_c55, m_c66, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, diff --git a/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp b/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp index 9ea651a2ea2..7ec996679d5 100644 --- a/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp +++ b/src/coreComponents/constitutive/solid/ElasticTransverseIsotropic.hpp @@ -62,12 +62,15 @@ class ElasticTransverseIsotropicUpdates : public SolidBaseUpdates arrayView1d< real64 const > const & c44, arrayView1d< real64 const > const & c66, arrayView1d< real64 const > const & thermalExpansionCoefficient, - arrayView1d< real64 const > const & anelasticStrainMagnitude, + arrayView1d< real64 const > const & anelasticStrainIncrement, + arrayView1d< real64 > const & newAnelasticStrainMagnitude, + arrayView1d< real64 > const & oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, bool const & disableInelasticity, const integer & enableAnelasticStrain ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainMagnitude, enableAnelasticStrain ), + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, + enableAnelasticStrain ), m_c11( c11 ), m_c13( c13 ), m_c33( c33 ), @@ -597,7 +600,9 @@ class ElasticTransverseIsotropic : public SolidBase m_c44, m_c66, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, @@ -622,7 +627,9 @@ class ElasticTransverseIsotropic : public SolidBase m_c44, m_c66, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, diff --git a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp index e65788616eb..f771d81d836 100644 --- a/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp +++ b/src/coreComponents/constitutive/solid/ModifiedCamClay.hpp @@ -70,12 +70,15 @@ class ModifiedCamClayUpdates : public ElasticIsotropicPressureDependentUpdates arrayView2d< real64 > const & oldPreConsolidationPressure, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, - arrayView1d< real64 const > const & anelasticStrainMagnitude, + arrayView1d< real64 const > const & anelasticStrainIncrement, + arrayView1d< real64 > const & newAnelasticStrainMagnitude, + arrayView1d< real64 > const & oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, bool const & disableInelasticity, const integer & enableAnelasticStrain ): - ElasticIsotropicPressureDependentUpdates( refPressure, refStrainVol, recompressionIndex, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, + ElasticIsotropicPressureDependentUpdates( refPressure, refStrainVol, recompressionIndex, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, + oldAnelasticStrainMagnitude, newStress, oldStress, disableInelasticity, enableAnelasticStrain ), m_virginCompressionIndex( virginCompressionIndex ), m_cslSlope( cslSlope ), @@ -540,7 +543,9 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent m_oldPreConsolidationPressure, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, @@ -567,7 +572,9 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent m_oldPreConsolidationPressure, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, diff --git a/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp b/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp index 77412caf82e..22afbc73b69 100644 --- a/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp +++ b/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp @@ -57,12 +57,15 @@ class PerfectlyPlasticUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, - arrayView1d< real64 const > const & anelasticStrainMagnitude, + arrayView1d< real64 const > const & anelasticStrainIncrement, + arrayView1d< real64 > const & newAnelasticStrainMagnitude, + arrayView1d< real64 > const & oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD > const & newStress, arrayView3d< real64, solid::STRESS_USD > const & oldStress, bool const & disableInelasticity, const integer & enableAnelasticStrain ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainMagnitude, newStress, oldStress, disableInelasticity, enableAnelasticStrain ), + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_yieldStress( yieldStress ) {} @@ -285,7 +288,9 @@ class PerfectlyPlastic : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, @@ -307,7 +312,9 @@ class PerfectlyPlastic : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, - m_anelasticStrainMagnitude, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, m_disableInelasticity, diff --git a/src/coreComponents/constitutive/solid/SolidBase.cpp b/src/coreComponents/constitutive/solid/SolidBase.cpp index 75f3f1683de..6192742fe3a 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.cpp +++ b/src/coreComponents/constitutive/solid/SolidBase.cpp @@ -40,7 +40,7 @@ SolidBase::SolidBase( string const & name, Group * const parent ): setInputFlag( InputFlags::OPTIONAL ). setDescription( "Default Linear Thermal Expansion Coefficient of the Solid Rock Frame" ); - registerWrapper( viewKeyStruct::defaultAnelasticStrainMagnitudeString(), &m_defaultAnelasticStrainMagnitude ). + registerWrapper( viewKeyStruct::defaultAnelasticStrainIncrementString(), &m_defaultAnelasticStrainIncrement ). setApplyDefaultValue( 0.0 ). setInputFlag( InputFlags::OPTIONAL ). setDescription( "Default anelastic strain magnitude" ); @@ -64,7 +64,9 @@ SolidBase::SolidBase( string const & name, Group * const parent ): registerField< fields::solid::thermalExpansionCoefficient >( &m_thermalExpansionCoefficient ); - registerField< fields::solid::anelasticStrainMagnitude >( &m_anelasticStrainMagnitude ); + registerField< fields::solid::anelasticStrainIncrement >( &m_anelasticStrainIncrement ); + registerField< fields::solid::newAnelasticStrainMagnitude >( &m_newAnelasticStrainMagnitude ); + registerField< fields::solid::oldAnelasticStrainMagnitude >( &m_oldAnelasticStrainMagnitude ); } @@ -76,10 +78,10 @@ void SolidBase::postInputInitialization() getField< fields::solid::thermalExpansionCoefficient >(). setApplyDefaultValue( m_defaultThermalExpansionCoefficient ); - getField< fields::solid::anelasticStrainMagnitude >(). - setApplyDefaultValue( m_defaultAnelasticStrainMagnitude ); + getField< fields::solid::anelasticStrainIncrement >(). + setApplyDefaultValue( m_defaultAnelasticStrainIncrement ); - GEOS_ERROR_IF( m_enableAnelasticStrain == 0 && m_defaultAnelasticStrainMagnitude > 0.0, + GEOS_ERROR_IF( m_enableAnelasticStrain == 0 && m_defaultAnelasticStrainIncrement > 0.0, getDataContext() << ": enableAnelasticStrain flag must be 1 if a nonzero" " AnelasticStrainMagnitude is used" ); } @@ -104,8 +106,13 @@ void SolidBase::saveConvergedState() const arrayView3d< real64 const, solid::STRESS_USD > newStress = m_newStress; arrayView3d< real64, solid::STRESS_USD > oldStress = m_oldStress; + arrayView1d< real64 const > newAnelasticStrainMagnitude = m_newAnelasticStrainMagnitude; + arrayView1d< real64 > oldAnelasticStrainMagnitude = m_oldAnelasticStrainMagnitude; + forAll< parallelDevicePolicy<> >( numE, [=] GEOS_HOST_DEVICE ( localIndex const k ) { + oldAnelasticStrainMagnitude[k] = newAnelasticStrainMagnitude[k]; + for( localIndex q = 0; q < numQ; ++q ) { LvArray::tensorOps::copy< 6 >( oldStress[k][q], newStress[k][q] ); diff --git a/src/coreComponents/constitutive/solid/SolidBase.hpp b/src/coreComponents/constitutive/solid/SolidBase.hpp index 45f3d7e2d91..9ba9bf3e4a5 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.hpp +++ b/src/coreComponents/constitutive/solid/SolidBase.hpp @@ -62,13 +62,17 @@ class SolidBaseUpdates arrayView3d< real64, solid::STRESS_USD > const & oldStress, arrayView1d< real64 const > const & thermalExpansionCoefficient, const bool & disableInelasticity, - arrayView1d< real64 const > const & anelasticStrainMagnitude, + arrayView1d< real64 const > const & anelasticStrainIncrement, + arrayView1d< real64 > const & newAnelasticStrainMagnitude, + arrayView1d< real64 > const & oldAnelasticStrainMagnitude, const integer enableAnelasticStrain ): m_newStress( newStress ), m_oldStress( oldStress ), m_thermalExpansionCoefficient( thermalExpansionCoefficient ), m_disableInelasticity ( disableInelasticity ), - m_anelasticStrainMagnitude( anelasticStrainMagnitude ), + m_anelasticStrainIncrement( anelasticStrainIncrement ), + m_newAnelasticStrainMagnitude( newAnelasticStrainMagnitude ), + m_oldAnelasticStrainMagnitude( oldAnelasticStrainMagnitude ), m_enableAnelasticStrain( enableAnelasticStrain ) {} @@ -108,7 +112,10 @@ class SolidBaseUpdates const bool m_disableInelasticity; /// The anelastic strain magnitude (i.e. chemistry, electrochemistry, etc.) - arrayView1d< real64 const > const m_anelasticStrainMagnitude; + arrayView1d< real64 const > const m_anelasticStrainIncrement; + + arrayView1d< real64 > const m_newAnelasticStrainMagnitude; + arrayView1d< real64 > const m_oldAnelasticStrainMagnitude; /// Flag to enable stress modification due to anelastic strain const integer m_enableAnelasticStrain; @@ -139,14 +146,14 @@ class SolidBaseUpdates } /** - * @brief Get anelasticStrainMagnitude + * @brief Get anelasticStrainIncrement * @param[in] k Element index. - * @return the nelasticStrainMagnitude of element k + * @return the anelasticStrainIncrement of element k */ GEOS_HOST_DEVICE - real64 getAnelasticStrainMagnitude( localIndex const k ) const + real64 getAnelasticStrainIncrement( localIndex const k ) const { - return m_anelasticStrainMagnitude[k]; + return m_anelasticStrainIncrement[k]; } /** @@ -611,7 +618,7 @@ class SolidBase : public constitutive::ConstitutiveBase // Default drained linear thermal expansion coefficient key static constexpr char const * defaultThermalExpansionCoefficientString() { return "defaultDrainedLinearTEC"; } // Default anelastic strain magnitude key - static constexpr char const * defaultAnelasticStrainMagnitudeString() { return "defaultAnelasticStrainMagnitude"; } + static constexpr char const * defaultAnelasticStrainIncrementString() { return "defaultAnelasticStrainIncrement"; } // Enable stress modification due to anelastic strain key static constexpr char const * enableAnelasticStrainString() { return "enableAnelasticStrain"; } }; @@ -742,11 +749,14 @@ class SolidBase : public constitutive::ConstitutiveBase /// Flag to disable inelasticity (plasticity, damage, etc.) bool m_disableInelasticity = false; - /// The anelastic strain magnitude (i.e. chemistry, electrochemistry, etc.) - array1d< real64 > m_anelasticStrainMagnitude; + /// The anelastic strain rate magnitude (i.e. chemistry, electrochemistry, etc.) + array1d< real64 > m_anelasticStrainIncrement; + + array1d< real64 > m_newAnelasticStrainMagnitude; + array1d< real64 > m_oldAnelasticStrainMagnitude; - /// The default value of the anelastic strain magnitude - real64 m_defaultAnelasticStrainMagnitude; + /// The default value of the anelastic strain rate magnitude + real64 m_defaultAnelasticStrainIncrement; /// Flag to enable stress modification due to anelastic strain integer m_enableAnelasticStrain; diff --git a/src/coreComponents/constitutive/solid/SolidFields.hpp b/src/coreComponents/constitutive/solid/SolidFields.hpp index 86f28b8e138..8064e969e1b 100644 --- a/src/coreComponents/constitutive/solid/SolidFields.hpp +++ b/src/coreComponents/constitutive/solid/SolidFields.hpp @@ -420,13 +420,29 @@ DECLARE_FIELD( dInternalEnergy_dTemperature, WRITE_AND_READ, "Derivative of the solid internal energy w.r.t. temperature [J/(m^3.K)]" ); -DECLARE_FIELD( anelasticStrainMagnitude, - "anelasticStrainMagnitude", +DECLARE_FIELD( anelasticStrainIncrement, + "anelasticStrainIncrement", array1d< real64 >, 0, LEVEL_0, WRITE_AND_READ, - "Anelastic strain magnitude (i.e. chemistry, electrochemistry, etc.)" ); + "Anelastic strain increment (i.e. chemistry, electrochemistry, etc.)" ); + +DECLARE_FIELD( newAnelasticStrainMagnitude, + "newAnelasticStrainMagnitude", + array1d< real64 >, + 0, + LEVEL_0, + WRITE_AND_READ, + "New anelastic strain magnitude" ); + +DECLARE_FIELD( oldAnelasticStrainMagnitude, + "oldAnelasticStrainMagnitude", + array1d< real64 >, + 0, + NOPLOT, + WRITE_AND_READ, + "Old anelastic strain magnitude" ); }