Skip to content

Commit

Permalink
added simplest TGV example
Browse files Browse the repository at this point in the history
  • Loading branch information
PhiSpel committed Aug 22, 2024
1 parent 0983874 commit ef9830b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/00_simplest_TGV.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
This file showcases the simplicity of the lettuce code.
The following code will run a two-dimensional Taylor-Green vortex on GPU.
"""

import torch
import lettuce as lt

flow = lt.TaylorGreenVortex(
lt.Context(dtype=torch.float64), # for running on cpu: device='cpu'
resolution=128,
reynolds_number=100,
mach_number=0.05,
stencil=lt.D2Q9
)
simulation = lt.Simulation(
flow=flow,
collision=lt.BGKCollision(tau=flow.units.relaxation_parameter_lu),
reporter=[])
mlups = simulation(num_steps=1000)
print("Performance in MLUPS:", mlups)

0 comments on commit ef9830b

Please sign in to comment.