Skip to content

Commit 876bded

Browse files
CHG: renamed nu -> mu to avoid confusion
1 parent ed1c833 commit 876bded

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

src/m/mech/mechanicalproperties.m

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,36 +50,36 @@
5050
clear vxlist vylist
5151

5252
%compute viscosity
53-
nu=zeros(numberofelements,1);
53+
mu=zeros(numberofelements,1);
5454
B_bar=md.materials.rheology_B(index)*summation/3;
5555
power=(md.materials.rheology_n-1)./(2*md.materials.rheology_n);
5656
second_inv=(ux.^2+vy.^2+((uy+vx).^2)/4+ux.*vy);
5757

5858
%some corrections
5959
location=find(second_inv==0 & power~=0);
60-
nu(location)=10^18; %arbitrary maximum viscosity to apply where there is no effective shear
60+
mu(location)=10^18; %arbitrary maximum viscosity to apply where there is no effective shear
6161

6262
if isa(md.materials,'matice')
6363
location=find(second_inv~=0);
64-
nu(location)=B_bar(location)./(second_inv(location).^power(location));
64+
mu(location)=B_bar(location)./(second_inv(location).^power(location));
6565
location=find(second_inv==0 & power==0);
66-
nu(location)=B_bar(location);
66+
mu(location)=B_bar(location);
6767
elseif isa(md.materials,'matdamageice')
6868
Zinv=1-damage(index)*summation/3;
6969
location=find(second_inv~=0);
70-
nu(location)=Zinv(location).*B_bar(location)./(second_inv(location).^power(location));
70+
mu(location)=Zinv(location).*B_bar(location)./(second_inv(location).^power(location));
7171
location=find(second_inv==0 & power==0);
72-
nu(location)=Zinv(location).*B_bar(location);
72+
mu(location)=Zinv(location).*B_bar(location);
7373
clear Zinv
7474
else
7575
error(['class of md.materials (' class(md.materials) ') not recognized or not supported']);
7676
end
7777
clear B_bar location second_inv power
7878

7979
%compute stress
80-
tau_xx=nu.*ux;
81-
tau_yy=nu.*vy;
82-
tau_xy=nu.*uyvx;
80+
tau_xx=mu.*ux;
81+
tau_yy=mu.*vy;
82+
tau_xy=mu.*uyvx;
8383

8484
%compute principal properties of stress
8585
for i=1:numberofelements,
@@ -133,6 +133,4 @@
133133
deviatoricstress.effectivevalue=1/sqrt(2)*sqrt(deviatoricstress.xx.^2+deviatoricstress.yy.^2+2*deviatoricstress.xy.^2);
134134
md.results.deviatoricstress=deviatoricstress;
135135

136-
viscosity=struct('nu',[]);
137-
viscosity.nu=nu;
138-
md.results.viscosity=viscosity;
136+
md.results.viscosity=mu;

src/m/mech/mechanicalproperties.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,37 +71,37 @@ def mechanicalproperties(md, vx, vy, *args):
7171
#clear vxlist vylist
7272

7373
#compute viscosity
74-
nu = np.zeros((numberofelements, ))
74+
mu = np.zeros((numberofelements, ))
7575
B_bar = np.dot(md.materials.rheology_B[index - 1], summation / 3.).reshape(-1, )
7676
power = ((md.materials.rheology_n - 1.) / (2. * md.materials.rheology_n)).reshape(-1, )
7777
second_inv = (ux**2. + vy**2. + ((uy + vx)**2.) / 4. + ux * vy).reshape(-1, )
7878

7979
#some corrections
8080
location = np.nonzero(np.logical_and(second_inv == 0, power != 0))
81-
nu[location] = pow(10, 18) #arbitrary maximum viscosity to apply where there is no effective shear
81+
mu[location] = pow(10, 18) #arbitrary maximum viscosity to apply where there is no effective shear
8282

8383
if 'matice' in md.materials.__module__:
8484
location = np.nonzero(second_inv)
85-
nu[location] = B_bar[location] / (second_inv[location]**power[location])
85+
mu[location] = B_bar[location] / (second_inv[location]**power[location])
8686
location = np.nonzero(np.logical_and(second_inv == 0, power == 0))
87-
nu[location] = B_bar[location]
87+
mu[location] = B_bar[location]
8888
location = np.nonzero(np.logical_and(second_inv == 0, power != 0))
89-
nu[location] = pow(10, 18)
89+
mu[location] = pow(10, 18)
9090
elif 'matdamageice' in md.materials.__module__:
9191
print('computing damage-dependent properties!')
9292
Zinv = np.dot(1 - damage[index - 1], summation / 3.).reshape(-1, )
9393
location = np.nonzero(second_inv)
94-
nu[location] = Zinv[location] * B_bar[location] / np.power(second_inv[location], power[location])
94+
mu[location] = Zinv[location] * B_bar[location] / np.power(second_inv[location], power[location])
9595
location = np.nonzero(np.logical_and(second_inv == 0, power == 0))
96-
nu[location] = Zinv[location] * B_bar[location]
96+
mu[location] = Zinv[location] * B_bar[location]
9797
#clear Zinv
9898
else:
9999
raise Exception('class of md.materials (' + md.materials.__module__ + ') not recognized or not supported')
100100

101101
#compute stress
102-
tau_xx = nu * ux
103-
tau_yy = nu * vy
104-
tau_xy = nu * uyvx
102+
tau_xx = mu * ux
103+
tau_yy = mu * vy
104+
tau_xy = mu * uyvx
105105

106106
#compute principal properties of stress
107107
for i in np.arange(numberofelements):

0 commit comments

Comments
 (0)