ACU-T: 5201 Coupled Simulation of a Check Valve using AcuSolve and MotionSolve

Prerequisites

This tutorial introduces you to the workflow for setting up an AcuSolve-MotionSolve co-simulation using HyperWorks CFD. Prior to starting this tutorial, you should have already run through the introductory HyperWorks tutorial, ACU-T: 1000 HyperWorks UI Introduction, and have a basic understanding of HyperWorks CFD, AcuSolve, and HyperView. To run this simulation, you will need access to a licensed version of HyperWorks CFD, MotionSolve, and AcuSolve.

Prior to running through this tutorial, copy HyperWorksCFD_tutorial_inputs.zip from <Altair_installation_directory>\hwcfdsolvers\acusolve\win64\model_files\tutorials\AcuSolve to a local directory. Extract ACU-T5201_pressureCheckValve.x_t and Valve_model.xml from HyperWorksCFD_tutorial_inputs.zip.

Problem Description

The problem to be addressed in this tutorial is shown schematically in Figure 1. It consists of a cylindrical pipe containing water that flows past a check valve with a shutter attached to a virtual spring (not included in the geometry). The inlet pressure varies over time and the movement of the shutter will be determined as a function of the balance of the fluid forces against the reactive force of the spring. The problem is rotationally periodic at 30° increments about the longitudinal axis, and it is assumed that the resulting flow is also rotationally periodic, allowing for modeling with the use of a wedge-shaped section. For this tutorial, a 30° section of the geometry is modeled, as shown in the figure. Modeling a portion of an rotationally periodic geometry leads to reduced computation time while still providing an accurate solution.


Figure 1. Schematic of Check Valve with Spring-Loaded Shutter

The pipe has an inlet diameter of 0.08 m and is 0.3 m long. The check-valve assembly is 0.085 m downstream of the inlet. It consists of a plate 0.005 m thick with a centered orifice 0.044 m in diameter and a shutter with an initial position 0.005 m from the opening, simulating a nearly closed condition. The shutter plate is 0.05 m in diameter and 0.005 m thick. The shutter plate is attached to a stem 0.03 m long and 0.01 m in diameter. The mass of the shutter and stem is 0.2 kg and its motion is affected by a virtual spring with a stiffness of 2162 N/m. The motion of the valve shutter is limited by a stop mounted on a perforated plate downstream of the shutter.

Note that AcuSolve's internal rigid-body-dynamics solver is not able to simulate contact. Therefore, this problem is formulated to avoid contact between the valve and the stop.

Modeling the geometry as a 30° section requires that the fluid model is set up to be consistent with the rigid-body model. Since only 1/12 of the rigid body is modeled, the forces computed by AcuSolve that act on the valve shutter represent 1/12 of the actual force on the device. Therefore, it is also necessary to account for this in the simulation. There are two methods that can be used to accomplish this:
  1. Scale up the fluid forces calculated by AcuSolve by a factor of 12 to represent the full load on the device when the displacement of the body is computed.

    Using this approach, the full stiffness of the valve spring is used in the rigid-body solution, and the full mass of the valve is used.

  2. Scale down the mass of the valve and the stiffness of the spring to by a factor of 12 to match the fraction of the valve geometry to be modeled.

    Using this approach, the loading passed to the rigid-body solver is not scaled.

This second approach is used in this tutorial; the scaled mass of 0.0167 kg and the scaled stiffness of 180.1667 N/m will be used

The fluid in this problem is water, which has a density (ρ) of 1000 kg/m3 and a molecular viscosity (μ) of 1 X 10-3 kg/m-sec.

At the start of the simulation, the flow field is stationary. Flow is driven by the pressure at the inlet, which varies over time as a piecewise linear function shown in Figure 2. As the pressure at the inlet rises, the flow will accelerate as the valve opens. The turbulence viscosity ratio is assumed to be 10.

