Programming exercises and homework 239
Similar derivations can be made for other stress components (see Eqs. (12.32)–
(12.36)). Like in 2D models (Chapter 13,Eqs.(13.35)–(13.36)), the numerical
implementation of stress rotation is done by re-computing elastic stress components
stored at markers according to the first-order accurate scheme
σ
ij(rotated)
= σ
ij(m)
+ t
m
× ˙σ
ij(Jaumann)
= σ
ij(m)
+ t
m
(σ
ik
ω
kj
− ω
ik
σ
kj
), (15.53)
where σ
ij(m)
is the deviatoric stress component for a given marker, t
m
is the
marker displacement time step (Chapter 13)andω
kj
the rotation rate components
that are defined at the same nodal points and computed with similar FD schemes
as respective ˙ε
kj
=
1
2
∂v
k
∂x
j
+
∂v
j
∂x
k
strain rate components (see Figs. 15.1, 15.3)
and then interpolated to markers using standard interpolation formula (Eq. (15.15),
Fig. 15.8).
Numerical algorithms. Numerical algorithms for the thermomechanical codes
in 3D, do not differ from algorithms described in Chapters 11, 13 for 2D codes with
the exception that direct solvers for various equations should rather be substituted
by the iterative ones described above.
Programming exercises and homework
Exercise 15.1
Program solving the 3D temperature equation on a regular 51 ×51 ×51 grid based
on Gauss–Seidel iteration (Eqs. (15.17)–(15.22)). The model setup corresponds
to hot rectangular block (20 ×20 ×20 km, T = 1500 K, ρ = 3100 kg/m
3
, C
P
=
1500 J/K/kg, k =1 W/m/K) which is located in a colder medium (T =1000 K, ρ =
3000 kg/m
3
, C
P
= 1000 J/K/kg, k = 3 W/m/K). The block is located in the
middle of the model, which is 100 ×100 ×100 km in size. Boundary conditions
are insulating at all boundaries. Use the relaxation parameter θ
temperature
relaxation
= 1.25 in
Eq. (15.17). An example is in Temperature3D_Gauss_Seidel.m.
Exercise 15.2
Generalise Exercise 14.1 to 3D. Solve the Poisson equation for the case of a
spherical planetary body embedded in a mass less-like medium (Eqs. (15.23)–
(15.29), Fig. 14.7). The number of resolution levels = 4, the resolution on the
coarsest (last) grid =7 ×7 ×7 nodal points, and the factor of increase in resolution
between the levels = 2. All other model parameters and material properties are
the same as in the 2D exercise. Use a ghost node approach along the spherical
boundary surface for the gravity potential in the same way as in 2D (Fig. 14.7,
Eqs. (14.13)–(14.16)), i.e. independently in x, y and z directions. An example is in
Poisson3D_Multigrid_planet_arbitrary.m.