Skip to content

Commit

Permalink
Merge pull request #6129 from danieldouglas92/fix_units_in_darcy_velo…
Browse files Browse the repository at this point in the history
…city_viz

Fix the units for the darcy velocity postprocessor
  • Loading branch information
gassmoeller authored Nov 8, 2024
2 parents d8fb091 + 7fa2dc0 commit 0b4a5c0
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 106 deletions.
6 changes: 3 additions & 3 deletions source/postprocess/visualization/darcy_velocity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ namespace aspect
const double fluid_density = fluid_out->fluid_densities[q];
const double permeability = fluid_out->permeabilities[q];
const Tensor<1,dim> solid_velocity = in.velocity[q];
const Tensor<1,dim> darcy_velocity = solid_velocity -
permeability / fluid_viscosity / porosity * gravity *
(solid_density - fluid_density) * velocity_scaling_factor;
const Tensor<1,dim> darcy_velocity = (solid_velocity -
permeability / fluid_viscosity / porosity * gravity *
(solid_density - fluid_density)) * velocity_scaling_factor;

for (unsigned int k=0; k<dim; ++k)
computed_quantities[q](k) = darcy_velocity[k];
Expand Down
23 changes: 14 additions & 9 deletions tests/darcy_convection_step.prm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# u_f = u_s - K_D / phi * (rho_s * g - rho_f * g)
# u_f = fluid velocity # m/yr
# u_s = solid velocity # m/yr
# K_D = Darcy Coefficient = k / eta_f
# K_D = Darcy Coefficient # m3 s / kg
# k = permeability # m2 / s
# eta_f = fluid viscosity # Pa s
# phi = porosity
Expand All @@ -23,12 +23,14 @@
# Where k_0 is the reference permeability. The test is a 10 km x 10 km 2D
# box with a uniform porosity of 0.02 (2%) everywhere. The fluid has a
# density of 1000 kg/m3, and a viscosity of 10 Pa s, and the solid has a
# density of 3000 kg/m3 and a uniform velocity of 0 m/yr. The reference
# pemeability is 1e-6, and gravity is set to -10. This results in a fluid
# velocity of 24.25 m/yr. The mesh is 2.5 km x 2.5 km, and with CFL = 1,
# this means that the time step should be 2500 m / 24.25 m/yr = 103.11
# density of 3000 kg/m3 with an x velocity of 0.001 m/yr and a y velocity of
# 0.75 m/yr. The reference pemeability is 1e-6, and gravity is set to -10.
# This results in a fluid velocity of ~24.9958 m/yr in the y direction, and
# 0.001 m/yr in the x direction The mesh is 2.5 km x 2.5 km, and with CFL = 1,
# this means that the first time step should be 2500 m / 24.9958 m/yr = 100.017 yr.
# This also serves as a test for the 'darcy velocity' postprocessor, by
# confirming that the darcy velocity is 24.25 m/yr.
# confirming that the darcy velocity is 24.9958 m/yr in the y direction, and
# 0.001 m/yr in the x direction.
############### Global parameters

set Dimension = 2
Expand Down Expand Up @@ -75,9 +77,13 @@ subsection Boundary temperature model
end
end

# Free slip boundary on all sides
# Prescribe a solid x velocity of 0.001 m/yr and a solid
# y velocity of 0.75 m/yr.
subsection Boundary velocity model
set Tangential velocity boundary indicators = left, right, top, bottom
set Prescribed velocity boundary indicators = top: function, bottom: function, left: function, right: function
subsection Function
set Function expression = 0.001;0.75
end
end

# porosity and bound_fluid are required compositional fields when
Expand Down Expand Up @@ -132,7 +138,6 @@ subsection Material model
# Set the solid density to 3000 kg/m3, and set the minimum/maximum viscosity
# to 1e21 Pa s for an isoviscous model.
subsection Visco Plastic
set Reference temperature = 1600
set Prefactors for diffusion creep = 5e-21
set Viscous flow law = diffusion
set Densities = 3000
Expand Down
44 changes: 0 additions & 44 deletions tests/darcy_convection_step/log.txt

This file was deleted.

