Skip to content

Minimal diffusion - advection example #206

Answered by david-zwicker
domagojhack asked this question in Q&A
Discussion options

You must be logged in to vote

Here is a simple example that advects a Gaussian spot:

grid = pde.CartesianGrid([[-10, 10], [-10, 10]], 32)
field = pde.ScalarField.from_expression(grid, 'exp(-x**2-y**2)')
velocity = pde.VectorField.from_expression(grid, ['1', '1'])
eq = pde.PDE({'c': 'laplace(c) - dot(velocity, gradient(c))'}, consts={'velocity': velocity})
result = eq.solve(field, t_range=5)
result.plot()

The initial fiel,
,
gets turned into

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@domagojhack
Comment options

Comment options

You must be logged in to vote
3 replies
@domagojhack
Comment options

@david-zwicker
Comment options

@domagojhack
Comment options

Answer selected by domagojhack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #205 on February 27, 2022 09:38.