Skip to content

Commit 4fd5889

Browse files
committed
Place the advection-diffusion example files into a folder
1 parent df730bf commit 4fd5889

File tree

3 files changed

+43
-39
lines changed

3 files changed

+43
-39
lines changed

examples/generalFormPDEScript/README.md

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!-- <img src="https://feascript.github.io/FEAScript-website/assets/FEAScriptGenPDE.png" width="80" alt="FEAScript General Form PDE Logo"> -->
2+
3+
## Advection-Diffusion with Gaussian Source
4+
5+
This example demonstrates solving a one-dimensional advection-diffusion problem with a Gaussian source term using the FEAScript library. The problem models the transport equation:
6+
7+
$$
8+
\frac{d^2u}{dx^2} + 10 \frac{du}{dx} = -10 \cdot e^{-200 \cdot (x - 0.5)^2}
9+
$$
10+
11+
This can be written in the general form as:
12+
13+
$$
14+
\frac{d}{dx}\left(A(x)\frac{du}{dx}\right) + B(x)\frac{du}{dx} + C(x)u = D(x)
15+
$$
16+
17+
where:
18+
19+
- $A(x) = 1$ (diffusion coefficient)
20+
- $B(x) = 10$ (advection coefficient)
21+
- $C(x) = 0$ (no reaction term)
22+
- $D(x) = -10 \cdot e^{-200 \cdot (x - 0.5)^2}$ (Gaussian source term centered at x = 0.5)
23+
24+
### Instructions
25+
26+
This example requires the `feascript` npm package and its peer dependencies (`mathjs`). It imports FEAScript directly from the npm package and runs the simulation in a Node.js environment. To run the example, follow these instructions:
27+
28+
1. **Create package.json with ES module support:**
29+
30+
```bash
31+
echo '{"type":"module"}' > package.json
32+
```
33+
34+
2. **Install dependencies:**
35+
36+
```bash
37+
npm install feascript mathjs
38+
```
39+
40+
3. **Run the example:**
41+
```bash
42+
node advectionDiffusion1D.js
43+
```
File renamed without changes.

0 commit comments

Comments
 (0)