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 HyperMesh CFD. Prior to starting this tutorial, you should have already run through the introductory tutorial, ACU-T: 1000 UI Introduction, and have a basic understanding of HyperMesh CFD and AcuSolve. To run this simulation, you will need access to a licensed version of HyperMesh CFD, MotionSolve, and AcuSolve.
Problem Description
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.
- 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.
- 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.
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 HyperMesh CFD and Create the HyperMesh Model Database
-
Start HyperMesh CFD from the Windows Start
menu by clicking .
When HyperMesh CFD is loaded, the Geometry ribbon is open by default.
-
Create a new .hm database in
one of the following ways:
- From the menu bar, click .
- From the Home tools, Files tool group, click the Save As tool.
- In the Save File As dialog, navigate to the directory where you would like to save the database.
-
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.
- Move the Valve_model.xml file to the problem directory.
Import and Validate the Geometry
Import the Geometry
- From the menu bar, click .
- In the Import File dialog, browse to your working directory then select ACU-T5201_pressureCheckValve.x_t and click Open.
-
In the Geometry Import Options dialog, leave all the
default options unchanged then click Import.
Validate the Geometry
-
From the Geometry ribbon, click the Validate tool.
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 does not 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. - Press Esc or right-click in the modeling window and swipe the cursor over the green check mark from right to left.
- Save the database.
Set Up Flow
Set Up the Simulation Parameters and Solver Settings
-
From the Flow ribbon, click the Physics tool.
The Setup dialog opens.
-
Under the Physics models setting:
- Set Time marching to Transient.
- Set the Time step size to 0.002 and the Final time to 0.35.
- Select Spalart-Allmaras as the Turbulence model.
-
Click the Solver controls setting and set the Maximum
stagger iterations to 3.
- Close the dialog and save the model.
Create a Multiplier Function for the Inlet Pressure
-
From the Flow ribbon, click the arrow next to the
Setup tool set, then select Multipliers.
- Click in the Multiplier Library dialog.
- In the multiplier creation dialog, change the name of the multiplier function to Inlet Pressure by clicking on the top-left corner.
- Set the Type to Piecewise Linear.
- Verify that the Variable is set to Time and Evaluation is set to Time Step.
- Click four times to add four rows to the bottom of the table.
-
Enter the table values according to the image below.
Assign Material Properties
-
From the Flow ribbon, click the Material tool.
-
Click anywhere on the pipe geometry.
The entire geometry is highlighted.
- In the microdialog, select Water from the Material drop-down menu.
- On the guide bar, click to execute the command and exit the tool.
- Save the model.
Define Flow Boundary Conditions
-
From the Flow ribbon, Pressure
tool group, click the Stagnation Pressure tool.
- In the modeling window, click on the inlet surface, as shown in Figure 16.
- In the microdialog, enter a value of 1 N/m2 for the Stagnation pressure.
-
Click the Multiplier function drop-down and select the function
Inlet Pressure from the list.
-
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.
- On the guide bar, click to execute the command and remain in the tool.
- In the Boundaries legend, right-click on Stagnation pressure and rename it to Inlet then press Enter.
-
Click the Outlet tool.
-
Click the outlet surface shown in the figure below.
- On the guide bar, click to execute the command and exit the tool.
-
Click the Symmetry tool.
-
Select the two surfaces shown in the figure below.
- On the guide bar, click to execute the command and remain in the tool.
- In the Boundaries legend, rename Symmetry to Front_symmetry.
-
Rotate the model and select the other two symmetry faces.
- On the guide bar, click to execute the command and remain in the tool.
- In the Boundaries legend, rename Symmetry to Back_symmetry.
- 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
-
From the Motion ribbon, click the Settings tool.
-
In the Setup dialog, change the Mesh motion to
Arbitrary.
- Click the External code setting and activate the External code option.
- Set the External Solver to MotionSolve and the Communication type to Socket.
- Deactivate the External socket option and set the Socket host to localhost.
-
Set the Socket port to 48000.
- Close the dialog.
Define the Mesh Displacement Boundary Conditions
-
From the Motion ribbon, click the Planar Slip tool.
- Select the two front symmetry surfaces shown Figure 27.
-
In the Mesh Motion legend, rename Planar Slip to
Front_symmetry by double-clicking on the name.
- On the guide bar, click to execute the command and remain in the tool.
- Rotate the model and select the two back symmetry faces.
- In the Mesh Motion legend, rename Planar Slip to Back_symmetry.
- On the guide bar, click to execute the command and exit the tool.
-
Click the External Surface tool.
- On the guide bar, make sure the Surfaces selector is active.
- Right-click in the modeling window and go to .
- 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.
-
Zoom in on the valve region and select all the valve wall surfaces using the
window selection method.
-
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.
- In the External Code Surfaces legend, rename the External Surface to Valve wall.
- Right-click Valve wall and select isolate.
- On the guide bar, click to execute the command and exit the tool.
-
Click the No Constraints tool.
- Select the external surfaces of Valve wall.
- On the guide bar, click to execute the command and exit the tool.
- 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
-
From the Mesh ribbon, Zones
tool group, click the Cylinder
tool.
-
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.
-
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.
-
Click the center of the manipulator and enter the following coordinates for the
center (-0.06, 0.02, 0)
-
Double-click on the cylindrical surface of the zone and enter
0.022 m as the radius of the cylinder.
-
Double-click on the base of the cylinder and enter 0.1 m
as the height of the cylinder.
- Click anywhere in the empty space in the modeling window.
- Enter a value of 0.0015 m for the mesh size in the microdialog.
-
In the Refinement zones legend, rename the zone to Valve region mesh
refinement.
- Save the model.
Define the Boundary Layer Controls
-
From the Mesh ribbon, click the Boundary Layer tool.
-
Right-click in the modeling window and go to .
All the wall surfaces should be highlighted and a dialog for BL specification appears.
-
Enter the following values in the dialog:
- First layer thickness: 0.00035
- Total number of layers: 3
- Growth method: Constant
- Initial growth rate: 1.2
- Termination policy: Truncate
- Activate Enable surface mesh modification.
- In the BL Controls legend, rename the BL control to Pipe walls BL.
- On the guide bar, click to execute the command and remain in the tool.
- 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.
- Select the valve wall surfaces using the box selection method.
-
In the dialog that appears, enter the following values for the BL
specification:
- First layer thickness: 0.00015
- Total number of layers: 3
- Growth method: Constant
- Initial growth rate: 1.2
- Termination policy: Truncate
- Activate Enable surface mesh modification.
- In the BL Controls legend, rename the BL control to Valve walls BL.
- On the guide bar, click to execute the command and exit the tool.
-
Click the drop-down next to the Mesh Controls tool set and select Advanced.
-
In the Advanced mesh settings dialog, change the Boundary
layer element type to Tetra then close the dialog.
- Turn on the display of all the surfaces and save the model.
Generate the Mesh
-
From the Mesh ribbon, click the
Volume tool.
- In the Meshing Operations dialog, set the Mesh size option to Maximum size and set the Maximum element size to 0.005.
- Deactivate Curvature based surface refinement.
-
Click Mesh to generate the mesh.
Once the meshing process has started, the Run Status dialog appears and the application moves to the Solution ribbon.
- Once the meshing is completed, close the Run Status dialog.
Compute the Solution
Define Nodal Outputs
-
From the Solution ribbon, click the Field tool.
-
In the Field Outputs dialog, set the Time step interval to
1 for the Solution variables.
Run AcuSolve
-
From the Solution ribbon, click the Run tool.
- Set the Parallel processing option to Intel MPI.
- Optional: Set the number of processors to 4 or 8 based on availability.
- Deactivate the Automatically define pressure reference option.
-
Leave the remaining options as default and click
Run to launch AcuSolve.
The Run Status dialog opens. Once the run is complete, the status is updated and you can close the dialog.
Run MotionSolve
- Run .
-
Select
from the menu bar.
- Click besides the Input file(s) field, browse to the location where you saved Valve_model.xml, and open it
-
For Options, type -as_cosim to indicate coupling between
MotionSolve and AcuSolve.
- Click Run to start MotionSolve.
Monitor the Results
-
From the Solution ribbon, click the Plot tool.
- Click next to the Library tab.
-
Keep the X-axis set to Step. For the Y-axis, click the
tree browser and select
mesh_displacement under Surface Output.
mesh_x_displacement is selected by default for the coordinate direction.
- Check the box for Valve wall - Output under Selector.
- Check the box for Twin Y-Axis.
- Click the tree browser for the second Y-axis and select pressure under Surface Output.
-
Check the box for Inlet - Output under Selector.
-
Click Create.
Note: The valve motion lags behind the pressure changes at the inlet. Note also the spike around the 37th time step. This represents the collision of the valve stem with the stop and the subsequent rebound of the valve.
Post-Process the Results with HM-CFD Post
Create an Animation of Velocity Magnitude
- Once the solution is completed, navigate to the Post ribbon.
- From the menu bar, click .
-
Select the AcuSolve log file in your problem
directory to load the results for post-processing.
The solid and all the surfaces are loaded in the Post Browser.
-
Click the Top face on the View Cube to align the
model.
- In the Post Browser, right-click on Front_symmetry and select Isolate.
- Right-click on Front_symmetry once more and select Edit.
- In the display properties microdialog, set the display to velocity.
- Activate the Legend toggle and set the max velocity to 6.0.
-
Click and set the Colormap Name to Rainbow
Uniform.
- Click on the guide bar.
-
Click at the bottom of the modeling window to view a live animation of the flow.
-
Save the animation.
- Go to .
- Click on the toolbar.
- Uncheck Include mouse cursor.
- Set the frame rate to 50.
- Click on the toolbar then drag over the area you want to record.
- Click to start recording and the same button to stop recording.
- Name the file and save it.
Display Pressure Contours and Velocity Vectors on a Section Cut
- Right-click in the modeling window and select Show All.
-
Click the Slice Planes tool.
- Select the plane perpendicular to the z-axis.
-
Make sure the View Cube is aligned with the Top face.
- Click in the slice plane microdialog.
-
Turn off the Display in the Contour tab of the display
properties microdialog.
- Click the Vector Display tab.
- Turn the Display on, set the variable to velocity, and the value to 0.001.
- Set the Coloring to pressure.
- Activate the Legend toggle and click to reset the range.
-
Click , set the Legend location to Upper
Center, the Legend orientation to
Horizontal, and the Colormap Name to
Rainbow Uniform.
- Click on the guide bar.
-
In the Post Browser, right-click on Slice Plane
1 and select Isolate.
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 HyperMesh CFD, and then running the simulation and post-process the results using HyperMesh CFD Post. You also learned how to create a vector plot on an existing contour plot on a cut plane.