models.cfd.gravity tutorial

10
 Solved with COMSOL Multiphysics 5.1  1 | GRAVITY AND BOUNDARY CONDITIONS Gravity and Boundary Conditions 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 contai ns a discussion ab out this speci fic 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/m 3 ) and g  the gravity vector (SI unit: m/s 2 ). To do this in any of the CFD Module’s physics inter faces for free flui d 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 hav e to be carefu l when setting up bo undary conditi ons at the outlets. The followin g 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,  F  y  = −ρ  g. In this case, the fluid has a dynamic viscosity, µ, of 1.0 Pa·s and a density , ρ, of 1000 kg/m 3 . 1 m/s Outlet  F  y = (9.81m/s 2 )·ρ Wall Wall Figure 1: A simple example of flow with gravity volume force.  Assume that the channel continue s on the outlet side, which means that the fluid leaves the domain following horizont al streamlines. There are three alternatives to simulate this behavior: a pressure profile, a point setting, or a pressure shift.

Upload: georgd2010

Post on 02-Nov-2015

3 views

Category:

Documents


0 download

DESCRIPTION

Models cfd Gravity Tutorial

TRANSCRIPT

  • Solved with COMSOL Multiphysics 5.1Gr a v i t y and Bounda r y Cond i t i o n 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.

    1 m/sOutletFy = (9.81m/s2)

    Wall

    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 | G R A V I T Y A N D B O U N D A R Y C O N D I T I O N S

  • Solved with COMSOL Multiphysics 5.1

    2 | G R APressure 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 0=V I T Y A N D B O U N D A R Y C O N D I T I O N S

  • Solved with COMSOL Multiphysics 5.1The 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).

    (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.

    p P 0+( )= 3 | G R A V I T Y A N D B O U N D A R Y C O N D I T I O N S

  • Solved with COMSOL Multiphysics 5.1

    4 | G R AThis 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.

    N E W

    1 In the New window, click Model Wizard.V I T Y A N D B O U N D A R Y C O N D I T I O N S

  • Solved with COMSOL Multiphysics 5.1

    M O D E L W I Z A R D1 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.

    G E O M E T R Y 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.

    M A T E R I A L S

    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[kg/m^3]

    kg/m Basic

    Dynamic viscosity mu 1[Pa*s]

    Pas Basic 5 | G R A V I T Y A N D B O U N D A R Y C O N D I T I O N S

  • Solved with COMSOL Multiphysics 5.1

    6 | G R A

    L A M I N A R F L O W ( S P F )Fluid Properties 11 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.

    L A M I N A R F L O W ( S P F )

    Inlet 11 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

    Outlet 11 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 11 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*s*(1-s)*1 x

    0 yV I T Y A N D B O U N D A R Y C O N D I T I O N S

  • Solved with COMSOL Multiphysics 5.14 Specify the F vector as

    M E S H 1

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

    S T U D Y 1

    On the Home toolbar, click Compute.

    R E S U L T S

    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.

    D E F I N I T I O N S

    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.

    L A M I N A R F L O W ( S P F )

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

    0 x

    -g_const*spf.rho y 7 | G R A V I T Y A N D B O U N D A R Y C O N D I T I O N S

  • Solved with COMSOL Multiphysics 5.1

    8 | G R A2 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 11 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).

    S T U D Y 1

    On the Home toolbar, click Compute.

    R E S U L T S

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

    L A M I N A R F L O W ( S P F )

    Outlet 11 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 1In the Model Builder window, under Component 1 (comp1)>Laminar Flow (spf) right-click Volume Force 1 and choose Disable.

    Open Boundary 11 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.

    S T U D Y 1

    On the Home toolbar, click Compute.V I T Y A N D B O U N D A R Y C O N D I T I O N S

  • Solved with COMSOL Multiphysics 5.1

    R E S U L T SVelocity (spf)Click the Zoom Extents button on the Graphics toolbar.

    The results should now look as in Figure 3. 9 | G R A V I T Y A N D B O U N D A R Y C O N D I T I O N S

  • Solved with COMSOL Multiphysics 5.1

    10 | G R A V I T Y A N D B O U N D A R Y C O N D I T I O N S

    Gravity and Boundary ConditionsIntroductionModel GeometryPressure ProfileIntegral Constraint for the PressurePressure ShiftModeling Instructions