# Compressible flow solver for density and velocity only

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 31, 2020, 09:30 Compressible flow solver for density and velocity only #1 New Member   Ali Shakeri Join Date: Mar 2020 Posts: 3 Rep Power: 4 Hi everybody, I am modelling an isothermal compressible flow. I have constitutive relation for viscosity and equation of state for pressure and temperature is always constant. I am reading the OpenFOAM user guide to find a suitable solver for my problem. I think I should choose one of these solvers: rhoCentralFoam rhoPimpleFoam rhoSimpleFoam The problem with all above solvers is that temperature is a mandatory field in all of them. However, I have no equation for temperature. Do I have other options in OpenFOAM to solve a compressible flow with only mass and momentum equations?

 April 1, 2020, 05:12 #2 New Member   CHEUNG WING KI Join Date: May 2017 Posts: 16 Rep Power: 7 Compressible flow solver does not solve the temperature directly, instead it solves the energy equation(h or e) then compute the temperature after that. So temperature B.C. is mandatory in compressible flow while it's not in incompressible flow(only p, U) In addition, only solving mass and momentum conservation equations in compressible flow would not be conserved.

April 1, 2020, 05:45
#3
New Member

Ali Shakeri
Join Date: Mar 2020
Posts: 3
Rep Power: 4
Quote:
 Originally Posted by as020002 Compressible flow solver does not solve the temperature directly, instead it solves the energy equation(h or e) then compute the temperature after that. So temperature B.C. is mandatory in compressible flow while it's not in incompressible flow(only p, U) In addition, only solving mass and momentum conservation equations in compressible flow would not be conserved.

Imagine that temperature is always constant. So, the only variables are density and velocity fields. Therefore, we can write conservation of mass and momentum and we can solve this system by constitutive relations for viscosity and pressure.

In my case even the constitutive relations are independent of temperature, so temperature and energy are totally irrelevant for my problem. Therefore, I am looking for a simple isothermal compressible solver. Is there such a solver in OpenFOAM?

What I can imagine is that I can use the rhoCentralFoam and put the right hand side of the energy equation to zero (ignore it). However, this means that I will waste some computational power for a variable which I do not have it in my problem.

 April 1, 2020, 07:03 #4 New Member   CHEUNG WING KI Join Date: May 2017 Posts: 16 Rep Power: 7 What I am confused is that even though the temperature is at constant does not mean the energy the same. Because the temperature is not just a simple scalar (like solving scalar transport equation), but a scalar determined by internal energy or enthalpy. As far as I've learnt in fluid dynamics, the energy equation's always activated when the flow has compressibility. If you still intend to do it, you may try rhoPimpleFoam. TommyM likes this.

April 1, 2020, 07:34
#5
Senior Member

Santiago Lopez Castano
Join Date: Nov 2012
Posts: 351
Rep Power: 14
Quote:
 Originally Posted by alishakeri Imagine that temperature is always constant. So, the only variables are density and velocity fields. Therefore, we can write conservation of mass and momentum and we can solve this system by constitutive relations for viscosity and pressure. In my case even the constitutive relations are independent of temperature, so temperature and energy are totally irrelevant for my problem. Therefore, I am looking for a simple isothermal compressible solver. Is there such a solver in OpenFOAM? What I can imagine is that I can use the rhoCentralFoam and put the right hand side of the energy equation to zero (ignore it). However, this means that I will waste some computational power for a variable which I do not have it in my problem.
You should rephrase your query there buddy, what you need is a DENSITY BASED SOLVER which, of course, falls in the category of a compressible solver. The difference is that instead of solving a PDE for enthalpy, you solve a transport-diffusion (no reaction, asumming you're working on the incompressible range) equation for density. I assume you want to study non-boussinesq gravity currents in... water? So, no shocks, or Ma > 0.2, right?

To answer your question, no, there isnt such a solver implemented in FOAM. You'll have to write it. Fortunately for you, you just have to base it on rhoPimpleFoam for the flow solver, delete whatever is related to temperature/enthalpy and just add the PDE for density. Such programming effort shouldn't take you long, if you know how to 'fiddle' with FOAM.

April 1, 2020, 08:42
#6
New Member

Ali Shakeri
Join Date: Mar 2020
Posts: 3
Rep Power: 4
Quote:
 Originally Posted by Santiago You should rephrase your query there buddy, what you need is a DENSITY BASED SOLVER which, of course, falls in the category of a compressible solver. The difference is that instead of solving a PDE for enthalpy, you solve a transport-diffusion (no reaction, asumming you're working on the incompressible range) equation for density. I assume you want to study non-boussinesq gravity currents in... water? So, no shocks, or Ma > 0.2, right? To answer your question, no, there isnt such a solver implemented in FOAM. You'll have to write it. Fortunately for you, you just have to base it on rhoPimpleFoam for the flow solver, delete whatever is related to temperature/enthalpy and just add the PDE for density. Such programming effort shouldn't take you long, if you know how to 'fiddle' with FOAM.

Thanks for the response. To elaborate, my problems is solving the hydrodynamic equations for a granular flow. Such flow is compressible but the temperature and energy does not play a role. In my problem, pressure and viscosity are functions of density only.

 January 3, 2022, 09:54 #7 New Member   Pengcheng Zhang Join Date: Aug 2021 Posts: 13 Rep Power: 3 Hi Ali, I have the same problem as you. Have you solved the problem yet? I've been trying to simulate the water hammer effect in hydraulic turbine with rhoPimpleFoam(or pimpleFoam?). In my case, the compressibiliy of water needs to be considered and energy equation is superfluous. I would appreciate it if you could give me some advice on how to modify rhoPimpleFoam or any other solutions. Thank you! Last edited by Zane; January 4, 2022 at 04:48.

 Tags compressible flow, density based