Pressure Relief Valve in the Position-Based Translational Domain
This example shows how to model a pressure relief valve in the position-based translational mechanical network. This example is the first in a series. The next example is Modeling the Spring in Chamber with Composite Components in the Position-Based Translational Domain.
Modeling the Valve
In this example, you model a pressure relief valve. The valve uses a pre-tensioned spring to push a poppet into its seat to close the valve. The valve opens when the inlet pressure induces a fluid force on the poppet larger than the closing force of the spring. The relief valve consists of two pieces that are modeled as separate blocks with the Spring in Chamber and the Conical Poppet Valve blocks. The Spring in Chamber and the Conical Poppet Valve blocks are constructed from simpler blocks and equations such as springs, masses, spacers, and hard stops.
Constructing blocks from simpler blocks has several advantages. Well designed fundamental blocks can make building complex blocks simpler because the new blocks can build upon previous work. It is also easier to maintain libraries constructed from simpler blocks because any changes to a lower level block automatically propagates to any blocks that use it. The custom components used in this example are contained in a custom library PositionBasedValve_lib
.
Simulate the model.
open_system('PositionBasedPressureReliefValveNegative'); set_param('PositionBasedPressureReliefValveNegative/Conical Poppet Valve', 'hardstop_force_specify','off'); % This is the default behavior sim('PositionBasedPressureReliefValveNegative');
In this system, the Spring in Chamber block is preloaded, which pushes the Conical Poppet Valve block into its seat and closes the valve.
The functions below plot the logged forces and poppet position.
h = figure; h.Position(3:4) = [1120 420]; t = tiledlayout(1,2); nexttile(1); PositionBasedPressureReliefValvePlotForces('PositionBasedPressureReliefValveNegative', 'noCheckSimLog'); nexttile(2); PositionBasedPressureReliefValvePlotLocation('PositionBasedPressureReliefValveNegative', 'noCheckSimLog');
At t = 0, the Spring in Chamber block hardstop is not in contact and has zero force. This hardstop represents the contact if the two piston heads touch. The Conical Poppet Valve block hardstop represents the contact when the poppet is in the seat. The Spring in Chamber block spring force and the Conical Poppet Valve block hardstop force are balanced and both have a value of 100 N between 0 and 1 seconds, which is the value of the Pre-load parameter in the Spring in Chamber block. Both the Spring in Chamber spring and Conical Poppet Valve hardstop forces are positive, which indicates that they are both in states of compression.
At t ≈ 1.1 seconds, the fluid pressure at port Af in the Conical Poppet Valve block begins to increase. The Conical Poppet Valve hardstop force drops to 0 as the valve begins to open. The spring force increases as the valve opens, which indicates the increased compression of the spring. The force induced on the poppet by the fluid pressure increases. The positive polarity of the fluid force indicates that it drives the valve open. There is no visible F port because it is the grounded casing, but a positive fluid force indicates that the fluid drives the poppet at port B away from the casing at port F, which is in the negative direction in this setup.
If the pressure relief valve were configured to open with positive poppet displacement, port B would be the grounded casing and port F would be exposed. In this case, a positive force would indicate ports B and F are being driven away from each other, which results in a positive displacement at port F. The hidden grounded node at port B or F is the reason that the force convention of this one-port block matches that of two-port blocks. The Conical Poppet Valve block is a two-port block, with one hidden grounded node.
At t ≈ 6.8 seconds, the hardstop in the Spring in Chamber is contacted and its force starts to increase. The positive sign indicates a compressive state.
Force Initialization
This figure show the model behavior at t=0 and shortly after. The rapid transient behavior indicates that the model not cleanly initialized.
set_param('PositionBasedPressureReliefValveNegative/Conical Poppet Valve', 'hardstop_force_specify','off'); % This is the default behavior PositionBasedPressureReliefValvePlotForces('PositionBasedPressureReliefValveNegative'); xlim([0, 0.0001]); ylim([0, 200]);
To initialize cleanly, the initial Conical Poppet Valve hardstop force must balance the Spring in Chamber preload force. Set the value of the Poppet seat force initial target in the Conical Poppet Valve block to match the value of the Pre-load parameter in the Spring in Chamber block. Set the value of the Priority parameter to High.
set_param('PositionBasedPressureReliefValveNegative/Conical Poppet Valve', 'hardstop_force_specify','on'); % Initialize force to non-default value sim('PositionBasedPressureReliefValveNegative'); PositionBasedPressureReliefValvePlotForces('PositionBasedPressureReliefValveNegative'); xlim([0, 0.0001]); ylim([0, 200]);
Setting the force variable initial targets correctly the model initializes in steady-steady state without oscillations.
Positive vs. Negative Opening Valves
The Conical Poppet Valve block can also open when the poppet displaces in the positive direction. The PositionBasedPressureReliefValvePositive
model is equivalent to the PositionBasedPressureReliefValveNegative
model, but the poppet displaces in the positive direction. In addition to the change to the poppet opening direction, the only other difference is the additional Spacer block. The model needs the Spacer block because the Knob side of the relief valve is connected the maximum location in the system, as opposed to the minimum location.The value of the Length initial target in the Spacer block is the sum of the Knob length and starting length of the spring, 50 mm + 45 mm = 95 mm.
open_system('PositionBasedPressureReliefValvePositive');
This figure shows the forces in both poppet orientations. The two systems return the same results even with the orientation change. This is consistent with the force convention of two-port position-based translational blocks. Positive forces induce component ports to separate while negative forces drive them together. For true one-port position-based translational blocks, positive forces induce positive motion. Blocks with no second hidden grounded node act as pure one-port blocks. These blocks have the port label R, while two-port blocks have the labels B and F.
PositionBasedPressureReliefValvePlotCompare
Takeaways
You can use the position-based translational mechanical domain to construct a pressure relief valve from composite components.
Initialize variables, such as forces, to set initial states to equilibrium and avoid initializing transients.
One-port blocks with a B position-based translational port should be connected to another block's R or F port. One-port blocks with an F position-based translational port should be connected to another block's R or B port. Positive force acts to separate the visible port from the grounded casing.
Positive force is compressive in two-port blocks, such as the Spring in Chamber block.