Skip to content

Commit

Permalink
Add test cases for cookbooks
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldouglas92 committed Jun 5, 2024
1 parent 2f941b3 commit fbb4a4d
Show file tree
Hide file tree
Showing 8 changed files with 322 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set End time = 2e6
set Surface pressure = 1e9
set Maximum time step = 1000
set Use operator splitting = true
set Output directory = output-coupled-two-phase-tian-parameterization-kinematic-slab
set Output directory = output_coupled_two_phase_tian_parameterization_kinematic_slab

# Checkpoint the model so that a restart can be done if needed.
subsection Checkpointing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

include $ASPECT_SOURCE_DIR/cookbooks/tian_parameterization_kinematic_slab/coupled-two-phase-tian-parameterization-kinematic-slab.prm

set Output directory = output-uncoupled-two-phase-tian-parameterization-kinematic-slab
set Output directory = output_uncoupled_two_phase_tian_parameterization_kinematic_slab

subsection Stokes solver parameters
# Lower solver tolerance to improve efficiency. Since the problem is simpler (i.e
Expand Down
47 changes: 47 additions & 0 deletions tests/coupled_two_phase_tian_parameterization_kinematic_slab.prm
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This test is for the fully coupled Simplified Subduction Model with Parameterized
# Solid-Fluid Reactions cookbook. It also doubles as a test for the min/max
# compaction viscosity.

include $ASPECT_SOURCE_DIR/cookbooks/tian_parameterization_kinematic_slab/coupled-two-phase-tian-parameterization-kinematic-slab.prm
set Adiabatic surface temperature = 1600
set Nonlinear solver scheme = single Advection, single Stokes
set End time = 2000

subsection Mesh refinement
set Initial global refinement = 1
subsection Minimum refinement function
set Function expression = 1
end
end

# Slightly change composition model to ensure that there is bound_fluid
# and porosity at the end of the test.
subsection Boundary composition model
set Fixed composition boundary indicators = left
set List of model names = function
subsection Function
set Function constants = initial_porosity=0, initial_bound_sed=0.03, initial_bound_MORB=0.02, initial_bound_gabbro=0.01, \
sediment_min=0, sediment_max=5e3, MORB_min=5e3, MORB_max=12e3, gabbro_min=12e3, gabbro_max=20e3, \
onset_time=0, slab_thickness=20e3
set Function expression = initial_porosity; \
if( t<=onset_time, 0, \
if( (y<=slab_thickness - sediment_min) & (y>slab_thickness - sediment_max), initial_bound_sed, \
if( (y<=slab_thickness - MORB_min) & (y>slab_thickness - MORB_max), initial_bound_MORB, \
if( (y<=slab_thickness - gabbro_min) & (y>slab_thickness - gabbro_max), initial_bound_gabbro, 0.0)))); \
if(y>slab_thickness, 1, 0); \
if(y<=8e3, 1, 0); \
if(y>8e3 & y<=15e3, 1, 0); \
if(y>15e3 & y<=slab_thickness, 1, 0)
end
end

subsection Material model
subsection Reactive Fluid Transport Model
set Minimum compaction viscosity = 1e18
set Maximum compaction viscosity = 1e21
end
end

subsection Postprocess
set List of postprocessors = composition statistics
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

Number of active cells: 16 (on 2 levels)
Number of degrees of freedom: 989 (162+73+162+25+81+81+81+81+81+81+81)

*** Timestep 0: t=0 years, dt=0 years
Solving temperature system... 0 iterations.
Skipping porosity composition solve because RHS is zero.
Skipping bound_fluid composition solve because RHS is zero.
Solving peridotite system ... 0 iterations.
Skipping gabbro composition solve because RHS is zero.
Skipping MORB composition solve because RHS is zero.
Skipping sediment composition solve because RHS is zero.
Rebuilding Stokes preconditioner...
Solving Stokes system... 20+0 iterations.
Solving fluid velocity system... 1 iterations.

Skipping mesh refinement, because the mesh did not change.

*** Timestep 0: t=0 years, dt=0 years
Solving temperature system... 0 iterations.
Skipping porosity composition solve because RHS is zero.
Skipping bound_fluid composition solve because RHS is zero.
Solving peridotite system ... 0 iterations.
Skipping gabbro composition solve because RHS is zero.
Skipping MORB composition solve because RHS is zero.
Skipping sediment composition solve because RHS is zero.
Rebuilding Stokes preconditioner...
Solving Stokes system... 20+0 iterations.
Solving fluid velocity system... 1 iterations.

