User Reference

This page documents the eight classes, and its members, corresponding to the eight analytical solutions provided in the access python package.

Assess is a python package that implements analytical solutions to the Stokes equations in cylindrical and spherical domains.

class assess.CylindricalStokesSolutionSmoothFreeSlip(n, k, Rp=2.22, Rm=1.22, nu=1.0, g=1.0)

Bases: assess.cylindrical.CylindricalStokesSolutionSmooth

Analytical Solution in cylindrical domain with smooth r^k forcing and free-slip boundary conditions

Parameters:
  • n – wave number
  • k – polynomial order of forcing
  • Rp – outer radius
  • Rm – inner radius
  • nu – viscosity
  • g – forcing strength
delta_rho(r, phi)

Perturbation density \(\rho'\) in forcing term: \(g\rho'\hat r\)

Parameters:
  • r – radius
  • phi – angle with x-axis
delta_rho_cartesian(X)

Perturbation density \(\rho'\) in forcing term: \(g\rho'\hat r\)

Parameters:X – 2D Cartesian coordinate
dpsi_rdr(r)

Radial derivative of radial part of streamfunction

Parameters:r – radius
dpsi_rdr2(r)

Second radial derivative of radial part of streamfunction

Parameters:r – radius
p(r, phi)

Pressure solution

Parameters:
  • r – radius
  • phi – angle with x-axis
pressure_cartesian(X)

Return pressure solution at Cartesian location.

Parameters:X – 2D Cartesian location
psi_r(r)

Radial part of streamfunction

Parameters:r – radius
radial_stress(r, phi)

Return radial component of stress.

Parameters:
  • r – radius
  • phi – angle with x-axis.
radial_stress_cartesian(X)

Return radial component of stress at Cartesian location.

Parameters:X – 2D Cartesian location
tau_rphi(r, phi)

Return shear stress \(\tau_{r\varphi}\).

Parameters:
  • r – radius
  • phi – angle with x-axis.
tau_rr(r, phi)

Return radial component of deviatoric stress.

Parameters:
  • r – radius
  • phi – angle with x-axis.
u_phi(r, phi)

Return tangential component of velocity.

Parameters:
  • r – radius
  • phi – angle with x-axis.
u_r(r, phi)

Return radial component of velocity.

Parameters:
  • r – radius
  • phi – angle with x-axis.
velocity_cartesian(X)

Return Cartesian velocity at Cartesian location.

Parameters:X – 2D Cartesian location
class assess.CylindricalStokesSolutionSmoothZeroSlip(n, k, Rp=2.22, Rm=1.22, nu=1.0, g=1.0)

Bases: assess.cylindrical.CylindricalStokesSolutionSmooth

Analytical Solution in cylindrical domain with smooth r^k forcing and zero-slip boundary conditions

Parameters:
  • n – wave number
  • k – polynomial order of forcing
  • Rp – outer radius
  • Rm – inner radius
  • nu – viscosity
  • g – forcing strength
delta_rho(r, phi)

Perturbation density \(\rho'\) in forcing term: \(g\rho'\hat r\)

Parameters:
  • r – radius
  • phi – angle with x-axis
delta_rho_cartesian(X)

Perturbation density \(\rho'\) in forcing term: \(g\rho'\hat r\)

Parameters:X – 2D Cartesian coordinate
dpsi_rdr(r)

Radial derivative of radial part of streamfunction

Parameters:r – radius
dpsi_rdr2(r)

Second radial derivative of radial part of streamfunction

Parameters:r – radius
p(r, phi)

Pressure solution

Parameters:
  • r – radius
  • phi – angle with x-axis
pressure_cartesian(X)

Return pressure solution at Cartesian location.

Parameters:X – 2D Cartesian location
psi_r(r)

Radial part of streamfunction

Parameters:r – radius
radial_stress(r, phi)

Return radial component of stress.

Parameters:
  • r – radius
  • phi – angle with x-axis.
radial_stress_cartesian(X)

Return radial component of stress at Cartesian location.

Parameters:X – 2D Cartesian location
tau_rphi(r, phi)

Return shear stress \(\tau_{r\varphi}\).

Parameters:
  • r – radius
  • phi – angle with x-axis.
tau_rr(r, phi)

Return radial component of deviatoric stress.

Parameters:
  • r – radius
  • phi – angle with x-axis.
u_phi(r, phi)

Return tangential component of velocity.