The initial inlet pressure is 0 Pa. At 0.002 s the pressure begins to ramp up and reaches 29,000 Pa at 0.05 s. The pressure is held at 29,000 Pa and begins to ramp back down starting at 0.2 s, reaching the initial pressure at 0.25 s where it remains for the rest of the simulation.


Figure 2. Transient pressure at the inlet

Prior simulations of this geometry indicate that the average velocity at the inlet reaches a maximum of 0.98 m/s. At this velocity, the Reynolds number for the flow is 78,400. When the Reynolds number is above 4,000 it is generally accepted that flow should be modeled as turbulent.

Note that the initial conditions of the flow are actually laminar; however, the increase in flow velocity and flow around the valve shutter is expected to cause a rapid transition to turbulent conditions. Therefore, the simulation will be set up to model transient, turbulent flow. When performing a transient analysis, convergence is achieved at every time step based on the defined stagger criteria. Mesh motion will be modeled using arbitrary mesh movement (arbitrary Lagrangian-Eulerian mesh motion).

For this case, the transient behavior of interest occurs in the time it takes for the pressure to ramp up and ramp back down, which is given by the transient pressure profile. To allow time for the spring to recover additional time will be simulated. For this tutorial 0.1 s is added after the pressure drops back to initial conditions for a total duration of 0.35 s.

Another critical decision in a transient simulation is choosing the time increment. The time increment is the change in time during a given time step of the simulation. It is important to choose a time increment that is short enough to capture the changes in flow properties of interest, but does not require unnecessary computation time. The change in inlet pressure from initial conditions to maximum occurs over 0.048 s. A time increment of 0.002 s would allow for excellent resolution of the transient changes without requiring excessive computational time.

Start HyperWorks CFD and Create the HyperMesh Model Database

  1. Start HyperWorks CFD from the Windows Start menu by clicking Start > All Programs > Altair <version> > HyperWorks CFD.
    When HyperWorks CFD is loaded, the Geometry ribbon is open by default.
  2. Create a new .hm database in one of the following ways:
    • From the menu bar, click File > Save.
    • From the Home tools, Files tool group, click the Save tool.


      Figure 3.
  3. In the Save File As dialog, navigate to the directory where you would like to save the database.
  4. Enter CheckValve_Coupled as the name for the database then click Save.
    This will be your problem directory and all the files related to the simulation will be stored in this location.
  5. Move the Valve_model.xml file to the problem directory.

Import and Validate the Geometry

Import the Geometry

  1. From the menu bar, click File > Import > Geometry Model.
  2. In the Import File dialog, browse to your working directory then select ACU-T5201_pressureCheckValve.x_t and click Open.
  3. In the Geometry Import Options dialog, leave all the default options unchanged then click Import.


    Figure 4.


    Figure 5.

Validate the Geometry

  1. From the Geometry ribbon, Cleanup tools, click the Validate tool.


    Figure 6.
    The Validate tool scans through the entire model, performs checks on the surfaces and solids, and flags any defects in the geometry, such as free edges, closed shells, intersections, duplicates, and slivers.

    The current model doesn’t have any of the issues mentioned above. Alternatively, if any issues are found, they are indicated by the number in the brackets adjacent to the tool name.

    Observe that a blue check mark appears on the top-left corner of the Validate icon. This indicates that the tool found no issues with the geometry model.


    Figure 7.
  2. Press Esc or right-click in the modeling window and select Exit from the context menu to exit the tool.
  3. Save the database.

Set Up Flow

Set Up the Simulation Parameters and Solver Settings

  1. From the Flow ribbon, Setup tools, click the Physics tool.


    Figure 8.
    The Setup dialog opens.
  2. Click the Time setting.
  3. Set the radio button to Transient, the Time step size to 0.002 sec, and the Final time to 0.35 sec.


    Figure 9.
  4. Click the Flow setting.
  5. Set the radio button to Turbulent and set the Turbulence model to Spalart-Allmaras..


    Figure 10.
  6. Click the Solver controls setting and set the Maximum stagger iterations to 3.


    Figure 11.
  7. Exit the Setup dialog and save the model.

