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 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.
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.
When one temperature stops being enough
Section titled “When one temperature stops being enough”A thick wall can be warm on one side and cold on the other. One state cannot represent both. Introduce a field , with position across a slab of thickness . In a steady, uniform, source-free slab with fixed end temperatures, our prediction is a straight profile:
At it returns ; at it returns ; 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 |
| Vector field | magnitude and direction | heat flux |
| Second-order tensor field | a linear action on a direction | stress |
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 , and on the right face toward positive .
Work out a gradient before reading syntax
Section titled “Work out a gradient before reading syntax”Take , , and . The derivative is . 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.
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:
// 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.
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.
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.
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
Here and are nondimensional coordinates; this is a mathematical test problem rather than a dimensional heat source. Differentiate twice in each coordinate: each second derivative contributes . 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: . 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.
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?
Exercise guidance
Section titled “Exercise guidance”For exercise 3, . 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 at and . 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.
References
Section titled “References”- Gilbert Strang and Edwin “Jed” Herman, Calculus, volume 3 (OpenStax, 2016), section 6.1, Vector fields and section 6.5, Divergence and curl, for the field and differential-operator meanings used here.
Previous: Ordinary differential equations · Back to the series map · Next: Conservation laws