Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non linear softening #158

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ConstitutiveRelationships.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export param_info,
iselastic,
AbstractSoftening,
NoSoftening,
LinearSoftening
LinearSoftening,
NoLinearSoftening
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be better to call it NonlinearSoftening


# add methods programmatically
for myType in (:LinearViscous, :DiffusionCreep, :DislocationCreep, :ConstantElasticity, :DruckerPrager, :ArrheniusType,
Expand Down
1 change: 1 addition & 0 deletions src/GeoParams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export dεII_dτII,
AbstractSoftening,
NoSoftening,
LinearSoftening,
NoLinearSoftening,

# Plasticity
AbstractPlasticity,
Expand Down
20 changes: 20 additions & 0 deletions src/Softening/Softening.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ struct NoSoftening <: AbstractSoftening end

@inline (softening::NoSoftening)(max_value, ::Vararg{Any, N}) where N = max_value

## Linear softening
struct LinearSoftening{T} <: AbstractSoftening
hi::T
lo::T
Expand All @@ -29,3 +30,22 @@ LinearSoftening(min_max_values::NTuple{2, T}, lo_hi::NTuple{2, T}) where T = Lin

return fma((one(T) - softening_var), softening.slope, softening.min_value)
end

## Non linear softening
# (Thibault et al 2021; https://agupubs.onlinelibrary.wiley.com/doi/pdfdirect/10.1029/2021GC009675)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duretz et al.

import SpecialFunctions.erfc

@with_kw struct NoLinearSoftening{T} <: AbstractSoftening
ξ₀::T= 0.0 # maximum value
Δ::T = 0.0 # amplitude of the softening (i.e. minimum value)
μ::T = 1.0 # mean of the softening
σ::T = 0.5 # standard deviation of the softening
end

NoLinearSoftening(args::Vararg{Any, N}) where N = NoLinearSoftening(promote(args...)...)

@inline (softening::NoLinearSoftening)(args::Vararg{Any, N}) where N = softening(promote(args...)...)

@inline function (softening::NoLinearSoftening)(softening_var::T) where T
return softening.ξ₀ - 0.5 * softening.Δ * erfc(- (softening_var - softening.μ) / softening.σ)
end
Loading