Fluid Structure Interaction and Mesh Deformation by nyut545e2

VIEWS: 764 PAGES: 28

									Master Contents   Master Index              Help On Help




                              CFX-5 Tutorials

Tutorial 20

Fluid Structure
Interaction and Mesh
Deformation
                  Sample files used in this tutorial can be copied to your working
                  directory from <CFXROOT>/examples. See Working Directory (p. 2)
                  and Sample Files (p. 3) for more information.
                  Sample files referenced by this tutorial include:
                  •   Valvefsi (folder)
                  •   ValveFSI.pre
                  •   ValveFSI_expressions.ccl
                  •   ValveFSIUserF.pre




CFX-5 Tutorials                                                          Page 461
Master Contents          Master Index          Help On Help
Fluid Structure Interaction and Mesh Deformation—Introduction

20.A:          Introduction
20.A.1:        Features explored in this tutorial
               Introduction: This tutorial addresses the following features of CFX-5.
               Component                Feature                   Details
               CFX-Pre                  User Mode                 General Mode
                                        Simulation Type           Transient
                                        Fluid Type                General Fluid
                                        Domain Type               Single Domain
                                        Turbulence Model          k-Epsilon
                                        Heat Transfer             None
                                        Output Control
                                        CEL (CFX Expression Language)
                                        User Fortran
                                        Boundary Conditions       Inlet (Subsonic)
                                                                  Outlet (Subsonic)
                                                                  Wall: No-Slip
                                                                  Wall: Adiabatic
                                        Timestep                  Transient Example
                                        Transient Results File
               CFX-Solver Manager       n/a                       n/a
               CFX-Post                 Plots                     Animation
                                                                  Point
                                                                  Slice Plane
                                                                  Vector
                                        Other                     Opening
                                                                  Symmetry Plane
                                                                  Wall: No Slip
                                                                  Wall: Moving

               You learn about:
               •   Moving Mesh
               •   Fluid-Solid Interaction (without modelling solid deformation)
               •   MPEG creation
               •   Monitor Points




Page 462                                                                     CFX-5 Tutorials
Master Contents           Master Index            Help On Help
                             Fluid Structure Interaction and Mesh Deformation—Introduction

20.A.2:           Before beginning this tutorial
                  Introduction: It is necessary that you have a working directory and that
                  sample files have been copied to that directory. This procedure is detailed
                  in "Introduction to the CFX-5 Tutorials" on page 1.
                  Unless you review the introductory materials and perform required steps
                  including setting up a working directory and copying related sample files,
                  the rest of this tutorial may not work correctly. It is recommended that you
                  perform the tasks in Tutorial 1, Tutorial 2 and Tutorial 3 before working with
                  other tutorials as these three tutorials detail specific procedures that are
                  simplified in subsequent tutorials.




CFX-5 Tutorials                                                                        Page 463
Master Contents          Master Index          Help On Help
Fluid Structure Interaction and Mesh Deformation—Introduction

20.A.3:        Overview of the problem to solve
               This tutorial involves a moving mesh and a two-way fluid-structure
               interaction (FSI) between a ball and a fluid in a check valve. The geometry,
               modelled as a 2-D slice (0.1 mm thick), is displayed in "Figure 1: Overview of
               the CheckValve Geometry" on page 464.
                                                 4.5 mm

                                                                             Valve Housing
                                                                             Region
                   Fluid flows up and
                   around the valve,
                   acting against
                   gravity and the
                   force of the                                              The ball is




                                                                   15 mm
                                                                             modelled as a
                                                                             cavity region with
                                                                             a simulated
                                                                             spring force
                                                                             acting
                                                                             downwards.

                   Gravity

                                                                             The ball is shown
                                                 4 mm                        in the
                                                                             zero-displacemen
                                                   y                         t position. In this
                                                                             position, the
                                                                             spring applies no
                                                          x
                                                                             force to the ball.




                                                                               Tank Region


                                                10 mm

                   Figure 1: Overview of the CheckValve Geometry
               Check valves are commonly used to allow uni-directional flow. The
               check-valve in this tutorial is located on the top of a tank, and acts as a
               pressure-relieving valve by moving to allow fluid to leave. The ball is
               connected to a spring that acts to push the ball downward when the ball is
               raised above the y=0 position. The forces on the ball are gravity, force due
               to the spring, and force due to fluid flow. The ball is represented as a cavity
               region in the mesh. The deformation of the ball is not modelled.

Page 464                                                                      CFX-5 Tutorials
Master Contents           Master Index            Help On Help
                             Fluid Structure Interaction and Mesh Deformation—Introduction
                  The tutorial is divided into two parts. In the first part, the motion of the ball
                  is controlled by CEL expressions which account for the forces acting on the
                  ball, including the force imparted by the flow. In the second part of the
                  tutorial, the motion of the ball is controlled by a Junction Box Routine that
                  updates the ball position at the start of each time step by loading mesh
                  coordinate files from a set of such files. The mesh coordinate files and
                  required FORTRAN routines are provided with this tutorial.




