@@ -6,7 +6,7 @@ Lon3D,Lat3D,Depth3D = lonlatdepth_grid(1.0:1:10.0, 11.0:1:20.0, (-20:1:-10)*km
6
6
Data = zeros (size (Lon3D));
7
7
Temp = ones (Float64, size (Data))* 1350 ;
8
8
Phases = zeros (Int32, size (Data));
9
- Grid = GeoData (Lon3D,Lat3D,Depth3D,(DataFieldName= Data,))
9
+ Grid = GeoData (Lon3D,Lat3D,Depth3D,(DataFieldName= Data,))
10
10
11
11
add_box! (Phases,Temp,Grid, xlim= (2 ,4 ), zlim= (- 15 ,- 10 ), phase= ConstantPhase (3 ), DipAngle= 10 , T= LinearTemp (Tbot= 1350 , Ttop= 200 ))
12
12
@test sum (Temp[1 ,1 ,:]) ≈ 14850.0
@@ -16,12 +16,12 @@ add_ellipsoid!(Phases,Temp,Grid, cen=(4,15,-17), axes=(1,2,3), StrikeAngle=90, D
16
16
17
17
18
18
19
- # CartData
19
+ # CartData
20
20
X,Y,Z = xyz_grid (1.0 : 1 : 10.0 , 11.0 : 1 : 20.0 , - 20 : 1 : - 10 );
21
21
Data = zeros (size (X));
22
22
Temp = ones (Float64, size (Data))* 1350 ;
23
23
Phases = zeros (Int32, size (Data));
24
- Grid = CartData (X,Y,Z,(DataFieldName= Data,))
24
+ Grid = CartData (X,Y,Z,(DataFieldName= Data,))
25
25
26
26
add_box! (Phases,Temp,Grid, xlim= (2 ,4 ), zlim= (- 15 ,- 10 ), phase= ConstantPhase (3 ), DipAngle= 10 , T= LinearTemp (Tbot= 1350 , Ttop= 200 ))
27
27
@test sum (Temp[1 ,1 ,:]) ≈ 14850.0
@@ -93,7 +93,7 @@ Phases = zeros(Int64, Grid.N...);
93
93
94
94
# 1) horizontally layer lithosphere; UpperCrust,LowerCrust,Mantle
95
95
add_box! (Phases,Temp,Grid, xlim= (- 100 ,100 ), zlim= (- 100 ,0 ), Origin= (0.0 ,0.0 ,0.0 ),
96
- phase= LithosphericPhases (Layers= [20 15 65 ], Phases = [1 2 3 ], Tlab= nothing ),
96
+ phase= LithosphericPhases (Layers= [20 15 65 ], Phases = [1 2 3 ], Tlab= nothing ),
97
97
DipAngle= 0.0 , T= LithosphericTemp (nz= 201 ))
98
98
99
99
@test sum (Temp[Int64 (nel/ 2 ),Int64 (nel/ 2 ),:]) ≈ 36131.638045729735
@@ -103,7 +103,7 @@ Temp = zeros(Float64, Grid.N...);
103
103
Phases = zeros (Int64, Grid. N... );
104
104
105
105
add_box! (Phases,Temp,Grid, xlim= (- 100 ,100 ), zlim= (- 100 ,0 ), Origin= (0.0 ,0.0 ,0.0 ),
106
- phase= LithosphericPhases (Layers= [20 15 65 ], Phases = [1 2 3 ], Tlab= nothing ),
106
+ phase= LithosphericPhases (Layers= [20 15 65 ], Phases = [1 2 3 ], Tlab= nothing ),
107
107
DipAngle= 30.0 , T= LithosphericTemp (nz= 201 ))
108
108
109
109
@test sum (Temp[Int64 (nel/ 2 ),Int64 (nel/ 2 ),:]) ≈ 41912.18172533137
@@ -113,7 +113,7 @@ Temp = zeros(Float64, Grid.N...);
113
113
Phases = zeros (Int64, Grid. N... );
114
114
115
115
add_box! (Phases,Temp,Grid, xlim= (- 100 ,100 ), zlim= (- 100 ,0 ),
116
- phase= LithosphericPhases (Layers= [20 15 65 ], Phases = [1 2 3 ], Tlab= nothing ),
116
+ phase= LithosphericPhases (Layers= [20 15 65 ], Phases = [1 2 3 ], Tlab= nothing ),
117
117
DipAngle= 30.0 , T= LithosphericTemp (nz= 201 ))
118
118
119
119
@test sum (Temp[Int64 (nel/ 2 ),Int64 (nel/ 2 ),:]) ≈ 41316.11499878003
@@ -151,7 +151,7 @@ rheology = (
151
151
);
152
152
153
153
add_box! (Phases,Temp,Grid, xlim= (- 100 ,100 ), zlim= (- 100 ,0 ),
154
- phase= LithosphericPhases (Layers= [20 80 ], Phases = [1 2 ], Tlab= nothing ),
154
+ phase= LithosphericPhases (Layers= [20 80 ], Phases = [1 2 ], Tlab= nothing ),
155
155
DipAngle= 30.0 , T= LithosphericTemp (rheology= rheology,nz= 201 ))
156
156
157
157
@test sum (Temp[Int64 (nel/ 2 ),Int64 (nel/ 2 ),:]) ≈ 40513.969831615716
@@ -161,7 +161,7 @@ Temp = zeros(Float64, Grid.N...);
161
161
Phases = zeros (Int64, Grid. N... );
162
162
163
163
add_box! (Phases,Temp,Grid, xlim= (- 100 ,100 ), zlim= (- 100 ,0 ),
164
- phase= LithosphericPhases (Layers= [20 15 65 ], Phases = [1 2 3 ], Tlab= nothing ),
164
+ phase= LithosphericPhases (Layers= [20 15 65 ], Phases = [1 2 3 ], Tlab= nothing ),
165
165
DipAngle= 30.0 , T= LithosphericTemp (lbound= " flux" ,nz= 201 ))
166
166
167
167
@test sum (Temp[Int64 (nel/ 2 ),Int64 (nel/ 2 ),:]) ≈ 37359.648604722104
@@ -188,7 +188,7 @@ TsMK = McKenzie_subducting_slab(Tsurface = 20.0, Tmantle = 1350.0, v_cm_yr = 4.0
188
188
189
189
# Add a box with a McKenzie thermal structure
190
190
191
- # horizontal
191
+ # horizontal
192
192
Temp = ones (Float64,size (Cart))* 1350 ;
193
193
add_box! (Phase, Temp, Cart; xlim= (0.0 ,600.0 ),ylim= (0.0 ,600.0 ), zlim= (- 80.0 , 0.0 ), phase = ConstantPhase (5 ), T= TsMK);
194
194
@test sum (Temp) ≈ 3.518172093383281e8
@@ -229,7 +229,7 @@ Temp = ones(Float64,(length(x),length(y),length(z)))*1350;
229
229
230
230
add_box! (Phase, Temp, Cart; xlim= (0.0 ,600.0 ),ylim= (0.0 ,600.0 ), zlim= (- 80.0 , 0.0 ), phase = ConstantPhase (5 ), T= T= ConstantTemp (120.0 ));
231
231
232
- # add accretionary prism
232
+ # add accretionary prism
233
233
add_polygon! (Phase, Temp, Cart; xlim= (500.0 , 200.0 , 500.0 ),ylim= (100.0 ,400.0 ), zlim= (0.0 ,0.0 ,- 60.0 ), phase = ConstantPhase (8 ), T= LinearTemp (Ttop= 20 , Tbot= 30 ))
234
234
235
235
@test maximum (Phase) == 8
@@ -270,13 +270,13 @@ Temp = fill(1350.0,size(Cart));
270
270
add_slab! (Phase,Temp,Cart, t1, phase= phase, T = TsHC)
271
271
@test extrema (Phase) == (1 , 9 )
272
272
273
- # Data_Final = CartData(X,Y,Z,(Phase=Phase,Temp=Temp))
273
+ # Data_Final = CartData(X,Y,Z,(Phase=Phase,Temp=Temp))
274
274
# write_paraview(Data_Final, "Data_Final");
275
275
276
276
Phase = ones (Int32,size (Cart));
277
277
Temp = fill (1350.0 ,size (Cart));
278
278
TsMK = McKenzie_subducting_slab (Tsurface = 20.0 , Tmantle = 1350.0 , v_cm_yr = 4.0 , Adiabat = 0.0 )
279
- temp = TsMK
279
+ temp = TsMK
280
280
281
281
Phase = ones (Int32,size (Cart));
282
282
Temp = fill (1350.0 ,size (Cart));
@@ -290,7 +290,7 @@ t1 = Trench(Start = (400.0,400.0), End = (800.0,800.0),θ_max = 90.0, direction
290
290
add_slab! (Phase,Temp,Cart, t1, phase= phase, T = T_slab)
291
291
@test Temp[84 ,84 ,110 ] ≈ 624.6682008876219
292
292
293
- Data_Final = CartData (X,Y,Z,(Phase= Phase,Temp= Temp))
293
+ Data_Final = CartData (X,Y,Z,(Phase= Phase,Temp= Temp))
294
294
295
295
# 2D slab:
296
296
nx,nz = 512 ,128
@@ -299,7 +299,7 @@ z = range(-660,0, nz);
299
299
Grid2D = CartData (xyz_grid (x,0 ,z))
300
300
Phases = zeros (Int64, nx, 1 , nz);
301
301
Temp = fill (1350.0 , nx, 1 , nz);
302
- add_box! (Phases, Temp, Grid2D; xlim= (- 800.0 ,0.0 ), zlim= (- 80.0 , 0.0 ), phase = ConstantPhase (1 ), T= HalfspaceCoolingTemp (Age= 40 ));
302
+ add_box! (Phases, Temp, Grid2D; xlim= (- 800.0 ,0.0 ), zlim= (- 80.0 , 0.0 ), phase = ConstantPhase (1 ), T= HalfspaceCoolingTemp (Age= 40 ));
303
303
304
304
trench = Trench (Start= (0.0 ,- 100.0 ), End= (0.0 ,100.0 ), Thickness= 80.0 , θ_max= 30.0 , Length= 300 , Lb= 150 );
305
305
add_slab! (Phases, Temp, Grid2D, trench, phase = ConstantPhase (2 ), T= HalfspaceCoolingTemp (Age= 40 ));
@@ -333,32 +333,103 @@ v_spread_cm_yr = 3 #spreading velocity
333
333
lith = LithosphericPhases (Layers= [15 55 ], Phases= [1 2 ], Tlab= 1250 )
334
334
add_box! (Phases, Temp, Grid2D; xlim= (- 800.0 ,0.0 ), zlim= (- 150.0 , 0.0 ), phase = lith, T= SpreadingRateTemp (SpreadingVel= v_spread_cm_yr));
335
335
336
- # Yet, now we add a trench as well.
336
+ # Yet, now we add a trench as well.
337
337
AgeTrench_Myrs = 800e3 / (v_spread_cm_yr/ 1e2 )/ 1e6 # plate age @ trench
338
338
339
339
# We want to add a smooth transition from a halfspace cooling thermal profile to a slab that is heated by the surrounding mantle below a decoupling depth `d_decoupling`.
340
340
T_slab = LinearWeightedTemperature ( F1= HalfspaceCoolingTemp (Age= AgeTrench_Myrs), F2= McKenzie_subducting_slab (Tsurface= 0 ,v_cm_yr= v_spread_cm_yr, Adiabat = 0.0 ), crit_dist= 600 )
341
341
342
- # # in this case, we have a more reasonable slab thickness:
343
- trench = Trench (Start= (0.0 ,- 100.0 ), End= (0.0 ,100.0 ), Thickness= 90.0 , θ_max= 30.0 , Length= 600 , Lb= 200 ,
342
+ # # in this case, we have a more reasonable slab thickness:
343
+ trench = Trench (Start= (0.0 ,- 100.0 ), End= (0.0 ,100.0 ), Thickness= 90.0 , θ_max= 30.0 , Length= 600 , Lb= 200 ,
344
344
WeakzoneThickness= 15 , WeakzonePhase= 6 , d_decoupling= 125 );
345
345
add_slab! (Phases, Temp, Grid2D, trench, phase = lith, T= T_slab);
346
346
347
347
# Lithosphere-asthenosphere boundary:
348
348
ind = findall (Temp .> 1250 .&& (Phases.== 2 .|| Phases.== 5 ));
349
349
Phases[ind] .= 0 ;
350
350
351
- @test sum (Temp) ≈ 8.292000736425713e7
351
+ @test sum (Temp) ≈ 8.292000736425713e7
352
352
@test extrema (Phases) == (0 , 6 )
353
353
# Grid2D = CartData(Grid2D.x.val,Grid2D.y.val,Grid2D.z.val, (;Phases, Temp))
354
354
# write_paraview(Grid2D,"Grid2D_SubductionCurvedOverriding");
355
355
356
+ # 2D volcano
357
+ nx,nz = 512 ,128
358
+ x = range (- 100e0 ,100e0 , nx);
359
+ z = range (- 60e0 ,5e0 , nz);
360
+ Grid2D = CartData (xyz_grid (x,0 ,z))
361
+ Phases = zeros (Int64, nx, 1 , nz);
362
+ Temp = fill (1350.0 , nx, 1 , nz);
363
+ lith = LithosphericPhases (Layers= [15 20 55 ], Phases= [3 4 5 ], Tlab= 1250 )
364
+
365
+ add_box! (Phases, Temp, Grid2D; xlim= (- 100.0 ,100.0 ), zlim= (- 60e0 , 0.0 ), phase = lith, T= HalfspaceCoolingTemp (Age= 80 ));
366
+
367
+ add_volcano! (Phases, Temp, Grid2D;
368
+ volcanic_phase = 1 ,
369
+ center = (mean (Grid2D. x. val), 0.0 ),
370
+ height = 3 ,
371
+ radius = 5 ,
372
+ base = 0.0 ,
373
+ background = nothing ,
374
+ T = HalfspaceCoolingTemp (Age= 20 )
375
+ )
376
+
377
+ @test any (Phases[256 ,1 ,:] .== 1 ) == true
378
+
379
+ # 3D volcano
380
+ # Create CartGrid struct
381
+ x = LinRange (0.0 ,100.0 ,64 );
382
+ y = LinRange (0.0 ,100.0 ,64 );
383
+ z = LinRange (- 60 ,5e0 ,64 );
384
+ Cart = CartData (xyz_grid (x, y, z));
385
+
386
+ # initialize phase and temperature matrix
387
+ Phase = zeros (Int32,size (Cart));
388
+ Temp = fill (1350.0 ,size (Cart));
389
+ lith = LithosphericPhases (Layers= [15 20 55 ], Phases= [3 4 5 ], Tlab= 1250 )
390
+
391
+ add_box! (Phase, Temp, Cart; xlim= (0.0 ,100.0 ),ylim= (0.0 ,100.0 ), zlim= (- 60.0 , 0.0 ), phase = lith, T= HalfspaceCoolingTemp (Age= 80 ));
392
+
393
+ add_volcano! (Phase, Temp, Cart;
394
+ volcanic_phase = 1 ,
395
+ center = (mean (Cart. x. val), mean (Cart. y. val), 0.0 ),
396
+ height = 3 ,
397
+ radius = 5 ,
398
+ base = 0.0 ,
399
+ background = nothing ,
400
+ T = HalfspaceCoolingTemp (Age= 20 )
401
+ )
402
+
403
+ @test any (Phase[32 ,32 ,:] .== 1 ) == true
404
+
405
+ # 3D fault
406
+ # Create CartGrid struct
407
+ x = LinRange (0.0 ,100.0 ,64 );
408
+ y = LinRange (0.0 ,100.0 ,64 );
409
+ z = LinRange (- 60 ,5e0 ,64 );
410
+ Cart = CartData (xyz_grid (x, y, z));
411
+
412
+ # initialize phase and temperature matrix
413
+ Phase = zeros (Int32,size (Cart));
414
+ Temp = fill (1350.0 ,size (Cart));
415
+ lith = LithosphericPhases (Layers= [15 20 55 ], Phases= [3 4 5 ], Tlab= 1250 )
356
416
417
+ add_box! (Phase, Temp, Cart; xlim= (0.0 ,100.0 ),ylim= (0.0 ,100.0 ), zlim= (- 60.0 , 0.0 ), phase = lith, T= HalfspaceCoolingTemp (Age= 80 ));
357
418
419
+ add_fault! (Phase, Temp, Cart;
420
+ Start= (0.0 ,0.0 ), End= (100 ,100 ),
421
+ Fault_thickness= 1.0 ,
422
+ Depth_extent= (- 30.0 , 0.0 ),
423
+ DipAngle= - 10e0 ,
424
+ phase= ConstantPhase (1 ),
425
+ T= ConstantTemp (1200 ),
426
+ )
358
427
428
+ @test any (Phase[32 ,32 ,:] .== 1 ) == true
429
+ @test any (Temp[32 ,32 ,:] .== 1200 ) == true
359
430
360
- # Q1Data
361
- Grid = Q1Data (xyz_grid (1.0 : 1 : 10.0 , 11.0 : 1 : 20.0 , - 20 : 1 : - 10 ))
431
+ # Q1Data
432
+ Grid = Q1Data (xyz_grid (1.0 : 1 : 10.0 , 11.0 : 1 : 20.0 , - 20 : 1 : - 10 ))
362
433
PhasesC = zeros (Int64,size (Grid)); # at cell
363
434
TempC = ones (Float64, size (Grid))* 1350 ;
364
435
PhasesV = zeros (Int64,size (Grid. x)); # at vertex
0 commit comments