1 of 13

Verification of Transient Sensitivities in Albany

Irina K. Tezaur

August 27, 2021

2 of 13

Problem Description – Thermal Problem

 

 

 

 

3 of 13

1D Transient Heat MMS Problem

 

 

 

4 of 13

1D Transient Heat MMS Problem

Resolution

Rel error in dx/dp

Rel error in dg/dp

h=1/80, dt=0.01

2.56e-3

2.49e-3

h=1/80, dt=0.001

2.98e-4

2.92e-4

h=1/80, dt=0.0001

1.35e-4

1.34e-4

h=1/40, dt=0.0001

4.86e-4

4.86e-4

h=1/20, dt=0.0001

1.89e-3

1.89e-3

 

5 of 13

1D Transient Heat MMS Problem – Forward vs. Adjoint Sensitivities

Resolution

Rel error in dg/dp - Forward

Rel error in dg/dp - Adjoint

CPU time - Forward

CPU time - Adjoint

h=1/20, dt=1e-2

4.17e-3

1.43e-1

1.95s

2.57s

h=1/20, dt=1e-3

2.04e-3

1.28e-2

19.4s

25.6s

h=1/20, dt=1e-4

1.89e-3

4.09e-4

197.6s

261.4s

  • A much smaller dt is needed to get a converged solution with the adjoint transient sensitivities.

  • For dt=1e-4, adjoint transient sensitivities are about 1 order more accurate than forward transient sensitivities.

  • Adjoint transient sensitivities are about 30% slower for the same mesh resolution/time-step.

6 of 13

2D Transient Heat MMS Problem

 

 

 

7 of 13

2D Transient Heat MMS Problem

Resolution

Rel error in dx/dp1

Rel error in dx/dp2

Rel error in dg/dp1

Rel error in dg/dp2

hx=hy=1/80, dt=0.01

2.51e-2

1.78e-2

2.45e-2

1.75e-2

hx=hy=1/80, dt=0.001

2.72e-3

1.71e-3

2.67e-3

1.68e-3

hx=hy=1/80, dt=0.0001

4.62e-4

4.64e-5

4.62e-4

2.83e-5

hx=hy=1/40, dt=0.0001

1.09e-3

3.81e-4

1.11e-3

3.95e-4

hx=hy=1/20, dt=0.0001

3.63e-3

2.08e-3

3.71e-3

2.13e-3

 

8 of 13

2D Transient Heat MMS Problem

  • Capability to output dxdp to Exodus using Piro::ObserverBase has been added to Piro and Albany.

Exact solution for dx/dp2 (MATLAB)

Computed solution for dx/dp2 (Paraview)

9 of 13

Problem Description – Advection Problem

 

 

 

 

 

 

  • It follows then that:

 

10 of 13

 

 

11 of 13

Advection Problem – sensitivities DgDp

  • Above plots show sensitivity of solution average response at different times computed using different time-integration schemes (forward and backward Euler) with dt=1e-4 and discretized using N=50 finite elements. Forward Euler uses mass lumping and avoids a linear solve (“Mass Matrix Is Identity=True” for adjoint transient sensitivities).
  • When running for longer times (up to T = 0.1), adaptive time-stepping is needed for adjoint transient sensitivities + implicit method to converge.
  • Oscillations in DgDp are observed at by time T = 0.1. Using different time-integrator does not help (tried BDF2, and SDIRK5). Problem does not run longer. Oscillations are reduced slightly by using simpler advection field.
  • The sensitivity calculation fails to converge (even with adaptive time-stepping and dt=1e-5) when running up to time T = 0.1 when the problem is discretized using N=100 finite elements with the implicit stepper (so refining the mesh hurts).
  • DgDp is wrong for explicit time stepper with mass lumping. To get this case to work, need to implement M*DfDp and DfDx^T*M^{-T} in Piro::InvertMassMatrixDecorator for the forward and adjoint ME, respectively.

 

 

 

12 of 13

Advection Problem – sensitivities DgDp

  • Above plots show sensitivity of solution average response at different times computed using a forward Euler time-stepping scheme with dt=1e-4 and discretized using N=50 finite elements (“Mass Matrix Is Identity=False” and adjoint ME is passed to integrator).

  • Now, results are reasonable, except oscillations are observed at the right end of the boundary if the problem is advanced forward long enough in time. Reducing the time-step (to dt=1e-5) does not help.

  • Using consistent mass matrix gives same result as using lumped mass matrix.

13 of 13

Questions

  • Are the results I’m seeing for the cases where the adjoint transient sensitivities work expected?

  • Why does explicit case with mass lumping, “Mass Matrix Is Identity=True”, and a single ME give the wrong result, whereas if we specify the adjoint ME and set “Mass Matrix Is Identity=False”, the calculation works?

  • Is there a way to get explicit without mass lumping to work? [I think we talked about this in the very beginning but I no longer remember the details.]

  • Have adjoint transient sensitivities been tested when ‘Initial Time’ is non-zero? In Albany, if I try to run this case, it appears no adjoint calculation happens. Not sure if the problem is in Piro or in Tempus.