MV-1015: Using Spline3D to Model Combustion Forces in an Engine
In this tutorial you will learn how to use Spline3D to model an input which depends on two independent variables.
- What are Spline 3Ds?
- Spline3Ds are reference data plotted in three-dimensional coordinates which have two independent vectors or axis. These can be visualized as a number of 2D Splines (Curves) placed at regular intervals along a third axis. For instance, a bushing is generally characterized by a Force versus the Displacement curve. Let’s say, the Force versus displacement also varies with temperature. Effectively, there are two independent variables for the bushing force - Displacement and Temperature. Another example is the Engine Pressure (or Force) versus the Crank angle map (popularly known as P-Theta diagram). The P-theta map will vary at different engine speeds (or RPM). Such a scenario can be modeled using Spline3D.
In this exercise, engine mechanism is simulated where the combustion force that varies with regard crank angle and engine speed is modeled using Spline3D.
Review the Model
In this step, you will load and review the model.
- Start a new MotionView session.
- Click the (Open Model) icon to open the SingleCylEngine.mdl model file.
-
Review the model.
- The model is a piston cylinder mechanism with a flywheel.
- The model has two systems: System Cyl1 and System Flywheel.
-
Review the System Flywheel.
-
Review the System Cyl1.
- The solver variables in System Flywheel are passed as attachments to this system and carry the variable names arg_Crank_angle_SolVar and arg_Crank_RPM_SolVar. You will use these to define the independent variables while defining the combustion force using Spline3D.
- A Cumbustion_ref marker exists as a reference for a combustion force whose Z axis is aligned along the direction of travel of the piston.
Add a Spline3D Entity
In this step you will learn how to add a combustion force to the piston using Spline3D.
-
Add a Spline entity by dong one of the following:
- From the Project Browser, right-click on System Cyl1 and select .
- In the Project Browser, Select System Cly1 and right-click the (Spline3D) icon.
-
In the dialog, enter F_ThetaSpline as the Label and
spl3d_F_ThetaSpline for the Variable.
-
Click OK.
This will display the Spline3D panel with the Properties tab active.
-
From the Type drop-down menu, select Value.
Note: The data for the spline can be defined using either the File or Value methods. For the File type, a reference to an external file in .csv format must be provided. In case of the Value type, the values can be imported from a .CSV file (using Import) or they can be entered in manually. In this tutorial, we will import the values from an external file.
- Click the Import button to display the Import Values From File dialog.
- From your <working directory>, browse to FTheta.csv and click OK.
-
In the Warning dialog that appears, click
Yes.
The .csvfile that will be used as the source for Spline3D needs to be in the format shown in Figure 7.
- The first column must hold the X-axis values (shown in blue in Figure 7) which is the first independent variable.
- The top row holds the Z-axis values (shown in Figure 7) which is the second independent variable.
- The other columns must have the Y-axis values (shown in green in Figure 7) with each column belonging to the particular Z-axis values heading that column.
Once imported, the values are populated in the panel. -
In the Panel, you can review the values in the table by clicking the (Expansion) button
to open the Spline Values Table Data window.
Note: When manually keying in the values, context menus are available which allow you to Insert/Delete/Append row and column data. You can access these menus by right-clicking on any of the row or column headers. If the right-click is made on the last row/column, an Append option will also be available.
- Close the Spline Values Table Data window.
-
Activate the Linear Extrapolation check box.
This will ensure that the values are extrapolated if the Solver starts looking for values beyond the range of the user provided data.
-
Click the Show Spline button to visualize the spline
graphically.
You can view all three axes in an isometric view.
-
Click to Close the viewer.
The imported values are Combustion Force on Piston vs Theta (crank angle) diagrams at different speeds (as shown in Figure 14). The F-Theta profiles vary slightly at different engine or crank speeds. The same plot was visualized in the Spline3D Viewer by placing the four different plots along the Z-axis.
Add a Force Using Spline3D
In this step you will add a force to represent the combustion in the cylinder. You will map it to the Spline3D added in Add a Spline3D Entity.
-
Add a force using one of the following methods:
- From the Project Browser, right-click on System Cyl1 and select from the context menu.
- Select System Cyl1 in the Project Browser and then right-click on the (Force) icon on the Force Entity toolbar.
- In the dialog, enter ThetaSpline Force as the Label and enter a Variable name. Click OK.
- From the Force panel, in the Connectivity tab use the Force menu to select Action reaction.
-
Resolve the connections as shows in Figure 15.
- Double click on the input collector ( and so on) and use the Model Tree.
- Select the desired entity from the modeling window.
Note: The Body 2 reference to Ground Body is through an attachment to the System Cyl1 system. - From the Trans Properties tab, change the Fz type to Spline3D.
- Double click on the (Spline3D collector).
-
From the Select a Spline3D dialog, expand System Cyl1 in
the Model Tree and then select
F_ThetaSpline.
- Click OK.
-
In the Independent variable X field, enter the expression
`MOD({arg_Crank_angle_SolVar.VARVAL},720)`
. -
In the Independent variable Z field, enter
`{arg_Crank_RPM_SolVar.VARVAL}`
. -
On the Model check toolbar, click (Check Model).
Note: The solver function MOD() used in Independent variable X refers to the solver variable Crank_angle (deg) in System Flywheel (via attachment arg_Crank_angle_SolVar to System Cyl1). This function calculates the remainder of the division of first argument value (value of the solver variable) by the second argument value (720); thereby resetting the value of Independent variable X every 720 degrees.
- To save the model, from the menu bar click .
Solve the Model
In this step, you will solve the model with MotionSolve.
- On the General Actions toolbar, click (Run).
- In the Run panel, enter an end time of 40 seconds and change the print interval to 0.001.
-
Click the (Open File) icon and assign a name and location for
the MotionSolve XML file.
-
Click the Run button.
This will invoke MotionSolve and solve the model.
- When the job is complete, Close the Solver View window and the Message Log.
Post-Process the Results
In this step, you will post-process the MotionSolve results from your Spline3D model.
-
In the Run panel, click the Animate button.
This will load your results in a HyperView window.
- From the Animation toolbar, click the (Start/Pause Animation) button to animate the model.
-
Visualize the forces on the Piston.
- From the Page Controls toolbar, click the (Add Page) icon.
- In the Select Application drop-down menu, change the client to HyperGraph 2D.
- In the Page Controls toolbar, click the arrow next to (Page Window Layout) and click (3 window layout).
- From the Build Plots panel, click to load the .plt file from the MotionSolve run.
-
Plot the Crank_angle (deg).
-
Plot the CombustionForce in the Z direction.
- Click in the second window (top right) to make it the active window.
- For Y Type, click Force.
- For Y Request, click REQ/70000002 ThetaSpline Force on Piston (ForceOnPiston).
- For Y Component, click Z.
-
Plot the Force vs Theta plots at different speeds as applied on the
Piston.
This will demonstrate the usage of the Spline3D input used in the Add a Spline3D Entity step of this tutorial.
-
Add three more plots for 1000, 1500, and 2000 RPM. Use the expressions listed
in Table 1.
Table 1. Curve Name x expression y expression 1000 RPM p2w1c1.y[subrange(p2w1c1.x,16,17)] p2w1c1.y[subrange(p2w1c1.x,16,17)] 1500 RPM p2w1c1.y[subrange(p2w1c1.x,26,27)] p2w1c1.y[subrange(p2w1c1.x,26,27)] 2000 RPM p2w1c1.y[subrange(p2w1c1.x,36,37)] p2w1c1.y[subrange(p2w1c1.x,36,37)] -
Assign different colors to these curves in one of the following ways:
- Click the (Curve Attributes) icon and select from the color panel under Line Attribute.
- In the Plot Browser, select each line and change the color in the Properties tab.
-
Compare the finished plots with the input data for the Spline3D plot in Add a Spline3D Entity.