Cheat sheet

SI units

Base units:

\(\mathrm{T}\) \(\mathrm{s}\)
\(\mathrm{L}\) \(\mathrm{m}\)
\(\mathrm{M}\) \(\mathrm{kg}\)
\(\theta\) \(\mathrm{K}\)
\(\mathrm{N}\) \(\mathrm{mol}\)
\(\mathrm{I}\) \(\mathrm{A}\)
\(I_v\) \(\mathrm{cd}\)

Derived units:

\(\mathrm{Hz}\) \(\mathrm{s}^{-1}\)
\(\mathrm{N}\) \(\mathrm{kg\,m\,s^{-2}}\)
\(\mathrm{Pa}\) \(\mathrm{N\,m^{-2}}\)
\(\mathrm{J}\) \(\mathrm{N\,m}\)
\(\mathrm{W}\) \(\mathrm{J\,s^{-1}}\)

Dimensionless numbers

Reynolds Re \(\dfrac{v\,L}{\nu}\)
Froude Fr \(\dfrac{v}{\sqrt{gh}}\)
Shallowness \(\epsilon\) \(\dfrac{H}{L}\)
Peclet Pe \(\dfrac{L\,v}{\alpha}\)
Prandtl Pr \(\dfrac{\nu}{\alpha}\)
Stefan Ste \(\dfrac{c_p\,\Delta T}{L}\)
Strouhal Str \(\dfrac{f\,L}{v}\)
Mach Ma \(\dfrac{v}{c}\)
Lewis Le \(\dfrac{\alpha}{D}\)

Miscellaneous

  1. Shape factor \[ \alpha = \frac{\overline{u^2}}{\overline{u}^2}, \quad \bar \ast = \tfrac{1}{h} \int_b^s \ast \,dz \]
  2. Velocity decomposition (translation + rotation + deformation) \[ \mathbf{v}(\mathbf{x} + \mathbf{r}) = \mathbf{v}(\mathbf{x}) + \mathbf{w} \times \mathbf{r} + \mathbf{D} \cdot \mathbf{r} \] with \(\mathbf{w} = \tfrac{1}{2} \nabla \times \mathbf{v}\), \(\mathbf{D} = \tfrac{1}{2}(\nabla \mathbf{v} + \nabla \mathbf{v}^T)\), \(\mathbf{W} = \tfrac{1}{2}(\nabla \mathbf{v} - \nabla \mathbf{v}^T)\).
  3. Helmholtz decomposition (gradient + curl part) \[ \mathbf{w} = \nabla \phi + \nabla \times \boldsymbol\psi, \quad \nabla \cdot \boldsymbol\psi = 0 \] with \(\nabla \times (\nabla \phi) = \mathbf 0\) (irrotational), \(\nabla \cdot (\nabla \times \boldsymbol\psi) = 0\) (solenoidal).
  4. Error function \[ \text{erf}(x) = \tfrac{2}{\sqrt{\pi}} \int_0^x e^{-y^2} dy, \quad \text{erfc} = 1 - \text{erf} \] \[ \partial_x \text{erf}(C x) = \tfrac{2}{\sqrt{\pi}}\, C\, e^{-(C x)^2} \]
  5. Thermal diffusivity \(\;\alpha = \dfrac{\kappa}{\rho c_p}\)
  6. Euler’s formula \(\;e^{i x} = \cos x + i \sin x\)

Physical principles

  1. Material symmetry \(\;\hat \sigma^{(\zeta)}(*) = \hat \sigma^{(\eta)}(* P)\)
  2. Material isotropy \[ \begin{aligned} \hat\sigma(F) &= \hat\sigma(V Q) = \hat\sigma(V Q P)\\ &= \hat\sigma(V Q Q^T) = \hat\sigma(V) \end{aligned} \]
  3. Material objectivity \(\;\sigma^{(\mathbf y)} = Q\, \sigma^{(\mathbf x)}\, Q^T\)
  4. Galilean invariance \(\;\pmb{\zeta} = \mathbf{x} - \mathbf{v} t\)

Constitutive relations & boundary conditions

  1. Hooke’s law \(\;\pmb{\sigma} = \lambda\, \mathrm{tr}(\mathbf{D})\, \mathbf{I} + 2 \mu \mathbf{D}\)
  2. Boussinesq approximation \(\;\rho = \rho_0(1 - B(T - T_0))\)
  3. Stefan condition \[ \rho_s L\, \partial_t X_m = -\kappa_l\, \partial_x T\big|_{X_m^{-}} + \kappa_s\, \partial_x T\big|_{X_m^{+}} \] \(X_m^{-}\) liquid side, \(X_m^{+}\) solid side.

Integration

  1. \(\displaystyle\int e^{k x} dx = \tfrac{1}{k} e^{k x} + C\)
  2. \(\displaystyle\int x\, e^{k x} dx = \tfrac{e^{k x}}{k^2}(k x - 1) + C\)
  3. Leibniz rule \[ \partial_x \!\int_{b(x)}^{s(x)}\! f\, dz = \int_{b(x)}^{s(x)}\! \partial_x f\, dz + \big[\, f\, \partial_x \hat z\, \big]_{\hat z = b}^{s} \]

