|
[Sponsors] |
December 11, 2018, 04:49 |
Solving rho instead of p
|
#1 |
Member
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9 |
Hello, i am trying to modify reactingFoam in openFoam 6.0 in order to solve rho, then calculate p=f(rho,T).
I want to make a compressible solver with gravity and species transport (+ some annoying specific things). As I am not very comfortable with the pressure equation (to add a mass source term is painfull), i want to solve rho, and calculate p with the perfect gas equation. I modified the main loop as follow: Code:
while (pimple.loop()) { while (pimple.correct()) { #include "./rhoEqn.H" Info << rho << endl;//display for debug scalar M = thermo.composition().W(0);//The molar mass of the mixture p = rho/(psi*M);//P = rho*R*T/M = C*R*T = n*R*T/V p.correctBoundaryConditions(); #include "./UEqn.H" } #include "compressibleContinuityErrs.H" #include "./YEqn.H" #include "./EEqn.H" if (pimple.turbCorr()) { turbulence->correct(); } }
|
|
December 11, 2018, 06:53 |
|
#2 |
Member
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9 |
Actually the pressure should be calculated as:
Code:
p = rho/psi I tried to solve rho without applying any boundary conditions, and then correcting the density at the boundary using the value of the pressure at the boundary. But this obviously didnt work, for example i have flows through walls. |
|
December 11, 2018, 08:50 |
|
#3 |
Member
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9 |
It seems that to solve this correctly i would have to use some boundary conditions on rho instead of p, which is very unpractical. (fixed pressure outlet needs a conversion using ideal gas law for example).
I will stick to presure based equations. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Segmentation fault when using reactingFOAM for Fluids | Tommy Floessner | OpenFOAM Running, Solving & CFD | 4 | April 22, 2018 13:30 |
chtMultiRegionSimpleFoam turbulent case | Aditya Patil | OpenFOAM Running, Solving & CFD | 6 | April 24, 2017 23:13 |
HeatSource BC to the whole region in chtMultiRegionHeater | xsa | OpenFOAM Running, Solving & CFD | 3 | November 7, 2016 06:07 |
Unstabil Simulation with chtMultiRegionFoam | mbay101 | OpenFOAM Running, Solving & CFD | 13 | December 28, 2013 14:12 |
calculation stops after few time steps | sivakumar | OpenFOAM Running, Solving & CFD | 7 | March 17, 2013 07:37 |