CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Compressible flow solver for density and velocity only (https://www.cfd-online.com/Forums/openfoam/225550-compressible-flow-solver-density-velocity-only.html)

alishakeri March 31, 2020 08:30

Compressible flow solver for density and velocity only
 
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?

as020002 April 1, 2020 04:12

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.

alishakeri April 1, 2020 04:45

Quote:

Originally Posted by as020002 (Post 763767)
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.

as020002 April 1, 2020 06:03

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.

Santiago April 1, 2020 06:34

Quote:

Originally Posted by alishakeri (Post 763777)
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.

alishakeri April 1, 2020 07:42

Quote:

Originally Posted by Santiago (Post 763802)
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.


I will follow your suggestion.

Zane January 3, 2022 08:54

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!


All times are GMT -4. The time now is 19:53.