Skip to content

Commit bbc33b5

Browse files
committed
Renaming AV, update doc, and update test
1 parent 8ff2627 commit bbc33b5

File tree

10 files changed

+261
-218
lines changed

10 files changed

+261
-218
lines changed

cookbooks/CPO_induced_anisotropic_viscosity/doc/CPO_induced_anisotropic_viscosity.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,33 @@ This cookbook explains how to use the CPO-induced anisotropic viscosity material
77

88
## Introduction
99

10-
Individual crystals of the mineral olivine reorganized their orientations into the crystal-preferred orientations (CPO) under deformation. The directional-dependence (anisotropy) in the viscous properties of olivine crystals suggests that the effective viscosity for olivine rocks/aggregates is different when deformations occur in different directions relative to the CPO. This CPO-induced anisotropic viscosity material model computes anisotropic viscosity based on the CPO evolution predicted by D-Rex ({cite}`fraters_billen_2021_cpo`; {cite}`kaminski2004`) and modifies the subsequent deformation.
10+
Individual crystals of the mineral olivine reorganize their orientations into the crystal-preferred orientations (CPO) under deformation. The viscous properties of olivine crystals are direction-dependent (anisotropic), which suggests that the effective viscosity for olivine rocks/aggregates is different when deformations occur in different directions relative to the CPO. This cookbook model computes an anisotropic viscosity based on the CPO evolution predicted by D-Rex ({cite}`fraters_billen_2021_cpo`; {cite}`kaminski2004`) and includes this information in the subsequent modeling process.
1111

1212
Our constitutive equation for the relationship between the strain rate and stress using the anisotropic viscosity tensor is adapted from {cite:t}`signorelli:etal:2021`:
1313

1414
```{math}
15-
:label: eqn:one
15+
:label: eqn:anisotropic_general_stress
1616
\dot{\varepsilon}_{ij} = \gamma J(\sigma_{ij})^{(n-1)} A_{ij} \sigma_{ij}
1717
```
1818

1919
where $\gamma$ is the part of fluidity (the inverse of viscosity) which is temperature- and grain-size dependent:
2020

2121
```{math}
22-
:label: eqn:two
22+
:label: eqn:fluidity
2323
\gamma=\gamma_0 exp \left(\frac{-Q}{RT} \right) /d^m
2424
```
2525

2626
$\gamma_0=1.1\times 10^{5}$ is the isotropic fluidity, $Q=530$ $kJ/mol$ is the activation energy, $R=8.314 m^3 \cdot Pa \cdot K^{−1} \cdot$ $mol^{−1}$ is the gas constant, $d=0.001$ $m$ is the grain size, and $m=0.73$ is the grain size exponent. These values for olivine are taken from rock experiments performed by {cite:t}`hansen:etal:2016` and {cite:t}`HK04`. $J(\sigma_{ij})$ is the equivalent yield stress, where $\sigma_{ij}$ is the deviatoric (anisotropic) stress computed using the tensorial and scalar component of the anisotropic viscosity:
2727

2828
```{math}
29-
:label: eqn:three
29+
:label: eqn:equivalent_yield_stress
3030
J(\sigma_{ij})=(F(\sigma_{11} - \sigma_{22})^2+G(\sigma_{22} - \sigma_{33})^2+H(\sigma_{33} - \sigma_{11})^2+2L\sigma_{23}^2+2M\sigma_{13}^2+2N\sigma_{12}^2)^{1/2}
3131
```
3232

3333
and $A_{ij}$ is the anisotropic tensor of fluidity in Kelvin notation:
3434