CFX-5 Tutorials                                                                          Page 465
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh

20.B:         Using CEL Expressions to Govern Mesh
              Deformation
20.B.1:       Setting up the Simulation in CFX-Pre
              This section describes the step-by-step definition of the flow physics in
              CFX-Pre. If you wish, you can use the session file ValveFSI.pre to
              complete this section for you and continue from Obtaining a Solution using
              the CFX-5 Solver (p. 474). See one of the first four tutorials for instructions on
              how to do this.

20.B.2:       Modelling the Ball Dynamics
              When defining your own simulations, the mesh motion may already be
              known. In such cases, it can be specified explicitly using the CEL. In this
              tutorial, the mesh motion is not known a-priori, and will be calculated using
              the forces that act on the ball. The dynamics equation that describes the
              motion of the ball is considered before setting up the simulation.
              According to Newton’s Second Law, the time rate of change in the ball’s
              linear momentum is proportional to the net force acting on the ball. In
              differential form, the equation to be solved for the motion of the ball is:
                         d
                   mBall* ( velBall ) = FFlow – FSpring – FGrav
                         dt
              where mBall is the mass of the ball (which is constant), velBall is the
              velocity of the ball in the y coordinate direction, and FFlow, FSpring and
              FGrav are, respectively, the flow (viscous and drag), spring, and
              gravitational forces acting on the ball.
              The left hand side of the equation is discretised to include an expression for
              the new displacement of the ball (relative to the spring’s neutral position).
              The time derivative of the ball velocity is discretised as:

                   d ( velBall )           velBallNew – velBallOld
                                       -                                                       -
                   --------------------- = -----------------------------------------------------
                            dt                                   tStep
              where velBallNew is further discretised as:

                                dBallNew – dBallOld
                                                                             -
                   velBallNew = ----------------------------------------------
                                                  tStep


Page 466                                                                                           CFX-5 Tutorials
Master Contents         Master Index          Help On Help
 Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh
                        The new displacement of the ball also appears in the expression for spring
                        force:
                               FSpring = kSpring × dBallNew
                        The discrete form of the equation of motion for the ball is re-assembled, and
                        the ball displacement is isolated as:

            ⎛ FFlow – FGrav + mBall × velBallOld + mBall × dBallOld⎞                           -
                                                      ----------------------------------------- --------------------------------------       -
            ⎝                                                         tStep                                                     2              ⎠
                                                                                                                    tStep
                                                                                                                                               -
 dBallNew = ------------------------------------------------------------------------------------------------------------------------------------
                                                         ⎛ kSpring + -------------⎞ mBall
                                                         ⎝                                     2⎠
                                                                                    tStep
                        No further substitutions are required because all of these quantities are
                        available through the CFX Expression Language as presented below.

20.B.3:                 Preparing the Working Directory
                        1. Copy the mesh file ValveFSI.out from the examples/valvefsi
                           directory into your working directory.

20.B.4:                 Creating a New Simulation
                        1. Start CFX-Pre.
                        2. Select File > New Simulation.
                        3. Select General Mode.
                        4. Set File name to ValveFSI and then click Save.

20.B.5:                 Creating the Required Expressions
                        The expressions created in this step will determine the motion of the ball.
                        These expressions are provided in a CCL file. Alternatively, you can enter
                        each of the expressions by hand.

To import the           1. Copy ValveFSI_expressions.ccl from the examples directory
CCL
expressions                to your working directory.
                        2. Select File > Import CCL.
                        3. Select ValveFSI_expressions.ccl then click Open.
                        4. Continue from Importing the Initial Mesh (p. 468).


CFX-5 Tutorials                                                                                                                  Page 467
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh
To enter the   1. Click Expressions Editor        (or click the Expressions tab in the
expressions
individually      CFX-Pre Workspace).
               2. Click New      .
               3. Set Name to kSpring then click OK.
               4. For the Definition, enter the following expression:
                  300 [N m^-1]
               5. Click Apply.
               6. In the same way, create the following new expressions:
                   Name                      Definition
                   tStep                     5.0e-5 [s]
                   tTotal                    7.5e-3 [s]
                   denBall                   7800 [kg m^-3]
                   volBall                   pi * (2.0 [mm])^2 * 1e-4 [m]
                   mBall                     denBall * volBall
                   FFlow                     force_y()@Ball
                   FGrav                     mBall * 9.81 [m s^-2]
                   velBallOld                areaAve(Mesh Velocity v)@Ball
                   dBallOld                  areaAve(Total Mesh Displacement y)@Ball
                   dBallNumer                FFlow - FGrav + mBall*velBallOld/tStep +
                                             mBall*dBallOld/tStep^2
                   dBallDenom                kSpring+mBall/tStep^2
                   dBallNew                  dBallNumer/dBallDenom

               Note: The areaAve function calls are evaluated using solution data from the
               end of the previous time step; These calls are not updated during the
               solution of the mesh displacement equations. Thus, dBallOld and velBallOld
               represent the required ‘old’ values.