Postprocessing:
Compositions min/max/mass: 0/0/0 // 0/0/0 // 0/1/9.913e+09 // 0/0/0 // 0/0/0 // 0/0/0

*** Timestep 1: t=1000 years, dt=1000 years
Solving composition reactions... in 10 substep(s).
Solving temperature system... 8 iterations.
Skipping porosity composition solve because RHS is zero.
Solving bound_fluid system ... 11 iterations.
Solving peridotite system ... 8 iterations.
Solving gabbro system ... 10 iterations.
Solving MORB system ... 11 iterations.
Skipping sediment composition solve because RHS is zero.
Rebuilding Stokes preconditioner...
Solving Stokes system... 15+0 iterations.
Solving fluid velocity system... 1 iterations.

Postprocessing:
Compositions min/max/mass: 0/0/0 // -0.002633/0.02/1.037e+06 // 0/1.008/9.91e+09 // -0.1319/1/1.296e+07 // -0.1316/1/5.185e+07 // 0/0/0

*** Timestep 2: t=2000 years, dt=1000 years
Solving composition reactions... in 10 substep(s).
Solving temperature system... 7 iterations.
Solving porosity system ... 10 iterations.
Solving bound_fluid system ... 11 iterations.
Solving peridotite system ... 7 iterations.
Solving gabbro system ... 10 iterations.
Solving MORB system ... 11 iterations.
Skipping sediment composition solve because RHS is zero.
Rebuilding Stokes preconditioner...
Solving Stokes system... 14+0 iterations.
Solving fluid velocity system... 1 iterations.

Postprocessing:
Compositions min/max/mass: -1.366e-07/4.974e-05/8415 // -0.002346/0.02/1.083e+06 // 0/1.016/9.907e+09 // -0.1179/1/1.364e+07 // -0.1173/1/5.457e+07 // 0/0/0

Number of active cells: 25 (on 3 levels)
Number of degrees of freedom: 1,570 (258+113+258+38+129+129+129+129+129+129+129)

Termination requested by criterion: end time




Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 1: Time step number
# 2: Time (years)
# 3: Time step size (years)
# 4: Number of mesh cells
# 5: Number of Stokes degrees of freedom
# 6: Number of temperature degrees of freedom
# 7: Number of degrees of freedom for all compositions
# 8: Iterations for temperature solver
# 9: Iterations for composition solver 1
# 10: Iterations for composition solver 2
# 11: Iterations for composition solver 3
# 12: Iterations for composition solver 4
# 13: Iterations for composition solver 5
# 14: Iterations for composition solver 6
# 15: Iterations for Stokes solver
# 16: Velocity iterations in Stokes preconditioner
# 17: Schur complement iterations in Stokes preconditioner
# 18: Minimal value for composition porosity
# 19: Maximal value for composition porosity
# 20: Global mass for composition porosity
# 21: Minimal value for composition bound_fluid
# 22: Maximal value for composition bound_fluid
# 23: Global mass for composition bound_fluid
# 24: Minimal value for composition peridotite
# 25: Maximal value for composition peridotite
# 26: Global mass for composition peridotite
# 27: Minimal value for composition gabbro
# 28: Maximal value for composition gabbro
# 29: Global mass for composition gabbro
# 30: Minimal value for composition MORB
# 31: Maximal value for composition MORB
# 32: Global mass for composition MORB
# 33: Minimal value for composition sediment
# 34: Maximal value for composition sediment
# 35: Global mass for composition sediment
0 0.000000000000e+00 0.000000000000e+00 16 187 81 486 0 0 0 0 0 0 0 19 21 147 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.00000000e+00 9.91319444e+09 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
1 1.000000000000e+03 1.000000000000e+03 16 187 81 486 8 0 11 8 10 11 0 14 16 112 0.00000000e+00 0.00000000e+00 0.00000000e+00 -2.63283793e-03 2.00000000e-02 1.03697004e+06 0.00000000e+00 1.00805359e+00 9.91030530e+09 -1.31885601e-01 1.00000000e+00 1.29620901e+07 -1.31641896e-01 1.00000000e+00 5.18485022e+07 0.00000000e+00 0.00000000e+00 0.00000000e+00
2 2.000000000000e+03 1.000000000000e+03 16 187 81 486 7 10 11 7 10 11 0 13 15 105 -1.36607082e-07 4.97421161e-05 8.41496117e+03 -2.34636340e-03 2.00000000e-02 1.08300325e+06 0.00000000e+00 1.01562005e+00 9.90743059e+09 -1.17891953e-01 1.00000000e+00 1.36420430e+07 -1.17303171e-01 1.00000000e+00 5.45709132e+07 0.00000000e+00 0.00000000e+00 0.00000000e+00
55 changes: 55 additions & 0 deletions tests/uncoupled_two_phase_tian_parameterization_kinematic_slab.prm
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This test is for the fully coupled Simplified Subduction Model with Parameterized
# Solid-Fluid Reactions cookbook. It also doubles as a test for the min/max
# compaction viscosity.

