Skip to content

Physical equations

@biface edited this page May 1, 2026 · 1 revision

Physical domains and equations

🇬🇧 English | 🇫🇷 Français


Canonical form

Every problem solved by oxiflow is expressed as:

$$\frac{\partial u}{\partial t} + \nabla \cdot F(u, \nabla u) = S(u, \mathbf{x}, t)$$

where:

  • $u(\mathbf{x}, t)$ — primary field (concentration, temperature, velocity…)
  • $F$ — flux tensor (advective, diffusive, dispersive)
  • $S$ — source or reaction term

The role of the ∇ operator

The symbol ∇ appears twice in the canonical form, with two distinct roles.

∇u — inside the argument of $F$ — is the gradient of $u$. For a scalar field it produces a vector pointing in the direction of steepest increase. It encodes how $u$ varies in space, which is the information diffusive flux needs.

∇·F — on the outside — is the divergence of $F$. It measures the net flux balance at a point: inflow minus outflow per unit volume. It reduces the rank of $F$ by one:

$u$ $F$ $\nabla \cdot F$
scalar (concentration, temperature) vector (matter flux, heat flux) scalar
vector (velocity, magnetic field) rank-2 tensor (stress, Maxwell) vector

The notation $F(u, \nabla u)$ means: the flux depends on the state and its gradient, which covers both advection ($F \propto u$) and diffusion ($F \propto \nabla u$).

Common numerical structure

Whatever the physics, the discrete structure is always the same:

u          →  field discretised on mesh nodes
∇u         →  gradient approximated at faces (FD, FV, FEM)
∇·F        →  flux balance at faces → nodal value
∂u/∂t      →  time integrator (Euler, RK4, DoPri45…)

The sections below show, for eight physical domains, how the original equation transforms into this single form and which terms play the role of $F$ and $S$.


Chromatographic transport

Phenomenon. A solute injected into a packed column is carried by the mobile phase (advection) while spreading longitudinally (axial dispersion) and exchanging with the stationary phase (adsorption). This is oxiflow's reference validation case, inherited from the chromatography project and reformulated on the generic engine.

Original equation (mass balance on the mobile phase, 1D column):

$$\frac{\partial c}{\partial t} + v\frac{\partial c}{\partial z} = D_{ax}\frac{\partial^2 c}{\partial z^2} - F_{\text{ads}}(c)$$

Transformation. Spatial terms are grouped into a single flux $F$ and the source term is identified:

$$\frac{\partial c}{\partial t} + \frac{\partial}{\partial z}\ \underbrace{\left(v\ c - D_{ax}\frac{\partial c}{\partial z}\right)}_{F} = \underbrace{-F_{\text{ads}}(c)}_{S}$$