20.B.6:        Importing the Initial Mesh
                  Tip: While we provide a mesh to use with this tutorial, you may want to
                  develop your own in the future. Instructions on how to create this mesh
                  in CFX-Mesh are available from the CFX Community Site. Please see
                  "Mesh Generation" on page 3 for details.
               1. Click the Mesh tab.
               2. Right-click in the Mesh Selector and select Import.

Page 468                                                                     CFX-5 Tutorials
Master Contents         Master Index          Help On Help
 Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh
                  3. Change the Mesh Format to PATRAN Neutral.
                  4. Select the file ValveFSI.out.
                  5. Change Mesh Units to mm, then click OK.

20.B.7:           Setting the Simulation Type
                  The Mesh Deformation feature is only available for transient simulations.
                  Therefore this simulation must be run as a transient simulation.
                  1. Click Simulation Type       .
                  2. Set Option to Transient.
                  3. Under Time Duration, set:
                     a. Option to Total Time
                     b. Total Time to the expression, tTotal
                  4. Under Time Steps, set:
                     a. Option to Timesteps
                     b. Timesteps to the expression, tStep
                  5. Under Initial Time, set:
                     a. Option to Automatic with Value
                     b. Time to 0 [s]
                  6. Click OK.

20.B.8:           Creating the Domain
                  1. Before creating the domain, click the Materials tab to load the Material
                     and Reaction libraries.
                  2. Click Domain      .
                  3. Set Name to CheckValve then click OK.
                  4. On the General Options panel:
                     a. Set Location to Assembly.
                     b. Set Domain Type to Fluid Domain.
                     c. Click      to expand the Fluids List and select Methanol CH4O.
                     d. Under Mesh Deformation, set Option to Regions of Motion
                        Specified.
                     e. Leave the other settings at their default values.
                  5. Click OK to create the domain.
CFX-5 Tutorials                                                                     Page 469
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh
                Mesh motion specifications are applied to two and three dimensional
                regions of the domain (i.e. boundaries and subdomains, respectively) as
                follows:
                •   The mesh motion specification for the ball will be displacement the
                    y-direction according to the CEL expression dBallNew (which happens
                    to be a single CEL variable).
                •   The mesh motion specification for the walls of the valve housing will be
                    Unspecified.
                    This settings allows the mesh nodes to move freely. The motion of the
                    mesh points on this boundary will be strongly influenced by the motion
                    of the ball. Since the ball moves vertically, the surrounding mesh nodes
                    will also move vertically and will therefore remain on the valve housing.
                    This mesh motion specification helps to preserve the quality of the
                    mesh on the upper surface of the ball.
                •   The mesh motion specifications for the tank opening and tank volume
                    will be Stationary.
                    The stationary tank volume ensures that the mesh does not fold at the
                    sharp corner that exists where the valve joins the tank. The stationary
                    mesh for the tank opening prevents the mesh nodes from moving (If the
                    tank opening had unspecified mesh motion, the mesh nodes on this
                    boundary would move vertically and separate from the non-vertical
                    parts of the boundary.).

20.B.9:         Creating the Boundary Conditions
To create the   1. Click Boundary Condition         .
boundary
condition for   2. Set Name to Ball then click OK.
the ball
                3. On the Basic Settings panel, set:
                    a. Boundary Type to Wall
                    b. Location to BALL
                4. Click the Boundary Details tab, then:
                    a. Set Wall Influence on Flow to No Slip.
                    b. Turn on Wall Velocity Relative To and set it to Mesh Motion.




Page 470                                                                      CFX-5 Tutorials
Master Contents         Master Index          Help On Help
 Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh
                  5. On the Mesh Motion tab, set:
                     a. Option to Specified Displacement
                     b. Displacement X Component to 0 [m]
                     c. Displacement Y Component to dBallNew
                     d. Displacement Z Component to 0 [m]
                  6. Click OK to create the boundary condition.

To create the     Since a 2D representation of the flow field is being modelled (using a 3D
symmetry          mesh with one element thickness in the Z direction) symmetry boundaries
boundary
condition         will be created on the low and high Z 2D regions of the mesh.
                  1. Click Boundary Condition       .
                  2. Set Name to Sym then click OK.
                  3. On the Basic Settings panel, set:
                     a. Boundary Type to Symmetry
                     b. Location to SYMP1 and SYMP2
                  4. Click OK to create the boundary condition.

To create the     1. Click Boundary Condition       .
vertical valve
wall boundary     2. Set Name to ValveVertWalls, then click OK.
condition
                  3. On the Basic Settings panel, set:
                     a. Boundary Type to Wall
                     b. Location to VPIPE LOWX and VPIPE HIGHX
                  4. Click the Boundary Details tab:
                     a. Set Option for Wall Influence on Flow to No Slip.
                     b. Turn on Wall Velocity Relative To and set it to Boundary Frame.
                  5. Click the Mesh Motion tab, then set Option to Unspecified.
                  6. Click OK to create the boundary condition.

