|
| 1 | +# Step 2: Magma inflation with evolution of porosity |
| 2 | + |
| 3 | +```{include} step02_inflation_statevars-synopsis.md |
| 4 | +``` |
| 5 | + |
| 6 | +## Simulation parameters |
| 7 | + |
| 8 | +We extend the simulation in Step 1 by including evolution of the porosity, which depends on the time derivative of the pressure and trace strain. |
| 9 | +We also compute the deformation relative to a uniform reference compressive pressure of 5 MPa to illustrate how to use a reference state with poroelasticity. |
| 10 | +We use the same initial conditions and boundary conditions as in Step 1. |
| 11 | + |
| 12 | +Because the evolution of porosity depends on the time derivative of the solution subfields, we need to include the time derivatives in the solution field. |
| 13 | +As a result, we have 6 subfields in our solution field. |
| 14 | + |
| 15 | +```{code-block} cfg |
| 16 | +--- |
| 17 | +caption: Solution subfields for Step 2. |
| 18 | +--- |
| 19 | +# Poroelasticity with porosity state variable requires solution with time derivatives |
| 20 | +solution = pylith.problems.SolnDispPresTracStrainVelPdotTdot |
| 21 | +
|
| 22 | +# Set basis order for all solution subfields |
| 23 | +[pylithapp.problem.solution.subfields] |
| 24 | +displacement.basis_order = 2 |
| 25 | +pressure.basis_order = 1 |
| 26 | +trace_strain.basis_order = 1 |
| 27 | +velocity.basis_order = 2 |
| 28 | +pressure_t.basis_order = 1 |
| 29 | +trace_strain_t.basis_order = 1 |
| 30 | +``` |
| 31 | + |
| 32 | +```{code-block} cfg |
| 33 | +--- |
| 34 | +caption: Material parameters for poroelasticity with state variables and reference state for Step 2. |
| 35 | +--- |
| 36 | +[pylithapp.problem.materials.crust] |
| 37 | +use_state_variables = True |
| 38 | +
|
| 39 | +db_auxiliary_field.values = [ |
| 40 | + solid_density, fluid_density, fluid_viscosity, porosity, shear_modulus, drained_bulk_modulus, biot_coefficient, fluid_bulk_modulus, solid_bulk_modulus, isotropic_permeability, |
| 41 | + reference_stress_xx, reference_stress_yy, reference_stress_zz, reference_stress_xy, |
| 42 | + reference_strain_xx, reference_strain_yy, reference_strain_zz, reference_strain_xy |
| 43 | + ] |
| 44 | +db_auxiliary_field.data = [ |
| 45 | + 2500*kg/m**3, 1000*kg/m**3, 0.001*Pa*s, 0.01, 6.0*GPa, 10.0*GPa, 1.0, 2.0*GPa, 20.0*GPa, 1e-15*m**2, |
| 46 | + -5.0*MPa, -5.0*MPa, -5.0*MPa, 0.0*MPa, |
| 47 | + 0.0, 0.0, 0.0, 0.0 |
| 48 | + ] |
| 49 | +
|
| 50 | +auxiliary_subfields.porosity.basis_order = 1 |
| 51 | +
|
| 52 | +[pylithapp.problem.materials.crust.bulk_rheology] |
| 53 | +use_reference_state = True |
| 54 | +
|
| 55 | +
|
| 56 | +[pylithapp.problem.materials.intrusion] |
| 57 | +use_state_variables = True |
| 58 | +
|
| 59 | +db_auxiliary_field.values = [ |
| 60 | + solid_density, fluid_density, fluid_viscosity, porosity, shear_modulus, drained_bulk_modulus, biot_coefficient, fluid_bulk_modulus, solid_bulk_modulus, isotropic_permeability, |
| 61 | + reference_stress_xx, reference_stress_yy, reference_stress_zz, reference_stress_xy, |
| 62 | + reference_strain_xx, reference_strain_yy, reference_strain_zz, reference_strain_xy |
| 63 | + ] |
| 64 | +db_auxiliary_field.data = [ |
| 65 | + 2500*kg/m**3, 1000*kg/m**3, 0.001*Pa*s, 0.1, 6.0*GPa, 10.0*GPa, 0.8, 2.0*GPa, 20.0*GPa, 1e-13*m**2, |
| 66 | + -5.0*MPa, -5.0*MPa, -5.0*MPa, 0.0*Pa, |
| 67 | + 0.0, 0.0, 0.0, 0.0 |
| 68 | + ] |
| 69 | +
|
| 70 | +auxiliary_subfields.porosity.basis_order = 1 |
| 71 | +
|
| 72 | +[pylithapp.problem.materials.intrusion.bulk_rheology] |
| 73 | +use_reference_state = True |
| 74 | +``` |
| 75 | + |
| 76 | +## Running the simulation |
| 77 | + |
| 78 | +```{code-block} console |
| 79 | +--- |
| 80 | +caption: Run Step 2 simulation |
| 81 | +--- |
| 82 | +$ pylith step02_inflation.cfg |
| 83 | +
|
| 84 | +# The output should look something like the following. |
| 85 | +
|
| 86 | + >> /Users/baagaard/software/unix/py310-venv/pylith-debug/lib/python3.10/site-packages/pylith/apps/PyLithApp.py:84:main |
| 87 | + -- pylithapp(info) |
| 88 | + -- Running on 1 process(es). |
| 89 | + >> /Users/baagaard/software/unix/py310-venv/pylith-debug/lib/python3.10/site-packages/pylith/meshio/MeshIOObj.py:43:read |
| 90 | + -- meshiocubit(info) |
| 91 | + -- Reading finite-element mesh |
| 92 | + >> /Users/baagaard/src/cig/pylith/libsrc/pylith/meshio/MeshIOCubit.cc:156:void pylith::meshio::MeshIOCubit::_readVertices(ExodusII &, scalar_array *, int *, int *) const |
| 93 | + -- meshiocubit(info) |
| 94 | + -- Component 'reader': Reading 747 vertices. |
| 95 | +
|
| 96 | +# -- many lines omitted -- |
| 97 | +
|
| 98 | + >> /Users/baagaard/software/unix/py310-venv/pylith-debug/lib/python3.10/site-packages/pylith/problems/TimeDependent.py:137:run |
| 99 | + -- timedependent(info) |
| 100 | + -- Solving problem. |
| 101 | +0 TS dt 1. time -1. |
| 102 | + 0 SNES Function norm 7.521665654021e-01 |
| 103 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 104 | + 1 SNES Function norm 5.516056137722e-02 |
| 105 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 106 | + 2 SNES Function norm 1.166275103468e-02 |
| 107 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 108 | + 3 SNES Function norm 3.829709526109e-03 |
| 109 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 110 | + 4 SNES Function norm 1.461994548486e-03 |
| 111 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 112 | + 5 SNES Function norm 6.066575419934e-04 |
| 113 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 114 | + 6 SNES Function norm 2.655403615568e-04 |
| 115 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 116 | + 7 SNES Function norm 1.202717080189e-04 |
| 117 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 118 | + 8 SNES Function norm 5.567347859811e-05 |
| 119 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 120 | + 9 SNES Function norm 2.613778728633e-05 |
| 121 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 122 | + 10 SNES Function norm 1.238875375025e-05 |
| 123 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 124 | + 11 SNES Function norm 5.911640181274e-06 |
| 125 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 126 | + 12 SNES Function norm 2.834946322421e-06 |
| 127 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 128 | + 13 SNES Function norm 1.364700102970e-06 |
| 129 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 130 | + 14 SNES Function norm 6.589360471852e-07 |
| 131 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 132 | + 15 SNES Function norm 3.189484959867e-07 |
| 133 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 134 | + 16 SNES Function norm 1.547003895237e-07 |
| 135 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 136 | + 17 SNES Function norm 7.516606485367e-08 |
| 137 | + Linear solve converged due to CONVERGED_ATOL iterations 0 |
| 138 | + 18 SNES Function norm 3.657704494472e-08 |
| 139 | + Linear solve converged due to CONVERGED_ATOL iterations 0 |
| 140 | + 19 SNES Function norm 1.782258437327e-08 |
| 141 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 142 | + 20 SNES Function norm 8.694405655955e-09 |
| 143 | + Linear solve converged due to CONVERGED_ATOL iterations 0 |
| 144 | + 21 SNES Function norm 4.245852416264e-09 |
| 145 | + Nonlinear solve converged due to CONVERGED_SNORM_RELATIVE iterations 21 |
| 146 | +1 TS dt 1. time 0. |
| 147 | + 0 SNES Function norm 1.826079838384e+01 |
| 148 | + Linear solve converged due to CONVERGED_ATOL iterations 31 |
| 149 | + 1 SNES Function norm 4.299962863814e-02 |
| 150 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 151 | + 2 SNES Function norm 6.431697063491e-03 |
| 152 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 153 | + 3 SNES Function norm 1.639359669638e-03 |
| 154 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 155 | + 4 SNES Function norm 5.026774903429e-04 |
| 156 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 157 | + 5 SNES Function norm 1.680648206351e-04 |
| 158 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 159 | + 6 SNES Function norm 5.967136123324e-05 |
| 160 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 161 | + 7 SNES Function norm 2.230420331383e-05 |
| 162 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 163 | + 8 SNES Function norm 8.721830601750e-06 |
| 164 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 165 | + 9 SNES Function norm 3.542878294948e-06 |
| 166 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 167 | + 10 SNES Function norm 1.484027205445e-06 |
| 168 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 169 | + 11 SNES Function norm 6.368036188603e-07 |
| 170 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 171 | + 12 SNES Function norm 2.784493002713e-07 |
| 172 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 173 | + 13 SNES Function norm 1.235724894148e-07 |
| 174 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 175 | + 14 SNES Function norm 5.549400015107e-08 |
| 176 | + Linear solve converged due to CONVERGED_ATOL iterations 0 |
| 177 | + 15 SNES Function norm 2.516326072475e-08 |
| 178 | + Linear solve converged due to CONVERGED_ATOL iterations 0 |
| 179 | + 16 SNES Function norm 1.150182762543e-08 |
| 180 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 181 | + 17 SNES Function norm 5.293129922422e-09 |
| 182 | + Nonlinear solve converged due to CONVERGED_SNORM_RELATIVE iterations 17 |
| 183 | +
|
| 184 | +# -- many lines omitted -- |
| 185 | +
|
| 186 | +50 TS dt 1. time 49. |
| 187 | + 0 SNES Function norm 1.583816680399e-01 |
| 188 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 189 | + 1 SNES Function norm 3.297785796277e-05 |
| 190 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 191 | + 2 SNES Function norm 1.625267288996e-05 |
| 192 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 193 | + 3 SNES Function norm 8.011050419800e-06 |
| 194 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 195 | + 4 SNES Function norm 3.949253118601e-06 |
| 196 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 197 | + 5 SNES Function norm 1.947152025331e-06 |
| 198 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 199 | + 6 SNES Function norm 9.601580478216e-07 |
| 200 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 201 | + 7 SNES Function norm 4.735242133215e-07 |
| 202 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 203 | + 8 SNES Function norm 2.335591654437e-07 |
| 204 | + Linear solve converged due to CONVERGED_ATOL iterations 1 |
| 205 | + 9 SNES Function norm 1.152140892580e-07 |
| 206 | + Linear solve converged due to CONVERGED_ATOL iterations 0 |
| 207 | + 10 SNES Function norm 5.684167635325e-08 |
| 208 | + Linear solve converged due to CONVERGED_ATOL iterations 0 |
| 209 | + 11 SNES Function norm 2.804655474534e-08 |
| 210 | + Linear solve converged due to CONVERGED_ATOL iterations 0 |
| 211 | + 12 SNES Function norm 1.384019346908e-08 |
| 212 | + Linear solve converged due to CONVERGED_ATOL iterations 0 |
| 213 | + 13 SNES Function norm 6.830511841192e-09 |
| 214 | + Nonlinear solve converged due to CONVERGED_SNORM_RELATIVE iterations 13 |
| 215 | +51 TS dt 1. time 50. |
| 216 | + >> /Users/baagaard/software/unix/py310-venv/pylith-debug/lib/python3.10/site-packages/pylith/problems/Problem.py:204:finalize |
| 217 | + -- timedependent(info) |
| 218 | + -- Finalizing problem. |
| 219 | +
|
| 220 | +
|
| 221 | +``` |
| 222 | + |
| 223 | +In contrast with Step 1, the evolution of porosity in Step 2 results in nonlinear governing equations. |
| 224 | +This requires multiple iterations of the linear solve for the nonlinear solver to converge. |
| 225 | + |
| 226 | +## Visualizing the results |
| 227 | + |
| 228 | +In {numref}`fig:example:magma:2d:step02:solution` we use ParaView to visualize the evolution of the y displacement component using the `viz/plot_dispwarp.py` Python script. |
| 229 | +First, we start ParaView from the `examples/magma-2d` directory. |
| 230 | + |
| 231 | +```{code-block} console |
| 232 | +--- |
| 233 | +caption: Open ParaView using the command line. |
| 234 | +--- |
| 235 | +$ PATH_TO_PARAVIEW/paraview |
| 236 | +
|
| 237 | +# For macOS, it will be something like |
| 238 | +$ /Applications/ParaView-5.10.1.app/Contents/MacOS/paraview |
| 239 | +``` |
| 240 | + |
| 241 | +Next, we override the default name of the simulation file with the name of the current simulation. |
| 242 | + |
| 243 | +```{code-block} python |
| 244 | +--- |
| 245 | +caption: Set the simulation in the ParaView Python Shell. |
| 246 | +--- |
| 247 | +>>> SIM = "step02_inflation_statevars" |
| 248 | +``` |
| 249 | + |
| 250 | +Next we run the `viz/plot_dispwarp.py` Python script as described in {ref}`sec-paraview-python-scripts`. |
| 251 | + |
| 252 | +:::{figure-md} fig:example:magma:2d:step02:solution |
| 253 | +<img src="figs/step02-solution.*" alt="Solution for Step 2 at t=100 yr. The colors indicate the fluid pressure, and the deformation is exaggerated by a factor of 1000." width="75%"/> |
| 254 | + |
| 255 | +Solution for Step 2 at t=100 yr. |
| 256 | +The colors of the shaded surface indicate the fluid pressure, and the deformation is exaggerated by a factor of 1000. |
| 257 | +The reference state gives rise to greater vertical deformation compared to Step 1. |
| 258 | +The choice of material properties does not lead to significant changes in porosity in either material during the simulation (not shown in the figure). |
| 259 | +::: |
0 commit comments