<< Click to Display Table of Contents >> Natural Boundary Conditions 

The NATURAL boundary condition is a generalization of the concept of a flux boundary condition. In diffusion equations, it is in fact the outward flux of the diffusing quantity. In stress equations, it is the surface load. In other equations, it can be less intuitive.
FlexPDE uses integration by parts to reduce the order of second derivative terms in the system equations.
Application of this technique over a twodimensional computation cell produces an interior area integral term and a boundary line integral term. Forming the same integral in two adjacent computation cells produces the same boundary integral at their interface, except that the direction of integration is opposite in the two cells. If the integrals are added together to form the total integral, the shared boundary integrals cancel.
•  Applied to the term dx(f), where f is an expression containing further derivative terms, integration by parts yields 
Integral(dx(f)*dV) = Integral(f*c*dS),
where c denotes the xcomponent of the outward surfacenormal unit vector and dS is the differential surface element.
(Y and Z derivative terms are handled similarly, with c replaced by the appropriate unitvector component.)
•  Applied to the term dxx(f), where f denotes a scalar quantity, integration by parts yields 
Integral(dxx(f)*dV) = Integral(dx(f)*c*dS),
where c denotes the xcomponent of the outward surfacenormal unit vector and dS is the differential surface element.
(Y and Z derivative terms are handled similarly, with c replaced by the appropriate unitvector component.)
•  Applied to the term DIV(F), where F denotes a vector quantity containing further derivative terms, integration by parts is equivalent to the divergence theorem, 
Integral(DIV(F)dV) = Integral(F . n dS),
where n denotes the outward surfacenormal unit vector and dS is the differential surface element.
•  Applied to the term CURL(F), where F denotes a vector quantity containing further derivative terms, integration by parts is equivalent to the curl theorem, 
Integral(CURL(F) dV) = Integral(n x F dS),
where again n denotes the outward surfacenormal unit vector and dS is the differential surface element.
•  FlexPDE performs these integrations in 3 dimensions, including the volume and surface elements appropriate to the geometry. In 2D Cartesian geometry, the volume cell is extended one unit in the Z direction; in 2D cylindrical geometry, the volume cell is r*dr*dtheta. 
This technique forms the basis of the treatment of exterior boundary conditions and interior material interface behavior in FlexPDE.
•  All boundary integral terms are assumed to vanish at internal cell interfaces. 
•  All boundary integral terms are assumed to vanish at internal and external boundaries, unless a NATURAL boundary condition statement provides an independent evaluation of the boundary integrand. 
There are several ramifications of this treatment:
In divergence equations, such as DIV(k F) = 0,
•  the quantity (k F . n ) will be continuous across interior material interfaces. 
•  The NATURAL boundary condition specifies the value of (k F . n) on the boundary. 
•  If (k F) is heat flux (k F = k Grad(T)), then energy will be conserved across material discontinuities, and the NATURAL boundary condition defines outward heat flux. 
•  If (k F) is electric displacement (D = eps Grad(V)) or magnetic induction (B = Curl(A)), then the material interface conditions dictated by Maxwell's equations will be satisfied, and in the electric case the NATURAL boundary condition will define the surface charge density. 
In curl equations, such as CURL(k F) = 0,
•  the quantity (k n x F) will be continuous across interior material interfaces. 
•  The NATURAL boundary condition specifies the value of (k n x F) on the boundary. 
•  If (k F) is magnetic field (H = (1/mu) Curl(A)) or electric field (E = Grad(V)), then the material interface conditions dictated by Maxwell's equations will be satisfied, and in the magnetic case the NATURAL boundary condition will define the surface current density. 
Note that it is not necessary to write the equations explicitly with the DIV or CURL operators for these conditions to be met. Any valid differential equivalent in the coordinate system of the problem will be treated the same way.
Note also that the NATURAL boundary condition and the PDE are intimately related.
•  If a differential operator has an argument that itself contains a differential operator, then that argument becomes the object of integration by parts, and generates a corresponding component of the NATURAL boundary condition. 
•  If the PDE is multiplied by some factor, then the associated NATURAL boundary condition must be multiplied by the same factor. 
•  The NATURAL boundary condition must have a sign consistent with the sign of the associated PDE terms when moved to the left side of the equation. 
•  The NATURAL boundary condition statement specifies to FlexPDE the integrand of the surface integral generated by the integration by parts, which is otherwise assumed to be zero. 