You are on page 1of 10

Solved with COMSOL Multiphysics 5.

G r av i t y a nd B o und ary Con d i t i on s


Introduction
The setup of fluid-flow models involving gravity requires some careful manipulation of
the boundary conditions. Presented in the form of an example model included in the
Application Libraries, the following section contains a discussion about this specific
type of problem, which is relevant for, among other things, the modeling of free
convection.
The influence of gravity on the flow pattern is often an important issue when modeling
flow in fluids with variable density. You can account for this influence in the model
equations by adding to the momentum balances the volume force g, where
denotes density (SI unit: kg/m3) and g the gravity vector (SI unit: m/s2). To do this
in any of the CFD Modules physics interfaces for free fluid flow, enter the components
of this vector in the Volume force text fields in the Settings window for Volume Force.
When you add this term, you have to be careful when setting up boundary conditions
at the outlets. The following example demonstrates some possible boundary settings
for this type of problems.

Model Geometry
Consider a horizontal channel of width 0.5 m and length 2 m (see Figure 1).The
gravity vector g is aligned in the negative y direction, that is, Fy = g. In this case, the
fluid has a dynamic viscosity, , of 1.0 Pas and a density, , of 1000 kg/m3.

Wall

1 m/s

Fy = (9.81m/s2)

Outlet

Wall

Figure 1: A simple example of flow with gravity volume force.


Assume that the channel continues on the outlet side, which means that the fluid leaves
the domain following horizontal streamlines. There are three alternatives to simulate
this behavior: a pressure profile, a point setting, or a pressure shift.

1 |

GRAVITY AND BOUNDAR Y CONDITIONS

Solved with COMSOL Multiphysics 5.1

Pressure Profile
In a column of fluid, there is a hydrostatic pressure equal to g(y y0) where y0 is a
horizontal reference location (m). In this case y0 = 0. To specify this pressure profile at
the outlet, select the Pressure boundary condition for the Outlet feature and use the
pressure setting p0 = g y (Pa).
Figure 2 shows the simulated result, where p = 0 at y = 0 and where flow exits straight
out of the domain as expected.

Figure 2: The pressure and velocity field with a prescribed pressure profile at the outlet.

Integral Constraint for the Pressure


If you do not want to prescribe a pressure profile at the outlet, you can alternatively
prescribe vanishing viscous stresses at the outlet and combine them with an integral
constraint at the outlet. To do so, add an Open Boundary feature and select No viscous
stress as the boundary condition at the outlet. Also add an integral coupling variable
and a global constraint specifying

p =

2 |

GRAVITY AND BOUNDAR Y CONDITIONS

Solved with COMSOL Multiphysics 5.1

The result is almost identical to the result in Figure 2 except that the pressure field has
shifted so that it is between -2500 Pa and +2500 Pa.
This approach can be useful for advanced body forces where it can be difficult to find
the correct pressure profile to prescribe at the outlet. It does however result in a less
robust equation system, so it should be regarded as a last resort rather than a standard
method.

Pressure Shift
Much of the pressure gradient is present only to balance the hydrostatic pressure. For
incompressible flows, as is the case here, you can use this knowledge to introduce a
shift in the pressure variable. The theory, described in the section The Boussinesq
Approximation in the CFD Module Users Guide, implies that the pressure, p, is
replaced by a new pressure variable, P (Pa).
p = ( P + 0 )

(1)

Here, (0) is the pressure gradient that balances the hydrostatic volume force if the
fluid has a constant density 0. This term can be canceled for the term 0 g in the
volume force, leaving Fy = g(0 ). Since the density is constant in this case, Fy is
zero and the result is the same as excluding the gravity. The point is that by excluding
the gravity in constant density flows, you implicitly introduce the pressure shift in
Equation 1.
The result appears in Figure 3, which shows that the hydrostatic pressure gradient has
been removed and only the pressure gradient necessary to drive the flow remains. In
addition to making it easier to prescribe the outlet pressure, this method also results in
equation systems with better condition numbers compared to including the gravity.

3 |

GRAVITY AND BOUNDAR Y CONDITIONS

Solved with COMSOL Multiphysics 5.1

This does not have any significant impact on small models where a direct solver can be
applied, but it can be of importance for larger models.

Figure 3: Solution to the problem outlined in Figure 1 with a shift in the pressure variable
and zero normal stress prescribed on the outlet.
If you select the Pressure boundary condition for the outlet without compensating for
the hydrostatic pressure, you allow for the liquid to fall out of the domain, which in
the case of a long channel is not a realistic description.

Application Library path: CFD_Module/Single-Phase_Tutorials/


gravity_tutorial

Modeling Instructions
From the File menu, choose New.
NEW

1 In the New window, click Model Wizard.

4 |

GRAVITY AND BOUNDAR Y CONDITIONS

Solved with COMSOL Multiphysics 5.1

MODEL WIZARD

1 In the Model Wizard window, click 2D.


2 In the Select physics tree, select Fluid Flow>Single-Phase Flow>Laminar Flow (spf).
3 Click Add.
4 Click Study.
5 In the Select study tree, select Preset Studies>Stationary.
6 Click Done.
GEOMETRY 1

Rectangle 1 (r1)
1 On the Geometry toolbar, click Primitives and choose Rectangle.
2 In the Settings window for Rectangle, locate the Size section.
3 In the Width text field, type 2.
4 In the Height text field, type 0.5.
5 Click the Build All Objects button.
MATERIALS

