forked from Alexander-Barth/FluidSimDemo-WebAssembly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
75 lines (68 loc) · 2.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html>
<head>
<title>Fluid Simulation using Julia compiled to WASM</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style>
body {
font-family: Sans-Serif;
}
form {
display: table;
border-spacing: 5px;
}
form>div {
display: table-row;
}
label {
display: table-cell;
text-align: right;
}
</style>
<body>
<script type="module">
import { run } from './test_fluid_sim.js';
run(document);
</script>
<h3>Inviscid and incompressible Navier-Stokes equations in 2D implemented in Julia and compiled to WASM.</h3>
<div><canvas id="plot" width="600" height="200" /></div>
<p>The field shows the pressure of the flow around a circular obstacle. Use the mouse to change and add obstacles in the flow field. You can you
the mouse to modify the domain.</p>
<form>
<div>
<label for="pen_size">Pen size</label>
<input type="number" id="pen_size" value="10" step="1" min="1">
</div>
<div>
<label for="erase">Erase mode</label>
<input type="checkbox" id="erase" value="erase">
</div>
<div>
<label for="u0">Inflow velocity (m/s)</label><input id="u0" type="number" value="2" step="0.01" min="0">
</div>
<div>
<label for="DeltaT">Time step (s)</label><input id="DeltaT" type="number" value="0.015" step="0.001">
</div>
<div>
<label for="iter_pressure">Iteration for pressure solver</label><input id="iter_pressure" type="number" value="40" step="1" min="0">
</div>
<div>
<label for="overrelaxation">Over-relaxation factor</label><input id="overrelaxation" type="number" value="1.9" step="0.01" min="1" max="2">
</div>
</div>
<div>
<label for="pmin">Minimum pressure (Pa)</label><input id="pmin" type="number" value="-4000" step="10">
</div>
<div>
<label for="pmax">Maximum pressure (Pa)</label><input id="pmax" type="number" value="2000" step="10">
</div>
<div>
<label for="show_velocity">Show velocity</label>
<input type="checkbox" id="show_velocity" value="show_velocity">
</div>
</form>
<p>The minimum and maximum pressure are only used for plotting the pressure field. The pressure is defined only up to an additive constant.</p>
<p>More information and the code is <a href="https://github.com/Alexander-Barth/FluidSimDemo-WebAssembly">avaiable here</a>.</p>
</body>
</html>