CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Why we specify both p and P_rgh in twoPhaseEulerFoam and other concerns (https://www.cfd-online.com/Forums/openfoam-solving/182203-why-we-specify-both-p-p_rgh-twophaseeulerfoam-other-concerns.html)

mshehata85 January 3, 2017 22:32

Why we specify both p and P_rgh in twoPhaseEulerFoam and other concerns
 
Hi All,
I am trying to use the twoPhaseEulerFoam solver to simulate particles drift in air. However, I got a little confused about couple of questions:

1- why we need to specify both the p and P_rgh fields? I thought it is because the flow is compressible and it is a sort of implicitly specifying initial rho field. am I right?

2- If so, how to make that solver incompressible? I managed to eliminate the energy equation by modifying the solver itself(commenting out the #include "EEqns.H" lines) as specified in another thread here. Afterwords, I tried to modify the continuous phase equationOfState from perfectGas to constant and specified the rho value. However the simulation crashed after a couple of runs. So, Does any one knows how to make that solver isothermal and incompressible?

3- I tried to use calculated boundary condition of p for all patches and zero gradient to all p_rgh and used the pRefCell & the pRefValue to set the reference pressure. However, after running the simulation, I noticed that the specified value is not maintained in the specified cell. How this could happen?

I appreciate any help in these topics.

Thanks in advance

Mahmoud

rdbisme February 25, 2017 12:02

Quote:

Originally Posted by mshehata85 (Post 631925)
Hi All,
I am trying to use the twoPhaseEulerFoam solver to simulate particles drift in air. However, I got a little confused about couple of questions:

1- why we need to specify both the p and P_rgh fields? I thought it is because the flow is compressible and it is a sort of implicitly specifying initial rho field. am I right?

2- If so, how to make that solver incompressible? I managed to eliminate the energy equation by modifying the solver itself(commenting out the #include "EEqns.H" lines) as specified in another thread here. Afterwords, I tried to modify the continuous phase equationOfState from perfectGas to constant and specified the rho value. However the simulation crashed after a couple of runs. So, Does any one knows how to make that solver isothermal and incompressible?

3- I tried to use calculated boundary condition of p for all patches and zero gradient to all p_rgh and used the pRefCell & the pRefValue to set the reference pressure. However, after running the simulation, I noticed that the specified value is not maintained in the specified cell. How this could happen?

I appreciate any help in these topics.

Thanks in advance

Mahmoud

I will try to answer to 2) and 3). I'm not an experienced user of the solver so take my comment as a suggestion that could be wrong.

2) In my case what I did to emulate an incompressible was just disabling the solution of energy equation. Check here

3) Emulating what is done in the tutorials what I always did is to set "calculated" for all the p patches, while setting up p_rgh as you would do with pressure in other cases. So for example: zeroGradient for inlet and fixedValue for outlet. For what concerns the pRefValue and pCellValue, it should be used only for the first iteration. In facts if you check in the solver code, you find:

Code:

// createFields.H
[...]
label pRefCell=0;
scalar pRefValue = 0.0;
setRefCell
(
  p,
  p_rgh,
  pimple.dict(),
  pRefCell,
  pRefValue,
)

that is called at the beginning of the solver execution.

For the first question I have to study a bit on that. :) Hope by the way that this comment could be useful.


All times are GMT -4. The time now is 13:30.