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

Advice regarding algorithm for solution of discretised equations in compressible flow

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By FMDenaro
  • 3 Post By LuckyTran
  • 1 Post By juliom

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2018, 09:11
Default Advice regarding algorithm for solution of discretised equations in compressible flow
  #1
Member
 
Join Date: Jan 2018
Posts: 31
Rep Power: 8
lorbekl is on a distinguished road
Hello all,

I have recently began working with the Finite Volume Method, trying to solve a 1D pipe flow problem assuming compressible flow. The boundary conditions in this case are known values of all variables on one side and on the other the derivatives of all variables are zero. My question concerns the algorithm for solving the discretized equations in such a case. When I first derived the equations I considered a possible approach as:
1) Assuming densities in all control volumes,
2) Solving the continuity equation to obtain velocities,
3) Solving the momentum equation to obtain pressure,
4) Solving the energy equation to obtain enthalpy,
5) Solving the equation of state to obtain new densities from the calculated pressure and enthalpy,
6) Taking the new densities into a new iteration (with a relaxation factor) until convergence.
The algorithm I described gave me reasonable results for 1D gas flow which were comparable to some other references. However, after reviewing some literature in this field (Ferziger,Perić) the algorithms for solving compressible flow are different, relying on correction equations (like for incompressible flows) etc.



At this point I would like to ask if there is something inherently wrong with how I imagined the algorithm to proceed, or are the "standard" algorithms just another way of solving these equations and are perhaps quicker/more robust/... but in principle give the same solution?



I would be thankful for any sort of input from persons who might have any experience handling problems like this.
lorbekl is offline   Reply With Quote

Old   January 18, 2018, 09:15
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by lorbekl View Post
Hello all,

I have recently began working with the Finite Volume Method, trying to solve a 1D pipe flow problem assuming compressible flow. The boundary conditions in this case are known values of all variables on one side and on the other the derivatives of all variables are zero. My question concerns the algorithm for solving the discretized equations in such a case. When I first derived the equations I considered a possible approach as:
1) Assuming densities in all control volumes,
2) Solving the continuity equation to obtain velocities,
3) Solving the momentum equation to obtain pressure,
4) Solving the energy equation to obtain enthalpy,
5) Solving the equation of state to obtain new densities from the calculated pressure and enthalpy,
6) Taking the new densities into a new iteration (with a relaxation factor) until convergence.
The algorithm I described gave me reasonable results for 1D gas flow which were comparable to some other references. However, after reviewing some literature in this field (Ferziger,Perić) the algorithms for solving compressible flow are different, relying on correction equations (like for incompressible flows) etc.



At this point I would like to ask if there is something inherently wrong with how I imagined the algorithm to proceed, or are the "standard" algorithms just another way of solving these equations and are perhaps quicker/more robust/... but in principle give the same solution?



I would be thankful for any sort of input from persons who might have any experience handling problems like this.

Just a couple of doubts:

- are you solving only for supersonic inflow
- are you considering viscous or inviscid model?
FMDenaro is offline   Reply With Quote

Old   January 18, 2018, 09:27
Default
  #3
Member
 
Join Date: Jan 2018
Posts: 31
Rep Power: 8
lorbekl is on a distinguished road
- The flow is subsonic
- Because I did not assume a velocity profile I model the change in pressure only through the darcy-weisbach equation (which I think includes both viscous and wall friction losses) and not with the div(Tau) term.
lorbekl is offline   Reply With Quote

Old   January 18, 2018, 09:36
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Your bc.s are wrong for subsonic conditions
FMDenaro is offline   Reply With Quote

Old   January 18, 2018, 09:40
Default
  #5
Member
 
Join Date: Jan 2018
Posts: 31
Rep Power: 8
lorbekl is on a distinguished road
How so? Would it be possible to elaborate this a little more?

Perhaps I would also add that while the inlet is subsonic, the expected outlet conditions could approach Ma=1
lorbekl is offline   Reply With Quote

Old   January 18, 2018, 11:19
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
The information travels in the domain according to the directions dictated by the slopes of the characteristic lines of the Euler system. For subsonic flows you have one direction coming from the interior of the domain
moshe likes this.
FMDenaro is offline   Reply With Quote

Old   January 18, 2018, 17:36
Default
  #7
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Quote:
Originally Posted by lorbekl View Post
1) Assuming densities in all control volumes,
2) Solving the continuity equation to obtain velocities,
3) Solving the momentum equation to obtain pressure

In general, the continuity equation is a scalar equation, you can't simply solve for a vector quantity. In layman's terms, there's 1 continuity equation but 3 velocity components. You got lucky because you are solving a 1D flow.

