CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Change P-rgh to Pfor interFoam (https://www.cfd-online.com/Forums/openfoam-pre-processing/127024-change-p-rgh-pfor-interfoam.html)

vishal_s December 1, 2013 23:41

Change P-rgh to Pfor interFoam
 
I am working on a multiphase flow. I have P value but in interfoam P_rgh is given. How to change P-rgh to P in the solver???

Tobi December 2, 2013 07:50

Hi,

in your solver both variables exists.
Can you describe your Problem in a other way?

Do you want to set up "p" instead of "p_rgh"?

Code:

p_rgh = p - rho*gh;
p = p_rgh + rho*gh;
 
    volScalarField p
    (
        IOobject
        (
            "p",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        p_rgh + rho*gh
    );


vishal_s December 2, 2013 07:55

Tobi, I am working on an external nozzle flow problem. In this case, the inlet pressure to the nozzle is know to me and the outlet is atmosphere.

Now in interFoam, we have p_rgh instead of P. Now If I am not wrong, P_rgh is the local dynamic pressure. SO how to set P in this case. If my inlet P is 4e6 what will be my p_rgh???

vishal_s December 2, 2013 23:51

yes Tobi, I want to set P. Can you tell me how to do it????

Tobi December 3, 2013 07:16

As you can see in the code above the p-file is not read while starting the solver but will be automatically generated every time step you save.

For your Problem the easiest way would be the following:

- calculate p_rgh at the inlet and set it to fixedValue so that you reach p

As shown you can do this with:
Code:


p_rgh = p - rho * gh

1. you know p
2. you know rho
3. you know g
4. you should know h


All times are GMT -4. The time now is 10:16.