Calculating pressure in Navier-Stokes finite difference solver

  • Context: Graduate 
  • Thread starter Thread starter jojodi
  • Start date Start date
  • Tags Tags
    Fluid
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 2K views
jojodi
Messages
3
Reaction score
0
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,
Brandon
 
Physics news on Phys.org
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.
 
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: