PTdSFSUB

ModelingUsed to compute normal and friction force for a Force_PTdSF entity.

Use

User-defined PTdSF force using displacement and velocity of the point of contact and computing normal and friction force in a PTDSFSUB.

<Force_PTdSF
    id                   = "301001"
    i_marker_id          = "30103070"
    radius               = "0.1"
    ref_dsurface_id      = "301001"
    force_model          = "USERSUB"
    usersub_param_string = "USER(100, 1000, 0.1)"
    interpreter          = "Python"
    script_name          = "ptdsfsub.py"
    usrsub_fnc_name      = "PTDSFSUB"
 />

Format

Fortran Calling Syntax
SUBROUTINE PTDSFSUB (ID, TIME, PAR, NPAR, DISP, VELO, DFLAG, IFLAG, NORMAL_FORCE, FRIC_FORCE)
C/C++ Calling Syntax
void STDCALL PTDSFSUB (int*id,double*time,double*par,int*npar,double*disp,double*velo,int
*dflag,int*iflag,double*normal_force,double*fric_force)
Python Calling Syntax
def PTdSFSUB(id, time, par, npar, disp, velo, dflag, iflag):
    return [normal_force, friction_force]
MATLAB Calling Syntax

Not Supported

Attributes

ID
[integer]
The user-defined motion element identifier.
TIME
[double precision]
The current simulation time.
PAR
[double precision]
An array that contains the constant arguments from the list provided in the user-defined statement.
NPAR
[integer]
The number of entries in the PAR array.
DISP
[double precision]
An array that contains the displacement data.
disp[0]
D [ Penetration Depth, Negative when in Contact]
disp[1]
X [ X of contact point with respect to the surface reference marker ]
disp[2]
Y [ Y of contact point with respect to the surface reference marker ]
disp[3]
Z [ Z of contact point with respect to the surface reference marker ]
VELO
[double precision]
An array that contains the velocity data.
velo[0]
D_dot [ Penetration Velocity]
velo[1]
X_dot [ X of contact tangential velocity with respect to the surface reference marker ]
velo[2]
Y_dot [ Y of contact tangential velocity with respect to the surface reference marker ]
velo[3]
Z_dot [ Z of contact tangential velocity with respect to the surface reference marker ]
DFLAG
[integer]
The differencing flag.
IFLAG
[logical]
The initialization flag.

Output

NORMAL_FORCE
[double precision]
The output value that contains the computed normal force. This scalar value is applied in the direction of the surface normal on the deformable surface at the point of contact.
FRIC_FORCE
[double precision]
The output array that contains the computed friction force (Fric_x, Fric_y, Fric_z).

Example

The following is an example of how to write a PTdSFSUB in Python:

def PTdSFSUB(id, time, par, npar, disp, velo, dflag, iflag):
    normal_force = [0]
    friction_force = [0,0,0]
    normal_force[0] = par[1]*disp[0] + par[2]*velo[0]
    friction_force[0] =0.01*normal_force[0]*velo[1]
    friction_force[1] =0.01*normal_force[0]*velo[2]
    friction_force[2] =0.01*normal_force[0]*velo[3]
    return [normal_force, friction_force]

Comments

When the sphere (centered at the I marker with given radius) is not in contact with the deformable surface or either u or v or both are out of range, the PTdSFSUB is only called at each converged time step, and the outputs (that is normal and friction forces) are completely ignored.