include $ASPECT_SOURCE_DIR/cookbooks/tian_parameterization_kinematic_slab/coupled-two-phase-tian-parameterization-kinematic-slab.prm
set Adiabatic surface temperature = 1600
set Nonlinear solver scheme = single Advection, single Stokes
set End time = 2000

subsection Mesh refinement
set Initial global refinement = 1
subsection Minimum refinement function
set Function expression = 1
end
end

subsection Compositional fields
set Compositional field methods = darcy field, field, field, field, field, field
end

# Slightly change composition model to ensure that there is bound_fluid
# and porosity at the end of the test.
subsection Boundary composition model
set Fixed composition boundary indicators = left
set List of model names = function
subsection Function
set Function constants = initial_porosity=0, initial_bound_sed=0.03, initial_bound_MORB=0.02, initial_bound_gabbro=0.01, \
sediment_min=0, sediment_max=5e3, MORB_min=5e3, MORB_max=12e3, gabbro_min=12e3, gabbro_max=20e3, \
onset_time=0, slab_thickness=20e3
set Function expression = initial_porosity; \
if( t<=onset_time, 0, \
if( (y<=slab_thickness - sediment_min) & (y>slab_thickness - sediment_max), initial_bound_sed, \
if( (y<=slab_thickness - MORB_min) & (y>slab_thickness - MORB_max), initial_bound_MORB, \
if( (y<=slab_thickness - gabbro_min) & (y>slab_thickness - gabbro_max), initial_bound_gabbro, 0.0)))); \
if(y>slab_thickness, 1, 0); \
if(y<=8e3, 1, 0); \
if(y>8e3 & y<=15e3, 1, 0); \
if(y>15e3 & y<=slab_thickness, 1, 0)
end
end

subsection Material model
subsection Reactive Fluid Transport Model
set Minimum compaction viscosity = 1e18
set Maximum compaction viscosity = 1e21
end
end

subsection Melt settings
set Include melt transport = false
end

subsection Postprocess
set List of postprocessors = composition statistics
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

Number of active cells: 16 (on 2 levels)
Number of degrees of freedom: 754 (162+25+81+81+81+81+81+81+81)

*** Timestep 0: t=0 years, dt=0 years
Solving temperature system... 0 iterations.
Skipping porosity composition solve because RHS is zero.
Skipping bound_fluid composition solve because RHS is zero.
Solving peridotite system ... 0 iterations.
Skipping gabbro composition solve because RHS is zero.
Skipping MORB composition solve because RHS is zero.
Skipping sediment composition solve because RHS is zero.
Rebuilding Stokes preconditioner...
Solving Stokes system... 33+0 iterations.

Skipping mesh refinement, because the mesh did not change.

*** Timestep 0: t=0 years, dt=0 years
Solving temperature system... 0 iterations.
Skipping porosity composition solve because RHS is zero.
Skipping bound_fluid composition solve because RHS is zero.
Solving peridotite system ... 0 iterations.
Skipping gabbro composition solve because RHS is zero.
Skipping MORB composition solve because RHS is zero.
Skipping sediment composition solve because RHS is zero.
Rebuilding Stokes preconditioner...
Solving Stokes system... 33+0 iterations.

Postprocessing:
Compositions min/max/mass: 0/0/0 // 0/0/0 // 0/1/9.913e+09 // 0/0/0 // 0/0/0 // 0/0/0

