General-form PDE
Node.js examples of generalFormPDE, in
examples/generalFormPDE.
Run the commands below from that folder (see running an example). All results are
from FEAScript-core 0.4.0.
Advection-diffusion in 1D
Steady advection-diffusion on with a Gaussian source centered at :
that is , , and in the general form. The value is fixed at the inlet, , and the gradient is zero at the outlet.
node advectionDiffusion1D/advectionDiffusion1D.js
Source:
advectionDiffusion1D.js
Geometry
Mesh
Results
Upstream of the source the solution stays close to the inlet value. Across the source it drops, and downstream it is carried unchanged to the outlet, where . The markers are the end nodes of the elements. The example prints the node coordinates and the solution vector.
Nonlinear reaction-diffusion in 1D
Steady diffusion with a quadratic reaction on :
solved with the Newton-Raphson method (nonlinear: true, with and its derivative
). The value is fixed at and the gradient is zero at .
node nonlinearReactionDiffusion1D/nonlinearReactionDiffusion1D.js
Source:
nonlinearReactionDiffusion1D.js
Geometry
Mesh
Results
The reaction consumes as it diffuses into the domain: on the 20 linear elements of the example, at and at . The elements are 0.5 long, so these values are 0.7 % and 0.5 % below the mesh-converged solution, and , which FEAScript reaches on finer meshes. The example prints the node coordinates and the solution vector.