Continuum laws and boundaries
The bundled Eqiora.Solid.LinearElasticity and Eqiora.Fluid
packages contain reusable volume laws and mechanical boundary interfaces. You
bind your own fields to them and supply a condition on each exterior face. Both
examples below compile as ordinary package imports.
The examples on this page require a development build from the same checkout: the bundled Fluid release is 0.5.0 and Solid.LinearElasticity is 0.7.0. The published Eqiora 0.1.5 distribution is unchanged and does not provide these package releases.
Scalar Poisson and Laplace
Section titled “Scalar Poisson and Laplace”Development builds bundle Eqiora.Scalar@0.3.0. Import
Eqiora.Scalar.scalar as scalar for a dimensionless potential on a
2D body whose coordinates are measured in metres. The dimensionless
coefficient defaults to one; override it explicitly for another constant.
| Component | Equation or boundary value |
|---|---|
Poisson2d |
-div(coefficient * grad(potential)) = source, with source in 1/m^2 |
Laplace2d |
The same volume law with zero source and no source argument |
FixedValue2d |
trace(potential) = value, with dimensionless boundary data |
NormalFlux2d |
normal(coefficient * grad(potential)) = flux, with flux in 1/m |
The normal flux has the positive constitutive-gradient sign. It is not
negative-gradient physical heat flux. Supply the same coefficient in the volume
and flux components. Zero flux uses flux = 0[1/m]. Normal flux requires an
authored smooth potential; the volume and fixed-value components require h1.
The caller owns the potential, body, exact boundary selections and coverage.
See the source-recovery lesson
for complete imported and handwritten versions of one problem. Save its imported
source as inverse-poisson.eqi and use the lesson runner’s complete
eqiora.compile call with its entry, geometry and parameter bindings. The
ordinary compile path resolves the bundled import. Explicit package
projects can add "Eqiora.Scalar" with version="0.3.0" through
eqiora.add_bundled_dependency and vendor it for offline reopening.
These Poisson and Laplace components have a dimensionless potential; use the separate thermal components below for Kelvin temperature. The lesson derives its heat nondimensionalization separately. The package contract and verification case describe the existing host reference Q1 checks. The package adds no FVM, MPI, GPU, unstructured-mesh, Robin or periodic execution support.
Steady heat conduction
Section titled “Steady heat conduction”The same Eqiora.Scalar@0.3.0 module also provides fixed-SI thermal components:
SteadyHeat2d: Fourier flux-conductivity * grad(temperature)and volumetricheating.TransientHeat2d: the same flux/source plusstorage capacity * temperaturefor a caller-owned temperature State, with capacity in J/(m³ K).FixedTemperature2d: prescribed Kelvin temperature expression on a boundary.OutwardHeatFlux2d: prescribed physical outward heat flux expression in W/m².
Temperature is a Kelvin Field, conductivity is an explicit parameter in W/(m K),
and heating has units W/m³. Positive heat flux leaves the body; use
flux = 0[W/m^2] for insulation. Flux boundaries require authored smooth
regularity and the same conductivity as the volume; volume and fixed-temperature
components require h1. The caller supplies the body, Field and complete
boundary coverage.
The heated-body lesson shows the imports first and the same equations written by hand. Focused product tests check Cartesian 2D Q1 on CPU, both physical flux signs, unit/support diagnostics and Plan/Result replay. The storage lesson uses imported constant-capacity heat with caller-owned initial data, Q1 and backward Euler; it also retains the same transient Law written by hand. Positive capacity is a physical-use assumption, not a new package positivity check. This package adds no validated threaded, MPI, GPU, convective or coupled-interface thermal workflow.
Elastic balance and boundaries
Section titled “Elastic balance and boundaries”import Eqiora.Solid.LinearElasticity.linear_elasticity as solid;
model ReferenceElasticBody() { domain body = box(0, 1, 0, 1); domain left = boundary(body, axis = 0, side = lower); domain right = boundary(body, axis = 0, side = upper); domain bottom = boundary(body, axis = 1, side = lower); domain top = boundary(body, axis = 1, side = upper); variable displacement: vector<m, 2> on body in smooth;
parameter mu: Pa = 3; parameter lambda: Pa = 2; instance balance: solid.IsotropicBalance2d( body = body, displacement = displacement, mu = mu, lambda = lambda ); instance elasticity: solid.IsotropicMechanicalInterface2d( body = body, exterior = boundaries(left, right, bottom, top), displacement = displacement, mu = mu, lambda = lambda ); instance clamp: solid.FixedDisplacement2d(body = body, face = left); instance free_right: solid.ZeroTraction2d(body = body, face = right); instance free_bottom: solid.ZeroTraction2d(body = body, face = bottom); instance free_top: solid.ZeroTraction2d(body = body, face = top);
connect elasticity.mechanical[boundary = left], clamp.mechanical; connect elasticity.mechanical[boundary = right], free_right.mechanical; connect elasticity.mechanical[boundary = bottom], free_bottom.mechanical; connect elasticity.mechanical[boundary = top], free_top.mechanical;}The square is clamped on the left and traction-free elsewhere. Its volume load is
zero, so its equilibrium displacement is zero. The Lamé parameters are
mu = 3 Pa and lambda = 2 Pa. The boundary conditions act on the same
displacement field as the volume equations.
Elastic components
Section titled “Elastic components”Component in Eqiora.Solid.LinearElasticity.linear_elasticity |
Use |
|---|---|
IsotropicBalance2d |
Unforced small-strain equilibrium with Lamé parameters mu and lambda |
IsotropicBalanceWithPotential2d |
The same balance with a conservative body load |
IsotropicMechanicalInterface2d |
Displacement trace and outward elastic traction on the complete exterior |
FixedDisplacement2d |
Zero displacement on one face |
ZeroTraction2d |
Zero traction on one face |
The balance uses stress .
For IsotropicBalanceWithPotential2d, load_potential is a scalar with units of pressure whose gradient gives the body
force; it is neither a boundary pressure nor a general vector force. The
interface’s QuasistaticMechanicalBoundary connector pairs displacement with
traction, so a connected terminal shares the body’s displacement and carries the
opposite traction.
For plane strain, derive the Lamé parameters from Young’s modulus and Poisson’s ratio as and . For plane stress, use the effective in-plane value instead.
Read strain and stress for the constitutive derivation and the mixed-boundary square for a loaded calculation.
Steady Stokes flow
Section titled “Steady Stokes flow”import Eqiora.Fluid.fluid as fluid;
model ReferenceStokes() { domain body = box(0, 4, 0, 1); domain left = boundary(body, axis = 0, side = lower); domain right = boundary(body, axis = 0, side = upper); domain bottom = boundary(body, axis = 1, side = lower); domain top = boundary(body, axis = 1, side = upper); variable velocity: vector<m / s, 2> on body in smooth; variable pressure: Pa on body in h1; parameter inlet_speed: m / s = 1;
parameter viscosity: Pa * s = 1; instance flow: fluid.SteadyStokes2d( body = body, exterior = boundaries(left, right, bottom, top), velocity = velocity, pressure = pressure, dynamic_viscosity = viscosity ); instance inlet: fluid.NormalVelocityInlet2d( body = body, face = left, speed = inlet_speed ); instance outlet: fluid.TractionFree2d(body = body, face = right); instance lower_wall: fluid.NoSlip2d(body = body, face = bottom); instance upper_wall: fluid.NoSlip2d(body = body, face = top); connect flow.mechanical[boundary = left], inlet.mechanical; connect flow.mechanical[boundary = right], outlet.mechanical; connect flow.mechanical[boundary = bottom], lower_wall.mechanical; connect flow.mechanical[boundary = top], upper_wall.mechanical;}The inlet specifies inward normal speed, the top and bottom walls impose zero velocity, and the outlet imposes zero total traction. The model contains no advective or inertial term: use it when viscous stresses dominate.
SteadyStokes2d combines the unforced volume balance with the complete exterior
velocity/traction interface. SteadyStokesBalance2d is the volume law alone;
use it when composing a custom interface. ForcedSteadyStokes2d and
ForcedSteadyStokesBalance2d require a physical force-potential Field. The
unforced forms do not create a zero-potential Field.
The example imports its inward-normal inlet, no-slip walls and traction-free outlet from the same package. On the left the outward normal points left, so positive inward speed gives rightward flow. Zero total traction at the outlet does not prescribe zero pressure. Boundary expressions retain their units, Parameters and exact parent support. Complete vector data remain subject to the selected numerical method’s existing diagnostics.
Stokes flow and boundaries derives these conditions. Computing incompressible flow continues to mesh and solver choices.
The imported example uses concrete Cartesian domains. A Component can also build its complete exterior from formal boundary arguments bound to caller Geometry. The cylinder example uses this form for grouped walls and a circular obstacle, with the same imported Stokes and boundary components. Geometry checks complete, disjoint coverage; each boundary connection keeps the same selection and parent. Numerical support remains method-specific: steady 2D Stokes accepts prescribed vectors without a normal, while normal-dependent expressions require a supported exact normal.
Compile either package example
Section titled “Compile either package example”Save either model as model.eqi and compile it with the bundled imports:
import eqiora
model = eqiora.compile(path="model.eqi")To keep an explicit package project for vendoring and offline reopening, create its manifest and install the bundled dependency:
from pathlib import Pathimport eqiora
project = Path("continuum")(project / "src").mkdir(parents=True, exist_ok=True)(project / "src/main.eqi").write_text(Path("model.eqi").read_text())(project / "eqiora.toml").write_text( '[package]\nname = "org.example.Continuum"\nversion = "0.1.0"\nentry = "main"\n')store = Path("package-store")store.mkdir(exist_ok=True)resolution = eqiora.add_bundled_dependency( project, store, "Eqiora.Solid.LinearElasticity", version="0.7.0")model = eqiora.compile_package(store, resolution, entry="ReferenceElasticBody")For the Stokes example, use "Eqiora.Fluid" and entry "ReferenceStokes";
its package version is "0.5.0". add_bundled_dependency installs the
package sources and writes the lock. To run the model, add a mesh and a
numerical method as described in the modeling guide.
Inertial flow law
Section titled “Inertial flow law”The repository source package Eqiora.Fluid defines the separate
ForcedInertialStokes2d volume component:
public component ForcedInertialStokes2d( support body: volume(ambient_dimension = 2), state velocity: vector<m / s, 2> on body, variable pressure: kg / (m * s ^ 2) on body, variable force_potential: kg / (m * s ^ 2) on body, parameter density: kg / m ^ 3, parameter dynamic_viscosity: kg / (m * s)) { relation momentum on body { density * derivative(velocity) - div( 2 * dynamic_viscosity * symmetric_part(grad(velocity)) - isotropic_lift(pressure) ) - grad(force_potential) = 0; } relation incompressibility on body { div(velocity) = 0; }}It binds a velocity state, pressure and force-potential fields, density, and dynamic viscosity. The time derivative adds inertia; there is still no velocity-advection term. Supply initial velocity, boundary conditions, pressure reference where needed, and a time method when building a complete problem around this law.
For a time-dependent advective flow example, see
cylinder wakes.
Eqiora.Fluid and Eqiora.Solid.LinearElasticity also contain
three-dimensional dynamic volume and interface declarations.
Other source packages
Section titled “Other source packages”Eqiora.Solid provides plane-strain and plane-stress components in terms of
Young’s modulus and Poisson’s ratio. It remains a separate source package;
this Fluid consolidation does not change its distribution.