To create the     1. Click Boundary Condition       .
tank opening
boundary          2. Set Name to TankOpen, then click OK.
condition
                  3. On the Basic Settings panel, set:
                     a. Boundary Type to Opening
                     b. Location to BOTTOM



CFX-5 Tutorials                                                                   Page 471
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh
                 4. Click the Boundary Details tab, then set:
                    a. Mass and Momentum to Pressure and Direction (stable)
                    b. Relative Pressure to 6 [atm]
                       Note the change in units from Pa to atm.
                 5. On the Mesh Motion panel, verify that the setting for Option is
                    Stationary.
                 6. Click OK to create the boundary condition.

To create the    1. Click Boundary Condition        .
valve opening
boundary         2. Set Name to ValveOpen, then click OK.
condition
                 3. On the Basic Settings panel, set:
                    a. Boundary Type to Opening
                    b. Location to TOP
                 4. Click the Boundary Details tab, then set:
                    a. Mass and Momentum to Static Pressure
                    b. Relative Pressure to 0 [atm]
                 5. On the Mesh Motion panel, verify that the setting is Stationary.
                 6. Click OK to create the boundary condition.

                 Note: Opening boundary types are used to allow the flow to leave and
                 re-enter the domain across the inflow and outflow boundaries. This
                 behaviour is expected due to the oscillatory motion of the ball and due to
                 the potentially large region of flow re-circulation that will occur on the
                 downstream side of the ball.

Verifying that   The default boundary applies to all 2D boundary regions which have not
the default      otherwise been given a boundary condition. In this case, the default
boundary is
set to a         boundary is the tank wall.
stationary
specification    1. In the Physics Selector, double-click CheckValve Default.
                 2. On the Mesh Motion tab, check that Option is set to Stationary.
                 3. Click OK.

20.B.10:         Creating the Tank Subdomain
                 1. Click Subdomain       .
                 2. Set Name to Tank then click OK.
                 3. On the Basic Settings panel, set Location to CV3D SUB.
Page 472                                                                     CFX-5 Tutorials
Master Contents         Master Index          Help On Help
 Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh
                  4. Click the Mesh Motion tab, then set Option to Stationary.
                  5. Click OK to create the subdomain.

20.B.11:          Setting Initial Values
                  1. Click Global Initialisation      .
                     Since a transient simulation is being modelled, initial values are
                     required for all variables. The Global Initialisation form will appear
                     with each variable set to Automatic with Value.
                  2. Under Cartesian Velocity Components, set:
                      a. U to 0 [m/s]
                      b. V to 0 [m/s]
                      c. W to 0 [m/s]
                  3. Set Relative Pressure to 0 [Pa].
                  4. Turn on Turbulence Eddy Dissipation and set it to Automatic with
                     Value.
                  5. Click OK to set the Initial Values.

20.B.12:          Setting Solver Control
                  1. Click Solver Control        .
                  2. Under Advection Scheme, leave Option set to High Resolution.
                  3. Set Transient Scheme to Second Order Backward Euler.
                  4. Set Max Iter. Per Timestep to 5.
                  5. Turn on Minimum Number of Coefficient Loops and set the value to
                     2.
                  6. Leave the Convergence Criteria settings at their default values.
                  7. Click OK to set the Solver Control settings.

20.B.13:          Setting Output Control
                  This step sets up transient results files to be written at set intervals.
                  1. Click Output Control            .
                  2. Click the Transient Results tab.
                  3. Click New        .


CFX-5 Tutorials                                                                           Page 473
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh
              4. Accept the default name Transient Results 1 by clicking OK.
              5. Under Transient Results 1:
                  a. Set Option to Minimal.
                  b. In the Output Variables List, select Pressure and Velocity.
                  c. Turn on Time Interval and set it to tStep.
              6. Click the Monitor tab.
              7. Turn on Monitor Options.
              8. Under Monitor Points and Expressions:
                  a. Click New.
                  b. Set Name to Ball Displacement.
                  c. Set Option to Expression.
                  d. Set Expression Value, to dBallOld.
              9. Click OK to set the Output Control settings.

20.B.14:      Writing the Solver (.def) File
              1. Click Write Solver (.def) File    .
                 Write Solver File is displayed.
              2. Leave Operation set to Start Solver Manager.
              3. Leave Report Summary of Interface Connections turned off and Quit
                 CFX-Pre turned on.
              4. Click OK.
              5. Click Yes when asked if you want to save the CFX file.

20.B.15:      Obtaining a Solution using the CFX-5 Solver
              When the CFX-Solver Manager starts:
              1. Click Start Run.
                 The CFX-Solver will calculate the solution.
              2. Click the User Points tab and watch the value of the Ball Displacement
                 as the solution proceeds.
              The largest value of the ball displacement occurs after about 0.001 s (20
              timesteps) and is approximately 0.00098 m (0.98 mm). After about 0.005 s
              (100 timesteps) the ball settles at a displacement of around 0.67 mm.
              3. When the CFX-Solver has finished, click OK in the message box.