Parameters:
  • r – radius
  • phi – angle with x-axis.
u_r(r, phi)

Return radial component of velocity.

Parameters:
  • r – radius
  • phi – angle with x-axis.
velocity_cartesian(X)

Return Cartesian velocity at Cartesian location.

Parameters:X – 2D Cartesian location
class assess.CylindricalStokesSolutionDeltaFreeSlip(n, sign, Rp=2.22, Rm=1.22, rp=1.72, nu=1.0, g=1.0)

Bases: assess.cylindrical.CylindricalStokesSolutionDelta

Analytical Solution in cylindrical domain with delta(r-r’) forcing and free-slip boundary conditions

Parameters:
  • n – wave number
  • sign – +1 for upper half solution r’<r<Rp -1 for lower half solution Rm<r<r’
  • Rp – outer radius
  • Rm – inner radius
  • nu – viscosity
  • g – forcing strength
dpsi_rdr(r)

Radial derivative of radial part of streamfunction

Parameters:r – radius
dpsi_rdr2(r)

Second radial derivative of radial part of streamfunction

Parameters:r – radius
p(r, phi)

Pressure solution

Parameters:
  • r – radius
  • phi – angle with x-axis
pressure_cartesian(X)

Return pressure solution at Cartesian location.

Parameters:X – 2D Cartesian location
psi_r(r)

Radial part of streamfunction

Parameters:r – radius
radial_stress(r, phi)

Return radial component of stress.

Parameters:
  • r – radius
  • phi – angle with x-axis.
radial_stress_cartesian(X)

Return radial component of stress at Cartesian location.

Parameters:X – 2D Cartesian location
tau_rphi(r, phi)

Return shear stress \(\tau_{r\varphi}\).

Parameters:
  • r – radius
  • phi – angle with x-axis.
tau_rr(r, phi)

Return radial component of deviatoric stress.

Parameters:
  • r – radius
  • phi – angle with x-axis.
u_phi(r, phi)

Return tangential component of velocity.

Parameters:
  • r – radius
  • phi – angle with x-axis.
u_r(r, phi)

Return radial component of velocity.

Parameters:
  • r – radius
  • phi – angle with x-axis.
velocity_cartesian(X)

Return Cartesian velocity at Cartesian location.

Parameters:X – 2D Cartesian location
class assess.CylindricalStokesSolutionDeltaZeroSlip(n, sign, Rp=2.22, Rm=1.22, rp=1.72, nu=1.0, g=1.0)

Bases: assess.cylindrical.CylindricalStokesSolutionDelta

Analytical Solution in cylindrical domain with delta(r-r’) forcing and zero-slip boundary conditions

Parameters:
  • n – wave number
  • sign – +1 for upper half solution r’<r<Rp -1 for lower half solution Rm<r<r’
  • Rp – outer radius
  • Rm – inner radius
  • nu – viscosity
  • g – forcing strength
dpsi_rdr(r)

Radial derivative of radial part of streamfunction

Parameters:r – radius
dpsi_rdr2(r)

Second radial derivative of radial part of streamfunction

Parameters:r – radius
p(r, phi)

Pressure solution

Parameters:
  • r – radius
  • phi – angle with x-axis
pressure_cartesian(X)

Return pressure solution at Cartesian location.

Parameters:X – 2D Cartesian location
psi_r(r)

Radial part of streamfunction

Parameters:r – radius
radial_stress(r, phi)

Return radial component of stress.

Parameters:
  • r – radius
  • phi – angle with x-axis.
radial_stress_cartesian(X)

Return radial component of stress at Cartesian location.

Parameters:X – 2D Cartesian location
tau_rphi(r, phi)

Return shear stress \(\tau_{r\varphi}\).

Parameters:
  • r – radius
  • phi – angle with x-axis.
tau_rr(r, phi)

Return radial component of deviatoric stress.

Parameters:
  • r – radius
  • phi – angle with x-axis.
u_phi(r, phi)

Return tangential component of velocity.

Parameters:
  • r – radius
  • phi – angle with x-axis.
u_r(r, phi)

Return radial component of velocity.

Parameters:
  • r – radius
  • phi – angle with x-axis.
velocity_cartesian(X)

Return Cartesian velocity at Cartesian location.

Parameters:X – 2D Cartesian location
class assess.SphericalStokesSolutionSmoothFreeSlip(l, m, k, Rp=2.22, Rm=1.22, nu=1.0, g=1.0)

