replaced phiflow >> op calls with .at()
This commit is contained in:
parent
bc8b2ddf73
commit
0bccd934cc
File diff suppressed because one or more lines are too long
@ -174,8 +174,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"A lot has happened in this `step()` call: we've advected the smoke field, added an upwards force via a Boussinesq model, advected the velocity field, and finally made it divergence free via a pressure solve.\n",
|
"A lot has happened in this `step()` call: we've advected the smoke field, added an upwards force via a Boussinesq model, advected the velocity field, and finally made it divergence free via a pressure solve.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"The Boussinesq model uses a multiplication by a tuple `(0, buoyancy_factor)` to turn the smoke field into a staggered, 2 component force field, sampled at the locations of the velocity components via the `>>` operator. \n",
|
"The Boussinesq model uses a multiplication by a tuple `(0, buoyancy_factor)` to turn the smoke field into a staggered, 2 component force field, sampled at the locations of the velocity components via the `at()` function. This function makes sure the individual force components are correctly interpolated for the velocity components of the staggered velocity. Note that this also directly ensure the boundary conditions of the original grid are kept. It internally also does `StaggeredGrid(..., extrapolation.ZERO,...)` for the resulting force grid. \n",
|
||||||
"This operator makes sure the individual force components are correctly interpolated for the velocity components of the staggered velocity. `>>` could be rewritten via the sampling function `at()` as `(smoke*(0,buoyancy_factor)).at(velocity)`. However, `>>` also directly ensure the boundary conditions of the original grid are kept. Hence, it internally also does `StaggeredGrid(..., extrapolation.ZERO,...)` for the force grid. Long story short: the `>>` operator does the same thing, and typically produces shorter and more readable code.\n",
|
|
||||||
"\n",
|
"\n",
|
||||||
"The pressure projection step in `make_incompressible` is typically the computationally most expensive step in the sequence above. It solves a Poisson equation for the boundary conditions of the domain, and updates the velocity field with the gradient of the computed pressure.\n",
|
"The pressure projection step in `make_incompressible` is typically the computationally most expensive step in the sequence above. It solves a Poisson equation for the boundary conditions of the domain, and updates the velocity field with the gradient of the computed pressure.\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user