In transient solvers: one usually solves the continuity equation for the density at the new time (since it's wrong to assume that density is unchanged). Then one solves the momentum equation for the velocity. Then solve the energy equation. Then do the pressure correction. Finally there is also a density correction at the end based on the final T,P to get the correct density.

For steady solvers: assuming properties as in 1) you solve the momentum equation for velocity. Then the energy equation. With the updated energy solution (temperature / internal energy / enthalpy) you can now update the density. Then finish it off with the pressure correction.

The seemingly unused continuity equation is hiding in the pressure correction part. The pressure correction is just a fancy way of saying I use the continuity and momentum equation to solve for velocity and pressure. This pressure correction is needed for incompressible and compressible flows.

Btw this is a segregated approach where you solve the equations sequentially and hence you run into this pressure correction equation. You could (more impressively?) solve all the equations (a coupled approach) at once for all variables. Or slightly less impressive you could solve the continuity and momentum equations together for velocity and pressure. But if you are already comfortable using one approach, I would not try to switch to another.
Stevie_1200, granzer and moshe like this.
LuckyTran is offline   Reply With Quote

Old   January 19, 2018, 08:15
Default
  #8
Member
 
Join Date: Jan 2018
Posts: 31
Rep Power: 8
lorbekl is on a distinguished road
Thank you both for your inputs. If I may, I would like to ask for another opinion.

The 1D compressible gas flow was my first step, building towards the real problem which I am trying to describe. This is flash evaporation due to the pressure dropping below the saturation pressure. Assuming homogenous flow, the differential equations (cont., mom., energy) are in essence the same, with the density and viscosity being a function of quality. So now I am wondering about two things:
a) Since incompressibility is an assumption, is it wrong (from a numerical point of view) to model both the one-phase liquid and the two-phase part of the domain as compressible? Because in this way I could retain just one set of equations and one solution algorithm.
b) Do you have any first guess as to what good boundary conditions might be in this case? Is it perhaps okay to specify all variables on one side, like I did at first?

lorbekl is offline   Reply With Quote

Old   January 19, 2018, 11:27
Default
  #9
Senior Member
 
Julio Mendez
Join Date: Apr 2009
Location: Fairburn, GA. USA
Posts: 290
Rep Power: 18
juliom is on a distinguished road
Send a message via Skype™ to juliom
This is an endless discussion and somehow represents the corner stone in CFD. Depending upon the flow type (subsonic or supersonic) the boundary conditions must be properly set. In addition to this, you may need to use certain preconditioning or a dispersion preservative scheme. In fact, this is quite difficult to explain but the bottom line is that you are using a incompressible approach to solve for a compressible flows (you are computing pressure and correcting using pressure). In compressible flows you don’t solve for pressure, you solve for density and temperature along with the equation of state.
moshe likes this.
juliom is offline   Reply With Quote

Old   January 19, 2018, 16:44
Default
  #10
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Quote:
Originally Posted by lorbekl View Post
a) Since incompressibility is an assumption, is it wrong (from a numerical point of view) to model both the one-phase liquid and the two-phase part of the domain as compressible? Because in this way I could retain just one set of equations and one solution algorithm.
If by incompressibility you mean that div(u)= 0, then it is quite common to even in fully incompressible solvers (i.e. constant density solvers) to solve the momentum equation assuming div(u) is not-zero (akin to injecting it as a source term) and then constraining the solution. The extra div(u) terms can even stabilize numerics. So yes I would agree it might be preferable to model both as compressible and then apply the appropriate constraints to the incompressible part.


Quote:
Originally Posted by lorbekl View Post
Is it perhaps okay to specify all variables on one side, like I did at first?
That is how you treat a supersonic inlet. For subsonic flows you shouldn't do it this way. i.e. you shouldn't specify both velocity and pressure at a subsonic inlet.
LuckyTran is offline   Reply With Quote

Old   January 22, 2018, 02:59
Default
  #11
Member
 
Join Date: Jan 2018
Posts: 31
Rep Power: 8
lorbekl is on a distinguished road
I see, thank you all for your help. I will try to work my way on my own from here. Hopefully with success
lorbekl is offline   Reply With Quote

Reply

Tags
compressible flow, finite volume method, solution


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
Issues on the simulation of high-speed compressible flow within turbomachinery dowlee OpenFOAM Running, Solving & CFD 11 August 6, 2021 07:40
Incompressible and compressible flow. Confused student. Main CFD Forum 27 March 18, 2017 13:25
Cavitation in compressible flow soni7007 CFX 3 March 29, 2013 13:06
Advice on multi-phase flow modelling Martin Main CFD Forum 3 October 14, 2008 06:16
Compressible Flow Modelling? yeo FLUENT 4 March 7, 2003 08:08


All times are GMT -4. The time now is 11:57.