CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   NSEs with Incompressible Ideal gas as buoyancy term (https://www.cfd-online.com/Forums/main/253137-nses-incompressible-ideal-gas-buoyancy-term.html)

Memet1c November 26, 2023 16:03

NSEs with Incompressible Ideal gas as buoyancy term
 
Hi all,

I would like to know if the following formulation is correct.
I am trying to express the NSEs in conservative form using the incompressible ideal gas model as the buoyancy term.

Incompressible ideal gas assumes:

\rho = \frac{p_{op}}{RT}

Where the density only varies with temperature and not pressure.

The NSEs expressed in conservative form:

\partial_{t}(\rho) + \partial_{x_{i}}(\rho u_{i}) = 0 - Continuity
\partial_{t}(\rho u_{i}) + \partial_{x_{j}}(\rho u_{i}u_{j}) = -\partial_{x_{i}}(p) + \mu \partial_{x_{k}x_{k}}(u_{i}) + \rho g_{i} - Momentum
c_{p}[ \partial_{t}(\rho T) + \partial_{x_{i}}(\rho u_{i} T)]= \kappa \partial_{x_{i}x_{i}}(T) + \dot{q} - Energy

Note that the viscous dissipation and pressure work terms have been omitted from the energy equation.

My question from here is, how do I proceed to solve this system of equations numerically?

Given that I have expressed the density as a function of purely temperature, do I substitute it into my continuity, momentum, and energy equations? Or do I solve my system of equations separately from my equation of state, only updating the density field after marching forward in time.

Any literature recommendations explaining the incompressible ideal gas model in detail, and especially its numerical implementation would be greatly appreciated.

LuckyTran November 27, 2023 16:37

You certainly can substitute the equation of state directly and eliminate density if this is the only CFD you will ever do.

General purpose solvers will use various approaches because they want their code to solve many different types of problems, i.e. they want the same code to be easily switchable from incompressible idea gas to classical ideal gas with just the push of a button.

FMDenaro November 27, 2023 16:50

Quote:

Originally Posted by Memet1c (Post 860614)
Hi all,

I would like to know if the following formulation is correct.
I am trying to express the NSEs in conservative form using the incompressible ideal gas model as the buoyancy term.

Incompressible ideal gas assumes:

\rho = \frac{p_{op}}{RT}

Where the density only varies with temperature and not pressure.

The NSEs expressed in conservative form:

\partial_{t}(\rho) + \partial_{x_{i}}(\rho u_{i}) = 0 - Continuity
\partial_{t}(\rho u_{i}) + \partial_{x_{j}}(\rho u_{i}u_{j}) = -\partial_{x_{i}}(p) + \mu \partial_{x_{k}x_{k}}(u_{i}) + \rho g_{i} - Momentum
c_{p}[ \partial_{t}(\rho T) + \partial_{x_{i}}(\rho u_{i} T)]= \kappa \partial_{x_{i}x_{i}}(T) + \dot{q} - Energy

Note that the viscous dissipation and pressure work terms have been omitted from the energy equation.

My question from here is, how do I proceed to solve this system of equations numerically?

Given that I have expressed the density as a function of purely temperature, do I substitute it into my continuity, momentum, and energy equations? Or do I solve my system of equations separately from my equation of state, only updating the density field after marching forward in time.

Any literature recommendations explaining the incompressible ideal gas model in detail, and especially its numerical implementation would be greatly appreciated.




Do you have some specific reason for that formulation? For small temperature variation, the Bousinnesq model works fine.


Otherwise have a look to the low Mach formulations.

Memet1c November 27, 2023 18:56

The code available to me uses the Boussinesq model, but the temperature range I encounter in my scenario is very large. From what I understand, Boussinesq assumes the density variation due to temperature is small, and thus approximately linear. This is not the case for me.


I chose to use the incompressible ideal gas model instead, as the pressure variation in my problem is very small.

LuckyTran November 27, 2023 19:03

I am confused why you are asking how to numerically solve something if you already have a working code. What even is the question? I can't validate the performance of your code for you.

Memet1c November 27, 2023 19:05

Quote:

Originally Posted by LuckyTran (Post 860658)
You certainly can substitute the equation of state directly and eliminate density if this is the only CFD you will ever do.

General purpose solvers will use various approaches because they want their code to solve many different types of problems, i.e. they want the same code to be easily switchable from incompressible idea gas to classical ideal gas with just the push of a button.


Apart from the versatility of being able to switch between models, what are other benefits with applying the EOS separately from the NSEs? Is the implementation in the main solving loop more straightforward?


Also, are there any additional modelling errors as opposed to substituting the EOS directly?


Thanks,

Memet1c November 27, 2023 19:09

Quote:

Originally Posted by LuckyTran (Post 860664)
I am confused why you are asking how to numerically solve something if you already have a working code. What even is the question? I can't validate the performance of your code for you.


The current code I have is purely incompressible, density is constant. I am not sure if I can include density as a field straight away, especially during the step which solves for pressure as a Poisson equation. I am still looking into this.

LuckyTran November 27, 2023 19:30

What you have is constrained coupled system of equations. You have your transport equations plus the EOS (the constraint).


When you hard-code the constraint into the transport equation you also force the errors/correctors to be forcibly propagated. When these correctors are large, they can cause the problem to diverge. A similar issue also occurs in the pressure-velocity coupling problem when you solve a Poisson problem for pressure. Not propagating them can mean you need more sweeps to converge (until the correctors are propagated throughout the domain). There is always a tradeoff between stability and convergence rate. Hence, there are endless permutations of solvers available.


For example, sometimes you start cranking and end up with a negative temperature, now you have a negative density and you're screwed.

Memet1c November 27, 2023 20:02

Quote:

Originally Posted by LuckyTran (Post 860668)
What you have is constrained coupled system of equations. You have your transport equations plus the EOS (the constraint).


When you hard-code the constraint into the transport equation you also force the errors/correctors to be forcibly propagated. When these correctors are large, they can cause the problem to diverge. A similar issue also occurs in the pressure-velocity coupling problem when you solve a Poisson problem for pressure. Not propagating them can mean you need more sweeps to converge (until the correctors are propagated throughout the domain). There is always a tradeoff between stability and convergence rate. Hence, there are endless permutations of solvers available.


For example, sometimes you start cranking and end up with a negative temperature, now you have a negative density and you're screwed.


I will have to look further into this.
Thanks for your advice

FMDenaro November 28, 2023 03:40

Quote:

Originally Posted by Memet1c (Post 860666)
The current code I have is purely incompressible, density is constant. I am not sure if I can include density as a field straight away, especially during the step which solves for pressure as a Poisson equation. I am still looking into this.

Starting from your code, it is suitable to use the low Mach formulation. That is largely used for combustion problems. This way you take into account larghe temperature gradient.

hunt_mat November 29, 2023 07:54

Quote:

Originally Posted by Memet1c (Post 860614)
Hi all,

I would like to know if the following formulation is correct.
I am trying to express the NSEs in conservative form using the incompressible ideal gas model as the buoyancy term.

Incompressible ideal gas assumes:

\rho = \frac{p_{op}}{RT}

Where the density only varies with temperature and not pressure.

The NSEs expressed in conservative form:

\partial_{t}(\rho) + \partial_{x_{i}}(\rho u_{i}) = 0 - Continuity
\partial_{t}(\rho u_{i}) + \partial_{x_{j}}(\rho u_{i}u_{j}) = -\partial_{x_{i}}(p) + \mu \partial_{x_{k}x_{k}}(u_{i}) + \rho g_{i} - Momentum
c_{p}[ \partial_{t}(\rho T) + \partial_{x_{i}}(\rho u_{i} T)]= \kappa \partial_{x_{i}x_{i}}(T) + \dot{q} - Energy

Note that the viscous dissipation and pressure work terms have been omitted from the energy equation.

My question from here is, how do I proceed to solve this system of equations numerically?

Given that I have expressed the density as a function of purely temperature, do I substitute it into my continuity, momentum, and energy equations? Or do I solve my system of equations separately from my equation of state, only updating the density field after marching forward in time.

Any literature recommendations explaining the incompressible ideal gas model in detail, and especially its numerical implementation would be greatly appreciated.

I think you may need to use Dalton's law of partial pressure to formulate a multiple component fluid, one which is a viscous fluid and the other is an incompressible gas.

Memet1c November 29, 2023 15:42

Quote:

Originally Posted by hunt_mat (Post 860756)
I think you may need to use Dalton's law of partial pressure to formulate a multiple component fluid, one which is a viscous fluid and the other is an incompressible gas.

Sorry I'm confused, why would the incompressible fluid be inviscid? And how exactly does this help?

hunt_mat November 29, 2023 16:18

I never said anything about inviscid.

Memet1c November 29, 2023 17:08

Quote:

Originally Posted by hunt_mat (Post 860756)
I think you may need to use Dalton's law of partial pressure to formulate a multiple component fluid, one which is a viscous fluid and the other is an incompressible gas.

Quote:

Originally Posted by hunt_mat (Post 860794)
I never said anything about inviscid.

Sorry, I thought by specifically describing one of the fluids as viscous the other would not be so (I guess both fluids are viscous then?). In any case, my working fluid is air, I don't see how breaking it down to its constituents helps me here.

My scenario is boundary layer flow over a flat surface, with temperature dependent heat release. I am not simulating combustion with species transport.

hunt_mat December 1, 2023 04:43

Quote:

Originally Posted by Memet1c (Post 860798)
Sorry, I thought by specifically describing one of the fluids as viscous the other would not be so (I guess both fluids are viscous then?). In any case, my working fluid is air, I don't see how breaking it down to its constituents helps me here.

My scenario is boundary layer flow over a flat surface, with temperature dependent heat release. I am not simulating combustion with species transport.

So your heat source is a z=0(say), and you want to understand the heat induced flow in an incompressible gas?

Memet1c December 2, 2023 09:31

Quote:

Originally Posted by hunt_mat (Post 860889)
So your heat source is a z=0(say), and you want to understand the heat induced flow in an incompressible gas?

Correct. If I could, I would simply use the Boussinesq approximation with the incompressible NS, but my temperature range is very large. I can expect a deltaT of the order of 1000 K


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