Hello folks,
Hope you all good. I’m having trouble with the convergence of Stokes subsystem. The domain is a 3D spherical shell and the system has temperature (P1), Stokes (P2xP1), 5 compositions (P1). The model can go efficiently for the first 60 steps (each step requires a few nonlinear iterations), after that the residual of Stokes subsystem dominates the total residual and stalls near 1.0e-5 even the max nonlinear iteration =100. The following is the log:
*** Timestep 60: t=3.35567e+09 years, dt=1e+08 years
Solving temperature system... 30 iterations.
Solving peridotite system ... 4 iterations.
Solving U238 system ... 19 iterations.
Solving U235 system ... 23 iterations.
Solving Th232 system ... 16 iterations.
Solving K40 system ... 22 iterations.
Solving Stokes system (GMG)... 164+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0.000187813, 1.55247e-10, 0.000243278, 0.010344, 2.46304e-05, 0.00319288, 3.682e-06
Relative nonlinear residual (total system) after nonlinear iteration 1: 0.010344
Solving temperature system... 27 iterations.
Solving peridotite system ... 2 iterations.
Solving U238 system ... 14 iterations.
Solving U235 system ... 20 iterations.
Solving Th232 system ... 10 iterations.
Solving K40 system ... 18 iterations.
Solving Stokes system (GMG)... 60+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 3.9103e-06, 1.32454e-11, 2.49716e-06, 0.000647025, 8.11117e-08, 0.000114895, 1.40779e-07
Relative nonlinear residual (total system) after nonlinear iteration 2: 0.000647025
Solving temperature system... 22 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 9 iterations.
Solving U235 system ... 17 iterations.
Solving Th232 system ... 4 iterations.
Solving K40 system ... 14 iterations.
Solving Stokes system (GMG)... 55+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 1.93589e-07, 5.94592e-13, 2.56315e-08, 4.04718e-05, 2.6778e-10, 4.13448e-06, 1.12013e-07
Relative nonlinear residual (total system) after nonlinear iteration 3: 4.04718e-05
Solving temperature system... 16 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 4 iterations.
Solving U235 system ... 14 iterations.
Solving Th232 system ... 1 iterations.
Solving K40 system ... 11 iterations.
Solving Stokes system (GMG)... 50+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 1.0975e-08, 5.83545e-13, 2.63044e-10, 2.53153e-06, 1.87047e-12, 1.48778e-07, 1.12668e-07
Relative nonlinear residual (total system) after nonlinear iteration 4: 2.53153e-06
Solving temperature system... 11 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 1 iterations.
Solving U235 system ... 11 iterations.
Solving Th232 system ... 0 iterations.
Solving K40 system ... 7 iterations.
Solving Stokes system (GMG)... 48+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 6.52306e-10, 5.84161e-13, 2.75681e-12, 1.58349e-07, 3.79287e-13, 5.35375e-09, 1.11534e-07
Relative nonlinear residual (total system) after nonlinear iteration 5: 1.58349e-07
Postprocessing:
...
Number of active cells: 1,057,096 (on 8 levels)
Number of degrees of freedom: 39,398,632 (30,075,738+1,331,842+1,331,842+1,331,842+1,331,842+1,331,842+1,331,842+1,331,842)
*** Timestep 61: t=3.45567e+09 years, dt=1e+08 years
Solving temperature system... 34 iterations.
Solving peridotite system ... 7 iterations.
Solving U238 system ... 18 iterations.
Solving U235 system ... 22 iterations.
Solving Th232 system ... 15 iterations.
Solving K40 system ... 21 iterations.
Solving Stokes system (GMG)... 203+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 0.00153151, 5.14947e-09, 0.00024315, 0.0103439, 2.45679e-05, 0.00319277, 0.000522223
Relative nonlinear residual (total system) after nonlinear iteration 1: 0.0103439
Solving temperature system... 28 iterations.
Solving peridotite system ... 2 iterations.
Solving U238 system ... 13 iterations.
Solving U235 system ... 19 iterations.
Solving Th232 system ... 9 iterations.
Solving K40 system ... 17 iterations.
Solving Stokes system (GMG)... 157+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 3.9239e-06, 1.46586e-11, 2.49577e-06, 0.000647015, 8.08506e-08, 0.000114891, 1.06373e-05
Relative nonlinear residual (total system) after nonlinear iteration 2: 0.000647015
Solving temperature system... 22 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 8 iterations.
Solving U235 system ... 16 iterations.
Solving Th232 system ... 3 iterations.
Solving K40 system ... 13 iterations.
Solving Stokes system (GMG)... 154+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 1.9215e-07, 6.67613e-13, 2.5615e-08, 4.04712e-05, 2.65196e-10, 4.13433e-06, 1.06359e-05
Relative nonlinear residual (total system) after nonlinear iteration 3: 4.04712e-05
Solving temperature system... 17 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 3 iterations.
Solving U235 system ... 13 iterations.
Solving Th232 system ... 1 iterations.
Solving K40 system ... 10 iterations.
Solving Stokes system (GMG)... 154+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 1.08477e-08, 6.53581e-13, 2.62766e-10, 2.5315e-06, 1.9697e-12, 1.48773e-07, 1.06343e-05
Relative nonlinear residual (total system) after nonlinear iteration 4: 1.06343e-05
Solving temperature system... 12 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 1 iterations.
Solving U235 system ... 10 iterations.
Solving Th232 system ... 0 iterations.
Solving K40 system ... 6 iterations.
Solving Stokes system (GMG)... 154+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 6.43424e-10, 6.54363e-13, 2.84011e-12, 1.58347e-07, 4.66064e-13, 5.35355e-09, 1.06349e-05
Relative nonlinear residual (total system) after nonlinear iteration 5: 1.06349e-05
Solving temperature system... 6 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 0 iterations.
Solving U235 system ... 7 iterations.
Solving Th232 system ... 0 iterations.
Solving K40 system ... 3 iterations.
Solving Stokes system (GMG)... 154+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 3.90573e-11, 6.54317e-13, 5.27704e-13, 9.90467e-09, 4.66409e-13, 1.92648e-10, 1.06347e-05
Relative nonlinear residual (total system) after nonlinear iteration 6: 1.06347e-05
Solving temperature system... 2 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 0 iterations.
Solving U235 system ... 4 iterations.
Solving Th232 system ... 0 iterations.
Solving K40 system ... 1 iterations.
Solving Stokes system (GMG)... 154+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 2.53068e-12, 6.5432e-13, 5.27697e-13, 6.19543e-10, 4.66384e-13, 6.96174e-12, 1.06347e-05
Relative nonlinear residual (total system) after nonlinear iteration 7: 1.06347e-05
Solving temperature system... 0 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 0 iterations.
Solving U235 system ... 2 iterations.
Solving Th232 system ... 0 iterations.
Solving K40 system ... 0 iterations.
Solving Stokes system (GMG)... 154+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 6.84763e-13, 6.54319e-13, 5.27697e-13, 3.87611e-11, 4.66388e-13, 9.9279e-13, 1.06347e-05
Relative nonlinear residual (total system) after nonlinear iteration 8: 1.06347e-05
Solving temperature system... 0 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 0 iterations.
Solving U235 system ... 1 iterations.
Solving Th232 system ... 0 iterations.
Solving K40 system ... 0 iterations.
Solving Stokes system (GMG)... 154+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 6.83705e-13, 6.54319e-13, 5.27697e-13, 2.5126e-12, 4.66386e-13, 9.9279e-13, 1.06347e-05
Relative nonlinear residual (total system) after nonlinear iteration 9: 1.06347e-05
Solving temperature system... 0 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 0 iterations.
Solving U235 system ... 0 iterations.
Solving Th232 system ... 0 iterations.
Solving K40 system ... 0 iterations.
Solving Stokes system (GMG)... 154+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 6.83795e-13, 6.54319e-13, 5.27697e-13, 3.44719e-13, 4.66387e-13, 9.92789e-13, 1.06347e-05
Relative nonlinear residual (total system) after nonlinear iteration 10: 1.06347e-05
Solving temperature system... 0 iterations.
Solving peridotite system ... 0 iterations.
Solving U238 system ... 0 iterations.
Solving U235 system ... 0 iterations.
Solving Th232 system ... 0 iterations.
Solving K40 system ... 0 iterations.
Solving Stokes system (GMG)... 154+0 iterations.
Relative nonlinear residuals (temperature, compositional fields, Stokes system): 6.83795e-13, 6.54319e-13, 5.27697e-13, 3.44719e-13, 4.66386e-13, 9.9279e-13, 1.06347e-05
Relative nonlinear residual (total system) after nonlinear iteration 11: 1.06347e-05
... THIS KEEPS GOING, SAME TOTAL RESIDUAL ...
At step 41, a refinement happens, which gives 820,000 active cells, 31 million DoF; At step 61, another refinement gives 1 million active cells, 39 million DoF. So the mesh becomes better, intuitively the Stokes should converge as before.
Part of the prm is also attached in case it’s useful:
set Additional shared libraries = ./src/libLaneuville_Material_Model.so, ./src/libLaneuville_Heating_Model.so, ./src/libLaneuville_Temperature_Boundary.so
set Dimension = 3
set Use years in output instead of seconds = true
set End time = 4.5e9
set Maximum time step = 1.0e8
set Maximum first time step = 1.0e3
set CFL number = 0.5
set Maximum relative increase in time step = 50
set Output directory = C0LB_3D_test1
set Resume computation = false
set Nonlinear solver scheme = iterated Advection and Stokes
set Max nonlinear iterations = 20
set Nonlinear solver tolerance = 1e-6
subsection Solver parameters
subsection Stokes solver parameters
set Stokes solver type = block GMG
set Linear solver tolerance = 1e-9
set Number of cheap Stokes solver steps = 300
set GMRES solver restart length = 200
end
end
subsection Discretization
set Composition polynomial degree = 1
set Temperature polynomial degree = 1
set Use discontinuous composition discretization = false
subsection Stabilization parameters
set Stabilization method = entropy viscosity # SUPG
set beta = 0.117 #0.078 for 2D, 0.117 for 3D
set cR = 0.33
end
end
subsection Formulation
set Formulation = Boussinesq approximation
end
subsection Melt settings
set Include melt transport = false
end
subsection Compositional fields
set Number of fields = 5
set Names of fields = peridotite, U238, U235, Th232, K40
set Types of fields = chemical composition
set Compositional field methods = field
end
subsection Initial composition model
set Model name = function
subsection Function
set Coordinate system = spherical
set Variable names = r, phi, theta
set Function constants = ...
set Function expression = ...
end
end
subsection Boundary composition model
set List of model names = initial composition
end
subsection Material model
set Material averaging = geometric average only viscosity
set Model name = laneuville
subsection Laneuville model
set Chemical density difference = 60.0
set Reference density = 3400.0
set Reference specific heat = 1000.0
set Reference temperature = 1600
set Mantle thermal conductivity = 3.0
set Crust thermal conductivity = 1.5
set Reference thermal diffusivity = 1.0e-6
set Thermal expansivity = 2.0e-5
set Activation energy = 3.0e5
set Reference viscosity = 1.0e30 # so that we have a large constant viscosity
set Max viscosity = 1.0e28
set Max melt fraction = 0.3
set Core density = 7.4e3
set Core specific heat = 8.0e2
set Physical radius of thermal conductivity interface = 1.7e6
end
end
subsection Geometry model
set Model name = spherical shell
subsection Spherical shell
set Inner radius = 390000.0
set Outer radius = 1740000.0
#set Cells along circumference = 64
set Opening angle = 360
end
end
subsection Boundary velocity model
set Zero velocity boundary indicators =
set Tangential velocity boundary indicators = top, bottom # top and bottom are slip-free
end
subsection Boundary temperature model
set Fixed temperature boundary indicators = inner, outer #Dirichlet BC, prescribed values
set Model name = laneuville
subsection Laneuville model
set Initial bottom temperature = 2000.0
set Initial top temperature = 250.0
end
end
subsection Heating model
set List of model names = laneuville
subsection Laneuville model
set Latent heat = 6.0e5
set Phase change smooth factor = 1.0e-3
set Partition coefficient of U238 (melt/mantle) = 1.0
set Partition coefficient of U235 (melt/mantle) = 1.0
set Partition coefficient of Th232 (melt/mantle) = 1.0
set Partition coefficient of K40 (melt/mantle) = 1.0
end
end
subsection Initial temperature model
set Model name = function
subsection Function
set Coordinate system = spherical
set Variable names = r, phi, theta
set Function constants = ...
set Function expression = ...
end
end
subsection Gravity model
set Model name = radial constant
subsection Radial constant
set Magnitude = 1.62
end
end
subsection Mesh refinement
set Initial global refinement = 5
set Initial adaptive refinement = 2
set Strategy = temperature#, viscosity
set Refinement fraction = 0.2
set Coarsening fraction = 0.1
set Time steps between mesh refinement = 20
end
subsection Postprocess
...
end
subsection Nullspace removal
set Remove nullspace = net rotation
end
subsection Checkpointing
set Steps between checkpoint = 50
end
I also tried AMG which requires more memory. When initial global refinement=5 and initial adaptive refinement=2, 512 GB of memory is used up. AMG also struggles after some 20 steps due to the stagnation of Stokes residual. So my question is: is 1.0e-5 acceptable for such a 3D model? How to improve the convergence rate? is AMG still a backup? Please note that the viscosity over the domain is almost a large constant for this test (Reference viscosity = 1.0e30), I guess the problem would becomes much worse if large contrast of viscosity is present (by setting Reference viscosity = 1.0e21 as I intend to do so).
Any ideas or comments are appreciated, thanks!
MM