![Page 1: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/1.jpg)
My First Fluid Project
Ryan Schmidt
![Page 2: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/2.jpg)
OutlineMAC MethodHow far did I get?What went wrong?Future Work
![Page 3: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/3.jpg)
The MAC MethodMarker-and-Cell – Harlow&Welch 1965
Standard technique for simulating incompressible fluids w/Navier-Stokes fluid equations
LANL Technical Report (access restricted!!!)
![Page 4: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/4.jpg)
Navier-Stokes Fluid Dynamics
Velocity field u, Pressure field pViscosity v, density d (constants)External force f
Navier-Stokes Equation:
Mass Conservation Condition:
![Page 5: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/5.jpg)
Navier-Stokes EquationDerived from momentum conservation condition4 Components:
Advection/ConvectionDiffusion (damping)
PressureExternal force (gravity, etc)
System of Nonlinear partial differential equations
![Page 6: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/6.jpg)
Incompressibility Condition
We want incompressible fluids*Velocity field u has zero divergence
Mass conservation over any subregionFlow in == flow outIncompressible fluid
Comes from continuum assumption
*gasses assumed to be locally incompressible
![Page 7: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/7.jpg)
Spatial DiscretizationStaggered grid for uCentered grid for p
(Cells)
![Page 8: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/8.jpg)
Equation DiscretizationCentral differences for spatial derivativesForward difference for time derivativeu component:
![Page 9: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/9.jpg)
Mathematical TrickeryAdvection form different in literature:
These two are equivalent if the fluid is incompressible. Proof:
![Page 10: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/10.jpg)
MarkersCell resolution very coarse (20-150)Want higher resolution surfaceAlso need to track which cells contain fluid
Solution: ‘Marker’ particlesMassless particles that flow freely in u fieldDo not contribute to computationVery fast to process
![Page 11: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/11.jpg)
MAC AlgorithmInitialize u,p grids (easier said than done)
Forward-difference u to get new velocities
Enforce zero-divergence condition
Rinse and repeat
![Page 12: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/12.jpg)
Enforcing Zero Divergence2 possibilities:
Iterative procedureProjection method of Stam99
Iterative Procedure – Pressure Iteration
Individually set each cell divergence to 0Calculate pressure change and modify velocities
Repeat over entire grid until maximum cell divergence < predefined tolerance
![Page 13: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/13.jpg)
Pressure IterationFor each cell calculate change in pressure
Now update cell:
![Page 14: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/14.jpg)
Bad Formatting?Does this:
Mean this?:
Inverse dependence onBut set to If << , Di,j will be small?
If not, system explodes!
![Page 15: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/15.jpg)
How far did I get?
![Page 16: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/16.jpg)
Well…
![Page 17: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/17.jpg)
It’s not pretty…
![Page 18: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/18.jpg)
Symmetry?Tried to reproduce experiments in literature
Correct Physical Constants! d=1, v=0.01, g=981 for breaking dam
Inflow supposed to be symmetric…
![Page 19: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/19.jpg)
What went wrong?
![Page 20: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/20.jpg)
Initial Conditions ?!?System becomes unstable as soon as there is any large amount of divergence
How do we specify initial conditions that will give us motion w/o immediately causing unstable divergence?
(I don’t know…)Inflow is simple case, but it still doesn’t work…
![Page 21: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/21.jpg)
Boundary Conditions Many, many cases
Too many to have special cases of finite difference equation
Solution: construct velocities & pressures in boundary cells so that standard finite difference equation comes out right
I may have them wrong…Not sure when to apply them
Unclear how order of application affects velocties…
![Page 22: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/22.jpg)
Wall BoundariesNormal velocity is 0
Prevents flow into boundary cellAlso have to set internal pressure
No-slipzero tangential velocity
Free-slip free tangential velocity
![Page 23: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/23.jpg)
Wall Boundary ProblemAssumption is made that there is only one adjacent fluid cell
What if there is morethan one?
Cannot do both…
![Page 24: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/24.jpg)
Free-Surface BoundariesHave to make sure that divergence in surface cells is 0
Lots of casesI think this is where my problem is28 cases and counting…
Asymmetry?
![Page 25: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/25.jpg)
Outer Tangential Velocities
Interpolation in surface cells reaches out into empty cells
Finite difference equations may as well
Need to have same velocity set there
![Page 26: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/26.jpg)
Future WorkGo back and check boundary conditions
Harass Nick Foster
Finish report and put it on the web, hope that someone reads it and has some insight
![Page 27: My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work](https://reader035.vdocuments.us/reader035/viewer/2022062618/55146aa5550346414e8b5d78/html5/thumbnails/27.jpg)
Thanks!
Questions?