CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Solving Navier-Stokes Numerically (Discretization)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 15, 2024, 17:24
Default Solving Navier-Stokes Numerically (Discretization)
  #1
New Member
 
Kokogu
Join Date: Mar 2024
Posts: 3
Rep Power: 2
kokogu is on a distinguished road
Unsteady, incompressible, laminar and fully developed flow inside a circular pipe can be expressed by following the 1D parabolic PDE form of the Navier-Stokes equation where u(r,t) is to be calculated.

\rho\frac{\partial u}{\partial t}=-\frac{\partial p}{\partial x}+\mu\frac1r\frac\partial{\partial r}\Big(r\frac{\partial u}{\partial r}\Big)

Boundary conditions for the problem are symmetry at the centre and no-slip on the walls. Initially, the fluid is at rest.

\begin{aligned}
& \frac{\partial u}{\partial r}(r=0, t)=0 \\
& u(r=R, t)=0 \\
& u(r, t=0)=0
\end{aligned}

Last edited by kokogu; March 19, 2024 at 15:39.
kokogu is offline   Reply With Quote

Old   March 16, 2024, 00:30
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,762
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
https://en.wikipedia.org/wiki/Crank%...icolson_method


see also the table on forward euler and backward euler for a very obvious hint on how to do those cases as well
LuckyTran is offline   Reply With Quote

Old   March 16, 2024, 04:30
Default
  #3
New Member
 
Kokogu
Join Date: Mar 2024
Posts: 3
Rep Power: 2
kokogu is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
https://en.wikipedia.org/wiki/Crank%...icolson_method


see also the table on forward euler and backward euler for a very obvious hint on how to do those cases as well
Yup read it but, still, I cannot discretise the spatial term.

\frac\partial{\partial r}\left(r\frac{\partial u}{\partial r}\right)\approx\frac1{\Delta r}\left(r_{i+1/2}\frac{u_{i+2}^{j}-u_{i+1}^{j41}}{\Delta r}-r_{i}\frac{u_{i}^{j}-u_{i-1}^{j+1}}{\Delta r}\right)

Maybe like this? But I could not grasp why are we doing smth like this. Also I am gonna solve this with MATLAB

Last edited by kokogu; March 19, 2024 at 15:40.
kokogu is offline   Reply With Quote

Old   March 16, 2024, 06:01
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by kokogu View Post
Yup read it but, still, I cannot discretise the spatial term.

\frac\partial{\partial r}\left(r\frac{\partial u}{\partial r}\right)\approx\frac1{\Delta r}\left(r_{i+\frac12}\frac{u_{i+1}^{j}-u_{i}^{j}}{\Delta r}-r_{i-\frac12}\frac{u_{i}^{j}-u_{i-1}^{j}}{\Delta r}\right)

Maybe like this? But I could not grasp why are we doing smth like this. Also I am gonna solve this with MATLAB



This is just the formula obtained by the successive discretization from the outer to inner operator d/dx using a centred second order discretization on the step dr.

This is done to avoid a larger stencil having the issue of the checkerboard modes.
FMDenaro is offline   Reply With Quote

Old   March 16, 2024, 06:27
Default
  #5
New Member
 
Kokogu
Join Date: Mar 2024
Posts: 3
Rep Power: 2
kokogu is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
This is just the formula obtained by the successive discretization from the outer to inner operator d/dx using a centred second order discretization on the step dr.

This is done to avoid a larger stencil having the issue of the checkerboard modes.
Could you help me discretize this? For FTCS, BTCS, and Crank-Nicolson Method.
kokogu is offline   Reply With Quote

Old   March 16, 2024, 06:38
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by kokogu View Post
Could you help me discretize this? For FTCS, BTCS, and Crank-Nicolson Method.

Since that seems a list of homeworks, start to code, when you have a specific question, ask here.
FMDenaro is offline   Reply With Quote

Old   March 16, 2024, 15:19
Default
  #7
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,762
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Quote:
Originally Posted by kokogu View Post
Maybe like this? But I could not grasp why are we doing smth like this. Also I am gonna solve this with MATLAB
If you don't discretize it, then it is a 2D PDE. Do you know how to solve a PDE? If you discretize it, then it becomes an algebraic formula (for FTCS) or it becomes a linear system (for BTCS and Crank-Nicolson). Do you know how to solve Ax=b? That's why you discretize it.


Furthermore, the general N-S and other important PDE's are non-linear. In this example you start with the parabolised navier-stokes which is linear to begin with. But discretizing a non-linear PDE also results in the same algebraic equations (for FTCS) and linear system (for BTCS and CN). The reason you are being assigned parabolised navier-stokes, is the discretization is simple and it facilitates learning how to discretize PDE's. Clearly if students struggle with discretizing the parabolised navier-stokes equations, then the full navier-stokes is even more daunting and then students baby-rage and quit prematurely.
LuckyTran is offline   Reply With Quote

Reply

Tags
btcs, discretisation, ftcs, navier stokes equation, navier-stokes solver


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Segmentation fault when using reactingFOAM for Fluids Tommy Floessner OpenFOAM Running, Solving & CFD 4 April 22, 2018 13:30
HeatSource BC to the whole region in chtMultiRegionHeater xsa OpenFOAM Running, Solving & CFD 3 November 7, 2016 06:07
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 03:50
Cannot run the code properly: very large time step continuity error crst15 OpenFOAM Running, Solving & CFD 9 December 14, 2014 19:17
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 07:37


All times are GMT -4. The time now is 02:35.