solver

Functions to solve the diffusion equation

solver.A(P)

Power-law scheme, Patankar eq. 5.34

solver.F_upwind(F)

Upwinding scheme

solver.apparent_heat(z_edges, Z_P, nt, dt, Gamma_P, phi_0, nz_P, nz_fv, phi_s, mix_rho, c_vol, LWC, mass_sol, dz, ICT, rho_firn, iii=0)

transient 1-d diffusion finite volume method

This is for standard heat (no liquid water), isotope, and air diffusion. If there is liquid water is should use the enthalpy solver.

Parameters:
  • z_edges
  • Z_P
  • nt
  • dt
  • Gamma_P
  • phi_0
  • nz_P
  • nz_fv
  • phi_s
Return phi_t:
solver.solver(a_U, a_D, a_P, b)

function for solving matrix problem

Parameters:
  • a_U
  • a_D
  • a_P
  • b
Return phi_t:
solver.transient_solve_EN(z_edges, Z_P, nt, dt, Gamma_P, phi_0, nz_P, nz_fv, phi_s, mix_rho, c_vol, LWC, mass_sol, dz, ICT, rho_firn, iii=0)

transient 1-d diffusion finite volume method for enthalpy

This is for heat diffusion when there is liquid water present. It uses a source term for the latent heat associated with the liquid water.

Parameters:
  • z_edges
  • Z_P
  • nt – number of iterations; depricated (now uses while loop)
  • dt – time step size
  • Gamma_P
  • phi_0 – temperature profile [C]
  • nz_P
  • nz_fv
  • phi_s – surface temperature [C]

:param g_liq :param c_vol: [J/m3/K] ‘volume-averaged specific heat of mixture’, or rho * cp. (so really heat capacity)

Return phi_t:

The source terms S_P and S_C come from the linearization described in Voller and Swaminathan, 1991, equations 31 and 32. and Voller, Swaminathan, and Thomas, 1990, equation 61

solver.transient_solve_TR(z_edges, Z_P, nt, dt, Gamma_P, phi_0, nz_P, nz_fv, phi_s, tot_rho, c_vol, airdict=None)

transient 1-d diffusion finite volume method

This is for standard heat (no liquid water), isotope, and air diffusion. If there is liquid water is should use the enthalpy solver.

Parameters:
  • z_edges
  • Z_P
  • nt
  • dt
  • Gamma_P
  • phi_0
  • nz_P
  • nz_fv
  • phi_s
Return phi_t:
solver.w(airdict, z_edges, rho_edges, Z_P, dZ)

Function for downward advection of air and also calculates total air content.