-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcontactForce.m
60 lines (49 loc) · 1.51 KB
/
contactForce.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
function [F_cx, F_cy, delta, delta_d] = contactForce(y, s, cmod, state)
% 'contactForce' computes the contact force and related parameters.
%
% INPUT:
% y : State vector
% s : Rotor system object
% cmod : The contact model object
% state : Contact indicator (0|1)
% OUTPUT:
% F_c* : Force components
% delta : Indentation
% delta_d : Indentation rate
%
if s.calc_indent(y) <= 0
% If the "indent" is negative the contact force and indentation is zero, while
% the initial relative impact velocity should be calculated
% Check which solver is calling the parent function, this is important since
% delta_d_init cannot change, when the event function is only "testing" the
% limit
if state == 0
cmod.delta_d_init = s.pen_rate(y);
delta_d = cmod.delta_d_init;
else
delta_d = 0;
end
F_cx = 0;
F_cy = 0;
delta = 0;
else
% Penetration
delta = s.calc_indent(y);
% Penetration rate
delta_d = s.pen_rate(y);
% Relative velocity between the rotor- and stator surface (that is the
% tangential component)
vt_rel = s.tan_rel_velocity(y);
% Normal- and friction force
Fn = cmod.calc_fn(delta, delta_d);
Ff = cmod.calc_ff(Fn, vt_rel);
% Contact angle
alpha = s.contact_ang(y);
% Contact forces in the inertial coordinate system
F = s.T_the(alpha)' * [Fn; Ff; 0];
F_cx = F(1);
F_cy = F(2);
% delta_d is overwritten here for debug purposes in 'debug1'
delta_d = cmod.delta_d_init;
end
end