Create a Multiplier Function for the Inlet Pressure

  1. From the Flow ribbon, click the arrow next to the Setup tool group name, then select Multipliers.


    Figure 12.
  2. Click in the Multiplier Library dialog.
  3. In the multiplier creation dialog, change the name of the multiplier function to Inlet Pressure by clicking on the top-left corner.
  4. Set the Type to Piecewise Linear.
  5. Verify that the Variable is set to Time and Evaluation is set to Time Step.
  6. Click four times to add four rows to the bottom of the table.
  7. Enter the table values according to the image below.


    Figure 13.

Assign Material Properties

  1. From the Flow ribbon, Domain tools, click the Material tool.


    Figure 14.
  2. Click anywhere on the pipe geometry.
    The entire geometry is highlighted.


    Figure 15.
  3. In the microdialog, select Water from the Material drop-down menu.
  4. On the guide bar, click to execute the command and exit the tool.
  5. Save the model.

Define Flow Boundary Conditions

In this step, you will assign the boundary conditions for the inlet, outlet and the symmetry faces.
  1. From the Flow ribbon, Boundaries tools, click the Stagnation Pressure tool.


    Figure 16.
  2. In the modeling window, click on the inlet surface, as shown in Figure 17.
  3. In the microdialog, enter a value of 1 N/m2 for the Stagnation pressure.
  4. Click the Multiplier function drop-down and select the function Inlet Pressure from the list.


    Figure 17.
  5. Click the Turbulence icon the microdialog, set the Turbulence input type to Viscosity Ratio, and the enter a value of 10 for the Turbulence viscosity ratio.


    Figure 18.
  6. On the guide bar, click to execute the command and remain in the tool.
  7. In the Boundaries legend, right-click on Stagnation pressure and rename it to Inlet then press Enter.
  8. From the Flow ribbon, Boundaries tools, click the Outlet tool.


    Figure 19.
  9. Click the outlet surface shown in the figure below.


    Figure 20.
  10. On the guide bar, click to execute the command and exit the tool.
  11. Click the Symmetry tool.


    Figure 21.
  12. Select the two surfaces shown in the figure below.


    Figure 22.
  13. On the guide bar, click to execute the command and remain in the tool.
  14. In the Boundaries legend, rename Symmetry to Front_symmetry.
  15. Rotate the model and select the other two symmetry faces.


    Figure 23.
  16. On the guide bar, click to execute the command and remain in the tool.
  17. In the Boundaries legend, rename Symmetry to Back_symmetry.
  18. Save the model.

Set Up Motion

In this step, you will activate the mesh motion and define the rigid body motion for the valve wall. Then, you will define the mesh displacement boundary conditions for the symmetry surfaces.

Define the Mesh Motion Type

  1. From the Motion ribbon, Setup tools, click the Settings tool.


    Figure 24.
  2. In the Setup dialog, change the Mesh motion to Arbitrary.


    Figure 25.
  3. Click the External code setting and activate the External code option.
  4. Set the External Solver to MotionSolve and the Communication type to Socket.
  5. Deactivate the External socket option and set the Socket host to localhost.
  6. Set the Socket port to 48000.


    Figure 26.
  7. Close the dialog.

