Skip to main content
Version: 0.2.0

Boundary conditions

Boundary conditions are added with model.addBoundaryCondition(boundaryKey, condition):

model.addBoundaryCondition("0", ["constantTemp", 200]);
  • boundaryKey is a string that identifies the boundary: "0", "1", ... (see Mesh for the keys of structured and Gmsh meshes).
  • condition is an array whose first entry is the condition type, followed by its parameters.

Each boundary holds one condition: calling addBoundaryCondition again with the same key replaces the previous condition. A boundary without a condition gets the natural (zero Neumann) condition of the model.

Condition types by model​

ModelConditionKindMeaning
Heat conduction["constantTemp", T]DirichletT=TbT = T_b on the boundary
["convection", h, Tinf]Robin−k ∂T/∂n=h(T−T∞)-k \, \partial T / \partial n = h (T - T_\infty)
["symmetry"]Neumann (natural)−k ∂T/∂n=0-k \, \partial T / \partial n = 0 (insulated or symmetry)
General form PDE["constantValue", value]Dirichletu=ubu = u_b on the boundary
["zeroGradient"]Neumann (natural)A du/dx=0A \, du/dx = 0
Front propagation["constantValue", value]DirichletArrival time of the front, u=ubu = u_b (0: initial front)
["zeroGradient"]Neumann (natural)∂u/∂n=0\partial u / \partial n = 0
Creeping flow["constantVelocity", ux, uy]Dirichletu=ubu = u_b, v=vbv = v_b on the boundary
["stressFree"]Neumann (natural)μ ∂uˉ/∂n−p nˉ=0\mu \, \partial \bar{u} / \partial n - p \, \bar{n} = 0

Here nˉ\bar{n} is the outward unit normal and ∂/∂n\partial / \partial n the derivative along it.

note

Natural conditions such as "symmetry", "zeroGradient" and "stressFree" add nothing to the discrete system: they name the condition that a boundary without a Dirichlet or Robin condition already satisfies. They are still useful to document the setup.

Unrecognized condition types​

FEAScript 0.2.0 does not check the condition types. A type that the selected model does not recognize, for example a misspelled "convektion", is ignored without a message, and that boundary gets the natural condition of the model. Check the spelling of every condition when a result looks wrong.

caution

The heat conduction model of version 0.2.0 recognizes "constantTemp" only. "constantTemperature", the name used from version 0.3.0, is ignored in 0.2.0.

How the conditions are imposed​

Following the Galerkin formulation:

  • Dirichlet conditions replace the residual of every node on the boundary: the row of the Jacobian matrix is cleared, its diagonal entry is set to one, and the residual entry is set to the prescribed value. With the frontal solver, the nodes are flagged as constrained before the elimination.
  • Robin conditions ("convection") add the boundary integral of the condition to the Jacobian matrix and the residual vector. In 2D, this integral is computed with Gauss quadrature along each element side on the boundary.
  • Natural conditions need no assembly.

When two boundaries share a node, for example at a corner of a rectangle:

  • a Dirichlet condition on either boundary takes precedence over a Robin or natural condition on the other;
  • if both boundaries have Dirichlet conditions with different values, the boundary with the larger key sets the value at the shared node (the boundaries are processed in increasing key order). In the lid-driven cavity of the creeping flow model, for example, the top-right corner takes the velocity of the right wall ("3") and the top-left corner the velocity of the lid ("2").