Skip to content
Get started

5. Fields and spatial domains

A scalar such as pressure assigns one value to each point of a region. A velocity field assigns a spatial vector. Writing only a quantity and its unit is therefore incomplete: a spatial model must also say which support carries the field and what shape its values have.

Eqiora keeps the support, which says where a field lives, separate from the concrete geometry. A volume says that a field lives in a region; its boundaries mark where the interior model meets its surroundings. Meshes and discretization come later.

After this chapter, you should be able to:

  • distinguish a field’s role, support, dimension, and value shape;
  • read grad, div, trace, and normal by their mathematical roles;
  • identify which quantities live in a volume and which are compared on its boundary; and
  • diagnose an operator applied to the wrong kind of field.

A thick wall can be warm on one side and cold on the other. One state T(t)T(t) cannot represent both. Introduce a field T(x,t)T(x,t), with position xx across a slab of thickness LL. In a steady, uniform, source-free slab with fixed end temperatures, our prediction is a straight profile:

T(x)=Th+(Tc−Th)xL.T(x)=T_h+(T_c-T_h)\frac{x}{L}.

At x=0x=0 it returns ThT_h; at x=Lx=L it returns TcT_c; at the midpoint it is their average. Later chapters derive why steady conservation and constant conductivity imply this shape. For now, the point is how a field attaches a value to each place.

Object What changes with position? Example
Scalar field one number temperature TT
Vector field magnitude and direction heat flux j\boldsymbol j
Second-order tensor field a linear action on a direction stress σ\boldsymbol\sigma

A vector’s components depend on a chosen coordinate frame. The physical heat flow does not change when we rotate the axes. A boundary’s outward normal also depends on geometry: on the left face of this slab it points toward negative xx, and on the right face toward positive xx.

Take Th=340 KT_h=340\,\mathrm K, Tc=300 KT_c=300\,\mathrm K, and L=0.2 mL=0.2\,\mathrm m. The derivative is dT/dx=−200 K/m\mathrm dT/\mathrm dx=-200\,\mathrm{K/m}. The gradient points toward increasing temperature, here toward the hot left side. Fourier’s law will give a heat flux pointing the other way. Merely knowing that the field lies between 300 and 340 K does not reveal this direction.

A field is defined on a domain before we choose sampling points. A mesh is one way to approximate that domain and its fields; refining it adds numerical resolution without changing the wall’s physical thickness or boundary names. The following flow source makes those same distinctions for vector velocity and scalar pressure. Read its declarations first, then return to its balances after the conservation and constitutive chapters.

The steady cylinder example declares one two-dimensional fluid volume and four named parts of its boundary:

steady-flow-past-cylinder.eqi
// Equations-only component for steady, incompressible flow around a cylinder.
// The concrete channel and cylinder Geometry are authored separately in Python.
public component SteadyFlowPastCylinder(
support fluid: volume(ambient_dimension = 2),
support inlet: boundary(parent = fluid),
support outlet: boundary(parent = fluid),
support walls: boundary(parent = fluid),
support cylinder: boundary(parent = fluid),
// Values supplied when the component is compiled into a Model.
parameter dynamic_viscosity: kg / (m * s),
parameter zero_pressure: kg / (m * s ^ 2),
parameter inlet_speed: m / s,
parameter channel_height: m
) {
// Supports name the volume and its semantic boundaries without defining their shape.
// Unknown continuum fields live on the fluid volume.
variable velocity: vector<m / s, 2> on fluid in smooth;
variable pressure: kg / (m * s ^ 2) on fluid in h1;
// Auxiliary fields keep prescribed forcing and profiles explicit and unit-checked.
variable force_potential: kg / (m * s ^ 2) on fluid;
variable inlet_profile: m / s on fluid in h1;
relation force_definition on fluid {
force_potential - zero_pressure = 0;
}
relation inlet_profile_definition on fluid {
inlet_profile
- 4 * inlet_speed * coordinate(1) * (channel_height - coordinate(1))
/ channel_height ^ 2 = 0;
}
// Steady Stokes momentum balance and incompressibility in the fluid volume.
relation momentum on fluid {
-div(
2 * dynamic_viscosity * symmetric_part(grad(velocity))
- isotropic_lift(pressure)
) - grad(force_potential) = 0;
}
relation incompressibility on fluid {
div(velocity) = 0;
}
// Boundary laws: parabolic inlet, traction-free outlet, and no-slip walls.
relation inlet_velocity on inlet {
trace(velocity) + normal(isotropic_lift(inlet_profile)) = 0;
}
relation outlet_traction on outlet {
normal(
2 * dynamic_viscosity * symmetric_part(grad(velocity))
- isotropic_lift(pressure)
) = 0;
}
relation wall_velocity on walls { trace(velocity) = 0; }
relation cylinder_velocity on cylinder { trace(velocity) = 0; }
}

