HyperWorks Solvers

CNFSUB

CNFSUB

Previous topic Next topic No expanding text in this topic  

CNFSUB

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Subroutine Type

Modeling

Definition

Used to calculate normal forces for the Force_Contact element.

Use

Implements a custom normal 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            = "UserCNF"

    cnf_param_string    = "USER(500.,1.5,0.5,0.01)"

    cnf_fnc_name        = "CNFSUB"

    cnf_dll_name        = "NULL"

    cff_type            = "Coulomb_On"

    mu_static           = "0.05"

    mu_dynamic          = "0.01"

    stiction_trans_vel  = "0.1"

    friction_trans_vel  = "0.5"

 />

Calling Syntax

Fortran

SUBROUTINE CNFSUB (ID, TIME, PAR, NPAR, LOCI, NI, LOCJ, NJ, GAP, GAPDOT, GAPDOTDOT, AREA, DFLAG, IFLAG, RESULTS)

 

C

void STDCALL CNFSUB (int *id, double *time, double *par, int *npar, double *loci, double *ni, double *locj, double *nj, double *gap, double *gapdot, double *gapdotdot, int *dflag, int *iflag, double *result)

 

Python

def CNFSUB(id, time, par, npar, loci, ni, locj, nj, gap, gapdot, gapdotdot, dflag, iflag):

    return result

 

MATLAB

function vector = CNFSUB(id, time, par, npar, loci, ni, locj, nj, gap, gapdot, gapdotdot, 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.

 

[double precision] GAP

The gap between I_GRAPHICS_ID and J_GRAPHICS_ID.  If GAP is positive or zero, there is no contact or penetration.

 

[double precision] GAPDOT

The first time derivative of GAP.

 

[double precision] GAPDOTDOT

The second time derivative of GAP.

 

[integer] ID

Force_Contact element identifier.

 

[logical] IFLAG

A Boolean variable that MotionSolve sets to true when it needs to know on which functions CNFSUB depends.  When the flag is set to false, then 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] NI

An array that contains the surface normal vector at the contact point on I_GRAPHICS_ID, resolved in the I_GRAPHICS_ID reference marker coordinate system.

 

[double precision] NJ

An array that contains the surface normal vector at the contact point on J_GRAPHICS_ID, resolved in the J_GRAPHICS_ID reference marker coordinate system.

 

[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.

Output Values

[double precision] RESULT

The value of the normal force.

Example

def CNFSUB(id, time, par, npar, loci, ni, locj, nj, gap, gapdot, gapdotdot, dflag, iflag):

 

    stiffness = par[0]

    exponent = par[1]

    damping = par[2]

    dmax = par[3]

    

    spring_force = stiffness*pow(fabs(gap),exponent)

    [tmp,errflg] = py_step(gap,-dmax,damping,0.0,0.0,0)

    damping_force = -tmp*gapdot

 

        result = 3*[0]    

        result[0] = spring_force+damping_force

        if result[0]<0.0:

            result[0] = 0.0

 

    return result

See Also:

Modeling Subroutines