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

Compressible flow

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 22, 2023, 06:52
Default Compressible flow
  #1
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
Suppose I have the linear system:

rho_t+Urho_x+rho_0v_x=0

v_t+Uv_x=Dv_xx+aT_x

T_t+UT_x=kT_xx+bv_x

This is a mixed system of equations, one hyperbolic and two parabolic. I thought about upwinding the first-order derivatives and doing central difference for the second-order derivatives. The domain is for 0<=x<=1, and t>0.

The method I used failed completely, I was using explicit Euler, with a low CFL number to get convergence, but the results were haywire.

Any suggestions on how to get started?
hunt_mat is offline   Reply With Quote

Old   June 22, 2023, 11:52
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
Suppose I have the linear system:

rho_t+Urho_x+rho_0v_x=0

v_t+Uv_x=Dv_xx+aT_x

T_t+UT_x=kT_xx+bv_x

This is a mixed system of equations, one hyperbolic and two parabolic. I thought about upwinding the first-order derivatives and doing central difference for the second-order derivatives. The domain is for 0<=x<=1, and t>0.

The method I used failed completely, I was using explicit Euler, with a low CFL number to get convergence, but the results were haywire.





Any suggestions on how to get started?



If I understand your notation, U should be U0=constant. In the momentum equation you have substituted the pressure gradient by means of the EOS? Then grad p= R grad (rho_0+rho)(T0+T) has the minus sign in the RHS.
hunt_mat likes this.
FMDenaro is offline   Reply With Quote

Old   June 23, 2023, 06:31
Default
  #3
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
For the moment, I don't want to consider such things, as the actual system I'm dealing with is somewhat complicated.

U is constant, I wanted to make my system simple.

I did upwinding for all first-order derivatives and central differencing for the second-order derivatives. I then solved this using explicit Euler using small timesteps and slow speeds and I just got complete junk.

I'm at a loss as to what to do.
hunt_mat is offline   Reply With Quote

Old   June 23, 2023, 07:26
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
For the moment, I don't want to consider such things, as the actual system I'm dealing with is somewhat complicated.

U is constant, I wanted to make my system simple.

I did upwinding for all first-order derivatives and central differencing for the second-order derivatives. I then solved this using explicit Euler using small timesteps and slow speeds and I just got complete junk.

I'm at a loss as to what to do.



you havent answered to my question about the pressure gradient
FMDenaro is offline   Reply With Quote

Old   June 23, 2023, 07:33
Default
  #5
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
I have, simply ignore the pressure gradient for now. The system I put in the OP was a representative set of equations that I wish to solve. This is a question on pure numerics. The issue is that I have one hyperbolic equation, and two parabolic equations.
hunt_mat is offline   Reply With Quote

Old   June 23, 2023, 07:58
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
I have, simply ignore the pressure gradient for now. The system I put in the OP was a representative set of equations that I wish to solve. This is a question on pure numerics. The issue is that I have one hyperbolic equation, and two parabolic equations.
You added arbitrarily two source term, now depending on you prescribed BCs are you sure a solution exists?
FMDenaro is offline   Reply With Quote

Old   June 23, 2023, 10:49
Default
  #7
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
The source terms aren't arbitrary but are dependent upon the model that these linear equations are meant to represent. The temperature gradient in the second one represents thermal stress, which couples temperature to the other variables. The velocity gradient comes in from the thermal stress as well in deriving the temperature equation from thermodynamics.

As for BCs, I have one end fixed and the other is stress-free (so one end is allowed to move), I have Dirichlet conditions for the temperature at each end. For the density, I have the density gradient at x=1, to be zero and I have no boundary condition for the other end.

I think that should be reasonably physical and representative of the physical system I hope to solve once I get the linear system working.
hunt_mat is offline   Reply With Quote

Old   June 23, 2023, 11:07
Default
  #8
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,753
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
If you choose the correct a and b, this would be identical to a reduced form of navier-stokes with a background flow U. You have "removed the pressure gradient" but replaced it with a momentum source which would mimic exactly the same pressure gradient that you would have had. Keep in mind the work-energy theorem.


You have a coupled system of PDE's, it's not a linear system until you discretize it. But discretizing with explicit euler should lead to a marching forward in time procedure, not a linear system. Are you sure you are solving a linear system?
LuckyTran is offline   Reply With Quote

