With the addition of a co-simulation interface between MotionSolve and AcuSolve, you can now solve multi-physics problems that involve complex rigid body movement, coupled with fluid flow, that generates pressure forces on the rigid bodies. This capability lets you enhance the fidelity of your multi-body system, letting you generate more realistic results.
In this scenario, MotionSolve computes the displacements and rotations for the rigid bodies, while AcuSolve computes the forces and moments on those bodies. Both solvers exchange data with each other while stepping forward in time via the TCP socket protocol. This means that the two solvers can be located on different machines and on different platforms and still communicate with one another. For example, the CFD simulation can run on an HPC, while the MBS simulation can run locally on a laptop.
In this tutorial, you will learn how to setup a model in MotionView that will be coupled with AcuSolve. You will use the MotionSolve-AcuSolve co-simulation interface to couple the rigid body dynamics of a check valve within a pipe with the flow field. The AcuSolve model has already been setup for you and is located at <installation directory>\14.0\tutorials\mv_hv_hg\mbd_modeling\motionsolve\cosimulation\Check_Valve_Coupled.acs. Steps for running this model in AcuSolve are included as part of this tutorial.
To learn more about how to setup the model in AcuSolve, please refer to <installation_directory>\14.0\acusolve\<platform>\help\acu\acusolve_tut\Tutorials\Check_Valve_Coupled\.
To successfully complete this tutorial, the following must be installed:
1. | HyperWorks Desktop (MotionView) v14.0. |
2. | HyperWorks Solvers (MotionSolve) v14.0. |
3. | AcuSolve v14.0. |
The following scenarios are supported for the MotionSolve-AcuSolve co-simulation:
Machine A |
Machine B |
||
Software |
Platform |
Software |
Platform |
MotionSolve/MotionView |
Windows 64-bit |
AcuSolve |
Windows 64-bit |
MotionSolve/MotionView |
Windows 64-bit |
AcuSolve |
Linux 64-bit |
MotionSolve/MotionView and AcuSolve |
Windows 64-bit |
- |
- |
From the table above, the co-simulation is currently only supported for the Windows 64-bit platform for MotionView and MotionSolve. You may use either a Windows 64-bit or a Linux 64-bit installation of AcuSolve.
The co-simulation interface between MotionSolve and AcuSolve consists of a “middleware” utility executable, acuMSI.exe. This executable is responsible for:
• | Establishing a connection to both MotionSolve and AcuSolve. |
• | Communicating the displacements and rotations from MotionSolve to AcuSolve. |
• | Communicating the forces and moments from AcuSolve to MotionSolve. |
• | Managing runtime and licensing. |
This is shown schematically in Figure 1 below.
Figure 1: Co-Simulation setup |
A check valve is a mechanical device that permits fluid to flow in only one direction. This is controlled by a shutter body. Fluid flowing in one direction pushes the shutter body in one direction, thereby opening the valve. Fluid flowing in the opposite direction pushes the shutter body in the other direction, which causes the valve to shut and prevents flow reversal in the pipe. Check valves are found in pumps, chemical and power plants, dump lines, irrigation sprinklers, hydraulic jacks, for example.
The geometry that is modeled in this tutorial is illustrated in Figure 2 below. It consists of:
• | A pipe with an inlet and outlet for the fluid flow. |
• | A check valve assembly that consists of a shutter plate attached to a stem. |
• | A stop mounted on a perforated plate downstream of the shutter body. |
The fluid flow in the pipe is assumed to be axisymmetric. This allows you to model only a part of the check valve. In this example, a 30 degree section of the geometry is modeled, as shown by the blue part in Figure 2. The advantage of doing this is a reduced simulation time while still capturing an accurate solution.
Figure 2: Pipe with check valve model setup |
The check valve assembly consists of a disc-like body mounted on a stem. When fluid flows in the direction specified by the red arrows in Figure 2 above, the fluid forces the shutter body to translate in the same direction as the fluid. The motion of the shutter body is also affected by a spring damper attached between the shutter body and the perforated plate. Finally, 3D rigid body contact is modeled between the shutter body and the stop to arrest the motion of the shutter body in the direction of the flow.
For the MBS model, only 1/12 of the shutter body and the perforated plate are modeled.
At the start of the simulation, the flow field is stationary. A pressure specified at the inlet drives the flow, which varies over time as a piecewise linear function. This is illustrated in Figure 3. As this pressure rises, the flow accelerates which in turn pushes the shutter body open and allows flow through the pipe.
Figure 3: Inlet pressure |
This dynamics of this kind of model can be termed as being “tightly” coupled between the two solvers. This means that the motion of the rigid bodies affects the fluid flow field, which in turn affects the rigid body motion in a cyclical fashion.
The rest of this tutorial assumes that this model has been correctly setup in AcuSolve. Note that the model is designed to translate the shutter body until it collides with the perforated plate. The MotionView model has been designed with a contact between these two bodies that causes the shutter body to rebound appropriately. To allow the rigid bodies to come into contact without the AcuSolve finite element mesh fully collapsing, the perforated plate in the fluid model has been offset by 0.002m in the positive X direction. This allows the MotionView model to react as specified by the contact entity while keeping the AcuSolve mesh from fully collapsing.
Step 1: Load the model in MotionView
1. | From the Start menu, select All Programs > Altair HyperWorks 14.0 (64-bit) > MotionView. |
2. | Open the model Valve_model.mdl from <altair>\14.0\tutorials\mv_hv_hg\mbd_modeling\motionsolve\cosimulation. |
This model is prepared to run in MotionSolve but requires modifications to run in co-simulation with AcuSolve. These steps are outlined below.
Once the model is loaded into MotionView, the graphical window displays the shutter valve, perforated plate, joint and spring entities, as well as a graphical representation of the spring damper as shown in Figure 4.
Figure 4: The MotionSolve model of the pressure check valve |
The MotionSolve model consists of the following components:
Component name |
Component type |
Description |
Ground Body |
Rigid Body |
Ground Body |
Shutter Body |
Rigid Body |
30 degree section of the shutter body. |
Perforated Body |
Rigid Body |
30 degree section of the perforated plate. |
Contact |
3D Rigid-Rigid Contact Force |
3D rigid-rigid contact force between the Shutter body and the Perforated Body. |
Solver Units |
Data Set |
The units for this model (Newton, Meter, Kilogram and Second). |
Gravity |
Data Set |
Gravity specified for this model. The gravity is turned on and acts in the negative Y direction. |
Shutter Body Graphic |
Graphic |
The graphic that represents the shutter body. This graphic is used both for the co-simulation and for the contact force calculations. |
Perforated Plate Graphic |
Graphic |
The graphic that represents the perforated plate body. This graphic is used both for the co-simulation and for the contact force calculations. |
Spring |
Graphic |
The graphic that represents the spring modeled between the shutter body and the perforated plate body. This is only for visualization and does not affect the co-simulation results. |
Fixed |
Fixed Joint |
This fixed joint clamps the perforated plate body to the ground. |
Translation |
Translational Joint |
This translational joint allows motion of the shutter body along the X axis. |
Spring |
Spring Damper |
This is a simple spring damper mounted between the shutter body and the perforated plate body. |
ContactOutput |
Output |
An output signal that measures the contact force. |
Displacement |
Output |
An output signal that measures the displacement between the shutter body and the ground. |
Velocity |
Output |
An output signal that measures the velocity of the shutter body with respect to the ground. |
Step 2: Specify the “wet” body that will interact with AcuSolve
To couple with AcuSolve, you need to specify one or more "wet" bodies. A "wet" body is a body in the MotionSolve model which interacts with the fluid flow and thus has forces and moments acting on it. Such a body can translate or rotate due to the actuating fluid force/moment as computed by AcuSolve as well as due to any actuating forces/moments in the MotionSolve model. In this example, we will define a single "wet" body – the shutter body that translates along the X axis due to fluid impinging on it.
To specify a body as "wet" in MotionView, you have to make use of a system definition, which is described below.
1. | Add the system definition to your model by locating the Model system in your Project Browser and select it. |
This changes the panel selection at the bottom.
o | From the Import/Export tab, select Import as shown in Figure 5 below. |
o | Click the file open icon, . |
Figure 5: Adding the system definition to the model |
2. | The system definition that is used for this co-simulation is located at <altair>\14.0\utility\mbd\fluid_force\sys_fluid_force.mdl. Click Import to import the file. |
The Import Definition dialog is displayed. Leave the labels as-is and click OK.
Figure 6: Adding the system definition to the model |
A new system called System Wet Body is created in your model.
3. | Specify the "wet" body by clicking the newly created System Wet Body and clicking the Attachments tab as shown in Figure 7. |
Figure 7: Defining the rigid body associated with the “wet” body |
4. | Click the Body collector and resolve it to Shutter Body. |
If you examine the contents of this system under the project browser on the left, you will see the following new components have been created:
Component Name |
Component Type |
Description |
Shutter Body - AcuSolveForce |
Action Only, TransRotational Force |
The force and moment calculated by AcuSolve is applied to the “wet” body through this force component. |
Plant Input |
Control Plant Input |
AcuSolve deposits the forces and torques into this modeling element. |
FromAS_FX FromAS_FY FromAS_FZ FromAS_TX FromAS_TY FromAS_TZ |
Solver Variables |
These variables hold the forces (X, Y and Z) and the moments (X, Y, Z) values from AcuSolve. |
Define wet_body attribute |
Template |
This template adds the attribute is_wet_body to the wet body that is chosen for this system. |
Define co-simulation with AcuSolve |
Template |
This template adds the attribute acusolve_cosim to the model to instruct MotionSolve to co-simulate with AcuSolve. |
At this point, you have setup the model in MotionView to interact with AcuSolve.
Step 3: Run the model without co-simulating with AcuSolve
To make sure that the MotionView model is setup correctly, run the model in MotionSolve and make sure there are no warning/error messages from MotionSolve.
1. | Deactivate the template Define co-simulation with AcuSolve as shown in Figure 8 below: |
Figure 8: Deactivate the co-simulation template |
2. | To deactivate the template, right-click on it in the browser and select Deactivate. |
By doing this, you are deactivating the flag which tells MotionSolve that this model is intended for co-simulation with AcuSolve. Thus, MotionSolve simulates this model as a stand-alone model without co-simulating with AcuSolve.
You may run this model using the Run panel in MotionView and ensure that there are no error or warning messages reported. This is recommended to ensure that the model works properly before attempting a co-simulation.
If you load the animation H3D generated from running this model, you will see that there is no motion in any of the parts. This is because all of the actuation for this model comes from AcuSolve, which was disabled for this simulation.
3. | After you have verified the model, re-activate the template Define co-simulation with AcuSolve to perform a co-simulation, shown in Figure 9 below: |
Figure 9: Activate the co-simulation template |
4. | To activate the template, right-click on it in the browser and select Activate. |
Step 4: Export the model to XML
1. | To export the model to your working directory, click the Export to Solver button, , and export the solver deck to your working directory. |
You may change the default name of the model.
Figure 10: Exporting the model to XML |
Step 5: Verify the model between MotionSolve and AcuSolve
To successfully run the co-simulation, the model created in MotionView and the model created in AcuSolve must be consistent. The following criteria need to be met in order for the two models to be consistent.
1. | The name of the “wet” body/bodies need to match between MotionSolve and AcuSolve. The names of the “wet” body/bodies are specified in the *.inp file on the AcuSolve side. |
Note The names are case-sensitive and must match exactly (see the text in red below).
MotionSolve (.xml):
<!-- MODEL.b_Part1 -->
<Body_Rigid
full_label = "Model-Shutter Body"
AcuSolve (.inp):
EXTERNAL_CODE_SURFACE( "Valve wall" ) {
rigid_body_name = "Model-Shutter Body"
2. | The print_interval for the MotionSolve model needs to match the step size for the AcuSolve model. For this tutorial it is set to 0.002s. |
3. | You must set the MotionSolve step size, h_max, to match the print_interval (0.002s in this case). |
4. | Also, verify that the end times for both models are set to the same values. For this tutorial, the end times for both the AcuSolve and MotionSolve models are set to 0.35s. |
See the Run Panel in MotionView to set the print_interval, step size (h_max), and end times.
Note that the units in the MotionSolve and AcuSolve models do not need to match to run the co-simulation; however, the units must match to overlay the results animations in HyperView. The units in MotionView are set via the Units form shown below:
Figure 11: Setting the units in MotionView |
All values in the MotionSolve model are set with respect to these units settings.
Step 6: Run the MotionSolve and middleware executables for co-simulation from the MotionSolve Run Manager
1. | From the Start menu, select All Programs > Altair HyperWorks (14.0) 64-bit > MotionSolve to open the HyperWorks Solver Run Manager. Locate the model you just exported by clicking on the file open icon, . |
Figure 12: Select the exported model from disk |
2. | Click the ellipsis button next to Options field to open the Available Options dialog. |
Figure 13: Selecting the co-simulation flag |
3. | Activate the –as_cosim option. When this flag is enabled, it tells the Run Manager to do the following: |
• | Invoke the MotionSolve executable and run the model that is specified. |
• | Invoke the middleware “acuMSI”, which enables communication between MotionSolve and AcuSolve. |
When you activate this option, the following dialog is displayed and you are prompted for additional options:
Figure 14: Specifying options for the co-simulation |
You may specify the following options here:
acuMSI options |
|
-aport <integer> |
Specifies the communication port number for communication between AcuSolve and acuMSI. The default is 48000. Note If you need to change the default port for communication between AcuSolve and acuMSI, in addition to changing this argument, you also have to specify the changed port number in the AcuSolve input file. |
-mport <integer> |
Specifies the communication port number for communication between MotionSolve and acuMSI. The default is 94043. Note If you need to change the default port for communication between MotionSolve and acuMSI, in addition to changing this argument, you also have to specify the changed port number in an environment variable MS_AS_PORT. MotionSolve checks for this environment variable at the start of the simulation and changes its listening port accordingly. |
-mi <integer> |
Specifies the maximum number of iterations per time step between the two solvers. The default is 0. |
-v <integer> |
Specifies the verbosity level of the output file from acuMSI. The default is set to 0 (verbosity OFF). |
4. | If you retain the default options, click None. |
5. | Click Apply Options and click Close. |
Figure 15: Specifying the co-simulation flag |
6. | You are now setup to start the co-simulation on the MotionSolve side. Click Run. |
Figure 16: Run the MotionSolve model |
This launches MotionSolve as well as the acuMSI executable. The MotionSolve run is paused at the first time step – it is now in waiting mode and the co-simulation will start as soon as AcuSolve is run.
Figure 17: The MotionSolve simulation is waiting for a connection to AcuSolve |
Step 7: Run the AcuSolve executable for co-simulation
1. | To run the co-simulation model in AcuSolve, first copy the model file Check_Valve_Coupled.acs from <installation_directory>\14.0\tutorials\mv_hv_hg\mbd_modeling\motionsolve\cosimulation to your working directory. |
2. | From the Start menu, select All Programs > Altair HyperWorks 14.0 (64-bit) > AcuSolve > AcuSolve Job Launcher. In the window that is displayed, change the field Problem name as specified by the AcuSolve .inp file. Make sure your Problem directory is set to your current working directory. |
Figure 18: Launching AcuSolve for the co-simulation |
For this model, the default values are used. AcuSolve runs using a single processor, and AcuConsole generates the input files and launches AcuSolve.
3. | Press Launch to launch the solution process. |
As the solution starts, an AcuTail window opens. After executing acuPrep, AcuSolve stops at the acuRun path step. It’s waiting for the execution of the MotionSolve process.
Soon, AcuSolve and MotionSolve should begin to communicate with one another. You should be able to see relevant time stepping information in both solver windows. For example, you should see something like the following in the MotionSolve window at the beginning of the co-simulation:
INFO: [AS-COSIM] Connected to AcuMsi on port 94043
INFO: [AS-COSIM] License checked out.
…
Time=2.000E-06; Order=1; H=2.000E-06 [Max Phi=1.314E-16]
Time=3.600E-02; Order=2; H=2.000E-03 [Max Phi=1.653E-08]
…
The co-simulation should take roughly 15 minutes to complete on a laptop (Intel i7. 2.8GHz).
Note that there is no order dependency on launching the co-simulation – either MotionSolve or AcuSolve can be launched first.
Step 8: Post process the results from the co-simulation
HyperView and HyperGraph can be used to post process the co-simulation results within the HyperWorks Desktop environment.
1. | To launch HyperView (HyperGraph), from the Start menu, select All Programs > Altair HyperWorks 14.0 (64-bit) > HyperView (HyperGraph). |
The animation H3D generated by the MotionSolve part of the co-simulation contains only the results from MotionSolve. Similarly, the result files from AcuSolve only contain the results for the AcuSolve model. To animate the results from the co-simulation, follow these steps:
1. | Load the animation H3D generated by MotionSolve in HyperView. |
o | Go to the Load Model panel. |
o | Click the file open button, , next to Load model and navigate to the results directory (the same directory where the .xml file is located). |
o | Select the .h3d file and click Open. |
o | Click Apply. |
Figure 19: Loading MotionSolve H3D in HyperView |
HyperView loads the MotionSolve results file into the graphical window at the first time step. From this point, you can animate the transient results using Start/Stop on the Animation Slider.
2. | To load the AcuSolve results, they must first be converted to the .h3d format. This can be accomplished by using the AcuSolve utility, acuTrans. AcuTrans is available from the Start menu. Select All Programs > Altair HyperWorks 14.0 (64-bit) > AcuSolve > AcuSolve Cmd Prompt. |
3. | Navigate to the results directory and execute the following command to convert the AcuSolve database into the .h3d format: |
acuTrans -out -to h3d -h3dopt single -ts A
This creates a single .h3d file containing all of the time steps available for the simulation.
4. | Using acuTrans, overlay the newly-created H3D over the MotionSolve result H3D in HyperView. This is accomplished by repeating Step 1 described above and activating Overlay when selecting the AcuSolve result H3D. |
Figure 20: Overlaying AcuSolve H3D over the MotionSolve H3D in HyperView |
Once loaded, the graphical window contains both results and can be animated as before. To visualize the information contained within the AcuSolve results, a Contour plot may be used. Click on the Contour button, , to display the panel.
5. | Set the options as shown in Figure 19 below and click Apply. |
Figure 21: Overlaying AcuSolve H3D over the MotionSolve H3D in HyperView |
This creates a contour plot of the velocity magnitude overlaid with the results from MotionSolve in one window.
Figure 22: Velocity magnitude plot overlaid with the MotionSolve results in HyperView |
You can also interpret the results with a two dimensional plot using HyperGraph. HyperWorks Desktop can be used in a multi-window layout, allowing both HyperView and HyperGraph to be open at the same time.
1. | First, open HyperView following the steps described in the previous section. |
2. | From the toolbar, click the Page Window Layout button, , and split the page into two vertical pages. |
Figure 23: Splitting the page into two vertical pages |
This automatically adjusts the graphical window to accommodate two pages, defaulting to two instances of HyperView.
3. | Click anywhere in the page on the right and switch to HyperGraph by clicking the Page Selector button, , and selecting HyperGraph 2D from the drop-down list. |
Figure 24: Change the page on the right to HyperGraph 2D |
4. | Click the Build Plots button, , to load the .plt file from the same results directory. |
Figure 25: Load the plot results in HyperGraph |
Once the .plt file is loaded into HyperGraph, the two outputs are available for plotting.
5. | Perform the following selections: |
o | Under Y Type, select Displacement |
o | Under Y Request, select Displacement (on Shutter Body) |
o | Under Y Component, select X |
o | Click Apply. |
HyperGraph can be used to create additional traces on the same plot to generate the following plots.
Figure 26: Select the signals for plotting |
Figure 27: The MotionSolve animation side-by-side with the MotionSolve plot results |