Skip to content

Commit

Permalink
change degradation function for quadratic case.
Browse files Browse the repository at this point in the history
  • Loading branch information
CusiniM committed Jul 5, 2024
1 parent 133980c commit 3901e2f
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/coreComponents/constitutive/solid/DamageSpectral.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ class DamageSpectralUpdates : public DamageUpdates< UPDATE_BASE >
localIndex const q ) const
{
static_assert( DISSIPATION_ORDER::value == 1 || DISSIPATION_ORDER::value == 2, "DISSIPATION_ORDER must be either 1 or 2" );
real64 m = 0;
if constexpr ( DISSIPATION_ORDER::value == 2 )
{
m = m_criticalFractureEnergy/(2*m_lengthScale*m_criticalStrainEnergy);
// m = m_criticalFractureEnergy/(2*m_lengthScale*m_criticalStrainEnergy);
return DamageUpdates< UPDATE_BASE >::template getDegradationValue<DISSIPATION_ORDER>( k , q );

Check warning on line 112 in src/coreComponents/constitutive/solid/DamageSpectral.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/constitutive/solid/DamageSpectral.hpp#L112

Added line #L112 was not covered by tests
}
else if constexpr ( DISSIPATION_ORDER::value == 1 )
else
{
m = 3*m_criticalFractureEnergy/(8*m_lengthScale*m_criticalStrainEnergy);
}
real64 const p = 1;
return pow( 1 - m_damage( k, q ), 2 ) /( pow( 1 - m_damage( k, q ), 2 ) + m * m_damage( k, q ) * (1 + p*m_damage( k, q )) );
real64 const m = 3*m_criticalFractureEnergy/(8*m_lengthScale*m_criticalStrainEnergy);
real64 const p = 1;
return pow( 1 - m_damage( k, q ), 2 ) /( pow( 1 - m_damage( k, q ), 2 ) + m * m_damage( k, q ) * (1 + p*m_damage( k, q )) );
}
}

template< typename DISSIPATION_ORDER = std::integral_constant< int, 1 > >
Expand All @@ -125,17 +125,17 @@ class DamageSpectralUpdates : public DamageUpdates< UPDATE_BASE >
real64 getDegradationDerivative( real64 const d ) const

Check warning on line 125 in src/coreComponents/constitutive/solid/DamageSpectral.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/constitutive/solid/DamageSpectral.hpp#L125

Added line #L125 was not covered by tests
{
static_assert( DISSIPATION_ORDER::value == 1 || DISSIPATION_ORDER::value == 2, "DISSIPATION_ORDER must be either 1 or 2" );
real64 m;
if constexpr ( DISSIPATION_ORDER::value == 2 )
{
m = m_criticalFractureEnergy/(2*m_lengthScale*m_criticalStrainEnergy);
// m = m_criticalFractureEnergy/(2*m_lengthScale*m_criticalStrainEnergy);
return DamageUpdates< UPDATE_BASE >::template getDegradationDerivative<DISSIPATION_ORDER>( d );

Check warning on line 131 in src/coreComponents/constitutive/solid/DamageSpectral.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/constitutive/solid/DamageSpectral.hpp#L131

Added line #L131 was not covered by tests
}
else if constexpr ( DISSIPATION_ORDER::value == 1 )
else
{
m = 3*m_criticalFractureEnergy/(8*m_lengthScale*m_criticalStrainEnergy);
real64 const m = 3*m_criticalFractureEnergy/(8*m_lengthScale*m_criticalStrainEnergy);
real64 const p = 1;
return -m*(1 - d)*(1 + (2*p + 1)*d) / pow( pow( 1-d, 2 ) + m*d*(1+p*d), 2 );

Check warning on line 137 in src/coreComponents/constitutive/solid/DamageSpectral.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/constitutive/solid/DamageSpectral.hpp#L135-L137

Added lines #L135 - L137 were not covered by tests
}
real64 const p = 1;
return -m*(1 - d)*(1 + (2*p + 1)*d) / pow( pow( 1-d, 2 ) + m*d*(1+p*d), 2 );
}

template< typename DISSIPATION_ORDER = std::integral_constant< int, 1 > >
Expand All @@ -144,17 +144,17 @@ class DamageSpectralUpdates : public DamageUpdates< UPDATE_BASE >
real64 getDegradationSecondDerivative( real64 const d ) const

Check warning on line 144 in src/coreComponents/constitutive/solid/DamageSpectral.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/constitutive/solid/DamageSpectral.hpp#L144

Added line #L144 was not covered by tests
{
static_assert( DISSIPATION_ORDER::value == 1 || DISSIPATION_ORDER::value == 2, "DISSIPATION_ORDER must be either 1 or 2" );
real64 m = 0;
if constexpr ( DISSIPATION_ORDER::value == 2 )
{
m = m_criticalFractureEnergy/(2*m_lengthScale*m_criticalStrainEnergy);
// m = m_criticalFractureEnergy/(2*m_lengthScale*m_criticalStrainEnergy);
return DamageUpdates< UPDATE_BASE >::template getDegradationSecondDerivative<DISSIPATION_ORDER>( d );

Check warning on line 150 in src/coreComponents/constitutive/solid/DamageSpectral.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/constitutive/solid/DamageSpectral.hpp#L150

Added line #L150 was not covered by tests
}
else if constexpr ( DISSIPATION_ORDER::value == 1 )
else
{
m = 3*m_criticalFractureEnergy/(8*m_lengthScale*m_criticalStrainEnergy);
real64 const m = 3*m_criticalFractureEnergy/(8*m_lengthScale*m_criticalStrainEnergy);
real64 const p = 1;
return -2*m*( pow( d, 3 )*(2*m*p*p + m*p + 2*p + 1) + pow( d, 2 )*(-3*m*p*p -3*p) + d*(-3*m*p - 3) + (-m+p+2) )/pow( pow( 1-d, 2 ) + m*d*(1+p*d), 3 );

Check warning on line 156 in src/coreComponents/constitutive/solid/DamageSpectral.hpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/constitutive/solid/DamageSpectral.hpp#L154-L156

Added lines #L154 - L156 were not covered by tests
}
real64 const p = 1;
return -2*m*( pow( d, 3 )*(2*m*p*p + m*p + 2*p + 1) + pow( d, 2 )*(-3*m*p*p -3*p) + d*(-3*m*p - 3) + (-m+p+2) )/pow( pow( 1-d, 2 ) + m*d*(1+p*d), 3 );
}


Expand Down

0 comments on commit 3901e2f

Please sign in to comment.