The flux $F = vc - D_{ax},\nabla c$ combines advective transport (proportional to $c$) and dispersive flux (proportional to $\nabla c$, Fick's law).

Canonical form:

Term Role oxiflow abstraction
$u = c(z, t)$ primary field ContextValue::ScalarField
$F = vc - D_{ax},\nabla c$ advective + dispersive flux computed by PhysicalModel::compute_physics()
$S = -F_{\text{ads}}(c)$ adsorption term (Langmuir, SMA…) local source term computed by PhysicalModel::compute_physics()
$D_{ax}$ axial dispersion coefficient ContextVariable::External { name: "D_ax" }
boundary conditions Danckwerts · Neumann · Robin BoundaryCondition (v0.2.0)

Péclet number: $\text{Pe} = vL/D_{ax}$. For $\text{Pe} > 50$, simplified Dirichlet boundary conditions are acceptable; otherwise Danckwerts conditions (Robin inlet, Neumann outlet) are required.


Transient heat transfer

Phenomenon. Heat is conserved: the change in internal energy of a control volume equals the net conductive flux entering it (Fourier's law: $\mathbf{q} = -\lambda\nabla T$) plus volumetric sources (Joule heating, chemical reactions, absorbed radiation…).

Original equation (energy balance):

$$\rho C_p \frac{\partial T}{\partial t} = \nabla \cdot (\lambda \nabla T) + Q(\mathbf{x}, t)$$

Transformation. Divide by $\rho C_p$ and move the flux term to the left-hand side:

$$\frac{\partial T}{\partial t} + \nabla \cdot \underbrace{\ \left(-\frac{\lambda}{\rho C_p}\nabla T\right)}_{F} = \underbrace{\frac{Q}{\rho C_p}}_{S}$$

Canonical form:

Term Role oxiflow abstraction
$u = T(\mathbf{x}, t)$ temperature field ContextValue::ScalarField
$F = -\alpha,\nabla T$ conductive flux (Fourier) PhysicalModel::compute_physics()
$\alpha = \lambda/\rho C_p$ thermal diffusivity ContextVariable::External { name: "alpha" }ContextValue::Scalar
$S = Q/\rho C_p$ normalised volumetric power ContextVariable::External { name: "Q" }ContextValue::Scalar
boundary conditions Dirichlet · Neumann · Robin BoundaryCondition (v0.2.0)

Reaction-diffusion systems

Phenomenon. Two chemical (or biological) species diffuse through a medium and react locally. Depending on the ratio of diffusivities $D_u/D_v$ and the chosen kinetics, these systems spontaneously produce periodic spatial structures (Turing instability, Gray–Scott patterns, FitzHugh–Nagumo oscillations). They are the paradigm of self-organisation in reactive media.

Original equations (coupled system):

$$\frac{\partial u}{\partial t} = D_u,\nabla^2 u + f(u, v), \qquad \frac{\partial v}{\partial t} = D_v,\nabla^2 v + g(u, v)$$

Transformation. Each equation is put into canonical form independently; coupling passes through $S$:

$$\frac{\partial u}{\partial t} + \nabla \cdot \underbrace{(-D_u,\nabla u)}_{F_u} = \underbrace{f(u, v)}_{S_u}$$

$$\frac{\partial v}{\partial t} + \nabla \cdot \underbrace{(-D_v,\nabla v)}_{F_v} = \underbrace{g(u, v)}_{S_v}$$

Canonical form:

Term Role oxiflow abstraction
$\mathbf{u} = [u, v]^\top$ multi-component state ContextValue::VectorField ($n_\text{nodes} \times 2$)
$F_k = -D_k,\nabla u_k$ diffusive flux per species PhysicalModel::compute_physics()
$D_u,D_v$ species diffusivities ContextVariable::External { name: "D_u" }, "D_v"ContextValue::Scalar
$S_k = f_k(\mathbf{u})$ coupled local kinetics source term — PhysicalModel, nonlinear

Full multi-component support at milestone v0.3.0.


Flow in porous media — Darcy / Richards

Phenomenon. Water flows through soil under a hydraulic potential gradient $\psi$ (pressure + gravity). In the saturated zone, Darcy's law is linear. In the unsaturated zone, the hydraulic conductivity $K(\theta)$ depends strongly on the volumetric water content $\theta$ — this is Richards' equation, which governs infiltration, drainage and water redistribution in soils.

Original equation (water volume conservation):

$$\frac{\partial \theta}{\partial t} = \nabla \cdot \bigl(K(\theta),\nabla \psi\bigr)$$

Transformation. Move the flux term to the left-hand side:

$$\frac{\partial \theta}{\partial t} + \nabla \cdot \underbrace{\bigl(-K(\theta),\nabla \psi\bigr)}_{F} = \underbrace{0}_{S}$$

Canonical form:

Term Role oxiflow abstraction
$u = \theta(\mathbf{x}, t)$ volumetric water content ContextValue::ScalarField
$\psi$ hydraulic potential ContextValue::ScalarField
$F = -K(\theta),\nabla\psi$ Darcy flux PhysicalModel::compute_physics()
$K(\theta)$ nonlinear conductivity dedicated ContextCalculatorContextValue::ScalarField
$S = 0$ no source extensible via ContextVariable::External

Free-surface flow — Shallow Water (Saint-Venant)

Phenomenon. The Saint-Venant equations (1871) describe the flow of a shallow water layer: floods, tsunamis, lahars, lake draining. They result from the vertical integration of the Navier–Stokes equations under the hydrostatic assumption. The system couples mass conservation (continuity) and momentum conservation.

Original equations (water depth $h$, depth-averaged velocity $\mathbf{v}$):

$$\frac{\partial h}{\partial t} + \nabla \cdot (h\mathbf{v}) = 0$$

$$\frac{\partial (h\mathbf{v})}{\partial t} + \nabla \cdot \ \left(h\mathbf{v} \otimes \mathbf{v} + \frac{g h^2}{2}\ \mathbf{I}\right) = -gh,\nabla z_b + \frac{1}{\rho},\boldsymbol{\tau}_b$$

Transformation. The state is the conservative vector $\mathbf{U} = [h,, h v_x,, h v_y]^\top$:

$$\frac{\partial \mathbf{U}}{\partial t} + \nabla \cdot \underbrace{\mathcal{F}(\mathbf{U})}_{F} = \underbrace{\mathbf{S}(h, \mathbf{v})}_{S}$$

where $\mathcal{F}$ is the hyperbolic flux tensor (mass flux + hydrostatic pressure + momentum advection) and $S$ is the topographic and basal friction source term.

Canonical form:

Term Role oxiflow abstraction
$u = [h, hv_x, hv_y]^\top$ conservative vector ContextValue::VectorField ($n_\text{nodes} \times 3$)
$F = \mathcal{F}(\mathbf{U})$ hyperbolic flux PhysicalModel::compute_physics() — FV scheme with limiter
$z_b$ bed topography ContextVariable::External { name: "z_b" }ContextValue::ScalarField
$\boldsymbol{\tau}_b$ basal friction ContextVariable::External { name: "tau_b" }ContextValue::VectorField
$S$ topographic + friction source dedicated ContextCalculator

This case illustrates the full power of the framework: a nonlinear coupled hyperbolic system fits into the canonical form without any modification to the numerical infrastructure.

Exit criterion at milestone v0.3.0: lahar–lake prototype on coupled structured grids.


Electrochemical transport — Nernst–Planck

Phenomenon. In an electrolyte, ions migrate under two simultaneous forces: a concentration gradient (Fickian diffusion) and an electric potential gradient (field-driven migration). The Nernst–Planck equation (1888–1890) is the fundamental transport law for electrochemical cells, biological membranes and supercapacitors.

Original equation (ionic species $i$ of charge $z_i$):

$$\frac{\partial c_i}{\partial t} = \nabla \cdot \ \left(D_i,\nabla c_i + \frac{z_i D_i}{RT},c_i,\nabla\varphi\right) + R_i(\mathbf{c})$$

Transformation. Diffusion and migration are grouped into a single flux and moved to the left-hand side:

$$\frac{\partial c_i}{\partial t} + \nabla \cdot \underbrace{\ \left(-D_i,\nabla c_i - \frac{z_i D_i}{RT},c_i,\nabla\varphi\right)}_{F_i} = \underbrace{R_i(\mathbf{c})}_{S_i}$$

Canonical form:

Term Role oxiflow abstraction
$u = c_i(\mathbf{x}, t)$ concentration of species $i$ ContextValue::ScalarField (per species)
$F_i = -D_i\nabla c_i - \frac{z_iD_i}{RT}c_i\nabla\varphi$ diffusive + migration flux PhysicalModel::compute_physics()
$D_i$ ionic diffusion coefficient ContextVariable::External { name: "D_i" }ContextValue::Scalar
$\varphi$ electric potential ContextValue::ScalarField — coupled domain v0.3.0
$S_i = R_i(\mathbf{c})$ electrochemical reactions source term — PhysicalModel, nonlinear

The potential $\varphi$ is itself the solution of a coupled Poisson equation — a typical case of strong cross-domain coupling v0.3.0).


Resistive magnetic diffusion

Phenomenon. In a conducting medium (plasma, molten metal, Earth's core), a time-varying magnetic field induces currents (Faraday's law) which in turn generate a magnetic field (Ampère's law). The resistivity of the medium dissipates these currents: the field diffuses and attenuates. This is low-frequency magnetohydrodynamics, relevant to tokamak design, induction heating and the geodynamo.

Original equation (diffusive regime, $\mathbf{B}$ magnetic field, $\mu$ permeability, $\sigma$ conductivity):

$$\frac{\partial \mathbf{B}}{\partial t} = \frac{1}{\mu\sigma},\nabla^2 \mathbf{B}$$

Transformation. Using $\nabla^2\mathbf{B} = \nabla(\nabla\cdot\mathbf{B}) - \nabla\times(\nabla\times\mathbf{B})$ and $\nabla\cdot\mathbf{B}=0$:

$$\nabla^2\mathbf{B} = \nabla\cdot(\nabla\mathbf{B})$$

which gives:

$$\frac{\partial \mathbf{B}}{\partial t} + \nabla \cdot \underbrace{!\left(-\frac{1}{\mu\sigma},\nabla\mathbf{B}\right)}_{F} = \underbrace{0}_{S}$$

Canonical form:

Term Role oxiflow abstraction
$u = \mathbf{B}(\mathbf{x}, t)$ magnetic field ContextValue::VectorField (3D)
$F = -\eta,\nabla\mathbf{B}$ magnetic diffusive flux PhysicalModel::compute_physics()
$\eta = 1/\mu\sigma$ magnetic diffusivity ContextVariable::External { name: "eta" }ContextValue::Scalar
$S = 0$ no source (free regime) current sources via ContextVariable::External

The finite Element Method on unstructured meshes is required for realistic geometries — milestone v2.0.0.


Structural dynamics — second-order systems

Phenomenon. Mechanical structures (beams, plates, shells) subjected to dynamic loads obey the generalised Newton's second law. The resulting equation is second-order in time. By introducing velocity as an auxiliary variable, it is reduced to a first-order system compatible with the canonical form — without loss of generality and without modifying the integrator.

Original equation (damped vibration with stiffness $K$, damping $C$, force $F$):

$$\frac{\partial^2 u}{\partial t^2} + C\frac{\partial u}{\partial t} + Ku = F(\mathbf{x}, t)$$

Transformation. Introduce $w = \partial u/\partial t$ and write the first-order system:

$$\frac{\partial u}{\partial t} + \nabla \cdot \underbrace{0}_{F_u} = \underbrace{w}_{S_u}$$

$$\frac{\partial w}{\partial t} + \nabla \cdot \underbrace{(-\alpha,\nabla u)}_{F_w} = \underbrace{F/\rho - Cw}_{S_w}$$

where $K$ is the spatial stiffness operator (for linear elasticity: $K = -\nabla\cdot(\mathbb{C}:\nabla)$, stiffness tensor $\mathbb{C}$).

Canonical form:

Term Role oxiflow abstraction
$\mathbf{u} = [u, w]^\top$ displacement + velocity ContextValue::VectorField ($n_\text{nodes} \times 2$)
$F_w = -\alpha,\nabla u$ elastic flux PhysicalModel::compute_physics()
$\alpha$ effective stiffness modulus ContextVariable::External { name: "alpha" }ContextValue::Scalar
$C$ damping coefficient ContextVariable::External { name: "C" }ContextValue::Scalar
$S_w = F/\rho - Cw$ external force + damping source term — PhysicalModel

Newmark $\beta$ and HHT $\alpha$ integrators are planned for milestone v0.4.0, which preserve the stability properties of implicit schemes required for structural dynamics.


Numerical stability — CFL condition

For explicit integrators (Euler, RK4), stability requires that physical information travel no more than one cell per time step:

$$\text{CFL} = \frac{v,\Delta t}{\Delta x} \leq 1$$

Mesh::characteristic_length() provides $\Delta x$ without exposing the internal mesh structure v0.1.0. TimeConfiguration::save_every limits the size of SimulationResult on long simulations.


Domaines physiques et équations

🇬🇧 English | 🇫🇷 Français


Forme canonique

Tout problème traité par oxiflow s'écrit :

$$\frac{\partial u}{\partial t} + \nabla \cdot F(u, \nabla u) = S(u, \mathbf{x}, t)$$

où :

  • $u(\mathbf{x}, t)$ — champ primaire (concentration, température, vitesse…)
  • $F$ — tenseur de flux (advectif, diffusif, dispersif)
  • $S$ — terme source ou de réaction

Le rôle de l'opérateur ∇

Le symbole ∇ apparaît deux fois dans la forme canonique, avec deux rôles distincts.

∇u — à l'intérieur de l'argument de $F$ — est le gradient de $u$. Pour un champ scalaire, il produit un vecteur orienté dans la direction de plus forte variation. Il encode comment $u$ varie dans l'espace, information dont le flux diffusif a besoin.

∇·F — à l'extérieur — est la divergence de $F$. Elle mesure le bilan net de flux en un point : flux entrant moins flux sortant par unité de volume. Elle réduit le rang de $F$ d'un cran :

$u$ $F$ $\nabla \cdot F$
scalaire (concentration, température) vecteur (flux de matière, flux de chaleur) scalaire
vecteur (vitesse, champ magnétique) tenseur rang 2 (contrainte, Maxwell) vecteur

La notation $F(u, \nabla u)$ signifie : le flux dépend de l'état et de son gradient, ce qui couvre à la fois l'advection ($F \propto u$) et la diffusion ($F \propto \nabla u$).

Structure numérique commune

Quelle que soit la physique, la structure discrète est toujours la même :

u          →  champ discrétisé sur les nœuds du maillage
∇u         →  gradient approché aux faces (différences finies, volumes finis, FEM)
∇·F        →  bilan de flux aux faces → valeur nodale
∂u/∂t      →  intégrateur temporel (Euler, RK4, DoPri45…)

Les sections suivantes montrent, pour huit domaines physiques, comment l'équation originelle se transforme en cette forme unique, et quels termes jouent le rôle de $F$ et de $S$.


Transport chromatographique

Phénomène. Un soluté injecté dans une colonne remplie d'un garnissage solide est entraîné par l'écoulement (advection) tout en se dispersant longitudinalement (dispersion axiale) et en s'échangeant avec la phase stationnaire (adsorption). C'est le cas de référence d'oxiflow, hérité du projet chromatography et reformulé sur la base du moteur générique.

Équation originelle (bilan de matière sur la phase mobile, colonne 1D) :

$$\frac{\partial c}{\partial t} + v\frac{\partial c}{\partial z} = D_{ax}\frac{\partial^2 c}{\partial z^2} - F_{\text{ads}}(c)$$

Transformation. On regroupe les termes spatiaux en un flux unique $F$ et on identifie le terme source :

$$\frac{\partial c}{\partial t} + \frac{\partial}{\partial z}\underbrace{\left(v\ c - D_{ax}\frac{\partial c}{\partial z}\right)}_{F} = \underbrace{-F_{\text{ads}}(c)}_{S}$$

Le flux $F = vc - D_{ax},\nabla c$ combine le transport advectif (proportionnel à $c$) et le flux dispersif (proportionnel à $\nabla c$, loi de Fick).

Forme canonique :

Terme Rôle Abstraction oxiflow
$u = c(z, t)$ champ primaire ContextValue::ScalarField
$F = vc - D_{ax},\nabla c$ flux advectif + dispersif calculé par PhysicalModel::compute_physics()
$S = -F_{\text{ads}}(c)$ terme d'adsorption (Langmuir, SMA…) terme source local calculé par PhysicalModel::compute_physics()
$D_{ax}$ coefficient de dispersion axiale ContextVariable::External { name: "D_ax" }ContextValue::Scalar
Paramètres isotherme Henry, capacité, sélectivité… ContextVariable::External { name: "…" }ContextValue::Scalar
Conditions aux limites Danckwerts (Robin entrée · Neumann sortie) BoundaryCondition (v0.2.0)

Nombre de Péclet : $\text{Pe} = vL/D_{ax}$. Pour $\text{Pe} > 50$, les conditions aux limites de Dirichlet simplifié sont acceptables ; sinon les conditions de Danckwerts (Robin entrée, Neumann sortie) sont requises.


Transfert thermique transitoire

Phénomène. La chaleur se conserve : la variation d'énergie interne d'un volume de contrôle est égale au flux conductif net entrant (loi de Fourier : $\mathbf{q} = -\lambda\nabla T$) plus les sources volumiques (effet Joule, réaction chimique, rayonnement absorbé…).

Équation originelle (bilan d'énergie) :

$$\rho C_p \frac{\partial T}{\partial t} = \nabla \cdot (\lambda \nabla T) + Q(\mathbf{x}, t)$$

Transformation. On divise par $\rho C_p$ et on transfère le terme de flux au membre gauche :

$$\frac{\partial T}{\partial t} + \nabla \cdot \underbrace{\left(-\frac{\lambda}{\rho C_p}\nabla T\right)}_{F} = \underbrace{\frac{Q}{\rho C_p}}_{S}$$

Forme canonique :

Terme Rôle Abstraction oxiflow
$u = T(\mathbf{x}, t)$ champ de température ContextValue::ScalarField
$F = -\alpha,\nabla T$ flux conductif (Fourier) PhysicalModel::compute_physics()
$\alpha = \lambda/\rho C_p$ diffusivité thermique ContextVariable::External { name: "alpha" }ContextValue::Scalar
$S = Q/\rho C_p$ puissance volumique normalisée ContextVariable::External { name: "Q" }ContextValue::Scalar
conditions aux limites Dirichlet · Neumann · Robin BoundaryCondition (v0.2.0)

Systèmes réaction-diffusion

Phénomène. Deux espèces chimiques (ou biologiques) diffusent dans un milieu et réagissent localement. Selon le rapport des diffusivités $D_u/D_v$ et la cinétique choisie, ces systèmes produisent spontanément des structures spatiales périodiques (instabilité de Turing, motifs de Gray–Scott, oscillations de type FitzHugh–Nagumo). Ils sont le paradigme du phénomène d'auto-organisation en milieu réactif.

Équations originelles (système couplé) :

$$\frac{\partial u}{\partial t} = D_u,\nabla^2 u + f(u, v), \qquad \frac{\partial v}{\partial t} = D_v,\nabla^2 v + g(u, v)$$

Transformation. Chaque équation se met sous forme canonique indépendamment ; le couplage passe par $S$ :

$$\frac{\partial u}{\partial t} + \nabla \cdot \underbrace{(-D_u,\nabla u)}_{F_u} = \underbrace{f(u, v)}_{S_u}$$

$$\frac{\partial v}{\partial t} + \nabla \cdot \underbrace{(-D_v,\nabla v)}_{F_v} = \underbrace{g(u, v)}_{S_v}$$

Forme canonique :

Terme Rôle Abstraction oxiflow
$\mathbf{u} = [u, v]^\top$ état multi-composant ContextValue::VectorField ($n_\text{nœuds} \times 2$)
$F_k = -D_k,\nabla u_k$ flux diffusif par espèce PhysicalModel::compute_physics()
$D_u,,D_v$ diffusivités des espèces ContextVariable::External { name: "D_u" }, "D_v"ContextValue::Scalar
$S_k = f_k(\mathbf{u})$ cinétique locale couplée terme source PhysicalModel — non linéaire

Support multi-composant complet au jalon v0.3.0.


Écoulement en milieu poreux — Darcy / Richards

Phénomène. L'eau s'écoule dans un sol sous l'effet d'un gradient de potentiel hydraulique $\psi$ (pression + gravité). En zone saturée, la loi de Darcy est linéaire. En zone non saturée, la conductivité hydraulique $K(\theta)$ dépend fortement de la teneur en eau $\theta$ — c'est l'équation de Richards, qui gouverne l'infiltration, le drainage et la redistribution de l'eau dans les sols.

Équation originelle (conservation du volume d'eau) :

$$\frac{\partial \theta}{\partial t} = \nabla \cdot \bigl(K(\theta),\nabla \psi\bigr)$$

Transformation. On transfère le terme de flux au membre gauche :

$$\frac{\partial \theta}{\partial t} + \nabla \cdot \underbrace{\bigl(-K(\theta),\nabla \psi\bigr)}_{F} = \underbrace{0}_{S}$$

Forme canonique :

Terme Rôle Abstraction oxiflow
$u = \theta(\mathbf{x}, t)$ teneur en eau volumique ContextValue::ScalarField
$\psi$ potentiel hydraulique ContextValue::ScalarField
$F = -K(\theta),\nabla\psi$ flux de Darcy PhysicalModel::compute_physics()
$K(\theta)$ conductivité non linéaire ContextCalculator dédié → ContextValue::ScalarField
$S = 0$ pas de source extensible via ContextVariable::External

Écoulement à surface libre — Saint-Venant

Phénomène. Les équations de Saint-Venant (1871) décrivent l'écoulement d'une lame d'eau peu profonde : crues, tsunamis, lahars, vidange de lacs. Elles résultent de l'intégration verticale des équations de Navier–Stokes sous hypothèse hydrostatique. Le système couple la conservation de la masse (continuité) et la conservation de la quantité de mouvement.

Équations originelles (profondeur $h$, vitesse profil-moyenne $\mathbf{v}$) :

$$\frac{\partial h}{\partial t} + \nabla \cdot (h\mathbf{v}) = 0$$

$$\frac{\partial (h\mathbf{v})}{\partial t} + \nabla \cdot !\left(h\mathbf{v} \otimes \mathbf{v} + \frac{g h^2}{2},\mathbf{I}\right) = -gh,\nabla z_b + \frac{1}{\rho},\boldsymbol{\tau}_b$$

Transformation. L'état est le vecteur conservatif $\mathbf{U} = [h,, h v_x,, h v_y]^\top$ :

$$\frac{\partial \mathbf{U}}{\partial t} + \nabla \cdot \underbrace{\mathcal{F}(\mathbf{U})}_{F} = \underbrace{\mathbf{S}(h, \mathbf{v})}_{S}$$

avec $\mathcal{F}$ le tenseur de flux hyperbolique (flux de masse + pression hydrostatique + advection de quantité de mouvement) et $S$ le terme source topographique et de frottement basal.

Forme canonique :

Terme Rôle Abstraction oxiflow
$u = [h, hv_x, hv_y]^\top$ vecteur conservatif ContextValue::VectorField ($n_\text{nœuds} \times 3$)
$F = \mathcal{F}(\mathbf{U})$ flux hyperbolique PhysicalModel::compute_physics() — schéma FV avec limiteur
$z_b$ topographie du fond ContextVariable::External { name: "z_b" }ContextValue::ScalarField
$\boldsymbol{\tau}_b$ frottement basal ContextVariable::External { name: "tau_b" }ContextValue::VectorField
$S$ source topographique + frottement ContextCalculator dédié

Ce cas illustre la pleine puissance du framework : un système hyperbolique non linéaire couplé entre dans la forme canonique sans modification de l'infrastructure numérique.

Critère de sortie au jalon v0.3.0 : proto lahar–lac sur grilles structurées couplées.


Transport électrochimique — Nernst-Planck

Phénomène. Dans un électrolyte, les ions migrent sous deux forces simultanées : le gradient de concentration (diffusion de Fick) et le gradient de potentiel électrique (migration sous champ). L'équation de Nernst–Planck (1888–1890) est la loi de transport fondamentale des cellules électrochimiques, des membranes biologiques et des supercondensateurs.

Équation originelle (espèce ionique $i$ de charge $z_i$) :

$$\frac{\partial c_i}{\partial t} = \nabla \cdot !\left(D_i,\nabla c_i + \frac{z_i D_i}{RT},c_i,\nabla\varphi\right) + R_i(\mathbf{c})$$

Transformation. On regroupe diffusion et migration en un flux unique et on transfère au membre gauche :

$$\frac{\partial c_i}{\partial t} + \nabla \cdot \underbrace{!\left(-D_i,\nabla c_i - \frac{z_i D_i}{RT},c_i,\nabla\varphi\right)}_{F_i} = \underbrace{R_i(\mathbf{c})}_{S_i}$$

Forme canonique :

Terme Rôle Abstraction oxiflow
$u = c_i(\mathbf{x}, t)$ concentration de l'espèce $i$ ContextValue::ScalarField (par espèce)
$F_i = -D_i\nabla c_i - \frac{z_iD_i}{RT}c_i\nabla\varphi$ flux diffusif + migratoire PhysicalModel::compute_physics()
$D_i$ coefficient de diffusion ionique ContextVariable::External { name: "D_i" }ContextValue::Scalar
$\varphi$ potentiel électrique ContextValue::ScalarField — domaine couplé v0.3.0
$S_i = R_i(\mathbf{c})$ réactions électrochimiques terme source PhysicalModel — non linéaire

Le potentiel $\varphi$ est lui-même solution d'une équation de Poisson couplée — cas typique de couplage fort inter-domaines v0.3.0.


Diffusion magnétique résistive

Phénomène. Dans un milieu conducteur (plasma, métal en fusion, noyau terrestre), un champ magnétique variable induit des courants (loi de Faraday) qui à leur tour génèrent un champ magnétique (loi d'Ampère). La résistivité du milieu dissipe ces courants : le champ diffuse et s'atténue. C'est la magnétohydrodynamique basse fréquence, pertinente pour la conception de tokamaks, le chauffage par induction et la géodynamo.

Équation originelle (régime diffusif, $\mathbf{B}$ champ magnétique, $\mu$ perméabilité, $\sigma$ conductivité) :

$$\frac{\partial \mathbf{B}}{\partial t} = \frac{1}{\mu\sigma},\nabla^2 \mathbf{B}$$

Transformation. En réécrivant $\nabla^2\mathbf{B} = \nabla(\nabla\cdot\mathbf{B}) - \nabla\times(\nabla\times\mathbf{B})$ et en utilisant $\nabla\cdot\mathbf{B}=0$ :

$$\nabla^2\mathbf{B} = -\nabla\times(\nabla\times\mathbf{B}) = \nabla\cdot(\nabla\mathbf{B})$$

ce qui donne :

$$\frac{\partial \mathbf{B}}{\partial t} + \nabla \cdot \underbrace{!\left(-\frac{1}{\mu\sigma},\nabla\mathbf{B}\right)}_{F} = \underbrace{0}_{S}$$

Forme canonique :

Terme Rôle Abstraction oxiflow
$u = \mathbf{B}(\mathbf{x}, t)$ champ magnétique ContextValue::VectorField (3D)
$F = -\eta,\nabla\mathbf{B}$ flux diffusif magnétique PhysicalModel::compute_physics()
$\eta = 1/\mu\sigma$ diffusivité magnétique ContextVariable::External { name: "eta" }ContextValue::Scalar
$S = 0$ pas de source (régime libre) sources de courant via ContextVariable::External

La méthode des éléments finis sur maillage non structuré est requise pour les géométries réalistes — jalon v2.0.0.


Dynamique structurale — systèmes du second ordre

Phénomène. Les structures mécaniques (poutres, plaques, coques) soumises à des charges dynamiques obéissent à la deuxième loi de Newton généralisée. L'équation résultante est du second ordre en temps. En introduisant la vitesse comme variable auxiliaire, on la ramène à un système du premier ordre compatible avec la forme canonique — sans perte de généralité et sans modifier l'intégrateur.

Équation originelle (vibrations amorties avec raideur $K$, amortissement $C$, force $F$) :

$$\frac{\partial^2 u}{\partial t^2} + C\frac{\partial u}{\partial t} + Ku = F(\mathbf{x}, t)$$

Transformation. On introduit $w = \partial u/\partial t$ et on écrit le système du premier ordre :

$$\frac{\partial u}{\partial t} + \nabla \cdot \underbrace{0}_{F_u} = \underbrace{w}_{S_u}$$

$$\frac{\partial w}{\partial t} + \nabla \cdot \underbrace{(-\alpha,\nabla u)}_{F_w} = \underbrace{F/\rho - Cw}_{S_w}$$

$K$ est l'opérateur de raideur spatiale (pour l'élasticité linéaire : $K = -\nabla\cdot(\mathbb{C}:\nabla)$, tenseur des rigidités $\mathbb{C}$).

Forme canonique :

Terme Rôle Abstraction oxiflow
$\mathbf{u} = [u, w]^\top$ déplacement + vitesse ContextValue::VectorField ($n_\text{nœuds} \times 2$)
$F_w = -\alpha,\nabla u$ flux élastique PhysicalModel::compute_physics()
$\alpha$ module de raideur effectif ContextVariable::External { name: "alpha" }ContextValue::Scalar
$C$ coefficient d'amortissement ContextVariable::External { name: "C" }ContextValue::Scalar
$S_w = F/\rho - Cw$ force externe + amortissement terme source PhysicalModel

Intégrateurs Newmark $\beta$ et HHT $\alpha$ prévus au jalon v0.4.0, qui conservent les propriétés de stabilité des schémas implicites nécessaires à la dynamique structurale.


Stabilité numérique — condition CFL

Pour les intégrateurs explicites (Euler, RK4), la stabilité exige que l'information physique ne parcoure pas plus d'une maille par pas de temps :

$$\text{CFL} = \frac{v,\Delta t}{\Delta x} \leq 1$$

Mesh::characteristic_length() fournit $\Delta x$ sans exposer la structure interne du maillage v0.1.0. TimeConfiguration::save_every limite la taille de SimulationResult sur les longues simulations.