Index notation

Einstein summation (repeated indices summed), \(\partial_i := \partial/\partial x_i\).

  • Levi-Civita \(\varepsilon_{ijk}\): \(+1\) even perm., \(-1\) odd perm., \(0\) repeated index.
  • Product identity \(\;\varepsilon_{ijk}\,\varepsilon_{lmk} = \delta_{il}\delta_{jm} - \delta_{im}\delta_{jl}\).

Ansätze

Plane wave: \(\phi(\mathbf x, t) = A\,\exp\!\bigl(i(\mathbf k \cdot \mathbf x - \omega t)\bigr)\).

Vector identities

\(D = \tfrac{1}{2}(\nabla\mathbf w + \nabla\mathbf w^{T})\); smooth fields \(\mathbf w,\ \phi,\ \boldsymbol\psi\).

(I) \(\nabla\cdot D = \tfrac{1}{2}\bigl(\Delta\mathbf w + \nabla(\nabla\cdot\mathbf w)\bigr)\)
(II) \(\nabla\cdot\bigl(\mathrm{tr}(D)\,\mathbf I\bigr) = \nabla(\nabla\cdot\mathbf w)\)
(III) \(\nabla\times(\nabla\phi) = \mathbf 0\)
(IV) \(\nabla\cdot(\nabla\times\boldsymbol\psi) = 0\)
(V) \(\nabla\times(\nabla\times\mathbf w) = \nabla(\nabla\cdot\mathbf w) - \Delta\mathbf w\)
(VI) \(\Delta(\nabla\cdot\mathbf w) = \nabla\cdot(\Delta\mathbf w)\)
(VII) \(\Delta\nabla\phi = \nabla\Delta\phi\)
(VIII) \((\mathbf v\!\cdot\!\nabla)\mathbf v = \nabla\!\bigl(\tfrac{v^2}{2}\bigr) - \mathbf v\times(\nabla\times\mathbf v)\) (Lamb)
(IX) \(\nabla\times(\mathbf a\times\mathbf b) = \mathbf a\,(\nabla\!\cdot\!\mathbf b) - \mathbf b\,(\nabla\!\cdot\!\mathbf a) + (\mathbf b\!\cdot\!\nabla)\mathbf a - (\mathbf a\!\cdot\!\nabla)\mathbf b\)
(X) \(\mathbf a\times(\mathbf b\times\mathbf c) = \mathbf b\,(\mathbf a\!\cdot\!\mathbf c) - \mathbf c\,(\mathbf a\!\cdot\!\mathbf b)\) (BAC–CAB)

FEniCSx

Function spaces (CG vs DG)

Purpose Command
cell type cell = domain.topology.cell_name()
continuous (CG), degree \(k\) element("Lagrange", cell, k)
discontinuous (DG), degree \(k\) element("DG", cell, k)
vector-valued (\(d\) = geom. dim) element("Lagrange", cell, k, shape=(d,))
\(H(\mathrm{div})\) (Raviart–Thomas) element("Raviart-Thomas", cell, k)
build the space V = functionspace(domain, elem)
mixed element mixed_element([el_u, el_p])
sub-space / collapse W.sub(0) , V, _ = W.sub(0).collapse()

Trial, test and known functions

Purpose Command
trial / test (single) u = TrialFunction(V) , v = TestFunction(V)
trial / test (mixed) (u, p) = TrialFunctions(W) , (v, q) = TestFunctions(W)
known field f = Function(V) then f.interpolate(...)
split a mixed function u, p = ufl.split(w)

Data and geometry

Purpose Command
constant Constant(domain, value)
coordinates x = SpatialCoordinate(domain)
facet normal n = FacetNormal(domain)
cell size h = CellDiameter(domain)

Operators and measures

Purpose Command
gradient / sym. gradient grad(u) , nabla_grad(u) , sym(grad(u))
divergence div(u)
products dot(a, b) (vectors) , inner(A, B) (any rank)
build vector / branch as_vector([...]) , conditional(cond, a, b)
cell / boundary / interior dx , ds (ds(tag)) , dS
tagged measure Measure("ds", domain, subdomain_data=tags)

DG facet coupling (on dS)

Purpose Command
restrict to a side u("+") , u("-") , n("+")
jump jump(u) \(= u^{+} - u^{-}\)
jump with normal jump(u, n) \(= u^{+} n^{+} + u^{-} n^{-}\)
average avg(u) \(= \tfrac12\,(u^{+} + u^{-})\)

Assembling the form

Purpose Command
bilinear / linear a = inner(grad(u), grad(v))*dx , L = inner(f, v)*dx
combined form → split a, L = lhs(F), rhs(F) (or system(F))
compile form(a)