Define the Mesh Displacement Boundary Conditions

  1. From the Motion ribbon, Constraints tools, click the Planar Slip tool.


    Figure 27.
  2. Select the two front symmetry surfaces shown Figure 28.
  3. In the Mesh Motion legend, rename Planar Slip to Front_symmetry by double-clicking on the name.


    Figure 28.
  4. On the guide bar, click to execute the command and remain in the tool.
  5. Rotate the model and select the two back symmetry faces.
  6. In the Mesh Motion legend, rename Planar Slip to Back_symmetry.
  7. On the guide bar, click to execute the command and exit the tool.
  8. Click the External Surface tool.


    Figure 29.
  9. On the guide bar, make sure the Surfaces selector is active.
  10. Right-click in the modeling window and go to Select > Advanced Select > By Boundaries > Default Wall.
  11. Now that all the wall surfaces are highlighted, isolate the selected surfaces either by pressing the I key, or by right-clicking in the modeling window and selecting Isolate.
  12. Zoom in on the valve region and select all the valve wall surfaces using the window selection method.


    Figure 30.
  13. In the microdialog, set the Coupling direction to Both and enter Model-Shutter Body as the name of the Rigid body.
    Note: The name of the rigid body specified here should match the name of the rigid body in the MotionSolve model.


    Figure 31.
  14. In the External Code Surfaces legend, rename the External Surface to Valve wall.
  15. On the guide bar, click to execute the command and exit the tool.
  16. Turn on the display of all surfaces and save the model.

Generate the Mesh

In this step, you will define the mesh controls and then generate the mesh.

Define the Zone Mesh Controls

The zone mesh controls allow you to define a local volume mesh size for specific regions using standard shaped zones like cylindrical, spherical, and cuboidal zones.
  1. From the Mesh ribbon, Zones tool group, click the Cylinder tool.


    Figure 32.
  2. In the modeling window, hover the mouse around the point shown in the figure below. When the preview cylinder zone is parallel to the axis of the pipe, click on the model near the point shown below.
    This point will be the center of the front face of the cylinder. In the next few steps you will edit the co-ordinates of this point manually.


    Figure 33.
  3. Move the mouse cursor away from the center and then click again.
    A preview of the zone should be displayed on the screen along with the manipulator. The manipulator allows you to modify the location and orientation of the zone.


    Figure 34.
  4. Click the center of the manipulator and enter the following coordinates for the center (-0.06, 0.02, 0)


    Figure 35.
  5. Double-click on the cylindrical surface of the zone and enter 0.022 m as the radius of the cylinder.


    Figure 36.
  6. Double-click on the base of the cylinder and enter 0.1 m as the height of the cylinder.


    Figure 37.
  7. Click anywhere in the empty space in the modeling window.
  8. Enter a value of 0.0015 m for the mesh size in the microdialog.
  9. In the Refinement zones legend, rename the zone to Valve region mesh refinement.


    Figure 38.
  10. Save the model.

Define the Boundary Layer Controls

  1. From the Mesh ribbon, Mesh Controls tools, click the Boundary Layer tool.


    Figure 39.
  2. Right-click in the modeling window and go to Select > Advanced Select > By Boundaries > Default Wall.
    All the wall surfaces should be highlighted and a dialog for BL specification appears.
  3. Enter the following values in the dialog:
    1. First layer thickness: 0.00035
    2. Total number of layers: 3
    3. Growth method: Constant
    4. Initial growth rate: 1.2
    5. Termination policy: Truncate
    6. Activate Enable surface mesh modification.


    Figure 40.
  4. In the BL Controls legend, rename the BL control to Pipe walls BL.
  5. On the guide bar, click to execute the command and remain in the tool.
  6. In the next few steps, you will define the boundary layer mesh control for the valve walls. For convenience, hide the front and back symmetry faces.
  7. Select the valve wall surfaces using the box selection method.
  8. In the dialog that appears, enter the following values for the BL specification:
    1. First layer thickness: 0.00015
    2. Total number of layers: 3
    3. Growth method: Constant
    4. Initial growth rate: 1.2
    5. Termination policy: Truncate
    6. Activate Enable surface mesh modification.


    Figure 41.
  9. In the BL Controls legend, rename the BL control to Valve walls BL.
  10. On the guide bar, click to execute the command and exit the tool.
  11. From the Mesh ribbon, click the drop-down next to the Mesh Controls tool group name and select Advanced.


    Figure 42.
  12. In the Advanced mesh settings dialog, change the Boundary layer element type to Tetra then close the dialog.


    Figure 43.
  13. Turn on the display of all the surfaces and save the model.