Bases: assess.spherical.SphericalStokesSolutionSmooth

Analytical Solution in cylindrical domain with smooth r^k forcing and free-slip boundary conditions

Parameters:
  • l – degree of the harmonic
  • m – order of the harmonic
  • k – polynomial order of forcing
  • Rp – outer radius
  • Rm – inner radius
  • nu – viscosity
  • g – forcing strength
Pl(r)

Radial part of poloidal function

Parameters:r – radius
dPldr(r)

Radial derivative of radial part of poloidal function

Parameters:r – radius
dPldr2(r)

Second radial derivative of radial part of poloidal function

Parameters:r – radius
delta_rho(r, theta, phi)

Perturbation density \(\rho'\) in forcing term: \(g\rho'\hat r\)

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
delta_rho_cartesian(X)

Perturbation density \(\rho'\) in forcing term: \(g\rho'\hat r\)

Parameters:X – 3D Cartesian coordinate
p(r, theta, phi)

Pressure solution

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
pressure_cartesian(X)

Return pressure solution at Cartesian location.

Parameters:X – 3D Cartesian location
radial_stress(r, theta, phi)

Return radial component of stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
radial_stress_cartesian(X)

Return radial component of stress at Cartesian location.

Parameters:X – 3D Cartesian location
tau_rphi(r, theta, phi)

Return longitudinal component of shear stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
tau_rr(r, theta, phi)

Return radial component of deviatoric stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
tau_rtheta(r, theta, phi)

Return colatitudinal component of shear stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_phi(r, theta, phi)

Return longitudinal (eastward) component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_r(r, theta, phi)

Return radial component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_theta(r, theta, phi)

Return colatitudinal (southward) component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
velocity_cartesian(X)

Return Cartesian velocity at Cartesian location.

Parameters:X – 3D Cartesian location
class assess.SphericalStokesSolutionSmoothZeroSlip(l, m, k, Rp=2.22, Rm=1.22, nu=1.0, g=1.0)

Bases: assess.spherical.SphericalStokesSolutionSmooth

Analytical Solution in cylindrical domain with smooth r^k forcing and zero-slip boundary conditions

Parameters:
  • l – degree of the harmonic
  • m – order of the harmonic
  • k – polynomial order of forcing
  • Rp – outer radius
  • Rm – inner radius
  • nu – viscosity
  • g – forcing strength
Pl(r)

Radial part of poloidal function

Parameters:r – radius
dPldr(r)

Radial derivative of radial part of poloidal function

Parameters:r – radius
dPldr2(r)

Second radial derivative of radial part of poloidal function

Parameters:r – radius
delta_rho(r, theta, phi)

Perturbation density \(\rho'\) in forcing term: \(g\rho'\hat r\)

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
delta_rho_cartesian(X)

Perturbation density \(\rho'\) in forcing term: \(g\rho'\hat r\)

Parameters:X – 3D Cartesian coordinate
p(r, theta, phi)

Pressure solution

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
pressure_cartesian(X)

Return pressure solution at Cartesian location.

Parameters:X – 3D Cartesian location
radial_stress(r, theta, phi)

Return radial component of stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
radial_stress_cartesian(X)

Return radial component of stress at Cartesian location.

Parameters:X – 3D Cartesian location
tau_rphi(r, theta, phi)

Return longitudinal component of shear stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
tau_rr(r, theta, phi)

Return radial component of deviatoric stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
tau_rtheta(r, theta, phi)

Return colatitudinal component of shear stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_phi(r, theta, phi)

Return longitudinal (eastward) component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_r(r, theta, phi)

Return radial component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_theta(r, theta, phi)

Return colatitudinal (southward) component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
velocity_cartesian(X)

Return Cartesian velocity at Cartesian location.

Parameters:X – 3D Cartesian location
class assess.SphericalStokesSolutionDeltaFreeSlip(l, m, sign, Rp=2.22, Rm=1.22, rp=1.72, nu=1.0, g=1.0)

Bases: assess.spherical.SphericalStokesSolutionDelta

Analytical Solution in cylindrical domain with delta(r-r’) forcing and free-slip boundary conditions

Parameters:
  • l – degree of the harmonic
  • m – order of the harmonic
  • sign – +1 for upper half solution r’<r<Rp -1 for lower half solution Rm<r<r’
  • Rp – outer radius
  • Rm – inner radius
  • nu – viscosity
  • g – forcing strength
Pl(r)

