Skip to content

solving stokes equation in 2d using boundary integration method on the stream function. A variant of Sherman–Lauricella equation is used.

Notifications You must be signed in to change notification settings

WangHaiYang874/stokes2d

Repository files navigation

stokes 2d

This repository aims to build solvers of 2d Stokes equation using boundary integration method of stream function in Greengard et al. for some simple geometries: a straight pipe, a curved pipe, a pipe with multiple income and outcome branches, etc.

As pipes can be connected to form a network of pipes, our solvers can be connected to form a solver for a network of pipes. This gives us a fast and efficient way to build solver for 2d Stokes equation on complicated network of pipes.

On the other hand, this could also be used as a direct way of building solvers for 2d Stokes equation on bounded geometries with prescribed boundary velocity.

credit

This is a summer project of Haiyang Wang as an undergraduate math student at NYU Courant, guided and advised by professor Greengard, Phd. Fryklund, and Phd. Samuel Potter.

todo

top of my todo.

  • finish the paper.
  • a solver for a multiply connected domain.
  • merge multiply connected domain with simply connected domain.
  • verify correction term for post-processing

math-ish

  • create different geometries
    • a simple straight pipe.
    • some bands with fixed angles.
    • Nlets 里面相临的两条线不能是平行的.

engineering-ish

  • add the finder for z.
  • add reverse_orientation method to the scheme: probably by simply rebuild the curves.
  • write a build script to be ran on a server.
  • change some instance of flatten to ravel.
  • store every data of the standard pieces. the data needs to include
  • removing scipy, 主要的scipy的dependency在
    • gmres
    • quad
    • LinearOperator

games

  • how to use matplotlib with pygame
  • the coordinate system of pygame is stupid. Can I change that? see stacks overflow.

probably later.

  • think about particles. it is hard but think about it... s

done

  • extracting grad pressure
  • extracting pressure difference across the tubes. this could be done with a path integral. More: it can be built into part of the solver. so in the web page we can simply take the pre-solved results easily and take a linear combination. the presolved idea applies to velocity field as well. We can simply store it, when using it we can simply take a linear combination.
  • find the appropriate energy function. explained in Fredrik's email, pressure drop is energy per unit volume. So we should only care about that.
  • understand how to handle geometry with corners by adding some caps and smooth corners.
    • smooth caps
    • smooth corners
  • vectorize the evaluation of the solver
  • (maybe later) ffm-ize the evaluation of the solver
  • refactoring everything into a easy to use software package
    • refactoring the geometry class
  • debugging the solve to get spectral accuracy
  • using gmres instead of np.linalg.solve
  • Geometry objects refactoring
    • make them sampler obeying the $5h$-rule is obeyed given a $\epsilon <= 5h$.
    • make them sampler that satisfies the ledregre coefficients.
    • make them carrying the initial conditions of velocity:
      • for non-cap geometry, it will be simply all zeros
      • for cap geometry, it will need to be assigned a flux and then have a boolean for inlet or outlet.
  • investigating how far away does the flow returns to poiseuille again: The key thing is to attempt to characterize how fast the return to Poiseuille occurs in a length-normalized setting.
    • plot flow everywhere in the domain
    • to visualize the "return to Poiseuille": to plot the error along the axis of symmetry of the pipe. Then, instead of a heat map, you can make a semilogy plot with "length along the tube" on the x-axis and absolute error on the y-axis. That is, plot a 1D slice of your image plots in a semilogy plot to make the error clearer.
    • 😂 do the weird doubly obstructed tube with only one side with obstruction? so it will be asymmetric.
    • Do a parameter study: it is likely that the relative size of your obstruction is what controls the length over which the return to Poiseuille occurs. I recommend creating a parametrized version of your geometry where you can control the size of the obstruction with a single scalar parameter. I doubt there is any good reason to have two bumps on either side of the channel---a simple thing you could do is add a (smoothed?) semicircular "bite" on either side of the pipe of radius r. Then you can try plotting the "deviation from Poiseuille" with respect to the scale parameter r/R.
    • check whether this provides an upper bound on how fast the return to Poiseuille happens. E.g., if you can fit one obstruction inside of another obstruction, will the return happen for the smaller, contained obstruction at least as fast as for the larger obstruction? Probably Fredrik or Leslie can weigh in and give some insight as to whether this is likely to be the case... I don't know, myself.
    • set a tol for return to poiseuille, varying the obstruction height, and observe how fast it is returning.
    • measure the difference of your flow to a Poiseuille flow at distance 7.5 from the obstruction (there you seem to reach the error imposed by the GMRES tolerance) as you increase N? Please plot this error vs the number of points on the boundary in log log scale.
    • Nlets
      • Y-shaped with varying parameter for optimization
      • cross.
  • an algorithm that connects the pipes.
    • abstract pipe:
      • lets
        • position: matching_pt
        • dir
        • radius
      • flows (fluxes) (lets[1:])
        • the pressure drops
        • fluxes
      • each lets is a vertex, each flow is an edge.
    • aggregate those pipes into a pipe system.
  • analytically explain the return to poiseuille behaviour.
  • plotting
    • give a specific criterion to check if a point is in that geometry.
    • the velocity field should be corrected near the boundary.
      • this essentially ask me to determine if a point is close to a curve, and such criterion should be implemented for each curve to have the best performance:
    • pressure and vorticity field as well?
    • have a method for plotting the velocity field using perhaps imshow
    • have a method for plotting the actual boundary of the geometry using a not-so-thin balck line.
    • i can also plot vector field and stream line with number. How surprising.
    • base points for each pipe. and when plotting, every coordinate needs to be shifted.
  • make sure that no two pipe intersects: this requires calculating intersection of two polygons, I am not sure how to do it for now.
  • package the gaussian quadrature rules from scipy into something like a json file?.
  • organize my python files.
  • test the matching, see if it really works well.

About

solving stokes equation in 2d using boundary integration method on the stream function. A variant of Sherman–Lauricella equation is used.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published