forked from jaolive/SiStER
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SiStER_flow_law_function.m
34 lines (22 loc) · 1.12 KB
/
SiStER_flow_law_function.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function [eta] = SiStER_flow_law_function(type,pre,Ea,n,R,T,epsII,sII,PARAMS)
% [eta] = SiStER_flow_law_function(type,pre,Ea,n,R,T,epsII,sII)
% gives generic form of ductile creep law
% to be used for both diffusion and dislocation creep in
% get_ductile_rheology functions
% inputs:
% type = 'from_stress' or 'from_strain_rate' to set flow law expression
% with usual parameters: prefactor (pre), activation energy (Ea, J/mol),
% exponent (n), gas constant (R), temperature (T, in deg C),
% second invariant of strain rate (epsII, s^-1) or second invariant
% of deviatoric stress (sII, Pa)
if strcmp(type,'from_stress')==1
eta = pre.^(-1).*sII.^(1-n).*exp(Ea./(R.*(T+273.15)));
elseif strcmp(type,'from_strain_rate')==1
eta = pre.^(-1./n).*epsII.^((1-n)./n).*exp((Ea)./(n.*R.*(T+273.15)));
elseif strcmp(type,'custom')==1
disp('ERROR ? CUSTOM VISCOSITY FUNCTION NOT CURRENTLY DEFINED')
disp('this feature will be available in a future update.')
eta = PARAMS.customviscofunction(phase,temperature,strain_rate,stress);
else
disp('ERROR ? flow law is undefined.')
end