Material 1 (mat1)
1 In the Model Builder window, under Component 1 (comp1) right-click Materials and

choose Blank Material.


2 Right-click Material 1 (mat1) and choose Rename.
3 In the Rename Material dialog box, type Fluid in the New label text field.
4 Click OK.
5 In the Settings window for Material, locate the Material Contents section.
6 In the table, enter the following settings:
Property

Name

Value

Unit

Property group

Density

rho

1000[k
g/m^3]

kg/m

Basic

Dynamic viscosity

mu

1[Pa*s
]

Pas

Basic

5 |

GRAVITY AND BOUNDAR Y CONDITIONS

Solved with COMSOL Multiphysics 5.1

LAMINAR FLOW (SPF)

Fluid Properties 1
1 In the Model Builder window, expand the Component 1 (comp1)>Laminar Flow (spf)

node, then click Fluid Properties 1.


2 In the Settings window for Fluid Properties, click to expand the Model inputs section.

Because you have added a material to the model, you can leave the default settings in
the Fluid Properties section.
The default value of the temperature equals 293.15 K, that is 20 degrees Celsius or 68
degrees Fahrenheit. For this simple model, keep this constant value.
LAMINAR FLOW (SPF)

Inlet 1
1 On the Physics toolbar, click Boundaries and choose Inlet.
2 Select Boundary 1 only.
3 In the Settings window for Inlet, locate the Velocity section.
4 Click the Velocity field button.
5 Specify the u0 vector as
6*s*(1-s)*1

Outlet 1
1 On the Physics toolbar, click Boundaries and choose Outlet.
2 Select Boundary 4 only.
3 In the Settings window for Outlet, locate the Pressure Conditions section.
4 In the p0 text field, type -g_const*spf.rho*y.

Here, the quantity spf.rho is the density variable used in the Single-Phase Flow interface
with tag spf.

Volume Force 1
1 On the Physics toolbar, click Domains and choose Volume Force.
2 Select Domain 1 only.
3 In the Settings window for Volume Force, locate the Volume Force section.

6 |

GRAVITY AND BOUNDAR Y CONDITIONS

Solved with COMSOL Multiphysics 5.1

4 Specify the F vector as


0

-g_const*spf.rho

MESH 1

In the Model Builder window, under Component 1 (comp1) right-click Mesh 1 and choose
Build All.
STUDY 1

On the Home toolbar, click Compute.


RESULTS

Velocity (spf)
1 In the Settings window for 2D Plot Group, click to expand the Plot settings section.
2 Locate the Plot Settings section. From the View list, choose View 1.
3 In the Model Builder window, expand the Velocity (spf) node, then click Surface 1.
4 In the Settings window for Surface, click Replace Expression in the upper-right corner

of the Expression section. From the menu, choose Component 1>Laminar Flow>p Pressure.
5 In the Model Builder window, right-click Velocity (spf) and choose Streamline.
6 Select Boundary 1 only.
7 On the Velocity (spf) toolbar, click Plot.
8 Click the Zoom Extents button on the Graphics toolbar.
DEFINITIONS

Integration 1 (intop1)
1 On the Definitions toolbar, click Component Couplings and choose Integration.
2 In the Settings window for Integration, locate the Source Selection section.
3 From the Geometric entity level list, choose Boundary.
4 Select Boundary 4 only.
LAMINAR FLOW (SPF)

Open Boundary 1
1 On the Physics toolbar, click Boundaries and choose Open Boundary.

7 |

GRAVITY AND BOUNDAR Y CONDITIONS

Solved with COMSOL Multiphysics 5.1

2 Select Boundary 4 only.


3 In the Settings window for Open Boundary, locate the Boundary Condition section.
4 From the Boundary condition list, choose No viscous stress.
5 In the Model Builder windows toolbar, click the Show button and select Advanced
Physics Options in the menu.

Global Constraint 1
1 On the Physics toolbar, click Global and choose Global Constraint.
2 In the Settings window for Global Constraint, locate the Global Constraint section.
3 In the Constraint expression text field, type intop1(p).
STUDY 1

On the Home toolbar, click Compute.


RESULTS

Velocity (spf)
Click the Zoom Extents button on the Graphics toolbar.
LAMINAR FLOW (SPF)

Outlet 1
1 In the Model Builder window, under Component 1 (comp1)>Laminar Flow (spf) click
Outlet 1.
2 In the Settings window for Outlet, locate the Pressure Conditions section.
3 In the p0 text field, type 0.

Global Constraint 1
In the Model Builder window, under Component 1 (comp1)>Laminar Flow (spf)
right-click Volume Force 1 and choose Disable.

Open Boundary 1
1 In the Model Builder window, under Component 1 (comp1)>Laminar Flow (spf)

right-click Global Constraint 1 and choose Disable.


2 Right-click Open Boundary 1 and choose Disable.
STUDY 1

On the Home toolbar, click Compute.

8 |

GRAVITY AND BOUNDAR Y CONDITIONS

Solved with COMSOL Multiphysics 5.1

RESULTS

Velocity (spf)
Click the Zoom Extents button on the Graphics toolbar.
The results should now look as in Figure 3.

9 |

GRAVITY AND BOUNDAR Y CONDITIONS

Solved with COMSOL Multiphysics 5.1

10 |

GRAVITY AND BOUNDARY CONDITIONS

You might also like