Minimal diffusion - advection example #206
-
Hi, The equation is: I understand how to implement first part of the equation with: eq = pde.PDE({"C": f"{D} * laplace(C)"}) But cannot find any description or examples that deal with vector fields to implement the I am asking for pointers on how to implement the advection part in Best regards. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Using vectors in |
Beta Was this translation helpful? Give feedback.
-
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() |
Beta Was this translation helpful? Give feedback.
Here is a simple example that advects a Gaussian spot:
The initial fiel,
,
gets turned into