diff --git a/src/coreComponents/constitutive/solid/CeramicDamage.hpp b/src/coreComponents/constitutive/solid/CeramicDamage.hpp index ae1a9775be6..14765786d62 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,15 @@ class CeramicDamageUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + 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 ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_damage( damage ), m_jacobian( jacobian ), m_lengthScale( lengthScale ), @@ -472,9 +480,13 @@ class CeramicDamage : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -498,9 +510,13 @@ class CeramicDamage : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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..03a37055b5b 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,15 @@ class DelftEggUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + 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 ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + const bool & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_recompressionIndex( recompressionIndex ), m_virginCompressionIndex( virginCompressionIndex ), m_cslSlope( cslSlope ), @@ -524,9 +531,13 @@ class DelftEgg : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -549,9 +560,13 @@ class DelftEgg : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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..645c7cd1255 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,15 @@ class DruckerPragerUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + 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 ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_friction( friction ), m_dilation( dilation ), m_hardening( hardening ), @@ -410,9 +418,13 @@ class DruckerPrager : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -434,9 +446,13 @@ class DruckerPrager : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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..6829dc18f42 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,15 @@ class DruckerPragerExtendedUpdates : public ElasticIsotropicUpdates arrayView1d< real64 const > const & bulkModulus, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + 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 ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_initialFriction( initialFriction ), m_residualFriction( residualFriction ), m_dilationRatio( dilationRatio ), @@ -441,9 +448,13 @@ class DruckerPragerExtended : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -467,9 +478,13 @@ class DruckerPragerExtended : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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..c0c68aea4aa 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropic.hpp @@ -46,17 +46,24 @@ 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 & 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 ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity ), + const bool & disableInelasticity, + const integer & enableAnelasticStrain ): + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, + enableAnelasticStrain ), m_bulkModulus( bulkModulus ), m_shearModulus( shearModulus ) {} @@ -157,6 +164,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 +386,31 @@ 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 + + m_newAnelasticStrainMagnitude[k] = m_oldAnelasticStrainMagnitude[k] + getAnelasticStrainIncrement( k ); + + real64 anelasticStrain[6]; + for( integer i = 0; i < 6; ++i ) + { + anelasticStrain[i] = m_newAnelasticStrainMagnitude[k] * anelasticStrainDirection[i]; + } + + smallStrainNoStateUpdate_StressOnly( k, q, anelasticStrain, stressModifier ); +} + // TODO: need to confirm stress / strain measures before activating hyper inferface /* @@ -533,18 +570,26 @@ class ElasticIsotropic : public SolidBase return ElasticIsotropicUpdates( m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD >(), arrayView3d< real64, solid::STRESS_USD >(), - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } } @@ -563,9 +608,13 @@ class ElasticIsotropic : public SolidBase m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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..0f228494f44 100644 --- a/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp +++ b/src/coreComponents/constitutive/solid/ElasticIsotropicPressureDependent.hpp @@ -49,19 +49,26 @@ 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 & 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 ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, + enableAnelasticStrain ), m_refPressure( refPressure ), m_refStrainVol( refStrainVol ), m_recompressionIndex( recompressionIndex ), @@ -583,9 +590,13 @@ class ElasticIsotropicPressureDependent : public SolidBase m_recompressionIndex, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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 +605,13 @@ class ElasticIsotropicPressureDependent : public SolidBase m_recompressionIndex, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, arrayView3d< real64, solid::STRESS_USD >(), arrayView3d< real64, solid::STRESS_USD >(), - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } } @@ -617,9 +632,13 @@ class ElasticIsotropicPressureDependent : public SolidBase m_recompressionIndex, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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..9a613a80193 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,15 @@ class ElasticOrthotropicUpdates : public SolidBaseUpdates arrayView1d< real64 const > const & c55, arrayView1d< real64 const > const & c66, arrayView1d< real64 const > const & thermalExpansionCoefficient, + 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 ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, + enableAnelasticStrain ), m_c11( c11 ), m_c12( c12 ), m_c13( c13 ), @@ -737,9 +744,13 @@ class ElasticOrthotropic : public SolidBase m_c55, m_c66, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -764,9 +775,13 @@ class ElasticOrthotropic : public SolidBase m_c55, m_c66, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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..7ec996679d5 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,15 @@ class ElasticTransverseIsotropicUpdates : public SolidBaseUpdates arrayView1d< real64 const > const & c44, arrayView1d< real64 const > const & c66, arrayView1d< real64 const > const & thermalExpansionCoefficient, + 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 ): - SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + SolidBaseUpdates( newStress, oldStress, thermalExpansionCoefficient, disableInelasticity, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, + enableAnelasticStrain ), m_c11( c11 ), m_c13( c13 ), m_c33( c33 ), @@ -593,9 +600,13 @@ class ElasticTransverseIsotropic : public SolidBase m_c44, m_c66, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -616,9 +627,13 @@ class ElasticTransverseIsotropic : public SolidBase m_c44, m_c66, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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..f771d81d836 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,16 @@ class ModifiedCamClayUpdates : public ElasticIsotropicPressureDependentUpdates arrayView2d< real64 > const & oldPreConsolidationPressure, arrayView1d< real64 const > const & shearModulus, arrayView1d< real64 const > const & thermalExpansionCoefficient, + 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 ): - ElasticIsotropicPressureDependentUpdates( refPressure, refStrainVol, recompressionIndex, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicPressureDependentUpdates( refPressure, refStrainVol, recompressionIndex, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, + oldAnelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_virginCompressionIndex( virginCompressionIndex ), m_cslSlope( cslSlope ), m_newPreConsolidationPressure( newPreConsolidationPressure ), @@ -535,9 +543,13 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent m_oldPreConsolidationPressure, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -560,9 +572,13 @@ class ModifiedCamClay : public ElasticIsotropicPressureDependent m_oldPreConsolidationPressure, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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..22afbc73b69 100644 --- a/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp +++ b/src/coreComponents/constitutive/solid/PerfectlyPlastic.hpp @@ -48,17 +48,24 @@ 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 & 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 ): - ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, newStress, oldStress, disableInelasticity ), + bool const & disableInelasticity, + const integer & enableAnelasticStrain ): + ElasticIsotropicUpdates( bulkModulus, shearModulus, thermalExpansionCoefficient, anelasticStrainIncrement, newAnelasticStrainMagnitude, oldAnelasticStrainMagnitude, newStress, oldStress, + disableInelasticity, enableAnelasticStrain ), m_yieldStress( yieldStress ) {} @@ -281,9 +288,13 @@ class PerfectlyPlastic : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, m_newStress, m_oldStress, - m_disableInelasticity ); + m_disableInelasticity, + m_enableAnelasticStrain ); } /** @@ -301,9 +312,13 @@ class PerfectlyPlastic : public ElasticIsotropic m_bulkModulus, m_shearModulus, m_thermalExpansionCoefficient, + m_anelasticStrainIncrement, + m_newAnelasticStrainMagnitude, + m_oldAnelasticStrainMagnitude, 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..6192742fe3a 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::defaultAnelasticStrainIncrementString(), &m_defaultAnelasticStrainIncrement ). + 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,10 @@ SolidBase::SolidBase( string const & name, Group * const parent ): registerField< fields::solid::density >( &m_density ); registerField< fields::solid::thermalExpansionCoefficient >( &m_thermalExpansionCoefficient ); + + registerField< fields::solid::anelasticStrainIncrement >( &m_anelasticStrainIncrement ); + registerField< fields::solid::newAnelasticStrainMagnitude >( &m_newAnelasticStrainMagnitude ); + registerField< fields::solid::oldAnelasticStrainMagnitude >( &m_oldAnelasticStrainMagnitude ); } @@ -63,6 +77,13 @@ void SolidBase::postInputInitialization() getField< fields::solid::thermalExpansionCoefficient >(). setApplyDefaultValue( m_defaultThermalExpansionCoefficient ); + + getField< fields::solid::anelasticStrainIncrement >(). + setApplyDefaultValue( m_defaultAnelasticStrainIncrement ); + + GEOS_ERROR_IF( m_enableAnelasticStrain == 0 && m_defaultAnelasticStrainIncrement > 0.0, + getDataContext() << ": enableAnelasticStrain flag must be 1 if a nonzero" + " AnelasticStrainMagnitude is used" ); } @@ -85,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 f21092d7a61..9ba9bf3e4a5 100644 --- a/src/coreComponents/constitutive/solid/SolidBase.hpp +++ b/src/coreComponents/constitutive/solid/SolidBase.hpp @@ -55,15 +55,25 @@ 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 & 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_disableInelasticity ( disableInelasticity ), + m_anelasticStrainIncrement( anelasticStrainIncrement ), + m_newAnelasticStrainMagnitude( newAnelasticStrainMagnitude ), + m_oldAnelasticStrainMagnitude( oldAnelasticStrainMagnitude ), + m_enableAnelasticStrain( enableAnelasticStrain ) {} /// Deleted default constructor @@ -101,6 +111,15 @@ class SolidBaseUpdates /// Flag to disable inelasticity const bool m_disableInelasticity; + /// The anelastic strain magnitude (i.e. chemistry, electrochemistry, etc.) + 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; + /** * @brief Get bulkModulus * @param[in] k Element index. @@ -126,6 +145,17 @@ class SolidBaseUpdates return m_thermalExpansionCoefficient[k]; } + /** + * @brief Get anelasticStrainIncrement + * @param[in] k Element index. + * @return the anelasticStrainIncrement of element k + */ + GEOS_HOST_DEVICE + real64 getAnelasticStrainIncrement( localIndex const k ) const + { + return m_anelasticStrainIncrement[k]; + } + /** * @brief Get shear modulus * @param[in] k Element index. @@ -371,6 +401,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 +617,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 * defaultAnelasticStrainIncrementString() { return "defaultAnelasticStrainIncrement"; } + // 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 +748,19 @@ class SolidBase : public constitutive::ConstitutiveBase /// Flag to disable inelasticity (plasticity, damage, etc.) bool m_disableInelasticity = false; + + /// 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 rate magnitude + real64 m_defaultAnelasticStrainIncrement; + + /// 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..8064e969e1b 100644 --- a/src/coreComponents/constitutive/solid/SolidFields.hpp +++ b/src/coreComponents/constitutive/solid/SolidFields.hpp @@ -420,6 +420,30 @@ DECLARE_FIELD( dInternalEnergy_dTemperature, WRITE_AND_READ, "Derivative of the solid internal energy w.r.t. temperature [J/(m^3.K)]" ); +DECLARE_FIELD( anelasticStrainIncrement, + "anelasticStrainIncrement", + array1d< real64 >, + 0, + LEVEL_0, + WRITE_AND_READ, + "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" ); + } } 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 ) {