As soon as you include gravity in Simcenter STAR-CCM+, hydrostatic pressure comes into play. Many times, you don’t need to bother – the simulation will behave as expected without further consideration. But if treated incorrectly, this part of the pressure field can be erratic, and cause unphysical results. So why is this? And when do you need to be cautious? In this blog post we will outline the details of what happens when you activate gravity in Simcenter STAR-CCM+, as well as when and why you need to take the hydrostatic pressure into consideration.
Working, piezometric and (hydro)static pressure
Let’s start by looking at how pressure is used and defined in STAR-CCM+. For numerical (and user) convenience, STAR-CCM+ uses relative pressure as both user input (e.g. boundary and initial conditions) and in the iterative solution procedure. This relative pressure is often referred to as the Working Pressure (or simply “Pressure” in the field functions) and is offset from the Absolute Pressure by the Reference Pressure (1 atm / 101325 Pa by default). The Reference Pressure is specified inside the Reference Values folder of any fluid continuum. This separation of pressures helps to avoid truncation errors in the numerical procedure, while it also (arguably) simplifies things when it comes to user input. To summarize, the relationship between the (working) pressure P and absolute pressure P_{abs} isP_{abs}=P+P_{ref}
Furthermore, with no gravitational force present, the working pressure is equal to the static pressure, i.e.P=P_{static}
However, as soon as you decide to include gravity in your simulation, the working pressure is instead referred to as the Piezometric Pressure, and the relation to the (hydro)static pressure changes to becomeP=P_{static}-\rho_{ref} \rm \bold{g} \cdot \left( \rm \bold{x}-\rm \bold{x_0}\right)
As can be seen, the inclusion of gravity adds two important parameters: the reference density \rho_{ref} and the reference altitude \rm \bold{x_0}. The reference altitude is the point at which the piezometric and static pressure are considered equal.When do you need to be cautious?
It is crucial to understand that when setting initial or boundary pressures in simulations where the gravity model is active, you are setting the piezometric pressure value. Simcenter STAR-CCM+ then calculates the corresponding (hydro)static pressure, based on the reference values you have provided. Knowing this, the first implication appears when your geometry includes pressure boundaries. For the sake of clarity, we will consider a set of examples to explain how (or if) they are affected.Single-phase, isothermal, constant density fluid with vertical pressure boundary
Let’s consider a horizontal duct with constant density water flowing from left to right. We have an inlet boundary to the left and a pressure outlet in the far right. The pressure outlet has a specified piezometric pressure of 0 Pa. Looking at the velocity vector field we see that the flow develops symmetrically around the center axis of the duct and if we look at the (hydro)static pressure field we can conclude that it is uniformly distributed throughout the domain. In other words, the outlet hydrostatic pressure corresponds well to the internal hydrostatic pressure, already with default settings (e.g. a 0 Pa setting on the pressure boundary).The reason for this is that for a constant density single-phase fluid, STAR-CCM+ assumes a reference density (\rho_{ref}) identical to the material density, meaning that you do not need to specify any reference density. This way the calculated hydrostatic pressure on the boundary will always be identical to the internal hydrostatic pressure.Single-phase, isothermal, variable density fluid with vertical pressure boundary
Let’s consider the same setup again, but this time we change from constant density water to a variable density using the IAPWS-IF97 formulation as our equation of state. Keeping all other settings as they are, we end up with the following solution:What happens here is that the calculated hydrostatic pressure on the outlet does not replicate the internal hydrostatic pressure inside the duct, causing the flow to accelerate out along the bottom end of the duct, also causing recirculation in the top. So, what went wrong here? The answer is that we did not pay attention to the reference density and altitude. The thing is, as soon as you have a variable density fluid, STAR-CCM+ assumes a reference density of 1.0 kg/m3. To make the calculated hydrostatic pressure on the outlet correlate to the internal hydrostatic pressure, the reference density must resonate with the material data. So, let’s see what happens if we update the reference density accordingly (as shown below).Recall that the reference altitude should be the point at which the piezometric and static pressure are considered equal. The default value for the reference altitude is always [0 0 0] meters. In this case, the default reference altitude makes sense, since the domain stretches from 0 meters in the top and -0.1 meters in the bottom. This way the (hydro)static pressure will start at 0 Pa in the top (i.e. equal to the piezometric pressure at the reference altitude), and then increase with depth.The updated result is shown in the following pictures.We can conclude that with the correct reference values, the boundary conditions and flow behavior resonate with what we expect.Single-phase natural convection with pressure boundaries
The differences outlined above are of utmost importance to understand when it comes to single-phase natural convection simulations with pressure boundaries. As soon as there is a connection with the ambient pressure, you need to make sure that you specify relevant reference values for density and altitude. If you do this right, the internal hydrostatic pressure will correlate to the calculated hydrostatic pressure on the pressure boundaries. This means that for a fluid with purely temperature dependent density (e.g. water, incompressible ideal gas or Boussinesq approximation), all ambient pressure boundaries should be specified with 0 Pa (i.e. zero gauge pressure) and the hydrostatic pressure will follow. Generally, these types of equation of state (i.e. purely temperature dependent densities) are sufficient for natural convection problems and are therefore the recommended practice for buoyancy driven flows.The term “incompressible ideal gas” may be a bit confusing, but what it refers to is the assumption that for Ma ≤ 0.3 (generally the case for natural convection), the density is independent of the hydrodynamic pressure. Instead, it relies solely on the reference pressure P_{ref} and the local temperature T, such that\rho=\cfrac{P_{ref}}{RT}
where R is the specific gas constant. For the boundary condition above (i.e. P=0 Pa) to be valid, this option must be activated under the Ideal gas node in the continuum, see picture below.Should you still, for some reason, choose to use a fully compressible ideal gas, the ambient pressure boundary would have to compensate for the internal hydrodynamic pressure dependence. Assuming that the ambient condition is isothermal at temperature T_0, the piezometric pressure becomesP_{piezo}=P_{ref} \mathrm{exp} \left( – \cfrac{g}{RT_0}(z-z_0) \right) – P_{ref} – \left( -\rho_{ref}g(z-z_0) \right)
This expression would have to be put into a user-defined field function and then used as boundary condition for all pressure boundaries. To be clear once again, this is generally not necessary and is not recommended practice, but it is included here for the sake of completeness. For full derivation of the expression, please refer to Setting the Ambient Pressure Boundary Condition in Natural Convection Cases (siemens.com).Multiphase with phase segregation
Moving from the single-phase regime into the multiphase regime, things become a bit more complex. The added complexity arises from the fact that the multiphase regime contains more than one material density, while the pressure relation between piezometric and hydrostatic remains unchanged, i.e. dependent on a single reference density. Let’s consider again an example as the basis for our reasoning here.Consider a tank partly filled with water and air, respectively. The tank is 0.2 meters high, and the free surface level is set at 0.1 meters (as depicted below). The topmost boundary is open to the ambient air (and set to 0 Pa) and the rest of the tank is closed. In this example we are using the VOF model to mimic the stratified conditions.For simplicity, let’s say we have a water density \rho_w of 1000 kg/m3 and an air density \rho_a of 1 kg/m3. This combination together with the pressure relation basically gives us three different choices for the reference density:- \rho_{ref}=\rho_w
- \rho_{ref}=\rho_a
- \rho_{ref}=0