Generate the Mesh

  1. From the Mesh ribbon, Mesh tools, click the Batch tool.


    Figure 44.
  2. In the Meshing Operations dialog, set the Mesh size option to Maximum size and set the Maximum element size to 0.005.
  3. Deactivate Curvature based surface refinement.
  4. Click Mesh to generate the mesh.


    Figure 45.

    Once the meshing process has started, the Run Status dialog appears and the application moves to the Solution ribbon.

  5. Once the meshing is completed, close the Run Status dialog.

Compute the Solution

Define Nodal Outputs

  1. From the Solution ribbon, Outputs tool, click the Field tool.


    Figure 46.
  2. In the Field Outputs dialog, set the Time step interval to 1 for the Solution variables.


    Figure 47.

Run AcuSolve

  1. From the Solution ribbon, Simulation tools, click the Run tool.


    Figure 48.
  2. In the Launch AcuSolve dialog, enter the following text in the Additional arguments box: -tlog -lprobe.
    This will launch the AcuProbe and AcuTail utilities automatically once the run is launched.
  3. Set the Parallel processing option to Intel MPI.
  4. Optional: Set the number of processors to 4 or 8 based on availability.
  5. Deactivate the Automatically define pressure reference option.
  6. Leave the remaining options as default and click Run to launch AcuSolve.


    Figure 49.
    The Run Status dialog opens. Once the run is complete, the status is updated and you can close the dialog.

Run MotionSolve

In the next steps you will start MotionSolve and provide settings for communication with AcuSolve.
  1. Run Start > All Programs > Altair HyperWorks <version> > MotionSolve to open the HyperWorks Solver Run Manager.
  2. Click beside the Input file(s) field, browse to the location where you saved Valve_model.xml, and open it.
  3. Click to open the Available Options dialog.
  4. Enable the -as_cosim option to indicate coupling between MotionSolve and AcuSolve.


    Figure 50.
  5. In the -as_cosim dialog that appears, click None.
  6. In the Available Options options dialog, click Apply Options and close the dialog.
  7. Click Run to start MotionSolve.
    As the solution progresses, a HyperWorks Solver View window will open. Solution progress is reported in this window. The AcuSolve AcuTail window will also update as the solution progresses.


    Figure 51.
As the solution progresses, you can monitor the progress with AcuProbe, as detailed in the next steps.

Monitor the Solution with AcuProbe

While AcuSolve is running, you can monitor flow characteristics such as inlet pressure, displacement of the valve, and velocity of the valve, using AcuProbe.

Once the MotionSolve run launched, the AcuProbe window will be launched automatically after the first time step.

  1. In the AcuProbe Data Tree, expand Surface Output > Inlet - Output > Pressure.
  2. Right-click on pressure and select Plot.
  3. Similarly, expand Valve_wall - Output > Geometry under Surface Output.
  4. Right-click on mesh_x_displacement and select Plot.
    Note: You might need to click on the toolbar in order to properly display the plot.


    Figure 52.

    In the next steps you will create a plot of the x-velocity of the valve walls.

  5. Turn off the plot of pressure at the inlet by right-clicking on Inlet - Output and selecting Plot None.
  6. Expand Valve_wall - Output > Momentum, right-click on x_velocity, and select Plot.


    Figure 53.
  7. Close the AcuTail and AcuProbe windows.

Post-Process the Results with HyperView

In this step, you will create an animation of the valve motion as the water flows across the valve using HyperView.

