Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Please help with a fluid solver ^_^

  1. Jan 24, 2005 #1
    I've been working for the last month trying to figure this out.
    I am trying to produce a computational solver for fluid dynamics based on the Navier-Stokes Equations. I have derived the finite difference form of all the terms and worked out the operators, but I have been unable in finding any way to claculate the pressure at a given point in the next frame. If someone could explain or possibly show me some pseudo-code to the procedure, I would be appreciative.

    Thanks in Advance,
  2. jcsd
  3. Jan 26, 2005 #2
    hmmm.. bump?
  4. Jan 26, 2005 #3


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I'll move this over to math perhaps someone there can help out.

    Meanwhile, if you posted what you have for the discretized equations it may spur some conversation.
  5. Jan 26, 2005 #4
    The equations for Navier-Stokes that I have been working on also have some problems as well now that I look at them. I assume I am using an incorrect order of operatins.

    [tex] \frac{\partial \bold{u}}{\partial t} + \bold{u} \cdot \nabla{\bold{u}} = -\frac{\nabla{P}}{\rho} + \nu\nabla^2\bold{u} [/tex]

    Where [tex]\bold{u}[/tex] is the fluid parcel velocity, [tex]\rho[/tex] is the parcel density, and [tex]P[/tex] is the pressure at that point.

    I have discretized this (I'm sure with some mistake(s) :smile: ) to...

    [tex]\frac{\bold{u}_{t+\delta}-2 \bold{u}_{t}+\bold{u}_{t-\delta}}{\delta t^2} + \bold{u} \cdot<\frac{\partial \bold{u}}{\partial x},\frac{\partial \bold{u}}{\partial y}>= -\frac{<\frac{\partial P}{\partial x},\frac{\partial P}{\partial y}>}{\rho} + \nu({\frac{\partial^2 \bold{u}}{\partial x^2}+\frac{\partial^2 \bold{u}}{\partial y^2}}) \bold{u} [/tex]

    then translates to (for the new frame) :

    [tex]\bold{u}_{t+\delta}= \delta^2 ( -\frac{<\frac{\partial P}{\partial x},\frac{\partial P}{\partial y}>}{\rho} + \nu({\frac{\partial^2 \bold{u}}{\partial x^2}+\frac{\partial^2 \bold{u}}{\partial y^2}} - <\bold{u}\cdot\frac{\partial \bold{u}}{\partial x},\frac{\partial \bold{u}}{\partial y}>) \bold{u} ) + 2\bold{u}_{t}-\bold{u}_{t-\delta}[/tex]

    For each dimension:
    (under construction :-p)
    [tex]\bold{u}_{x,t+\delta}= \delta^2 ( -\frac{\frac{\partial P}{\partial x}{\rho} + \nu(\frac{\partial^2 \bold{u}}{\partial x^2} + \frac{\partial^2 \bold{u}}{\partial y^2} - \bold{u}\cdot\frac{\partial \bold{u}}{\partial x}) \bold{u} ) + 2\bold{u}_{t}-\bold{u}_{t-\delta}[/tex]
    Last edited: Jan 26, 2005
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook