Skip to content

Commit 22de7e6

Browse files
committed
Update equation and test
1 parent 5667fbd commit 22de7e6

File tree

5 files changed

+84
-9
lines changed

5 files changed

+84
-9
lines changed

cookbooks/CPO_induced_anisotropic_viscosity/plugin/cpo_induced_anisotropic_viscosity.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,10 @@ namespace aspect
339339

340340
const Tensor<2,dim> S_CPO= R * stress * transpose(R);
341341

342-
double Jhill = 1./2. * (F*Utilities::fixed_power<2>(S_CPO[1][1]-S_CPO[2][2]) + G*Utilities::fixed_power<2>(S_CPO[2][2]-S_CPO[0][0]) + H*Utilities::fixed_power<2>(S_CPO[0][0]-S_CPO[1][1]) + 2*L*Utilities::fixed_power<2>(S_CPO[1][2]) + 2*M*Utilities::fixed_power<2>(S_CPO[0][2]) + 2*N*Utilities::fixed_power<2>(S_CPO[0][1]));
342+
double Jhill = 2./3. * (F*Utilities::fixed_power<2>(S_CPO[1][1]-S_CPO[2][2]) + G*Utilities::fixed_power<2>(S_CPO[2][2]-S_CPO[0][0]) + H*Utilities::fixed_power<2>(S_CPO[0][0]-S_CPO[1][1]) + 2*L*Utilities::fixed_power<2>(S_CPO[1][2]) + 2*M*Utilities::fixed_power<2>(S_CPO[0][2]) + 2*N*Utilities::fixed_power<2>(S_CPO[0][1]));
343343
if (Jhill < 0)
344344
{
345-
Jhill = 1./2. * (std::abs(F)*Utilities::fixed_power<2>(S_CPO[1][1]-S_CPO[2][2]) + std::abs(G)*Utilities::fixed_power<2>(S_CPO[2][2]-S_CPO[0][0]) + std::abs(H)*Utilities::fixed_power<2>(S_CPO[0][0]-S_CPO[1][1]) + 2*L*Utilities::fixed_power<2>(S_CPO[1][2]) + 2*M*Utilities::fixed_power<2>(S_CPO[0][2]) + 2*N*Utilities::fixed_power<2>(S_CPO[0][1]));
345+
Jhill = 2./3. * (std::abs(F)*Utilities::fixed_power<2>(S_CPO[1][1]-S_CPO[2][2]) + std::abs(G)*Utilities::fixed_power<2>(S_CPO[2][2]-S_CPO[0][0]) + std::abs(H)*Utilities::fixed_power<2>(S_CPO[0][0]-S_CPO[1][1]) + 2*L*Utilities::fixed_power<2>(S_CPO[1][2]) + 2*M*Utilities::fixed_power<2>(S_CPO[0][2]) + 2*N*Utilities::fixed_power<2>(S_CPO[0][1]));
346346
}
347347

