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/)
-   -   An old story... the p_rgh field (https://www.cfd-online.com/Forums/openfoam-pre-processing/220290-old-story-p_rgh-field.html)

Tobi September 2, 2019 10:21

An old story... the p_rgh field
 
1 Attachment(s)
Hi everybody,

even though people might think I am good in FOAM, I am having still problems with the p_rgh field and boundary conditions. Well in the numerical point of view it is not a big deal to get the idea of the p_rgh field and even the derivation of the equation. However, letīs talk about that (again) using a relatively simple case.

Referring to the attached PDF, we see two tanks (1) and (2) filled with water while on both tanks an atmospheric pressure is given above the fluid level. The filling level difference is given by \Delta h_{12} represents the level difference. Each tank has a pipe to the storage tank shown in the middle of the draft.

The area of interest is given in the right bottom corner. Letīs imagine infinite large tanks (1) and (2) which means that the water level does not change during time. Thus, we always have a defined (and fixed) hydrostatic pressure that acts as a driving force for the water (1) and water (2) to flow into the storage tank (3).


Let's assume that tank (1) has 30 degC warm water and tank (2) has 45 degC warm water. We take a defined mass flow out of tank (3) while new water is sucked in from tank (1) and tank (2).

The ratio depends on the hydrostatic pressures of both streams. Means, if \Delta h_{12} increases (higher water level in the tank (2)), more water from the tank (2) is flowing into tank (3).


As in all p_rgh cases, I am struggling with the correct pressure boundary conditions.


Questions
  • Which pressure boundary conditions should be used for p_rgh for the fluid (1) and (2) and at the outlet (3)
  • For (3) I would use a fixedFluxPressure while setting the mass flow rate of interest
  • For (1) and (2) I have no idea of the p_rgh values and bc; assuming a constant water height in the tank (1) and (2), it should be possible to set fixed pressure value. However, the p_rgh quantity is without the hydrostatic part which means, for example, that for constant temperature the p_rgh field is equal in the whole domain (if no flow occurs)

Did anybody had similar set-upīs before and can help me out? I was looking into the hydrostatic* pressure boundary conditions but did not find any suitable one for my case.

Any hints are welcomed.
Thank you in advance
Tobi

jherb September 2, 2019 15:33

I think for your case, you have to set fixedValue boundary conditions in your patches (1) and (2) with the value
p_atmosphere - rho(at position of boundary) * g * h_rel


h_rel is the hight difference to your reference point (which might be set automatically to 0)

Tobi September 2, 2019 17:04

Hi Herb,

thank you for the quick response. One question. hrel is the difference between the level in tank (1) to the reference point as well as the level in tank (2) to the reference point?

jherb September 2, 2019 17:34

Yes, both tanks should have the same reference point.


So if the heights are different, the boundary (fixed)Value should be different.


(I am not totally sure about the sign)


So for the bigger height, the value of p_rgh is higher (p - rho * (-9.81) * h). Which actually make sense:If there is no flow, the pressure should be the same everywhere.

Tobi September 2, 2019 17:38

Okay, I will check it tomorrow. Did you ever checked out the following BC:


Code:

This boundary condition provides static pressure condition for p_rgh,     
    calculated as:                                                             
                                                                               
        \f[                                                                   
            p_rgh = ph_rgh - 0.5 \rho |U|^2                                   
        \f]


Wondering in which szenario we are using it because I never realized the field ph_rgh in any solver.

jherb September 2, 2019 17:43

I think, you want this:
https://cpp.openfoam.org/v4/classFoa...d.html#details


This boundary condition provides static pressure condition for p_rgh, calculated as:

https://cpp.openfoam.org/v4/form_51.png


Or in the Foundation version: https://github.com/OpenFOAM/OpenFOAM...hScalarField.H

Tobi September 2, 2019 18:07

Ah okay, right but shouldn't it be a totalPrghPressure somehow, which reduces the pressure at the face based on the kinematic pressure (velocity field).


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