37 changes: 26 additions & 11 deletions tests/darcy_convection_step/screen-output
Original file line number Diff line number Diff line change
@@ -1,44 +1,59 @@
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------

-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Number of active cells: 4 (on 2 levels)
Number of degrees of freedom: 134 (50+9+25+25+25)

*** Timestep 0: t=0 years, dt=0 years
Solving temperature system... 0 iterations.
Solving porosity system ... 0 iterations.
Skipping bound_fluid composition solve because RHS is zero.
Solving Stokes system (GMG)... 7+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 6.2054e-17, 1.34414e-16, 0, 5.09696e-16
Relative nonlinear residual (total system) after nonlinear iteration 1: 5.09696e-16
Solving Stokes system (GMG)... 6+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 6.2054e-17, 1.34414e-16, 0, 1.00007
Relative nonlinear residual (total system) after nonlinear iteration 1: 1.00007


WARNING: The nonlinear solver in the current timestep failed to converge.
Acting according to the parameter 'Nonlinear solver failure strategy'...
Continuing to the next timestep even though solution is not fully converged.
Postprocessing:
Writing graphical output: output-darcy_convection_step/solution/solution-00000

*** Timestep 1: t=103.11 years, dt=103.11 years
*** Timestep 1: t=100.017 years, dt=100.017 years
Solving composition reactions... in 1 substep(s).
Solving temperature system... 0 iterations.
Solving porosity system ... 0 iterations.
Skipping bound_fluid composition solve because RHS is zero.
Solving Stokes system (GMG)... 6+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 3.51395e-16, 1.5726e-16, 0, 2.2185e-16
Relative nonlinear residual (total system) after nonlinear iteration 1: 3.51395e-16
Solving Stokes system (GMG)... 0+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 1.24886e-16, 1.30786e-16, 0, 1.54323e-08
Relative nonlinear residual (total system) after nonlinear iteration 1: 1.54323e-08


Postprocessing:

*** Timestep 2: t=200 years, dt=96.8895 years
*** Timestep 2: t=200 years, dt=99.9833 years
Solving composition reactions... in 1 substep(s).
Solving temperature system... 0 iterations.
Solving porosity system ... 0 iterations.
Skipping bound_fluid composition solve because RHS is zero.
Solving Stokes system (GMG)... 7+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 1.14854e-16, 1.32969e-16, 0, 3.48944e-16
Relative nonlinear residual (total system) after nonlinear iteration 1: 3.48944e-16
Solving Stokes system (GMG)... 0+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 1.5766e-16, 4.62514e-16, 0, 1.54323e-08
Relative nonlinear residual (total system) after nonlinear iteration 1: 1.54323e-08


Postprocessing:

Termination requested by criterion: end time


+----------------------------------------------+------------+------------+
+----------------------------------+-----------+------------+------------+
+----------------------------------+-----------+------------+------------+


WARNING: During this computation 1 nonlinear solver failures occurred!
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
72 changes: 36 additions & 36 deletions tests/darcy_convection_step/solution/solution-00000.0000.gnuplot

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/darcy_convection_step/statistics
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
# 13: Velocity iterations in Stokes preconditioner
# 14: Schur complement iterations in Stokes preconditioner
# 15: Visualization file name
0 0.000000000000e+00 0.000000000000e+00 4 59 25 50 1 0 0 0 6 8 8 output-darcy_convection_step/solution/solution-00000
1 1.031104829590e+02 1.031104829590e+02 4 59 25 50 1 0 0 0 5 7 7 ""
2 2.000000000000e+02 9.688951704104e+01 4 59 25 50 1 0 0 0 6 8 8 ""
0 0.000000000000e+00 0.000000000000e+00 4 59 25 50 1 0 0 0 5 7 7 output-darcy_convection_step/solution/solution-00000
1 1.000166530498e+02 1.000166530498e+02 4 59 25 50 1 0 0 0 4294967295 0 0 ""
2 2.000000000000e+02 9.998334695023e+01 4 59 25 50 1 0 0 0 4294967295 0 0 ""

0 comments on commit 0b4a5c0

Please sign in to comment.