3535
```{math}
36-
:label: eqn:four
36+
:label: eqn:anisotropic_fluidity
3737
A_{ij}=\frac{2}{3} \left[
3838
\begin{matrix}
3939
F+H & -F & -H & 0 & 0 & 0 \\
@@ -47,17 +47,17 @@ F+H & -F & -H & 0 & 0 & 0 \\
4747

4848
$J(\sigma_{ij})$ and $A_{ij}$ are computed using Hill coefficients $H, J, K, L, M,$ and $N$ {cite}`hill:1948`, which are obtained from regression analysis of a texture database constructed with olivine textures from laboratory experiments, shear box models, and subduction models (Kiraly et al., in rev.).
4949

50-
In this material model plugin, strain rate, density, temperature, and other parameters are taken as input to compute the viscosity, which is passed into the Stokes system to compute the stress. As a result, we adapt {math:numref}`eqn:one` to be:
50+
In this material model plugin, strain rate, density, temperature, and other parameters are taken as input to compute the anisotropic viscosity, which is passed into the Stokes system to compute the stress. As a result, we adapt {math:numref}`eqn:anisotropic_general_stress` to be:
5151

5252
```{math}
53-
:label: eqn:five
54-
\sigma_{ij} = \frac{1}{\gamma J(\sigma_{ij})^{(n-1)}} * inv(A_{ij}) * \dot\varepsilon_{ij}
53+
:label: eqn:anisotropic_stress
54+
\sigma_{ij} = \frac{1}{\gamma J(\sigma_{ij})^{(n-1)}} * A_{ij}^{-1} * \dot\varepsilon_{ij}
5555
```
5656

57-
Since the Hill coefficients are defined in the microscopic CPO reference frame, and parameters computed in ASPECT are in the macroscopic model reference frame, several reference frame conversions are needed. First, we need to rotate $\sigma_{ij}$ in {math:numref}`eqn:three` from the model reference frame to the CPO reference frame so that $J(\sigma_{ij})$ is in the CPO reference frame. This is achieved by constructing a matrix from the eigenvectors corresponding with the largest eigenvalues of the covariance matrix for the a-, b-, and c-axis of olivine textures and then we assign the nearest orthogonal matrix to be the rotation matrix R:
57+
Since the Hill coefficients are defined in the microscopic CPO reference frame, and parameters computed in ASPECT are in the macroscopic model reference frame, several reference frame conversions are needed. First, we need to rotate $\sigma_{ij}$ in {math:numref}`eqn:equivalent_yield_stress` from the model reference frame to the CPO reference frame so that $J(\sigma_{ij})$ is in the CPO reference frame. This is achieved by constructing a matrix from the eigenvectors corresponding with the largest eigenvalues of the covariance matrix for the a-, b-, and c-axis of olivine textures and then we assign the nearest orthogonal matrix to be the rotation matrix R:
5858

5959
```{math}
60-
:label: eqn:six
60+
:label: eqn:rotation_matrix
6161
R = \left[
6262
\begin{matrix}
6363
\verb|max_eigenvector|\_{a1} & \verb|max_eigenvector|\_{b1} & \verb|max_eigenvector|\_{c1} \\
@@ -68,10 +68,10 @@ R = \left[
6868

6969
We compute the rotation matrix R on the particles and further convert it to Euler angles for computation and memory efficiency. These properties need to be interpolated from particles to fields to be used in the material model. As a result, the anisotropic viscosity material model requires at least one particle in each cell so that all cells can have the texture parameters (Euler angles and eigenvalues) for constructing the rotation matrix R and compute the Hill coefficients. In the material model, the interpolated Euler angles are converted to the rotation matrix again. We use the same notation R to describe the rotation matrix used in the material model in the following paragraphs.
7070

71-
The inverse of the A tensor then needs to be rotated to the model reference frame. Since $inv(A)$ is the Kelvin notation of the rank-4 tensor, we apply the Kelvin notation representation of the R rotation matrix, $R_K$, on $inv(A_{ij})$:
71+
The inverse of the A tensor then needs to be rotated to the model reference frame. Since $A_{ij}^{-1}$ is the Kelvin notation of the rank-4 tensor, we apply the Kelvin notation representation of the R rotation matrix, $R_K$, on $A_{ij}^{-1}$:
7272

7373
```{math}
74-
:label: eqn:seven
74+
:label: eqn:rotation_matrix_kelvin
7575
R_K = \left[
7676
\begin{matrix}
7777
R_{11}^2 & R_{12}^2 & R_{13}^2 & \sqrt2* R_{12}* R_{13} & \sqrt2* R_{11}* R_{13} & \sqrt2* R_{11}* R_{12} \\
@@ -86,19 +86,19 @@ R_{31}^2 & R_{32}^2 & R_{33}^2 & \sqrt2* R_{32}* R_{33} & \sqrt2* R_{31}* R_{33}
8686
The final equation involving all reference frame conversions is:
8787

8888
```{math}
89-
:label: eqn:eight
90-
\sigma_{ij} = \frac{1}{\gamma J(R\prime*\sigma_{ij}* R)^{(n-1)}} * (R_K * inv(A_{ij}) * R_K\prime) * \dot\varepsilon_i
89+
:label: eqn:anisotropic_stress_final
90+
\sigma_{ij} = \frac{1}{\gamma J(R'*\sigma_{ij}* R)^{(n-1)}} * (R_K * A_{ij}^{-1} * R_K') * \dot\varepsilon_i
9191
```
9292

93-
We save $\frac{1}{\gamma J(R\prime*\sigma_{ij}* R)^{(n-1)}}$ as the material model viscosity output, which we call the scalar viscosity. The tensorial part of anisotropic viscosity, $R_K * inv(A_{ij}) * R_K\prime$ is called the stress-strain director and is stored in the additional outputs. Due to the dependence of the scalar viscosity on stress and the stress is determined by the scalar viscosity from the previous time step, the computation of the scalar viscosity is not stable and its value naturally fluctuates up and down. This fluctuation ultimately causes a numerical instability associated with the prediction of the anisotropic viscosity. Therefore, we damp the scalar viscosity using a non-linear Newtonian iteration, and in each iteration, only half of the change in the scalar viscosity is applied until the result is stable.
93+
$R'$ and $R_K'$ is the transpose of matrix $R$ and $R_K$ respectively. We save $\frac{1}{\gamma J(R'*\sigma_{ij}* R)^{(n-1)}}$ as the material model viscosity output, which we call the scalar viscosity. The tensorial part of anisotropic viscosity, $R_K * A_{ij}^{-1} * R_K'$ is called the stress-strain director and is stored in the additional outputs. Due to the dependence of the scalar viscosity on stress and the stress is determined by the scalar viscosity from the previous time step, the computation of the scalar viscosity is not stable and its value naturally oscillates. This fluctuation ultimately causes a numerical instability associated with the prediction of the anisotropic viscosity. Therefore, we damp the scalar viscosity using a non-linear Newton iteration, and in each iteration, only half of the change in the scalar viscosity is applied until the result is stable.
9494

9595

9696

9797
## Compiling requirement
9898

99-
Since the determinant of $A_{ij}$ is 0, $A_{ij}$ is a singular, non-invertible matrix. We find the MoorePenrose pseudoinverse of the matrix $A_{ij}$ as an approximate of the inverse of $A_{ij}$, using the SCALAPACK package in deal.ii. Thus it is required to link ASPECT with a deal.ii version with the scalapack package included and you can turn on the scalapack package when compiling deal.ii, for example, with `./candi.sh -j 8 --packages="p4est trilinos sundials scalapack dealii"`.
99+
Since the determinant of $A_{ij}$ is 0, $A_{ij}$ is a singular, non-invertible matrix. We find the MoorePenrose pseudoinverse of the matrix $A_{ij}$ as an approximate of the inverse of $A_{ij}$, using the SCALAPACK package provided in deal.II. Thus it is required to link ASPECT with a deal.II version with the scalapack package included in order to run this cookbook. When using candi you can enable the scalapack package by including `scalapack` in the list of installed packages or uncommenting the line in `candi.cfg` that corresponds to the scalapack installation. Alternatively, you can install ScaLAPACK yourself and enable the configuration variable `DEAL_II_WITH_SCALAPACK` during the cmake configuration of deal.II.
100100

101-
## Input
101+
## Model setup
102102

103103
The usage of the AV material model is demonstrated with a 3d simple shear box model, where its dimension is $1 \times 1 \times 1 $ (non-dimensionalized). The shear strain rate is set to
104104
$0.5$. The origin is the center of the box, and one Olivine particle with 1000 grains sits at the origin to track CPO developments for computation of anisotropic viscosity parameters.
@@ -123,3 +123,6 @@ Note: These settings are similar to those used for simulations involving CPO alo
123123
```
124124

125125
In the `CPO induced Anisotropic Viscosity` material model subsection, all parameters have reasonable default values and do not need to be manually specified unless customization is needed.
126+
127+
The output includes a particle property, anisotropic stress, which is a 3-by-3 matrix that can be visualized as a tensor, showing the components of the stress tensor. As a result of using the anisotropic viscosity material model, the components will be different in different directions.
128+

cookbooks/CPO_induced_anisotropic_viscosity/plugin/anisotropic_stress.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ namespace aspect
3030
namespace VisualizationPostprocessors
3131
{
3232
template <int dim>
33-
AnisoStress<dim>::
34-
AnisoStress ()
33+
AnisotropicStress<dim>::
34+
AnisotropicStress ()
3535
:
3636
DataPostprocessorTensor<dim> ("anisotropic_stress",
3737
update_values | update_gradients | update_quadrature_points),
@@ -42,7 +42,7 @@ namespace aspect
4242

4343
template <int dim>
4444
void
45-
AnisoStress<dim>::
45+
AnisotropicStress<dim>::
4646
evaluate_vector_field(const DataPostprocessorInputs::Vector<dim> &input_data,
4747
std::vector<Vector<double>> &computed_quantities) const
4848
{
@@ -59,7 +59,7 @@ namespace aspect
5959
this->get_material_model().create_additional_named_outputs(out);
6060
this->get_material_model().evaluate(in, out);
6161

62-
const std::shared_ptr<MaterialModel::AV<dim>> anisotropic_viscosity = out.template get_additional_output_object<MaterialModel::AV<dim>>();
62+
const std::shared_ptr<MaterialModel::AnisotropicViscosity<dim>> anisotropic_viscosity = out.template get_additional_output_object<MaterialModel::AnisotropicViscosity<dim>>();
6363
AssertThrow(anisotropic_viscosity != nullptr,
6464
ExcMessage("Need anisotropic viscosity tensor from the anisotropic viscosity material model for computing the anisotropic stress."));
6565

@@ -93,7 +93,7 @@ namespace aspect
9393

9494
template <int dim>
9595
void
96-
AnisoStress<dim>::
96+
AnisotropicStress<dim>::
9797
create_additional_material_model_outputs(MaterialModel::MaterialModelOutputs<dim> &out) const
9898
{
9999
this->get_material_model().create_additional_named_outputs(out);
@@ -110,7 +110,7 @@ namespace aspect
110110
{
111111
namespace VisualizationPostprocessors
112112
{
113-
ASPECT_REGISTER_VISUALIZATION_POSTPROCESSOR(AnisoStress,
113+
ASPECT_REGISTER_VISUALIZATION_POSTPROCESSOR(AnisotropicStress,
114114
"Anisotropic stress",
115115
"A visualization output object that generates output "
116116
"for the 6 (in 3d) components of the shear stress "

cookbooks/CPO_induced_anisotropic_viscosity/plugin/anisotropic_stress.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace aspect
5050
* base class. See there for their meaning.
5151
*/
5252
template <int dim>
53-
class AnisoStress
53+
class AnisotropicStress
5454
: public DataPostprocessorTensor<dim>,
5555
public SimulatorAccess<dim>,
5656
public Interface<dim>
@@ -59,11 +59,12 @@ namespace aspect
5959
/**
6060
* Constructor.
6161
*/
62-
AnisoStress ();
62+
AnisotropicStress ();
6363

6464
void
6565
evaluate_vector_field(const DataPostprocessorInputs::Vector<dim> &input_data,
6666
std::vector<Vector<double>> &computed_quantities) const override;
67+
6768
void
6869
create_additional_material_model_outputs(MaterialModel::MaterialModelOutputs<dim> &out) const;
6970
};

0 commit comments

Comments
 (0)