Subroutine Type |
Modeling |
|
Definition |
Used to calculate friction forces for the Force_Contact element. |
|
Use |
Implements a friction force for contact. |
|
<Force_Contact id = "301001" num_i_graphics = "1" i_graphics_id = "90000" num_j_graphics = "1" j_graphics_id = "90001" cnf_type = "Impact" stiffness = "500." exponent = "1.5" damping = "0.5" dmax = "0.01" cff_type = "UserCFF" cff_param_string = "USER(0.05,0.01,0.1,0.5)" cff_fnc_name = "CFFSUB" cff_dll_name = "NULL" /> |
||
Calling Syntax |
Fortran SUBROUTINE CFFSUB (ID, TIME, PAR, NPAR, LOCI, LOCJ, X, XDOT, NFORCE, AREA, DFLAG, IFLAG, RESULTS)
C void STDCALL CFFSUB (int *id, double *time, double *par, int *npar, double *loci, double *locj, double *x, double *xdot, double *nforce, int *dflag, int *iflag, double *result)
Python def CFFSUB(id, time, par, npar, loci, locj, x, xdot, nforce, dflag, iflag): return result
MATLAB function vector = CFFSUB(id, time, par, npar, loci, locj, x, xdot, nforce, dflag, iflag) |
|
Input Arguments |
[double precision] AREA |
The area of the contact patch. |
|
[logical] DFLAG |
A Boolean variable that MotionSolve sets to true when it needs partial derivatives. Otherwise, it is set to false. |
|
[integer] ID |
Force_Contact element identifier. |
|
[logical] IFLAG |
A Boolean variable that MotionSolve sets to true when it needs to know which functions CFFSUB depends on. When the flag is set to false, the values of the user-defined expressions are computed. |
|
[double precision] LOCI |
An array that contains the position vector of the contact point on I_GRAPHICS_ID with respect to the origin of the I_GRAPHICS_ID reference marker, resolved in the I_GRAPHICS_ID reference marker coordinate system. |
[double precision] LOCJ |
An array that contains the position vector of the contact point on J_GRAPHICS_ID with respect to the origin of the J_GRAPHICS_ID reference marker, resolved in the J_GRAPHICS_ID reference marker coordinate system. |
|
[double precision] NFORCE |
The value of the normal force. |
|
[integer] NPAR |
The number of entries in the PAR array. |
|
[double precision] PAR |
An array that contains the constant arguments from the list provided in the user-defined statement. |
|
[double precision] TIME |
The current simulation time. |
|
[double precision] X |
The contact deformation vector. The first two elements contain deformation along the x- and y-axes of the I incident marker. The third element contains the rotational deformation about z-axis of I incident marker. |
|
[double precision] XDOT |
The contact slip velocity vector. The first two elements contain the slip velocity along the x- and y-axes of the I incident marker. The third element contains the angular velocity about the z-axis of the I incident marker. |
|
Output Values |
[double precision] RESULT |
The value of the friction force vector. The first two elements contain the force along the x- and y-axes of the I incident marker. The third element contains the torque about the z-axis of the I incident marker. |
Example |
def CFFSUB(id, time, par, npar, loci, locj, x, xdot, nforce, dflag, iflag):
result = [0, 0, 0]
mu_sta = float(par[0]) mu_dyn = float(par[1]) vs = float(par[2]) vd = float(par[3])
v = sqrt(xdot[0]*xdot[0]+xdot[1]*xdot[1]) mu = 0.0 if v>=vd: mu = mu_dyn elif v>vs: mu, errflg] = py_step(v, vs, mu_sta, vd, mu_dyn, 0) else: [mu, errflg] = py_step(v, -vs, -mu_sta, vs, mu_sta, 0)
result[0] = -mu*(nforce)*xdot[0]/v result[1] = -mu*(nforce)*xdot[1]/v
return result |
See Also: