5. Fields and spatial domains
A field needs somewhere to live
Section titled “A field needs somewhere to live”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 separates the semantic support from concrete geometry. A volume says that a field lives in a region; its boundaries identify the places where the interior model meets its surroundings. Meshes and discretization choices come later.
Learning outcomes
Section titled “Learning outcomes”After this chapter, you should be able to:
- distinguish a field’s role, support, dimension, and value shape;
- read
grad,div,trace, andnormalby 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.
Name the region and its boundaries
Section titled “Name the region and its boundaries”The steady cylinder example declares one two-dimensional fluid volume and four named parts of its boundary:
component FlowRegion( 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),) { variable velocity: vector<m / s, 2> on fluid; variable pressure: kg / (m * s ^ 2) on fluid; // Interior and boundary equations complete the component.}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.
Read spatial operators by where they act
Section titled “Read spatial operators by where they act”For a scalar field and vector field :
| Expression | Meaning | Where the result is used |
|---|---|---|
| spatial rate of change of a scalar | in the volume | |
| net outward tendency per unit volume | in the volume | |
| interior value restricted to a boundary | on the boundary | |
| normal action of a tensor | on the boundary |
The operators also transform dimensions. If velocity has dimension , its divergence has dimension . 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.
The model uses these roles directly:
relation incompressibility on fluid { div(velocity) = 0;}
relation wall_velocity on walls { trace(velocity) = 0;}The first relation is an interior statement. The second compares the boundary trace of the interior velocity with a prescribed zero velocity.
Read the complete steady-flow model.
A spatial equation with a known solution
Section titled “A spatial equation with a known solution”For a scalar field on the unit square, a useful checking problem is
The source is chosen so the solution is known: . 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 verification package contains its Eqiora declarations, and the registered Poisson case describes the numerical comparison. For a complete public spatial workflow, follow the cylinder Gallery case, whose equations and execution both refer to the same flow problem.
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.
Exercises
Section titled “Exercises”- State the support, dimension, and value shape of
velocityandpressure. - Explain why
trace(velocity)belongs in a relation onwalls, not in the volume relation for incompressibility. - If temperature has dimension , what dimension does its gradient have?
- Add a named
symmetryboundary to the support declarations. What physical relation would still need to be supplied before the name has meaning?
Previous: Ordinary differential equations · Back to the series map · Next: Conservation laws