velocity and pressure share the support fluid, but their value shapes differ. The four boundary supports do not create four new fluids; they name where distinct boundary relations apply.

For a scalar field pp and vector field u\boldsymbol{u}:

Expression Meaning Where the result is used
∇p\nabla p spatial rate of change of a scalar in the volume
∇ ⁣⋅u\nabla\!\cdot\boldsymbol{u} net outward tendency per unit volume in the volume
tr⁡u\operatorname{tr}\boldsymbol{u} interior value restricted to a boundary on the boundary
Tn\boldsymbol{T}\boldsymbol{n} normal action of a tensor on the boundary

The operators also transform dimensions. If velocity has dimension L/TL/T, its divergence has dimension 1/T1/T. If pressure has dimension force per area, its gradient has dimension force per volume. Shape and dimension are separate checks, and both must make sense.

Locate incompressibility and wall_velocity in the source. The first is an interior statement; the second compares the boundary trace of interior velocity with a prescribed zero velocity. A boundary name alone imposes neither relation.

Read the complete steady-flow model.

For a scalar field on the unit square, a useful checking problem is

−div⁡(grad⁡u)=2π2sin⁡(πx)sin⁡(πy),u=0 on all four sides.-\operatorname{div}(\operatorname{grad} u) =2\pi^2\sin(\pi x)\sin(\pi y), \qquad u=0\text{ on all four sides}.

Here xx and yy are nondimensional coordinates; this is a mathematical test problem rather than a dimensional heat source. Differentiate twice in each coordinate: each second derivative contributes −π2sin⁡(πx)sin⁡(πy)-\pi^2\sin(\pi x)\sin(\pi y). Their negative sum gives the right-hand side. On every side one sine factor vanishes. Thus both the interior equation and the boundary values are checked independently.

The source is chosen so the solution is known: u(x,y)=sin⁡(πx)sin⁡(πy)u(x,y)=\sin(\pi x)\sin(\pi y). This is a scalar Poisson problem, not the cylinder-flow model above. Knowing the answer in advance lets a numerical comparison measure error instead of relying on a plausible-looking picture.

The Poisson example package contains the corresponding declarations. The numerical-simulation path explains why a known solution is useful for studying approximation error. To continue with the velocity and pressure fields above, follow fluid mechanics and the cylinder investigation.

Deliberate failure: divergence of a scalar

Section titled “Deliberate failure: divergence of a scalar”

Replace the incompressibility relation with div(pressure) = 0. Pressure is a scalar, while divergence here expects a spatial vector or tensor. The field is still on the right support and its unit is still valid, but the operator has no matching shape. Repair the mathematical statement; changing the mesh or solver cannot make the expression meaningful.

  1. State the support, dimension, and value shape of velocity and pressure.
  2. Explain why trace(velocity) belongs in a relation on walls, not in the volume relation for incompressibility.
  3. If temperature has dimension Θ\Theta, what dimension does its gradient have?
  4. Add a named symmetry boundary to the support declarations. What physical relation would still need to be supplied before the name has meaning?

For exercise 3, [∇T]=Θ/L[\nabla T]=\Theta/L. For exercise 4, a support name identifies a location; it does not yet impose no flow, a prescribed value, or a stress. State the physical symmetry and then derive which normal or tangential quantities it constrains.

Field check. For the slab, evaluate TT at x=L/4x=L/4 and 3L/43L/4. If a numerical profile has the right endpoint values but the wrong midpoint slope, which interior assumption should you inspect? Boundary agreement alone does not establish the field equation.

Previous: Ordinary differential equations · Back to the series map · Next: Conservation laws