Page 474                                                                  CFX-5 Tutorials
Master Contents         Master Index          Help On Help
 Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh
                   4. Click Post-Process Results         .
                   5. When Start CFX-Post appears, turn on Shut down Solver Manager
                      then click OK.

20.B.16:           Viewing the Results in CFX-Post
Creating User      In the following steps, you will create an XY plane that lies midway between
Locations and      the two symmetry planes. The plane will be used to show mesh movement;
Plots
                   it will also serve as a locator for a vector plot that will be used in an
                   animation.

Creating a slice   1. Click Create Plane        .
plane
                   2. Under Geometry, set:
                       a. Method to XY Plane
                       b. Z to 5e-05 [m]
                   3. Under Render:
                       a. Turn off Draw Faces.
                       b. Turn on Draw Lines.
                   4. Click Apply to create the plane.

Creating a         5. Create a Point at (0, 0.0003, 0.0001) using the XYZ method.
Point
                      This is a reference point for the low Y point of the ball at timestep 0. Click
                      Apply.
                   6. Open the Timestep selector          and load the results for a few different
                      timesteps (for example: 0, 20, 45, 85, 125).
                      You will see the ball in different positions. The mesh deformation will
                      also be visible.
                   The maximum displacement occurs at around 20 timesteps (as was shown
                   in the CFX-Solver Manager), which is before the ball reaches equilibrium.

20.B.17:           Creating an animation with velocity vectors
                   1. Turn off the visibility of slice plane Plane 1.

Creating a         2. Create a Vector Plot, set Locations to slice plane Plane 1 and Variable
Vector Plot
using the slice       to Velocity. Click Apply.
plane
                   3. Using the Timestep Selector, load time value 0.

CFX-5 Tutorials                                                                           Page 475
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh
              4. Click Show Animation Editor          .
                 The Animation Editor appears.
              5. In the Animation Editor:
                  a. Click New        to create KeyframeNo1.
                  b. Highlight KeyframeNo1 in the Keyframe Creation and Editing
                     list, then change # of Frames to 148.
                     This will produce an animation keyframe at each timestep, resulting
                     in an MPEG that plays for just over six seconds.
              6. Load the last Timestep (150) using the Timestep Selector.
              7. In the Animation Editor:
                  a. Click New        to create KeyframeNo2.
                     The # of Frames parameter has no effect for the last Keyframe, so
                     leave it at the default value.
                  b. Click the Options tab, then, in Animation, change Width to 704
                     and Height to 480.
                  c. Click the Advanced tab, then set Quality to Custom.
                  d. Turn off Variable Bit Rate and set Bit Rate to 3000000.
                     This limits the bit rate so that the movie will play in most players.
                     You can lower this value if your player cannot handle this bit rate.
                  e. Click OK.
                  f.   Turn on Save Animation Movie.
                  g. Click Browse        next to the MPEG File data box to set a path and
                     file name for the MPEG file.
                     The file extension “.mpg” will NOT be added if you leave it out. If the
                     file path is not given, the file will be saved in the directory from
                     which CFX-Post was launched.
                  h. Click Save in Save MPEG.
                     The MPEG file name (including path) will be set, but the MPEG will
                     not be created yet.
                  i.   Frame 1 is not loaded (The loaded frame is shown in the top right
                       corner of the Animation Editor, beside F:). Click To Beginning
                       to load it then wait a few seconds for the frame to load.
                  j.   Click Play Forward        .
                       The MPEG will be created as the animation proceeds. This will be
                       slow, since a time step must be loaded and objects must be created
                       for each frame. To view the MPEG file, you need to use a viewer that
                       supports the MPEG format.

Page 476                                                                    CFX-5 Tutorials
Master Contents         Master Index          Help On Help
 Fluid Structure Interaction and Mesh Deformation—Using CEL Expressions to Govern Mesh
                  8. When you have finished, exit from CFX-Post.




CFX-5 Tutorials                                                              Page 477
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using a Junction Box Routine to Govern

20.C:           Using a Junction Box Routine to Govern
                Mesh Deformation
                In this part of the tutorial, a Junction Box Routine will be used to read in a
                sequence of meshes, causing a sinusoidal motion of the ball. The meshes
                are provided for convenience; they were generated based on the following
                expression for displacement of the ball in the y direction as a function of
                time:
                1[mm] * (1-cos(2*pi*t/(20.*tStep)))
                This is an alternative to using CEL expressions to govern mesh deformation.

20.C.1:         Setting up the Simulation in CFX-Pre
                This section describes the step-by-step definition of the flow physics in
                CFX-Pre. If you wish, you can use the session file ValveFSIUserF.pre to
                complete this section for you and continue from Obtaining a Solution using
                the CFX-5 Solver (p. 486). See one of the first four tutorials for instructions on
                how to do this.
                Important: If using a Linux platform, the Portland Group Fortran compiler is
                required for this tutorial. See Defining the Junction Box Routine (p. 481).

