Skip to content

Commit ef9830b

Browse files
committed
added simplest TGV example
1 parent 0983874 commit ef9830b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

examples/00_simplest_TGV.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""
2+
This file showcases the simplicity of the lettuce code.
3+
The following code will run a two-dimensional Taylor-Green vortex on GPU.
4+
"""
5+
6+
import torch
7+
import lettuce as lt
8+
9+
flow = lt.TaylorGreenVortex(
10+
lt.Context(dtype=torch.float64), # for running on cpu: device='cpu'
11+
resolution=128,
12+
reynolds_number=100,
13+
mach_number=0.05,
14+
stencil=lt.D2Q9
15+
)
16+
simulation = lt.Simulation(
17+
flow=flow,
18+
collision=lt.BGKCollision(tau=flow.units.relaxation_parameter_lu),
19+
reporter=[])
20+
mlups = simulation(num_steps=1000)
21+
print("Performance in MLUPS:", mlups)

0 commit comments

Comments
 (0)