348348
AssertThrow(std::isfinite(Jhill),

cookbooks/CPO_induced_anisotropic_viscosity/shearbox_cpo_av.prm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set Dimension = 3
1010
set Pressure normalization = surface
1111
set Surface pressure = 0
1212
set Nonlinear solver scheme = single Advection, single Stokes
13-
set End time = 0.1
13+
set End time = 0.5
1414
set Use years instead of seconds = false
1515
set Output directory = output_Shearbox_CPO_AV
1616

@@ -119,7 +119,7 @@ subsection Postprocess
119119

120120
subsection Visualization
121121
set Time between graphical output = 0.1
122-
set List of output variables = material properties, strain rate, named additional outputs, shear stress, stress
122+
set List of output variables = material properties, strain rate, named additional outputs, shear stress, stress, Anisotropic stress
123123

124124
subsection Material properties
125125
set List of material properties = density, viscosity

tests/cpo_induced_anisotropic_viscosity.prm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include $ASPECT_SOURCE_DIR/cookbooks/CPO_induced_anisotropic_viscosity/shearbox_cpo_av.prm
22
set Additional shared libraries = ./libCPO_induced_anisotropic_viscosity.debug.so
33

4-
set End time = 0
4+
set End time = 0.5
55

66
subsection Particles
77
subsection Generator

tests/cpo_induced_anisotropic_viscosity/screen-output

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Loading shared library <./libcpo_induced_anisotropic_viscosity.debug.so>
2+
Loading shared library <./libcpo_induced_anisotropic_viscosity.release.so>
33

44
Number of active cells: 1 (on 1 levels)
55
Number of degrees of freedom: 494 (81+8+27+27+27+27+27+27+27+27+27+27+27+27+27+27+27)
@@ -9,15 +9,85 @@ Number of degrees of freedom: 494 (81+8+27+27+27+27+27+27+27+27+27+27+27+27+27+2
99
Advecting particles... done.
1010
Copying properties into prescribed compositional field scalar_viscosity... done.
1111
Rebuilding Stokes preconditioner...
12-
Solving Stokes system (AMG)... 9+0 iterations.
12+
Solving Stokes system (AMG)... 4+0 iterations.
1313

1414
Postprocessing:
15-
RMS, max velocity: 0.772 m/s, 0.972 m/s
15+
RMS, max velocity: 0.289 m/s, 0.5 m/s
1616
Compositions min/max/mass: 1e+09/1e+09/1e+09 // 5.276/5.276/5.276 // 0.5203/0.5203/0.5203 // 0.3479/0.3479/0.3479 // 0.1318/0.1318/0.1318 // 1.736/1.736/1.736 // 0.5743/0.5743/0.5743 // 0.3808/0.3808/0.3808 // 0.04489/0.04489/0.04489 // 5.435/5.435/5.435 // 0.6079/0.6079/0.6079 // 0.3106/0.3106/0.3106 // 0.08157/0.08157/0.08157 // 0/0/0
1717
Writing graphical output: output-cpo_induced_anisotropic_viscosity/solution/solution-00000
1818
Writing particle output: output-cpo_induced_anisotropic_viscosity/particles/particles-00000
1919
Writing particle cpo output: output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00000
2020

21+
*** Timestep 1: t=0.1 seconds, dt=0.1 seconds
22+
Solving temperature system... 0 iterations.
23+
Advecting particles... done.
24+
Copying properties into prescribed compositional field scalar_viscosity... done.
25+
Rebuilding Stokes preconditioner...
26+
Solving Stokes system (AMG)... 9+0 iterations.
27+
28+
Postprocessing:
29+
RMS, max velocity: 0.289 m/s, 0.5 m/s
30+
Compositions min/max/mass: 1.864e+07/1.864e+07/1.864e+07 // 4.654/4.654/4.654 // 0.6551/0.6551/0.6551 // 0.2233/0.2233/0.2233 // 0.1217/0.1217/0.1217 // 2.055/2.055/2.055 // 0.5386/0.5386/0.5386 // 0.4457/0.4457/0.4457 // 0.01567/0.01567/0.01567 // 0.08621/0.08621/0.08621 // 0.4653/0.4653/0.4653 // 0.3568/0.3568/0.3568 // 0.1779/0.1779/0.1779 // 0/0/0
31+
Writing graphical output: output-cpo_induced_anisotropic_viscosity/solution/solution-00001
32+
Writing particle output: output-cpo_induced_anisotropic_viscosity/particles/particles-00001
33+
Writing particle cpo output: output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00001
34+
35+
*** Timestep 2: t=0.2 seconds, dt=0.1 seconds
36+
Solving temperature system... 0 iterations.
37+
Advecting particles... done.
38+
Copying properties into prescribed compositional field scalar_viscosity... done.
39+
Rebuilding Stokes preconditioner...
40+
Solving Stokes system (AMG)... 13+0 iterations.
41+
42+
Postprocessing:
43+
RMS, max velocity: 0.289 m/s, 0.5 m/s
44+
Compositions min/max/mass: 1.635e+07/1.635e+07/1.635e+07 // 4.682/4.682/4.682 // 0.687/0.687/0.687 // 0.2543/0.2543/0.2543 // 0.05866/0.05866/0.05866 // 1.956/1.956/1.956 // 0.6427/0.6427/0.6427 // 0.318/0.318/0.318 // 0.03931/0.03931/0.03931 // 0.2642/0.2642/0.2642 // 0.5393/0.5393/0.5393 // 0.2979/0.2979/0.2979 // 0.1628/0.1628/0.1628 // 0/0/0
45+
Writing graphical output: output-cpo_induced_anisotropic_viscosity/solution/solution-00002
46+
Writing particle output: output-cpo_induced_anisotropic_viscosity/particles/particles-00002
47+
Writing particle cpo output: output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00002
48+
49+
*** Timestep 3: t=0.3 seconds, dt=0.1 seconds
50+
Solving temperature system... 0 iterations.
51+
Advecting particles... done.
52+
Copying properties into prescribed compositional field scalar_viscosity... done.
53+
Rebuilding Stokes preconditioner...
54+
Solving Stokes system (AMG)... 7+0 iterations.
55+
56+
Postprocessing:
57+
RMS, max velocity: 0.289 m/s, 0.5 m/s
58+
Compositions min/max/mass: 1.636e+07/1.637e+07/1.637e+07 // 4.901/4.901/4.901 // 0.5217/0.5217/0.5217 // 0.3452/0.3452/0.3452 // 0.1331/0.1331/0.1331 // 1.327/1.327/1.327 // 0.507/0.507/0.507 // 0.4874/0.4874/0.4874 // 0.005555/0.005555/0.005555 // 6.167/6.167/6.167 // 0.8138/0.8138/0.8138 // 0.165/0.165/0.165 // 0.02117/0.02117/0.02117 // 0/0/0
59+
Writing graphical output: output-cpo_induced_anisotropic_viscosity/solution/solution-00003
60+
Writing particle output: output-cpo_induced_anisotropic_viscosity/particles/particles-00003
61+
Writing particle cpo output: output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00003
62+
63+
*** Timestep 4: t=0.4 seconds, dt=0.1 seconds
64+
Solving temperature system... 0 iterations.
65+
Advecting particles... done.
66+
Copying properties into prescribed compositional field scalar_viscosity... done.
67+
Rebuilding Stokes preconditioner...
68+
Solving Stokes system (AMG)... 6+0 iterations.
69+
70+
Postprocessing:
71+
RMS, max velocity: 0.289 m/s, 0.5 m/s
72+
Compositions min/max/mass: 1.814e+07/1.814e+07/1.814e+07 // 5.401/5.401/5.401 // 0.5239/0.5239/0.5239 // 0.3726/0.3726/0.3726 // 0.1035/0.1035/0.1035 // 2.101/2.101/2.101 // 0.5855/0.5855/0.5855 // 0.3469/0.3469/0.3469 // 0.06767/0.06767/0.06767 // 4.669/4.669/4.669 // 0.674/0.674/0.674 // 0.1845/0.1845/0.1845 // 0.1415/0.1415/0.1415 // 0/0/0
73+
Writing graphical output: output-cpo_induced_anisotropic_viscosity/solution/solution-00004
74+
Writing particle output: output-cpo_induced_anisotropic_viscosity/particles/particles-00004
75+
Writing particle cpo output: output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00004
76+
77+
*** Timestep 5: t=0.5 seconds, dt=0.1 seconds
78+
Solving temperature system... 0 iterations.
79+
Advecting particles... done.
80+
Copying properties into prescribed compositional field scalar_viscosity... done.
81+
Rebuilding Stokes preconditioner...
82+
Solving Stokes system (AMG)... 6+0 iterations.
83+
84+
Postprocessing:
85+
RMS, max velocity: 0.289 m/s, 0.5 m/s
86+
Compositions min/max/mass: 1.758e+07/1.758e+07/1.758e+07 // 4.104/4.104/4.104 // 0.7394/0.7394/0.7394 // 0.1602/0.1602/0.1602 // 0.1004/0.1004/0.1004 // 1.107/1.107/1.107 // 0.5986/0.5986/0.5986 // 0.3103/0.3103/0.3103 // 0.09108/0.09108/0.09108 // 6.233/6.233/6.233 // 0.563/0.563/0.563 // 0.2924/0.2924/0.2924 // 0.1446/0.1446/0.1446 // 0/0/0
87+
Writing graphical output: output-cpo_induced_anisotropic_viscosity/solution/solution-00005
88+
Writing particle output: output-cpo_induced_anisotropic_viscosity/particles/particles-00005
89+
Writing particle cpo output: output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00005
90+
2191
Termination requested by criterion: end time
2292

2393

tests/cpo_induced_anisotropic_viscosity/statistics

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,9 @@
5959
# 59: Number of advected particles
6060
# 60: Particle file name
6161
# 61: Particle CPO file name
62-
0 0.000000000000e+00 0.000000000000e+00 1 89 27 378 0 0 0 9 9 9 7.72321167e-01 9.72325063e-01 1.00000000e+09 1.00000000e+09 1.00000000e+09 5.27630079e+00 5.27630079e+00 5.27630079e+00 5.20309402e-01 5.20309402e-01 5.20309402e-01 3.47923711e-01 3.47923711e-01 3.47923711e-01 1.31766887e-01 1.31766887e-01 1.31766887e-01 1.73622715e+00 1.73622715e+00 1.73622715e+00 5.74325744e-01 5.74325744e-01 5.74325744e-01 3.80780388e-01 3.80780388e-01 3.80780388e-01 4.48938682e-02 4.48938682e-02 4.48938682e-02 5.43504380e+00 5.43504380e+00 5.43504380e+00 6.07858069e-01 6.07858069e-01 6.07858069e-01 3.10569263e-01 3.10569263e-01 3.10569263e-01 8.15726682e-02 8.15726682e-02 8.15726682e-02 0.00000000e+00 0.00000000e+00 0.00000000e+00 output-cpo_induced_anisotropic_viscosity/solution/solution-00000 1 output-cpo_induced_anisotropic_viscosity/particles/particles-00000 output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00000
62+
0 0.000000000000e+00 0.000000000000e+00 1 89 27 378 0 0 0 4 4 4 2.88675135e-01 5.00000000e-01 1.00000000e+09 1.00000000e+09 1.00000000e+09 5.27630079e+00 5.27630079e+00 5.27630079e+00 5.20309402e-01 5.20309402e-01 5.20309402e-01 3.47923711e-01 3.47923711e-01 3.47923711e-01 1.31766887e-01 1.31766887e-01 1.31766887e-01 1.73622715e+00 1.73622715e+00 1.73622715e+00 5.74325744e-01 5.74325744e-01 5.74325744e-01 3.80780388e-01 3.80780388e-01 3.80780388e-01 4.48938682e-02 4.48938682e-02 4.48938682e-02 5.43504380e+00 5.43504380e+00 5.43504380e+00 6.07858069e-01 6.07858069e-01 6.07858069e-01 3.10569263e-01 3.10569263e-01 3.10569263e-01 8.15726682e-02 8.15726682e-02 8.15726682e-02 0.00000000e+00 0.00000000e+00 0.00000000e+00 output-cpo_induced_anisotropic_viscosity/solution/solution-00000 1 output-cpo_induced_anisotropic_viscosity/particles/particles-00000 output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00000
63+
1 1.000000000000e-01 1.000000000000e-01 1 89 27 378 0 0 0 9 9 9 2.88675135e-01 5.00000000e-01 1.86352107e+07 1.86352107e+07 1.86352107e+07 4.65379362e+00 4.65379362e+00 4.65379362e+00 6.55064477e-01 6.55064477e-01 6.55064477e-01 2.23254860e-01 2.23254860e-01 2.23254860e-01 1.21680662e-01 1.21680662e-01 1.21680662e-01 2.05523620e+00 2.05523620e+00 2.05523620e+00 5.38639659e-01 5.38639659e-01 5.38639659e-01 4.45692291e-01 4.45692291e-01 4.45692291e-01 1.56680496e-02 1.56680496e-02 1.56680496e-02 8.62077695e-02 8.62077695e-02 8.62077695e-02 4.65288335e-01 4.65288335e-01 4.65288335e-01 3.56763907e-01 3.56763907e-01 3.56763907e-01 1.77947758e-01 1.77947758e-01 1.77947758e-01 0.00000000e+00 0.00000000e+00 0.00000000e+00 output-cpo_induced_anisotropic_viscosity/solution/solution-00001 1 output-cpo_induced_anisotropic_viscosity/particles/particles-00001 output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00001
64+
2 2.000000000000e-01 1.000000000000e-01 1 89 27 378 0 0 0 13 13 13 2.88675135e-01 5.00000000e-01 1.63538553e+07 1.63538557e+07 1.63538555e+07 4.68191169e+00 4.68191169e+00 4.68191169e+00 6.86995446e-01 6.86995446e-01 6.86995446e-01 2.54340432e-01 2.54340432e-01 2.54340432e-01 5.86641214e-02 5.86641214e-02 5.86641214e-02 1.95593521e+00 1.95593521e+00 1.95593521e+00 6.42677563e-01 6.42677563e-01 6.42677563e-01 3.18014417e-01 3.18014417e-01 3.18014417e-01 3.93080207e-02 3.93080207e-02 3.93080207e-02 2.64223298e-01 2.64223298e-01 2.64223298e-01 5.39265192e-01 5.39265192e-01 5.39265192e-01 2.97927889e-01 2.97927889e-01 2.97927889e-01 1.62806919e-01 1.62806919e-01 1.62806919e-01 0.00000000e+00 0.00000000e+00 0.00000000e+00 output-cpo_induced_anisotropic_viscosity/solution/solution-00002 1 output-cpo_induced_anisotropic_viscosity/particles/particles-00002 output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00002
65+
3 3.000000000000e-01 1.000000000000e-01 1 89 27 378 0 0 0 7 7 7 2.88675135e-01 5.00000000e-01 1.63648179e+07 1.63660690e+07 1.63654434e+07 4.90124042e+00 4.90124042e+00 4.90124042e+00 5.21650669e-01 5.21650669e-01 5.21650669e-01 3.45223725e-01 3.45223725e-01 3.45223725e-01 1.33125606e-01 1.33125606e-01 1.33125606e-01 1.32703227e+00 1.32703227e+00 1.32703227e+00 5.07011584e-01 5.07011584e-01 5.07011584e-01 4.87433154e-01 4.87433154e-01 4.87433154e-01 5.55526238e-03 5.55526238e-03 5.55526238e-03 6.16742540e+00 6.16742540e+00 6.16742540e+00 8.13791350e-01 8.13791350e-01 8.13791350e-01 1.65040519e-01 1.65040519e-01 1.65040519e-01 2.11681311e-02 2.11681311e-02 2.11681311e-02 0.00000000e+00 0.00000000e+00 0.00000000e+00 output-cpo_induced_anisotropic_viscosity/solution/solution-00003 1 output-cpo_induced_anisotropic_viscosity/particles/particles-00003 output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00003
66+
4 4.000000000000e-01 1.000000000000e-01 1 89 27 378 0 0 0 6 6 6 2.88675135e-01 5.00000000e-01 1.81430453e+07 1.81430495e+07 1.81430474e+07 5.40122005e+00 5.40122005e+00 5.40122005e+00 5.23943612e-01 5.23943612e-01 5.23943612e-01 3.72586477e-01 3.72586477e-01 3.72586477e-01 1.03469912e-01 1.03469912e-01 1.03469912e-01 2.10070182e+00 2.10070182e+00 2.10070182e+00 5.85454430e-01 5.85454430e-01 5.85454430e-01 3.46873102e-01 3.46873102e-01 3.46873102e-01 6.76724685e-02 6.76724685e-02 6.76724685e-02 4.66879242e+00 4.66879242e+00 4.66879242e+00 6.73983116e-01 6.73983116e-01 6.73983116e-01 1.84471150e-01 1.84471150e-01 1.84471150e-01 1.41545734e-01 1.41545734e-01 1.41545734e-01 0.00000000e+00 0.00000000e+00 0.00000000e+00 output-cpo_induced_anisotropic_viscosity/solution/solution-00004 1 output-cpo_induced_anisotropic_viscosity/particles/particles-00004 output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00004
67+
5 5.000000000000e-01 1.000000000000e-01 1 89 27 378 0 0 0 6 6 6 2.88675135e-01 5.00000000e-01 1.75833622e+07 1.75833623e+07 1.75833622e+07 4.10371973e+00 4.10371973e+00 4.10371973e+00 7.39363795e-01 7.39363795e-01 7.39363795e-01 1.60220058e-01 1.60220058e-01 1.60220058e-01 1.00416147e-01 1.00416147e-01 1.00416147e-01 1.10714450e+00 1.10714450e+00 1.10714450e+00 5.98598415e-01 5.98598415e-01 5.98598415e-01 3.10324521e-01 3.10324521e-01 3.10324521e-01 9.10770642e-02 9.10770642e-02 9.10770642e-02 6.23337747e+00 6.23337747e+00 6.23337747e+00 5.63042860e-01 5.63042860e-01 5.63042860e-01 2.92401912e-01 2.92401912e-01 2.92401912e-01 1.44555227e-01 1.44555227e-01 1.44555227e-01 0.00000000e+00 0.00000000e+00 0.00000000e+00 output-cpo_induced_anisotropic_viscosity/solution/solution-00005 1 output-cpo_induced_anisotropic_viscosity/particles/particles-00005 output-cpo_induced_anisotropic_viscosity/particles_cpo/CPO-00005

0 commit comments

Comments
 (0)