Skip to content
Projects

Refluxing

The equations of patchwork.mesh.reflux, declared on the code that implements them and checked by the tests.

FluxRegister

classsource

Matches the fluxes of coarse and fine levels at their interfaces (refluxing).

balance
Vi uin+1−uinΔt=−∑f∈∂iAf Ff nf,i,nf,i=±1V_i\,\frac{u_i^{n+1} - u_i^n}{\Delta t} = -\sum_{f\in\partial i} A_f\,F_f\,n_{f,i}, \qquad n_{f,i} = \pm 1
register
δf=∑fine steps∑fine facess AF−s AcFc,s=Δt (default)\delta_f = \sum_{\text{fine steps}} \sum_{\text{fine faces}} s\,A F - s\,A_c F_c, \qquad s = \Delta t \text{ (default)}
reflux
uc+=∓δfVc(− for the face above the cell, + below), then restrictu_c \mathrel{+}= \mp\frac{\delta_f}{V_c} \quad (- \text{ for the face above the cell, } + \text{ below}), \text{ then restrict}
Assumes
  • the fluxes are the caller's: flux densities along the axis, per block, from its own cells and halo
  • coarse-fine faces are those between leaf cells of different levels: proper nesting is not needed
  • the integral then changes only through the domain's faces, to round-off, in the plane and in (r,z)(r, z)
  • subcycling: a finer level takes rr steps of Δt/r\Delta t / r, then reflux(level=); scale =Δt/2= \Delta t / 2 per stage of Heun
References
Built from