<< Click to Display Table of Contents >> Setting the Boundary Conditions |
Boundary conditions are specified as modifiers during the walk of the perimeter of the domain.
The primary types of boundary condition are VALUE and NATURAL.
The VALUE (or Dirichlet) boundary condition specifies the value that a variable must take on at the boundary of the domain. Values may be any legal arithmetic expression, including nonlinear dependences on variables.
The NATURAL boundary condition specifies a flux at the boundary of the domain. Definitions may be any legal arithmetic expression, including nonlinear dependence on variables. With Laplace's equation, the NATURAL boundary condition is equivalent to the Neumann or normal derivative boundary condition.
Note: The precise meaning of the NATURAL boundary condition depends on the PDE for which the boundary condition is being specified. Details are discussed in the Chapter "Natural Boundary Conditions."
Each boundary condition statement takes as an argument the name of a variable. This name associates the boundary condition with one of the listed equations, for it is in reality the equation that is modified by the boundary condition. The equation modified by VALUE(u)=0, for example, is the equation which has previously been identified as defining u. NATURAL(u)=0 will depend for its meaning on the form of the equation which defines u.
In our sample problem, suppose we wish to define a zero temperature along the bottom edge, an insulating boundary on the right side, a temperature of 1 on the top edge, and an insulating boundary on the left. We can do this with these commands:
...
REGION 1 'box' { the bounding box }
START(-1,-1)
{ Phi=0 on base line: }
VALUE(Phi)=0 LINE TO(1,-1)
{ normal derivative =0 on right side: }
NATURAL(Phi)=0 LINE TO (1,1)
{ Phi = 1 on top: }
VALUE(Phi)=1 LINE TO (-1,1)
{ normal derivative =0 on left side: }
NATURAL(Phi)=0 LINE TO CLOSE
Notice that a VALUE or NATURAL statement declares a condition which will apply to the subsequent boundary segments until the declaration is changed.
Notice also that the segment shape (Line or Arc) must be restated after a change of boundary condition.
Note: Other boundary condition forms are allowed. See the Reference chapter "Sections | Boundaries".