Skip to content

Commit f9ce070

Browse files
committed
McKenzie assumes slab bot=0
1 parent 2e1d666 commit f9ce070

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

src/Setup_geometry.jl

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,37 +1067,32 @@ Compute the temperature field of a `McKenzie_subducting_slab` scenario
10671067
"""
10681068
function Compute_ThermalStructure(Temp, X, Y, Z,Phase, s::McKenzie_subducting_slab)
10691069
@unpack Tsurface, Tmantle, Adiabat, v_cm_yr, κ, it = s
1070-
@show Tsurface, Tmantle, Adiabat, v_cm_yr, κ, it
10711070

10721071
# Thickness of the layer:
10731072
D0 = (maximum(Z)-minimum(Z));
1073+
Zshift = Z .- Z[1] # McKenzie model is defined with Z = 0 at the bottom of the slab
10741074

10751075
# Convert subduction velocity from cm/yr -> m/s;
10761076
convert_velocity = 1/(100.0*365.25*60.0*60.0*24.0);
1077-
10781077
v_s = v_cm_yr*convert_velocity;
10791078

1080-
# calculate the Reynolds number
1081-
Re = (v_s*D0*1000)/2/κ;
1082-
@show Re, κ, v_s, v_cm_yr, D0
1083-
1079+
# calculate the thermal Reynolds number
1080+
Re = (v_s*D0*1000)/2/κ; # factor 1000 to transfer D0 from km to m
1081+
10841082
# McKenzie model
10851083
sc = 1/D0
1086-
1087-
σ = zeros(size(Temp));
1088-
1084+
σ = ones(size(Temp));
10891085
# Dividi et impera
10901086
for i=1:it
1091-
a = (-1).^(i)./(i.*pi)
1092-
b = (Re .- (Re.^2 .+ i .^2. *pi .^2) .^(0.5)) .*X .*sc;
1093-
c = sin.(i .*pi .*(1 .- abs.(Z .*sc))) ;
1087+
a = (-1.0).^(i)./(i.*pi)
1088+
b = (Re .- (Re.^2 .+ i^2.0 .* pi^2.0).^(0.5)) .*X .*sc;
1089+
c = sin.(i .*pi .*(1 .- abs.(Zshift .*sc))) ;
10941090
e = exp.(b);
1095-
σ .+= a.*e.*c
1091+
σ .+= 2*a.*e.*c
10961092
end
1097-
@show extrema(σ)
10981093

1099-
Temp .= Tmantle .+ 2*(Tmantle-Tsurface).*σ;
1100-
# Temp .= Temp + (Adiabat*abs.(Z))
1094+
Temp .= Tsurface .+ (Tmantle-Tsurface).*σ;
1095+
Temp .= Temp + (Adiabat*abs.(Z))
11011096

11021097
return Temp
11031098
end

test/test_setup_geometry.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,14 @@ TsMK = McKenzie_subducting_slab(Tsurface = 20.0, Tmantle = 1350.0, v_cm_yr = 4.0
188188
# horizontal
189189
Temp = ones(Float64,size(Cart))*1350;
190190
AddBox!(Phase, Temp, Cart; xlim=(0.0,600.0),ylim=(0.0,600.0), zlim=(-80.0, 0.0), phase = ConstantPhase(5), T=TsMK);
191-
@test sum(Temp) 3.518284446708499e8
191+
@test sum(Temp) 3.518172093383281e8
192192

193193
# inclined
194194
Temp = ones(Float64,size(Cart))*1350;
195195
AddBox!(Phase, Temp, Cart; xlim=(0.0,600.0),ylim=(0.0,600.0), zlim=(-80.0,0),StrikeAngle=0, DipAngle=45, phase = ConstantPhase(5), T=TsMK);
196-
@test sum(Temp) 3.51230950244323e8
196+
@test sum(Temp) 3.5133669349123573e8
197197

198198

199-
200199
# T_slab = LinearWeightedTemperature(0.1,1.0,100.0,:X,TsMK,TsHC);
201200

202201
# AddBox!(Phase, Temp, Cart; xlim=(0.0,600.0),ylim=(0.0,600.0), zlim=(0.0,-80.0),StrikeAngle=0, DipAngle=45, phase = ConstantPhase(5), T=McKenzie(20.0));

0 commit comments

Comments
 (0)