Old   June 23, 2023, 11:10
Default
  #9
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
The source terms aren't arbitrary but are dependent upon the model that these linear equations are meant to represent. The temperature gradient in the second one represents thermal stress, which couples temperature to the other variables. The velocity gradient comes in from the thermal stress as well in deriving the temperature equation from thermodynamics.

As for BCs, I have one end fixed and the other is stress-free (so one end is allowed to move), I have Dirichlet conditions for the temperature at each end. For the density, I have the density gradient at x=1, to be zero and I have no boundary condition for the other end.

I think that should be reasonably physical and representative of the physical system I hope to solve once I get the linear system working.





Ok, let us have a step back. You start from the NSE equations for compressible flows



d rho/dt+ u*drho/dx+rho*du/dx=0


du/dt + u*du/dx+(1/rho)*dp/dx= ni*d^2u/dx2



d(rho*E)/dt + d/dx (rho*u*E + p/rho)=k*d^2T/dx^2 +4/3*mu*d(u*du/dx)/dx


E=u^2/2+Cp*T



and then introduce a linearization?


How do you get your final linear system?
FMDenaro is offline   Reply With Quote

Old   June 23, 2023, 12:17
Default
  #10
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
I am absolutely positive that the system is linear.
hunt_mat is offline   Reply With Quote

Old   June 23, 2023, 12:22
Default
  #11
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
The system wasn't a reduction of the Navier-Stokes equations, but a set of linear equations that mimic the Navier-Stokes equations.
hunt_mat is offline   Reply With Quote

Old   June 23, 2023, 12:29
Default
  #12
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
I am absolutely positive that the system is linear.



This is not my doubt, linearization is a mathematical procedure you can introduce. Of course, one could argue if it is physically correct for the problem you want to solve, but I assume that all fluctuations in your problem are small so that we can focus on the numerical issues of your question.



1) My question is how do you get your linear system of equations when you introduce the linearization in the NSE I wrote above.


2) For small viscosity and conducibility values you have a perturbed set of hyperbolic linear equations. According to the direction of the characteristic lines, you have to be careful in the BCs.


3) Have you first tested the standard case of the linear hyperbolic Euler equations where you have an exact solution?


4) have you considered the stability constraint for the diffusive terms


Then, you could give more details about the problems you see in your numerical solution, with some plots
FMDenaro is offline   Reply With Quote

Old   June 23, 2023, 12:33
Default
  #13
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
The system wasn't a reduction of the Navier-Stokes equations, but a set of linear equations that mimic the Navier-Stokes equations.



Why the title of your post is "compressible flows"?



Again, how do you want to judge the quality of your solution on such a system of equations? Have you found an analytical solution before?
FMDenaro is offline   Reply With Quote

Old   June 23, 2023, 12:45
Default
  #14
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
1) My question is how do you get your linear system of equations when you introduce the linearization in the NSE I wrote above.

I explained this before. There was no linearisation. The equations were put forward as a stand alone system designed to mimic the set of nonlinear equations I am hoping to solve. I wanted to start easy, so I wrote down a set of linear equations that I thought would be easy to solve.

2) For small viscosity and conducibility values you have a perturbed set of hyperbolic linear equations. According to the direction of the characteristic lines, you have to be careful in the BCs.

Only one is hyperbolic, the others are parabolic, having only a second-order spatial derivative. That's the big issue that I am looking at currently.


3) Have you first tested the standard case of the linear hyperbolic Euler equations where you have an exact solution?

Not relevant as I have explained before.

4) have you considered the stability constraint for the diffusive terms

I'm not too sure what you mean by this. Could you explain what you mean a little more?
hunt_mat is offline   Reply With Quote

Old   June 23, 2023, 12:47
Default
  #15
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
Why the title of your post is "compressible flows"?

The original set of equations was essentially looking at a 1D compressible elastic rod that shrinks under heating.

Again, how do you want to judge the quality of your solution on such a system of equations? Have you found an analytical solution before?

As it's on a finite domain, it has to be solved using Fourier series, and then you're into looking at how many terms you take.
hunt_mat is offline   Reply With Quote

Old   June 23, 2023, 12:53
Default
  #16
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
1) My question is how do you get your linear system of equations when you introduce the linearization in the NSE I wrote above.

I explained this before. There was no linearisation. The equations were put forward as a stand alone system designed to mimic the set of nonlinear equations I am hoping to solve. I wanted to start easy, so I wrote down a set of linear equations that I thought would be easy to solve.

