-
Notifications
You must be signed in to change notification settings - Fork 0
Physical equations
🇬🇧 English | 🇫🇷 Français
Every problem solved by oxiflow is expressed as:
where:
-
$u(\mathbf{x}, t)$ — primary field (concentration, temperature, velocity…) -
$F$ — flux tensor (advective, diffusive, dispersive) -
$S$ — source or reaction term
The symbol ∇ appears twice in the canonical form, with two distinct roles.
∇u — inside the argument of
∇·F — on the outside — is the divergence of
| scalar (concentration, temperature) | vector (matter flux, heat flux) | scalar |
| vector (velocity, magnetic field) | rank-2 tensor (stress, Maxwell) | vector |
The notation
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
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):
Transformation. Spatial terms are grouped into a single flux
The flux
Canonical form:
| Term | Role | oxiflow abstraction |
|---|---|---|
| primary field | ContextValue::ScalarField |
|
| advective + dispersive flux | computed by PhysicalModel::compute_physics()
|
|
| adsorption term (Langmuir, SMA…) | local source term computed by PhysicalModel::compute_physics()
|
|
| axial dispersion coefficient | ContextVariable::External { name: "D_ax" } |
|
| boundary conditions | Danckwerts · Neumann · Robin |
BoundaryCondition (v0.2.0) |
Péclet number:
Phenomenon. Heat is conserved: the change in internal energy of a control volume equals the net conductive flux entering it (Fourier's law:
Original equation (energy balance):
Transformation. Divide by
Canonical form:
| Term | Role | oxiflow abstraction |
|---|---|---|
| temperature field | ContextValue::ScalarField |
|
| conductive flux (Fourier) | PhysicalModel::compute_physics() |
|
| thermal diffusivity |
ContextVariable::External { name: "alpha" } → ContextValue::Scalar
|
|
| normalised volumetric power |
ContextVariable::External { name: "Q" } → ContextValue::Scalar
|
|
| boundary conditions | Dirichlet · Neumann · Robin |
BoundaryCondition (v0.2.0) |
Phenomenon. Two chemical (or biological) species diffuse through a medium and react locally. Depending on the ratio of diffusivities
Original equations (coupled system):
Transformation. Each equation is put into canonical form independently; coupling passes through
Canonical form:
| Term | Role | oxiflow abstraction |
|---|---|---|
| multi-component state |
ContextValue::VectorField ( |
|
| diffusive flux per species | PhysicalModel::compute_physics() |
|
| species diffusivities |
ContextVariable::External { name: "D_u" }, "D_v" → ContextValue::Scalar
|
|
| coupled local kinetics | source term — PhysicalModel, nonlinear |
Full multi-component support at milestone v0.3.0.
Phenomenon. Water flows through soil under a hydraulic potential gradient
Original equation (water volume conservation):
Transformation. Move the flux term to the left-hand side:
Canonical form:
| Term | Role | oxiflow abstraction |
|---|---|---|
| volumetric water content | ContextValue::ScalarField |
|
| hydraulic potential | ContextValue::ScalarField |
|
| Darcy flux | PhysicalModel::compute_physics() |
|
| nonlinear conductivity | dedicated ContextCalculator → ContextValue::ScalarField
|
|
| no source | extensible via ContextVariable::External
|
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
Transformation. The state is the conservative vector
where
Canonical form:
| Term | Role | oxiflow abstraction |
|---|---|---|
| conservative vector |
ContextValue::VectorField ( |
|
| hyperbolic flux |
PhysicalModel::compute_physics() — FV scheme with limiter |
|
| bed topography |
ContextVariable::External { name: "z_b" } → ContextValue::ScalarField
|
|
| basal friction |
ContextVariable::External { name: "tau_b" } → ContextValue::VectorField
|
|
| 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.
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
Transformation. Diffusion and migration are grouped into a single flux and moved to the left-hand side:
Canonical form:
| Term | Role | oxiflow abstraction |
|---|---|---|
| concentration of species |
ContextValue::ScalarField (per species) |
|
| diffusive + migration flux | PhysicalModel::compute_physics() |
|
| ionic diffusion coefficient |
ContextVariable::External { name: "D_i" } → ContextValue::Scalar
|
|
| electric potential |
ContextValue::ScalarField — coupled domain v0.3.0
|
|
| electrochemical reactions | source term — PhysicalModel, nonlinear |
The potential
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,
Transformation. Using
which gives:
Canonical form:
| Term | Role | oxiflow abstraction |
|---|---|---|
| magnetic field |
ContextValue::VectorField (3D) |
|
| magnetic diffusive flux | PhysicalModel::compute_physics() |
|
| magnetic diffusivity |
ContextVariable::External { name: "eta" } → ContextValue::Scalar
|
|
| 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.
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
Transformation. Introduce
where
Canonical form:
| Term | Role | oxiflow abstraction |
|---|---|---|
| displacement + velocity |
ContextValue::VectorField ( |
|
| elastic flux | PhysicalModel::compute_physics() |
|
| effective stiffness modulus |
ContextVariable::External { name: "alpha" } → ContextValue::Scalar
|
|
| damping coefficient |
ContextVariable::External { name: "C" } → ContextValue::Scalar
|
|
| external force + damping | source term — PhysicalModel
|
Newmark
For explicit integrators (Euler, RK4), stability requires that physical information travel no more than one cell per time step:
Mesh::characteristic_length() provides TimeConfiguration::save_every limits the size of SimulationResult on long simulations.
🇬🇧 English | 🇫🇷 Français
Tout problème traité par oxiflow s'écrit :
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 symbole ∇ apparaît deux fois dans la forme canonique, avec deux rôles distincts.
∇u — à l'intérieur de l'argument de
∇·F — à l'extérieur — est la divergence de
| 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
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
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) :
Transformation. On regroupe les termes spatiaux en un flux unique
Le flux
Forme canonique :
| Terme | Rôle | Abstraction oxiflow |
|---|---|---|
| champ primaire | ContextValue::ScalarField |
|
| flux advectif + dispersif | calculé par PhysicalModel::compute_physics()
|
|
| terme d'adsorption (Langmuir, SMA…) | terme source local calculé par PhysicalModel::compute_physics()
|
|
| 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 :
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 :
Équation originelle (bilan d'énergie) :
Transformation. On divise par
Forme canonique :
| Terme | Rôle | Abstraction oxiflow |
|---|---|---|
| champ de température | ContextValue::ScalarField |
|
| flux conductif (Fourier) | PhysicalModel::compute_physics() |
|
| diffusivité thermique |
ContextVariable::External { name: "alpha" } → ContextValue::Scalar
|
|
| puissance volumique normalisée |
ContextVariable::External { name: "Q" } → ContextValue::Scalar
|
|
| conditions aux limites | Dirichlet · Neumann · Robin |
BoundaryCondition (v0.2.0) |
Phénomène. Deux espèces chimiques (ou biologiques) diffusent dans un milieu et réagissent localement. Selon le rapport des diffusivités
Équations originelles (système couplé) :
Transformation. Chaque équation se met sous forme canonique indépendamment ; le couplage passe par
Forme canonique :
| Terme | Rôle | Abstraction oxiflow |
|---|---|---|
| état multi-composant |
ContextValue::VectorField ( |
|
| flux diffusif par espèce | PhysicalModel::compute_physics() |
|
| diffusivités des espèces |
ContextVariable::External { name: "D_u" }, "D_v" → ContextValue::Scalar
|
|
| cinétique locale couplée | terme source PhysicalModel — non linéaire |
Support multi-composant complet au jalon v0.3.0.
Phénomène. L'eau s'écoule dans un sol sous l'effet d'un gradient de potentiel hydraulique
Équation originelle (conservation du volume d'eau) :
Transformation. On transfère le terme de flux au membre gauche :
Forme canonique :
| Terme | Rôle | Abstraction oxiflow |
|---|---|---|
| teneur en eau volumique | ContextValue::ScalarField |
|
| potentiel hydraulique | ContextValue::ScalarField |
|
| flux de Darcy | PhysicalModel::compute_physics() |
|
| conductivité non linéaire |
ContextCalculator dédié → ContextValue::ScalarField
|
|
| pas de source | extensible via ContextVariable::External
|
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
Transformation. L'état est le vecteur conservatif
avec
Forme canonique :
| Terme | Rôle | Abstraction oxiflow |
|---|---|---|
| vecteur conservatif |
ContextValue::VectorField ( |
|
| flux hyperbolique |
PhysicalModel::compute_physics() — schéma FV avec limiteur |
|
| topographie du fond |
ContextVariable::External { name: "z_b" } → ContextValue::ScalarField
|
|
| frottement basal |
ContextVariable::External { name: "tau_b" } → ContextValue::VectorField
|
|
| 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.
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
Transformation. On regroupe diffusion et migration en un flux unique et on transfère au membre gauche :
Forme canonique :
| Terme | Rôle | Abstraction oxiflow |
|---|---|---|
| concentration de l'espèce |
ContextValue::ScalarField (par espèce) |
|
| flux diffusif + migratoire | PhysicalModel::compute_physics() |
|
| coefficient de diffusion ionique |
ContextVariable::External { name: "D_i" } → ContextValue::Scalar
|
|
| potentiel électrique |
ContextValue::ScalarField — domaine couplé v0.3.0
|
|
| réactions électrochimiques | terme source PhysicalModel — non linéaire |
Le potentiel
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,
Transformation. En réécrivant
ce qui donne :
Forme canonique :
| Terme | Rôle | Abstraction oxiflow |
|---|---|---|
| champ magnétique |
ContextValue::VectorField (3D) |
|
| flux diffusif magnétique | PhysicalModel::compute_physics() |
|
| diffusivité magnétique |
ContextVariable::External { name: "eta" } → ContextValue::Scalar
|
|
| 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.
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
Transformation. On introduit
où
Forme canonique :
| Terme | Rôle | Abstraction oxiflow |
|---|---|---|
| déplacement + vitesse |
ContextValue::VectorField ( |
|
| flux élastique | PhysicalModel::compute_physics() |
|
| module de raideur effectif |
ContextVariable::External { name: "alpha" } → ContextValue::Scalar
|
|
| coefficient d'amortissement |
ContextVariable::External { name: "C" } → ContextValue::Scalar
|
|
| force externe + amortissement | terme source PhysicalModel
|
Intégrateurs Newmark
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 :
Mesh::characteristic_length() fournit TimeConfiguration::save_every limite la taille de SimulationResult sur les longues simulations.