Open HyperView and Load the Model and Results

  1. Start HyperView from the Windows Start menu by clicking Start > All Programs > Altair <version> > HyperView.
    Once the HyperView window is loaded, the Load model and results panel should be open by default. If you do not see the panel, click File > Open > Model.
  2. In the Load model and results panel, click next to Load model.
  3. In the Load Model File dialog, navigate to your working directory and select the AcuSolve .Log file for the solution run that you want to post-process. In this example, the file to be selected is CheckValve_Coupled.1.Log.
  4. Click Open.
  5. Click Apply in the panel area to load the model and results.
    The model is colored by geometry after loading.

Create an Animation of Velocity Magnitude

In the next step, you will create an animation of the velocity magnitude on the symmetry plane and then save it.
  1. In the Results Browser, expand the list of Components then click the Isolate Shown icon .
  2. Click the Front_symmetry - Output component to turn off the visibility of all the components except the front symmetry surface.


    Figure 54.
  3. Orient the display to the xy-plane by clicking on the Standard Views toolbar.
  4. Click on the Results toolbar to open the Contour panel.
  5. In the panel area, change the Result type to Velocity (v) and verify that the drop-down below it is set to Mag (magnitude).
  6. Click the Components entity selector. In the Extended Entity Selection dialog, select Displayed.
  7. Click Apply.
  8. In the panel area, under the Display tab, turn off the Discrete color option.


    Figure 55.
  9. Go to the Legend tab and then click Edit Legend.
  10. In the Edit Legend dialog, change the Type to Dynamic scale and the Numeric format to Fixed then click OK.


    Figure 56.
  11. Click on the Animation toolbar to play the velocity magnitude animation on the front symmetry plane.


    Figure 57.
  12. On the ImageCapture toolbar, click on the Capture Graphics Area Video icon .
  13. In the Save Graphics Area Video As dialog, browse to the directory where you want to save the animation, give a name to the video (ex: velocity mag), then click Save.

Display Pressure and Velocity Contours on a Section Cut

In the next step, you will create a section cut on the mid-z plane and then display the pressure contours and velocity vectors on that cross section.
  1. In the Results Browser, turn off the display of all the Components except the Fluid_Main SolidBody_2_1 component.


    Figure 58.
  2. Click on the Results toolbar to open the Contour panel.
  3. In the panel area, change the Result type to Pressure (s).
  4. Click the Components entity selector. In the Extended Entity Selection dialog, select Displayed.
  5. Click Apply to create the contour plot of pressure.
  6. In the panel area, under the Result tab, activate the Overlay result display check box (if not already selected).


    Figure 59.
  7. Click the Section cut icon on the HV-Display toolbar.
  8. In the panel area, click Add to create a new section cut named Section 1.
  9. In the Define plane section, set the axis to Z Axis then click Apply.
  10. Set the Z Base coordinate to 0 and press Enter.
  11. Change the Display options from Clipping plane to Cross section.
  12. Click Gridline. In the Gridline Options dialog, deactivate the Show check box under Grid line then click OK.


    Figure 60.
  13. Click on the Results toolbar to open the Vector panel.
  14. In the panel area, set the Result type to Velocity (v).
  15. Click the Selection drop-down and select Sections from the list of options.


    Figure 61.
  16. Click the Sections entity selector then select All.
  17. In the panel area, activate the Overlay result display check box (if not set already).
  18. Click Apply.
  19. Under the Plot tab, verify that only the X+Y+Z Resultant option is selected.
  20. Go to the Display tab, set the Size scaling option to Uniform, and enter a value of 0.002 in the size field.
  21. Set the Color by option to Direction and set the X+Y+Z color to White.


    Figure 62.
  22. Go to the Section tab, activate the Projected check box, then click Apply.
    The vector plot should look like the one shown in the figure below.


    Figure 63.

    The result at 0.156 sec is shown.

Summary

In this tutorial, you learned the basic workflow to set up a co-simulation using AcuSolve and MotionSolve. The tutorial introduced you to the steps involved in setting up external code communication between AcuSolve and MotionSolve using HyperWorks CFD, and then running the simulation and post-process the results using HyperView. You also learned how to create a vector plot on an existing contour plot on a cut plane.