Preparing the   To prepare the working directory, copy the files and sub-directories
Working         contained in <CFXROOT> /examples/valvefsi into your working
Directory
                directory.
                The working directory should now contain the initial mesh file
                (ValveFSI.out), plus two sub-directories. The meshes sub-directory
                contains meshes for one period of ball motion, with an amplitude of 1 mm,
                in the sequence of files CheckValve.0 to CheckValve.19. The




Page 478                                                                          CFX-5 Tutorials
Master Contents          Master Index          Help On Help
 Fluid Structure Interaction and Mesh Deformation—Using a Junction Box Routine to Govern
                  juncbox sub-directory contains the Fortran source files that are used in the
                  Junction Box Routine that will read the sequence of mesh files. The
                  subroutines contained in these files are summarized as:
                  •   update_mesh_user: Highest level Junction Box Routine that is
                      responsible for replacing the mesh coordinates inside CFX-5 with the
                      updated coordinates read in or defined by the low level routine,
                      set_mesh_user.
                  •   set_mesh_user: Low level routine that defines the updated mesh
                      coordinates. In this tutorial, this is done by reading mesh files. In other
                      applications, however, this could be done by using a set of Fortran
                      commands that directly modify the existing mesh coordinates.
                  •   update_crdvx_user and upd_crdvx_user: Routines to call for the
                      generation of a node map between the initial mesh and the first
                      user-defined mesh, and to repeatedly use this map to replace the mesh
                      inside CFX-5 with the remaining sequence of user-defined meshes.
                  Two important attributes of the sequence of meshes read by the
                  SET_MESH_USER routine warrant highlighting:
                  1. The coordinates of the first mesh in the sequence must be identical to
                     the initial solver-internal mesh coordinates. This ensures that a node
                     map between the user and initial solver-internal mesh coordinates can
                     be generated.
                  2. The topology (i.e. connectivity) of all meshes in the sequence does not
                     change. This ensures that the map between the user and solver-internal
                     mesh coordinate can be re-used.

20.C.2:           Creating a New Simulation
                  1. Start CFX-Pre.
                  2. Select File > New Simulation.
                  3. Select General Mode.
                  4. Set File name to ValveFSIUserF and then click Save.

20.C.3:           Creating the Required Expressions
                  The expressions created in this step are used for the simulation setup and
                  for monitoring values during the solution process.



CFX-5 Tutorials                                                                         Page 479
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using a Junction Box Routine to Govern
To create an     The creation of this expression is very simple, as CFX Expression Language
expression for   (CEL) provides a way to calculate directional force on any region. For more
force on the
ball due to      information, please refer to "CFX Expression Language" on page 33 in the
fluid flow       document "CFX-5 Reference Guide".
                 1. Click Expressions Editor         (or click the Expressions tab in the
                    CFX-Pre Workspace).
                 2. Click New       .
                 3. Set Name to FFlow then click OK.
                 4. For the Definition, enter the following expression:
                    force_y()@Ball
                 5. Click Apply.

To create an     The period of oscillation for the ball will be 1e-3 s (20 timesteps of 5e-5[s]
expression for   each), and a total of two periods will be simulated.
the total
simulation       1. Click New       .
time
                 2. Set Name to tTotal then click OK.
                 3. For the Definition, enter the following expression:
                    2e-3 [s].
                 4. Click Apply.

To create an     1. Click New       .
expression for
the time step    2. Set Name to tStep then click OK.
                 3. For the Definition, enter the following expression: 5.e-5 [s]
                 4. Click Apply.

20.C.4:          Importing the Initial Mesh
                 1. Click the Mesh tab.
                 2. Click Import Mesh         .
                 3. Change the Mesh Format to PATRAN Neutral.
                 4. Select the file ValveFSI.out.
                 5. Change Mesh Units to mm.
                 6. Click OK.




Page 480                                                                         CFX-5 Tutorials
Master Contents          Master Index          Help On Help
 Fluid Structure Interaction and Mesh Deformation—Using a Junction Box Routine to Govern