2) For small viscosity and conducibility values you have a perturbed set of hyperbolic linear equations. According to the direction of the characteristic lines, you have to be careful in the BCs.

Only one is hyperbolic, the others are parabolic, having only a second-order spatial derivative. That's the big issue that I am looking at currently.


3) Have you first tested the standard case of the linear hyperbolic Euler equations where you have an exact solution?

Not relevant as I have explained before.

4) have you considered the stability constraint for the diffusive terms

I'm not too sure what you mean by this. Could you explain what you mean a little more?

In your equations you have convection, diffusion and production terms. Each one has its stability constraint. You cannot use only the cfl condition.
FMDenaro is offline   Reply With Quote

Old   June 23, 2023, 14:31
Default
  #17
Senior Member
 
Eifoehn4's Avatar
 
-
Join Date: Jul 2012
Location: Germany
Posts: 184
Rep Power: 14
Eifoehn4 is on a distinguished road
There is a methology for non-conservative products called path-conservative schemes, which might useful for you. The method can be applied to systems of the form

\frac{\partial \mathbf{Q}}{\partial t} + \nabla \cdot \mathbf{f}(\mathbf{Q})+\mathbf{B(\mathbf{Q})}\nabla\mathbf{Q}=\mathbf{S}(\mathbf{Q}), \quad \text{standard form}

\frac{\partial \mathbf{Q}}{\partial t} +\mathbf{A(\mathbf{Q})}\cdot\nabla \mathbf{Q}  =  \mathbf{S}(\mathbf{Q}) , \quad \text{quasi-linear form}

\text{with} \quad\mathbf{A(\mathbf{Q})}=\frac{\partial \mathbf{f}(\mathbf{Q})}{\partial \mathbf{Q}} +\mathbf{B(\mathbf{Q})}.

Here \mathbf{Q} is the conservative state vector, \mathbf{f} is the conservative flux vector (which may also contain parabolic terms \mathbf{f}(\mathbf{Q},\nabla \mathbf{Q}) ) and \mathbf{S} is a source term. The third term in the first line is the non-conservative product. In case of

\mathbf{B}(\mathbf{Q})=0,

you recover the well known conservation law. You may read some papers of LeFloch, Parès or Castro. [1],[2]

Regards
__________________
Check out my side project:

A multiphysics discontinuous Galerkin framework: Youtube, Gitlab.
Eifoehn4 is offline   Reply With Quote

Old   June 23, 2023, 14:42
Default
  #18
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,753
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
I try to avoid semantic arguments but it is creating confusion. A "linear system" generally means a system of linear algebraic equations which needs to be solved via gaussian elimination, etc.

Your equations are indeed linear in U and T because it is a linearized system of PDE's. But it isn't a "linear system" that you learn in high school algebra. You are referring to the linear vector property of functionals. We are taking about linear systems (of equations).

Convective terms have CFL stability constraint. Diffusive terms have Fourier number constraints.


So after discretization, you end up with what? A system of equations or just a marching procedure? Can you show it?
LuckyTran is offline   Reply With Quote

Old   June 25, 2023, 08:36
Default
  #19
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 184
Rep Power: 4
hunt_mat is on a distinguished road
I don't know what you think a linear system should look like. My background is mathematics, it's a linear system of equations to me.

I discretised the system using finite differences. I used a forward difference for all first-order derivatives and central difference for all second-order derivatives.
poly_tec likes this.
hunt_mat is offline   Reply With Quote

Old   June 25, 2023, 08:53
Default
  #20
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Your system can be written like


u^n+1 = T.u^n

Where u is the state vector.

If you do the stability analysis on the eigenvalues of T you will be able to understand that the CFL is not the only parameter to check.
FMDenaro is offline   Reply With Quote

Reply

Tags
1dfluid, cfd


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
Compressible nozzle flow - no problem for fluent but impossible with openFOAM? flar.t OpenFOAM Running, Solving & CFD 10 March 30, 2022 02:21
Compressible flow, no data at the outlet mireis FLUENT 6 September 3, 2015 03:10
Natural Convection using Compressible Flow (chtMultiRegionFOAM) msarkar OpenFOAM 2 September 7, 2010 01:13
help with compressible flow BC's (need subsonic flow) meangreen Main CFD Forum 5 July 24, 2010 14:16
Solving unsteady compressible low speed flow atit Main CFD Forum 8 July 31, 2000 14:19


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