|
[Sponsors] |
Solving 1D Navier-Stokes equation using ode45 MATLAB |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 11, 2020, 15:28 |
Solving 1D Navier-Stokes equation using ode45 MATLAB
|
#1 |
New Member
Neelay Doshi
Join Date: Mar 2019
Posts: 7
Rep Power: 7 |
Hello everyone!
I am trying to solve 1-dimension, inviscid and compressible Navier-Stokes equation using the ode45 function in MATLAB. I have derived the necessary governing equation and have attached them in the post. I understand that normally these are solved using FDM, FVM etc, but I wish to solve them using ode45 as it would require much lesser computational time. As you can see, the equations are coupled and every equation contains a derivative term of another variable which may not be calculated yet. For instance, as per my understanding, if I were create an ode function containing the 4 system of equations as per the order given in the attachment, then ode45 would first try to solve the energy equation (dT/dx) but it wouldn't know the value of the derivative of velocity (du/dx) as it has not been calculated yet, and so the solver would use du/dx=0, which would be incorrect. Is their anyother way to solve these coupled odes? Kindly correct me if I am mistaken. |
|
April 11, 2020, 15:47 |
|
#2 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73 |
Note sure you addressed correctly the question.
The inviscid flow model is the Euler system of equations not the Navier-Stokes. Then you are assuming a steady condition that means this set of equations rho*u=G=constant (mass) G*du/dx +dp/dx=0 (momentum) G*d/dx (E+p/rho) =0 (total energy) Are you really want to solve numerically this system?? |
|
April 11, 2020, 15:57 |
|
#3 |
New Member
Neelay Doshi
Join Date: Mar 2019
Posts: 7
Rep Power: 7 |
Yes I meant Euler system, but the governing equations you have written and the ones i have attached are essentially the same, i have simply rearranged the terms.
Yes I would like to try to solve it numerically (using ode45). Do you suggest that it is not possible? |
|
April 11, 2020, 16:05 |
|
#4 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73 |
Quote:
As you see, the energy equation is simply integrated as E+p/rho=constant, along with the mass constraint G=constant you get from the momentum G*u+p= constant. There is nothing to solve numerically |
||
April 11, 2020, 16:14 |
|
#5 | |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,754
Rep Power: 66 |
Quote:
but why would the solver choose du/dx=0 and not -12345, hmm? Think about it... What you are missing are the initial conditions and boundary conditions for Euler equations. Your problem definition is not complete you state the governing equations, the initial conditions, and boundary conditions. You should know the values of rho,p,T,U as well as drho/dx,dp/dx,dT/dx,dU/dx on the boundaries. You are choosing to approach this with ode45, making it akin to an intitial value problem instead of a boundary value problem. Still, you should know their values at least at x=0. Last edited by LuckyTran; April 11, 2020 at 23:55. |
||
April 12, 2020, 05:17 |
|
#6 | ||
New Member
Neelay Doshi
Join Date: Mar 2019
Posts: 7
Rep Power: 7 |
Quote:
Quote:
Kindly tell me where have I gone wrong in writing the function code. |
|||
April 12, 2020, 19:01 |
|
#7 | |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,754
Rep Power: 66 |
Quote:
What you need to do is put in x=0 (i.e. put the initial conditions in) into the system and solve for all the missing derivatives (not using ode45 because it is not a coupled system of ode's you are solving but an algebraic linear system). |
||
Tags |
navier stokes equations, ode solving |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend" | bigphil | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 686 | December 22, 2022 10:10 |
HeatSource BC to the whole region in chtMultiRegionHeater | xsa | OpenFOAM Running, Solving & CFD | 3 | November 7, 2016 06:07 |
pisoFoam with k-epsilon turb blows up - Some questions | Heroic | OpenFOAM Running, Solving & CFD | 26 | December 17, 2012 04:34 |
Orifice Plate with a fully developed flow - Problems with convergence | jonmec | OpenFOAM Running, Solving & CFD | 3 | July 28, 2011 06:24 |
Error while running rhoPisoFoam.. | nileshjrane | OpenFOAM Running, Solving & CFD | 8 | August 26, 2010 13:50 |