20.C.5:           Defining the Junction Box Routine
                  You must compile and link the provided FORTRAN routines before the
                  CFX-Solver is started. The cfx5mkext command is used to create the
                  required objects and libraries as described below.
                  Important: The user FORTRAN routine performs file input/output
                  operations. On Linux platforms, the Portland Group compiler must be used
                  (not g77). Information on obtaining this compiler is found in "User
                  Subroutines" on page 32 in the document "CFX-5 Installation". If you are not
                  sure which FORTRAN compiler is used, check the output from the cfx5mkext
                  command (which is run in the next step) and ensure that a path to the
                  Portland Group compiler is used.
                  Important: To use the cfx5mkext command make sure that the FORTRAN
                  compiler is in your path. See "Default FORTRAN Compilers" on page 433 in
                  the document "CFX-5 Solver Modelling" for a list of commands that should
                  execute the compiler on each platform.
                  1. Select Tools > Command Editor           .
                  2. Type the following in the Command Editor (make sure you do not miss
                     the semi-colon at the end of the line):
                     ! system ("cfx5mkext -name meshread juncbox/*.F") == 0 or die;
                      •   This is equivalent to executing:
                          cfx5mkext -name meshread juncbox/*.F
                          at an OS command prompt.
                      •   The “!” indicates that the following line is to be interpreted as
                          power syntax and not CCL. Everything after the “!” symbol is
                          processed as Perl commands.
                      •   “system” is a Perl function to execute a system command.
                      •   The “== 0 or die” will cause an error message to be returned if, for
                          some reason, there is an error in processing the command.
                  3. Click Process to compile the subroutine.
                  A subdirectory whose name is system dependent will be created in your
                  working directory (For example, on IRIX a subdirectory named irix will be
                  created in your working directory.). This subdirectory contains the shared
                  object library named meshread.

                  Note: You can introduce the -double option to compile the subroutines
                  for use with double precision CFX-Solver executables.



CFX-5 Tutorials                                                                       Page 481
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using a Junction Box Routine to Govern
               Note: If you are running problems in parallel over multiple platforms then
               you will need to create these subdirectories using the cfx5mkext
               command for each different platform.
               The following steps create a CCL object that specifies the path to the
               meshes directory and the number of meshes. The FORTRAN subroutine
               later looks up the values contained in this object so that it can determine
               where the meshes are located, and how many exist.
               4. Type the following CCL into the Command Editor window, replacing
                  <filepath> with the path to your current directory.
   USER:
       MeshDir = <filepath>/meshes
       NMeshes = 20
   END
               If you are working on windows, substitute the forward slash with a
               backslash. For example:
                   •   UNIX: MeshDir =
                       /home/user/cfx5/tutorials/ValveFSI/meshes
                   •   Windows: MeshDir =
                       c:\user\cfx5\tutorials\ValveFSI\meshes
               5. Click Process to apply the settings.
               The next step sets up the Junction Box Routine.
               6. Click User Routine      .
               7. Set Name to Mesh Read then click OK.
               8. Set Option to Junction Box Routine.
               9. Set Calling Name to the name of the highest level routine:
                  update_mesh_user.
               10. Set Library Name to meshread.
               11. Set Library Path to the current working directory. For example:
                   •   UNIX: /home/user/cfx5/tutorials/valvefsi
                   •   Windows: c:\user\cfx5\tutorials\valvefsi
               12. Set Junction Box Location to Start of Time Step.
               13. Click OK.

20.C.6:        Setting the Simulation Type
               This tutorial must be run as a transient simulation in order to use the Mesh
               Deformation feature.
Page 482                                                                    CFX-5 Tutorials
Master Contents          Master Index          Help On Help
 Fluid Structure Interaction and Mesh Deformation—Using a Junction Box Routine to Govern
                  Click Simulation Type       .
                  1. Set Option to Transient.
                  1. Under Time Duration, set:
                     a. Option to Total Time
                     b. Total Time to the expression, tTotal
                  2. Under Time Steps, set:
                     a. Option to Timesteps
                     b. Timesteps to the expression, tStep
                  3. Under Initial Time, set:
                     a. Option to Automatic with Value
                     b. Time to 0 [s]
                  4. Click OK.

20.C.7:           Creating the Domain
To create the     1. Click Domain      .
domain
                  2. Set Name to CheckValve then click OK.
                  3. On the General Options panel:
                     a. Set Location to Assembly
                     b. Set Domain Type to Fluid Domain
                     c. Set Fluids List to Methanol CH4O.
                     d. Under Mesh Deformation, set Option to Junction Box Routine.
                     e. Set Junction Box Routine to Mesh Read.
                  4. Click OK to create the domain.

20.C.8:           Creating the Boundary Conditions
To create the     1. Click Boundary Condition         .
boundary
condition for     2. Set Name to Ball then click OK.
the ball
                  3. On the Basic Settings panel, set:
                     a. Type to Wall
                     b. Set Location to BALL




CFX-5 Tutorials                                                                Page 483
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using a Junction Box Routine to Govern
                4. Click the Boundary Details tab, then:
                   a. Set Wall Influence on Flow to No Slip.
                   b. Turn on Wall Velocity Relative To and set it to Mesh Motion.
                5. Click OK to create the boundary condition.

To create the   Since a 2D representation of the flow field is being modelled (using a 3D
symmetry        mesh with one element thickness in the Z direction) symmetry boundaries
boundary
condition       will be created on the low and high Z 2D regions of the mesh.
                1. Click Boundary Condition       .
                2. Set Name to Sym then click OK.
                3. On the Basic Settings panel, set:
                   a. Boundary Type to Symmetry
                   b. Location to SYMP1 and SYMP1
                4. Click OK to create the boundary condition.

To create the   1. Click Boundary Condition       .
tank opening
boundary        2. Set Name to TankOpen then click OK.
condition
                3. On the Basic Settings panel, set:
                   a. Boundary Type to Opening
                   b. Location to BOTTOM
                4. Click the Boundary Details tab, then set:
                   a. Mass and Momentum to Pressure and Direction (stable)
                   b. Relative Pressure to 6 [atm]
                      Note the change in units from Pa to atm.
                5. Click OK to create the boundary condition.

To create the   1. Click Boundary Condition       .
valve opening
boundary        2. Set Name to ValveOpen then click OK.
condition
                3. On the Basic Settings panel, set:
                   a. Boundary Type to Opening
                   b. Location to TOP
                4. Click the Boundary Details tab, then set:
                   a. Mass and Momentum to Static Pressure
                   b. Relative Pressure to 0 [atm]


Page 484                                                                  CFX-5 Tutorials
Master Contents          Master Index          Help On Help
 Fluid Structure Interaction and Mesh Deformation—Using a Junction Box Routine to Govern
                  5. Click OK to create the boundary condition.

                  Note: Opening boundary types are used to allow the flow to leave and
                  re-enter the domain across the inflow and outflow boundaries. This
                  behaviour is expected due to the oscillatory motion of the ball and due to
                  the potentially large region of flow re-circulation that will occur on the
                  downstream side of the ball.

To create the     1. In the Physics Selector, double-click CheckValve Default.
remaining wall
boundary          2. Click the Boundary Details tab, then:
conditions
                      a. Set Wall Influence on Flow to No Slip.
                      b. Turn on Wall Velocity Relative To and set it to Boundary Frame.
                  3. Click OK to create the boundary condition.

20.C.9:           Setting Initial Values
                  1. Click Global Initialisation      .
                     Since a transient simulation is being modelled, initial values are
                     required for all variables. The Global Initialisation form will appear
                     with each variable set to Automatic with Value.
                  2. Under Cartesian Velocity Components, set:
                      a. U to 0 [m/s]
                      b. V to 0.1 [m/s]
                      c. W to 0 [m/s]
                  3. Set Relative Pressure to 0 [Pa].
                  4. Turn on Turbulence Eddy Dissipation and set it to Automatic with
                     Value.
                  5. Click OK to set the Initial Values.

20.C.10:          Setting Solver Control
                  1. Click Solver Control       .
                  2. Under Advection Scheme, leave Option set to High Resolution.
                  3. Set Transient Scheme to Second Order Backward Euler.
                  4. Set Max Iter. Per Timestep to 5.
                  5. Turn on Minimum Number of Coefficient Loops and set the value to 2.
                  6. Leave the Convergence Criteria settings at their default values.

CFX-5 Tutorials                                                                      Page 485
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using a Junction Box Routine to Govern
               7. Click OK to set the Solver Control settings.

20.C.11:       Setting Output Control
               A Monitor Point will be used to monitor the values of FFlow at each time
               step.
               1. Click Output Control       .
               2. Click the Monitor tab.
               3. Turn on Monitor Options.
               4. Under Monitor Points and Expressions:
                   a. Click New.
                   b. Set Name to force on ball due to flow.
                   c. Set Option to Expression.
                   d. Set Expression Value to FFlow.
               5. Click OK to set the Output Control settings.

20.C.12:       Writing the Solver (.def) File
               1. Click Write Solver (.def) File     .
                  Write Solver File is displayed.
               2. Leave Operation set to Start Solver Manager.
               3. Leave Report Summary of Interface Connections turned off and Quit
                  CFX-Pre turned on.
               4. Click OK.
               5. Click Yes when asked if you want to save the CFX file.

20.C.13:       Obtaining a Solution using the CFX-5 Solver
               When the CFX-Solver Manager starts:
               1. Click Start Run. The CFX-Solver will calculate the solution.
               2. When the CFX-Solver has finished, click OK in the message box.

20.C.14:       Analysing the Fluid Flow Force on the Ball
               In the Solver Manager, click the User Points tab and observe the plot for the
               monitored value of FFlow (force imparted on the ball by the flow) as the
               solution develops. Using the mouse, click on various points on the curve.

Page 486                                                                     CFX-5 Tutorials
Master Contents          Master Index          Help On Help
 Fluid Structure Interaction and Mesh Deformation—Using a Junction Box Routine to Govern
                  Note: By default, the CFX-Solver Manager will not plot a point for each inner
                  loop iteration. To include these points in the plot, select
                  Workspace > Workspace Properties. On the Global Plot Settings tab,
                  turn on Plot Coefficient Loop Data and click OK.




     Previous Tutorial                                                    Next Tutorial


CFX-5 Tutorials                                                                       Page 487
Master Contents          Master Index         Help On Help
Fluid Structure Interaction and Mesh Deformation—Using a Junction Box Routine to Govern




Page 488                                                                CFX-5 Tutorials

								
To top