Radial part of poloidal function

Parameters:r – radius
dPldr(r)

Radial derivative of radial part of poloidal function

Parameters:r – radius
dPldr2(r)

Second radial derivative of radial part of poloidal function

Parameters:r – radius
p(r, theta, phi)

Pressure solution

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
pressure_cartesian(X)

Return pressure solution at Cartesian location.

Parameters:X – 3D Cartesian location
radial_stress(r, theta, phi)

Return radial component of stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
radial_stress_cartesian(X)

Return radial component of stress at Cartesian location.

Parameters:X – 3D Cartesian location
tau_rphi(r, theta, phi)

Return longitudinal component of shear stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
tau_rr(r, theta, phi)

Return radial component of deviatoric stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
tau_rtheta(r, theta, phi)

Return colatitudinal component of shear stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_phi(r, theta, phi)

Return longitudinal (eastward) component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_r(r, theta, phi)

Return radial component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_theta(r, theta, phi)

Return colatitudinal (southward) component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
velocity_cartesian(X)

Return Cartesian velocity at Cartesian location.

Parameters:X – 3D Cartesian location
class assess.SphericalStokesSolutionDeltaZeroSlip(l, m, sign, Rp=2.22, Rm=1.22, rp=1.72, nu=1.0, g=1.0)

Bases: assess.spherical.SphericalStokesSolutionDelta

Analytical Solution in cylindrical domain with delta(r-r’) forcing and zero-slip boundary conditions

Parameters:
  • l – degree of the harmonic
  • m – order of the harmonic
  • sign – +1 for upper half solution r’<r<Rp -1 for lower half solution Rm<r<r’
  • Rp – outer radius
  • Rm – inner radius
  • nu – viscosity
  • g – forcing strength
Pl(r)

Radial part of poloidal function

Parameters:r – radius
dPldr(r)

Radial derivative of radial part of poloidal function

Parameters:r – radius
dPldr2(r)

Second radial derivative of radial part of poloidal function

Parameters:r – radius
p(r, theta, phi)

Pressure solution

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
pressure_cartesian(X)

Return pressure solution at Cartesian location.

Parameters:X – 3D Cartesian location
radial_stress(r, theta, phi)

Return radial component of stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
radial_stress_cartesian(X)

Return radial component of stress at Cartesian location.

Parameters:X – 3D Cartesian location
tau_rphi(r, theta, phi)

Return longitudinal component of shear stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
tau_rr(r, theta, phi)

Return radial component of deviatoric stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
tau_rtheta(r, theta, phi)

Return colatitudinal component of shear stress.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_phi(r, theta, phi)

Return longitudinal (eastward) component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_r(r, theta, phi)

Return radial component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
u_theta(r, theta, phi)

Return colatitudinal (southward) component of velocity.

Parameters:
  • r – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
velocity_cartesian(X)

Return Cartesian velocity at Cartesian location.

Parameters:X – 3D Cartesian location
assess.Y(l, m, theta, phi)

Real-valued spherical harmonic function \(Y_{lm}(\theta, \varphi)\)

This is based on the following definition:

\[Y_{lm}(\theta, \varphi) = \sqrt{\frac{(2l+1)}{4\pi}\frac{(l-m)!}{(l+m)!}}P_l^m(\cos(\theta))\cos(m\varphi)\]

which is equal to the real part of scipy.special.sph_harm.

Parameters:
  • l – degree of the harmonic
  • m – order of the harmonic
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
assess.dYdphi(l, m, theta, phi)

Colatitudinal derivative of spherical harmonic function \(Y_{lm}(\theta, \varphi)\)

Parameters:
  • l – degree of the harmonic
  • m – order of the harmonic
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
assess.dYdtheta(l, m, theta, phi)

Longitudinal derivative of spherical harmonic function \(Y_{lm}(\theta, \varphi)\)

Parameters:
  • l – degree of the harmonic
  • m – order of the harmonic
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
assess.to_spherical(X)

Convert Cartesian 3D coordinates X to spherical r, theta, phi

Parameters:X – Cartesian 3D coordinates
Returns r, theta, phi:
 radius, colatitude, longitude
assess.from_spherical(r, theta, phi)

Convert spherical r, theta, phi to 3D Cartesian coordinates.

Parameters:
  • r, – radius
  • theta – co-latitude in [0, pi]
  • phi – longitude in [0, 2*pi]
Returns X:

Cartesian 3D coordinates