*** Timestep 1: t=1000 years, dt=1000 years
Solving composition reactions... in 10 substep(s).
Solving temperature system... 8 iterations.
Skipping porosity composition solve because RHS is zero.
Solving bound_fluid system ... 11 iterations.
Solving peridotite system ... 8 iterations.
Solving gabbro system ... 10 iterations.
Solving MORB system ... 11 iterations.
Skipping sediment composition solve because RHS is zero.
Rebuilding Stokes preconditioner...
Solving Stokes system... 23+0 iterations.

Postprocessing:
Compositions min/max/mass: 0/0/0 // -0.002639/0.02/1.036e+06 // 0/1.008/9.91e+09 // -0.1322/1/1.295e+07 // -0.1319/1/5.179e+07 // 0/0/0

*** Timestep 2: t=2000 years, dt=1000 years
Solving composition reactions... in 10 substep(s).
Solving temperature system... 7 iterations.
Solving porosity system ... 10 iterations.
Solving bound_fluid system ... 11 iterations.
Solving peridotite system ... 7 iterations.
Solving gabbro system ... 10 iterations.
Solving MORB system ... 11 iterations.
Skipping sediment composition solve because RHS is zero.
Rebuilding Stokes preconditioner...
Solving Stokes system... 22+0 iterations.

Postprocessing:
Compositions min/max/mass: -1.355e-07/4.983e-05/8426 // -0.002357/0.02/1.081e+06 // 0/1.015/9.908e+09 // -0.1184/1/1.362e+07 // -0.1178/1/5.446e+07 // 0/0/0

Number of active cells: 25 (on 3 levels)
Number of degrees of freedom: 1,199 (258+38+129+129+129+129+129+129+129)

Termination requested by criterion: end time




Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 1: Time step number
# 2: Time (years)
# 3: Time step size (years)
# 4: Number of mesh cells
# 5: Number of Stokes degrees of freedom
# 6: Number of temperature degrees of freedom
# 7: Number of degrees of freedom for all compositions
# 8: Iterations for temperature solver
# 9: Iterations for composition solver 1
# 10: Iterations for composition solver 2
# 11: Iterations for composition solver 3
# 12: Iterations for composition solver 4
# 13: Iterations for composition solver 5
# 14: Iterations for composition solver 6
# 15: Iterations for Stokes solver
# 16: Velocity iterations in Stokes preconditioner
# 17: Schur complement iterations in Stokes preconditioner
# 18: Minimal value for composition porosity
# 19: Maximal value for composition porosity
# 20: Global mass for composition porosity
# 21: Minimal value for composition bound_fluid
# 22: Maximal value for composition bound_fluid
# 23: Global mass for composition bound_fluid
# 24: Minimal value for composition peridotite
# 25: Maximal value for composition peridotite
# 26: Global mass for composition peridotite
# 27: Minimal value for composition gabbro
# 28: Maximal value for composition gabbro
# 29: Global mass for composition gabbro
# 30: Minimal value for composition MORB
# 31: Maximal value for composition MORB
# 32: Global mass for composition MORB
# 33: Minimal value for composition sediment
# 34: Maximal value for composition sediment
# 35: Global mass for composition sediment
0 0.000000000000e+00 0.000000000000e+00 16 187 81 486 0 0 0 0 0 0 0 32 34 68 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 1.00000000e+00 9.91319444e+09 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
1 1.000000000000e+03 1.000000000000e+03 16 187 81 486 8 0 11 8 10 11 0 22 24 49 0.00000000e+00 0.00000000e+00 0.00000000e+00 -2.63897272e-03 2.00000000e-02 1.03573618e+06 0.00000000e+00 1.00792232e+00 9.91036714e+09 -1.32154382e-01 1.00000000e+00 1.29474543e+07 -1.31948636e-01 1.00000000e+00 5.17868088e+07 0.00000000e+00 0.00000000e+00 0.00000000e+00
2 2.000000000000e+03 1.000000000000e+03 16 187 81 486 7 10 11 7 10 11 0 21 23 49 -1.35538213e-07 4.98262779e-05 8.42600735e+03 -2.35715286e-03 2.00000000e-02 1.08075722e+06 0.00000000e+00 1.01539290e+00 9.90754232e+09 -1.18366167e-01 1.00000000e+00 1.36157275e+07 -1.17842891e-01 1.00000000e+00 5.44591625e+07 0.00000000e+00 0.00000000e+00 0.00000000e+00

0 comments on commit fbb4a4d

Please sign in to comment.