0% found this document useful (0 votes)
26 views70 pages

Harmonic Balance Method Analysis Guide

Hbm

Uploaded by

amit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views70 pages

Harmonic Balance Method Analysis Guide

Hbm

Uploaded by

amit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 70

Harmonic Balance Method Analysis Guide

ANSYS, Inc. Release 2024 R1


Southpointe January 2024
2600 Ansys Drive
Canonsburg, PA 15317 ANSYS, Inc. and
[email protected] ANSYS Europe,
Ltd. are UL
http://www.ansys.com registered ISO
(T) 724-746-3304 9001: 2015
(F) 724-514-9494 companies.
Copyright and Trademark Information

© 2024 ANSYS, Inc. Unauthorized use, distribution or duplication is prohibited.

ANSYS, Ansys Workbench, AUTODYN, CFX, FLUENT and any and all ANSYS, Inc. brand, product, service and feature
names, logos and slogans are registered trademarks or trademarks of ANSYS, Inc. or its subsidiaries located in the
United States or other countries. ICEM CFD is a trademark used by ANSYS, Inc. under license. CFX is a trademark
of Sony Corporation in Japan. All other brand, product, service and feature names or trademarks are the property
of their respective owners. FLEXlm and FLEXnet are trademarks of Flexera Software LLC.

Disclaimer Notice

THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETS AND ARE CONFID-
ENTIAL AND PROPRIETARY PRODUCTS OF ANSYS, INC., ITS SUBSIDIARIES, OR LICENSORS. The software products
and documentation are furnished by ANSYS, Inc., its subsidiaries, or affiliates under a software license agreement
that contains provisions concerning non-disclosure, copying, length and nature of use, compliance with exporting
laws, warranties, disclaimers, limitations of liability, and remedies, and other provisions. The software products
and documentation may be used, disclosed, transferred, or copied only in accordance with the terms and conditions
of that software license agreement.

ANSYS, Inc. and ANSYS Europe, Ltd. are UL registered ISO 9001: 2015 companies.

U.S. Government Rights

For U.S. Government users, except as specifically granted by the ANSYS, Inc. software license agreement, the use,
duplication, or disclosure by the United States Government is subject to restrictions stated in the ANSYS, Inc.
software license agreement and FAR 12.212 (for non-DOD licenses).

Third-Party Software

See the legal information in the product help files for the complete Legal Notice for ANSYS proprietary software
and third-party software. If you are unable to access the Legal Notice, contact ANSYS, Inc.

Published in the U.S.A.


Table of Contents
1. Introduction to Harmonic Balance Method (HBM) Analysis ................................................................... 1
1.1. Harmonic Balance Method Equations ................................................................................................ 1
1.1.1. Dynamic Equations of Motion .................................................................................................. 1
1.1.2. Equation Solution .................................................................................................................... 3
1.1.3. Solution Convergence and Stopping Criteria ............................................................................ 4
1.1.4. Alternating Frequency-Time Procedure .................................................................................... 5
1.2. References ........................................................................................................................................ 5
2. HBM Analysis Overview .......................................................................................................................... 7
2.1. Commands Used in an HBM Analysis ................................................................................................. 7
2.2. Terminology Used in a HBM Analysis ................................................................................................. 8
3. Modeling an HBM Analysis ..................................................................................................................... 9
3.1. Nonlinear Elements Supported in an HBM Analysis .......................................................................... 10
3.2. Linear part of the Model .................................................................................................................. 12
3.3. Limitations ..................................................................................................................................... 13
4. Applying Loads and Constraints in an HBM Analysis ........................................................................... 15
5. Solving an HBM Analysis ....................................................................................................................... 17
5.1. HBM Initial Guess ............................................................................................................................ 18
5.2. HBM Solution Controls .................................................................................................................... 19
5.3. Tips and Best Practices .................................................................................................................... 20
5.3.1. Node-to-node Contact Definition ........................................................................................... 21
5.3.2. Basic Checks After an HBM analysis ......................................................................................... 21
5.3.3. Convergence .......................................................................................................................... 22
5.3.4. Scaling the Solution Vector ..................................................................................................... 23
6. Postprocessing Results of an HBM Analysis .......................................................................................... 25
6.1. HBM expansion and postprocessing tips and limitations .................................................................. 26
7. Harmonic Balance Method Examples ................................................................................................... 27
7.1. Example 1: 1-DOF Duffing Oscillator ................................................................................................ 27
7.1.1. Problem Description .............................................................................................................. 27
7.1.2. Input for the Analysis .............................................................................................................. 28
7.1.3. Results ................................................................................................................................... 30
7.2. Example 2: Two Cantilever Beams with Frictionless Gap Contact ....................................................... 33
7.2.1. Problem Description and modeling ........................................................................................ 33
7.2.1.1. Full model ..................................................................................................................... 34
7.2.1.2. Model with CMS Reduction ............................................................................................ 34
7.2.1.3. Model with Prestressed Superelement ........................................................................... 35
7.2.2. Input for the Analysis .............................................................................................................. 35
7.2.3. Results ................................................................................................................................... 46
7.3. Example 3: Two jointed beams with frictional contact interface ........................................................ 50
7.3.1. Problem Description .............................................................................................................. 51
7.3.2. Input for the Analysis .............................................................................................................. 54
7.3.3. Results ................................................................................................................................... 59
A. Macro to Expand HBM Solution by Combining Harmonics ........................................................................ 61

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. iii
Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
iv of ANSYS, Inc. and its subsidiaries and affiliates.
List of Figures
3.1. Conceptual Model Showing the Linear and Nonlinear Elements in an HBM Analysis ................................. 9
5.1. Procedural Workflow for Prestressed CMS HBM Analysis ......................................................................... 18
7.1. Direct Postprocessing of Harmonic 3 Results ......................................................................................... 31
7.2. Frequency-Response Curve from Combined Harmonic Results .............................................................. 32
7.3. Add Harmonic Coefficients .................................................................................................................... 33
7.4. Full Model ............................................................................................................................................ 34
7.5. Model with CMS Reduction ................................................................................................................... 35
7.6. Displacement ....................................................................................................................................... 47
7.7. Bottom Beam - Linear Harmonic Results ................................................................................................ 48
7.8. Effects of Contact on the Bottom Beam - Full model (A), CMS model (B) .................................................. 49
7.9. Effects of Prestress Load on Response Peak ............................................................................................ 50
7.10. Finite Element Model of the Two Jointed Beams .................................................................................. 51
7.11. First Out-of-plane Mode (Mode 2) at 318.7 Hz ...................................................................................... 51
7.12. Scaled Response for Different Levels of Excitation ................................................................................ 60

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. v
Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
vi of ANSYS, Inc. and its subsidiaries and affiliates.
List of Tables
3.1. Supported Options for Nonlinear Spring Element COMBIN39 ................................................................. 10
3.2. Supported Options for Combination Element COMBIN40 ...................................................................... 11
3.3. Supported Options for 3D Node-to-Node Contact Element CONTA178 ................................................... 11

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. vii
Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
viii of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 1: Introduction to Harmonic Balance Method
(HBM) Analysis
The harmonic balance method (HBM) is useful for solving structural dynamics forced response problems
with local nonlinearities. Examples of physical systems that can be modeled with HBM are:

• Under-platform dampers of a jet engine bladed disk

• Bolted joints in a flange assembly

1.1. Harmonic Balance Method Equations


The following is a brief introduction to the harmonic balance equations.

1.1.1. Dynamic Equations of Motion


The general dynamic equation of motion in the time domain is:
(1.1)

where,

, , and are the acceleration, velocity, and displacement vectors.


, , are the mass, damping, and stiffness matrices.
is the vector of applied (external) excitation.

is the vector of internal nonlinear forces.

Periodic excitation and response may be assumed and enforced by the following equations [1].

(1.2)

(1.3)

(1.4)

where

represents the real part of a complex quantity.


is the time-domain harmonic index.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 1
Introduction to Harmonic Balance Method (HBM) Analysis

is the number of harmonics (specified as NH on HROPT,HBM,NH).


is the circular frequency of the period.
is time.
(¯) represents the complex Fourier coefficient of a quantity.

Substituting Equation 1.2 (p. 1) - Equation 1.4 (p. 1) into Equation 1.1 (p. 1) and equating coeffi-
cients of gives the balance equations describing the dynamics of a system in the frequency domain
for time-harmonic :
(1.5)
(1.6)

Collating the time-harmonics in Equation 1.6 (p. 2) formulates the set of algebraic equations:
(1.7)

The expanded version of the multiharmonic (p. 8) Equation 1.7 (p. 2) expressed with complex
quantities is:

(1.8)

The corresponding expanded version of Equation 1.7 (p. 2) expressed with real quantities is:

(1.9)

where
(1.10)
(1.11)
(1.12)

and represents the imaginary part of a complex quantity.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
2 of ANSYS, Inc. and its subsidiaries and affiliates.
Harmonic Balance Method Equations

1.1.2. Equation Solution

Newton-Raphson Method and Numerical Continuation


Equation 1.9 (p. 2) can be solved to obtain the forced response at a given frequency . A Newton-
Raphson procedure is used to iterate from an initial guess (specified via HBMOPT,UINIT) [5, 6]. The
nonlinear equation solver uses a trust-region algorithm based on a gradient-descent method [5,8].

The residual of the balance equation (Equation 1.9 (p. 2)) is given by:
(1.13)

The solver tries to satisfy the condition iteratively making guesses of using a Jacobian
described as [1, 2]:

(1.14)

A numerical continuation algorithm may be optionally employed in conjunction with the Newton-
Raphson type solver. In this case, the frequency is treated as an additional solution variable, and the
solver tries to satisfy the following condition:

where

is the augmented multiharmonic solution vector.


is the circular frequency (rad/s).

Numerical continuation enables automatic determination of the frequency step during solution [7,
8].

You can improve the convergence rate by scaling the augmented multiharmonic solution vector using
the HBMOPT,SCAL command. The following scaling strategies are available:

• Scale by a scalar value (UScal with Type = 2 or VALU). All degrees of fredom (DOFs) of the
solution vector are scaled with the same value:

• Scale by a value per solution DOF (UScal with Type = 1 or APDL, where UScal is a 1D APDL
array of the same length as the solution vector):

where

is a vector whose components are the inverse of the components of UScal

and is the Hadamard (term by term) product.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 3
Introduction to Harmonic Balance Method (HBM) Analysis

You can also scale the circular frequency by a scalar value (FSCAL) using the HBMOPT,SCAL
command:

Scaling of the multiharmonic solution vector only, of the frequency only, and of both (augmented
multiharmonic vector) are supported.

1.1.3. Solution Convergence and Stopping Criteria


At any given iteration of the nonlinear equation solver, the solution is considered to be converged
if the norm of the residual is lower than a tolerance criteria :
(1.15)

The solver also stops at the kth iteration, irrespective of convergence if the norm of the difference
between consecutive solution estimates is below a tolerance criteria :
(1.16)

where

is the solution estimate at the kth iteration, and

for continuation.

The solver also stops at the kth iteration, irrespective of convergence if the norm of the gradient es-
timate is below a tolerance criteria :
(1.17)

where

is the gradient estimate at the kth iteration, .

These conditions on the norm of the difference between consecutive solution estimates (step size)
, residual norm , and gradient norm are stopping criteria. Specify their values as UTOL,
RTOL, and GTOL on HBMOPT,TRTOL.

The numerical continuation algorithm stops if one of the following criteria occurs:

• The number of iterations exceeds a maximum value (MAXITER on HBMOPT,NR).

• The number of successful continuation steps exceeds a maximum value (MAXSTEPS on HB-
MOPTCONTTERM).

• The continuation step size [7,8] is below a minimum value (DSMIN on HBMOPT,CONTSET).

• The minimum or maximum limit (FREQMIN and FREQMAX on HBMOPT,CONTTERM) of the


simulation frequency range is encountered.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
4 of ANSYS, Inc. and its subsidiaries and affiliates.
References

1.1.4. Alternating Frequency-Time Procedure

and in Equation 1.13 (p. 3) and Equation 1.14 (p. 3) are obtained using an alternating fre-
quency-time (AFT) (p. 8) procedure. At any given iteration step, the solution estimates and parameters
are used to calculate the equivalent periodic time-domain displacements using Backward
Fast Fourier transforms (BFFTs). Note that this is equivalent to enforcing Equation 1.2 (p. 1). The
initial velocity at the first time-step of the period may also be calculated using similar equations.

A transient analysis is performed on a nonlinear sub-model with the calculated quantities applied as
boundary conditions (BCs) and initial conditions (ICs). The ordinary differential equation representing
the dynamics of the nonlinear sub-model is given by:
(1.18)

where , , are the mass, damping, and stiffness matrices of the nonlinear sub-model obtained
by assembling the nonlinear elements only.

The internal forces at nonlinear elements are assembled to calculate the internal force vector
at each time step. This calculation is repeated for time points spanning multiple
periods until periodic convergence is achieved or some user-specified limit is reached. Then, forward
fast Fourier transforms (FFTs) (p. 8) are used to convert back the periodic time-domain internal forces
to individual harmonics in the frequency domain. These harmonic terms are the components of
the force vector on the right hand side of Equation 1.8 (p. 2). Similar calculations are performed

to obtain the Jacobian .

1.2. References
1. Firrone, C. M. and Zucca, S. (2011) Modeling friction contacts in structural dynamics and its
application to turbine bladed disks. Numerical Analysis - Theory and Application, Prof. Jan Awre-
jcewicz (Ed.). INTECH, Rijeka, ch. 14: 301 - 334.

2. Petrov, E. P. and Ewins, D. J. (2003) Analytical formulation of friction interface elements for
analysis of nonlinear multi-harmonic vibrations of bladed disks. Journal of Turbomachinery-
Transactions of the ASME, 125(2): 364 - 371.

3. Nacivet, S., Pierre, C., Thouverez, F., and Jezequel, L. (2003) A dynamic Lagrangian frequency-
time method for the vibration of dry-friction-damped systems. Journal of Sound and Vibration,
265(1): 201 - 219.

4. Poudou, O., and Pierre, C. (2003) Hybrid frequency-time domain methods for the analysis of
complex structural systems with dry friction damping. 44th Structures, Structural Dynamics and
Materials Conference, Vol. 1: 111 - 124.

5. Madsen, K., Nielsen, H., and Tingleff, O. (2004) Methods for Non-Linear Least Squares Problems
(2nd ed.): 60.

6. Nocedal, J. and Wright, S. J. (2006) Numerical Optimization (2nd ed.). New York, NY: Springer.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 5
Introduction to Harmonic Balance Method (HBM) Analysis

7. Seydel R. (2010) Practical Bifurcation and Stability Analysis (Interdisciplinary Applied Mathematics,
vol. 5). New York, NY: Springer.

8. Krack, M.and Gross, J. (2019) Harmonic Balance for Nonlinear Vibration Problems. Springer Nature
Switzerland AG: Cham, Switzerland.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
6 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 2: HBM Analysis Overview
The harmonic balance method enables a nonlinear harmonic analysis using multiple harmonics and
supporting localized nonlinearities. The nonlinear forces coming from nonlinear elements (p. 10) are
calculated in the time domain. An alternating frequency-time (AFT) (p. 8) method is used to link the
multiharmonic analysis performed on the linear elements and the sequential transient analyses performed
on the nonlinear elements. For details, see Modeling an HBM Analysis (p. 9).

The nonlinear multiharmonic equations are solved using a trust-region method, which is a gradient-
descent type method, based on the Newton-Raphson procedure. A continuation method where the
continuation parameter is the excitation frequency is used to follow the solution branch.

When the solution has run successfully, each harmonic response is written on a dedicated results file.
Therefore, each harmonic can be postprocessed using typical harmonic solution postprocessing com-
mands (described in Reviewing the Results in the Structural Analysis Guide). The postprocessing of the
total solution, which is the combination of all harmonics, is done using an external macro (see Ap-
pendix A: Macro to Expand HBM Solution by Combining Harmonics (p. 61)).

How the Program Performs an HBM Analysis


The harmonic balance method procedure automatically partitions the model during solution to run in
distributed-memory parallel (DMP) mode using two processors. The nonlinear multiharmonic solution
runs on one processor, the master MPI process, while the AFT transient analysis runs on another processor.

2.1. Commands Used in an HBM Analysis


The main commands used to specify a harmonic balance method (HBM) analysis are listed below. For
a more detailed description of available options, their default settings, recommendations, and a discussion
of how various options affect the analysis, see also HBM Solution Controls (p. 19). For example usage,
see Harmonic Balance Method Examples (p. 27).

Preprocessor (/PREP7) or Solution (/SOLU) commands


HROPT Issue HROPT,HBM,NH to specify:

• the harmonic balance solution method (Method = HBM)

• number of harmonics to be included in the analysis, an integer NH within the range


1 ≤ NH ≤ 30 (defaults to 1).

HBMOPT Used to specify solution options (must be issued in the solution (/SOLU) processor).

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 7
HBM Analysis Overview

Preprocessor (/PREP7) or Solution (/SOLU) commands


HARFRQ Used to define the frequency range by setting FREQB and FREQE to the beginning and
end frequency (Hz). Note the following:

• FREQB may be greater than FREQE for a decreasing frequency sweep. However,
FREQB ≤ FREQE is enforced if no continuation method is used
(HBMOPT,CONTSET,OFF).

• Specifying an array of frequency values (FREQARR) is not supported.

NSUBST Used to specify the number of substeps, NSBSTP, if no continuation method is used (only
applicable for HBMOPT,CONTSET,OFF).

2.2. Terminology Used in a HBM Analysis


The following terms are used to describe concepts relevant to HBM analyses.

Harmonic balance method (HBM)

HBM is a computational method used to solve the equations of motion of a nonlinear dynamical
system in the frequency domain, which may be solved to obtain the steady-state periodic response.

Multiharmonic solution

The multiharmonic solution of HBM equations is comprised of the system responses (amplitude and
phase) at a given fundamental frequency (usually the frequency of applied excitation forces) as
well as harmonics (integral multiples of ), which together represent the periodic steady-state re-
sponse.

Alternating frequency-time (AFT)

The alternating frequency time (AFT) method is a procedure that is commonly used during HBM
equation solution, which enables accurate calculation of nonlinear force estimates in the time domain.
During this procedure, solution estimates are converted from the frequency domain to the time
domain, and the transient nonlinear forces computed in the time domain are then converted back
into the frequency domain.

Fast Fourier transform (FFT)

A fast Fourier transform (FFT) is a commonly used computational algorithm to efficiently convert a
signal from the time domain to a representation in the frequency domain (forward FFT) and vice
versa (backward FFT).

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
8 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 3: Modeling an HBM Analysis
A model for an HBM analysis is generally partitioned into a linear part and a nonlinear part, as shown
in the following figure. Only specific nonlinearities can be included in an HBM analysis. These are de-
scribed in detail in the next section, Nonlinear Elements Supported in an HBM Analysis (p. 10). There
are no specific guidelines for modeling the linear part of an HBM analysis. For more details, see Linear
part of the Model (p. 12).

Figure 3.1: Conceptual Model Showing the Linear and Nonlinear Elements in an HBM Analysis

For modeling limitations, see Limitations (p. 13).

If your model is cyclically symmetric and if the non-linearity is located within a sector, the multistage
cyclic symmetry procedure can be used to reduce both the size of the problem and solve time. However,
the procedure is limited to a single harmonic index (HI = 0) stage without a duplicate sector and
multistage cyclic symmetry with superelements is not supported (see Limitations (p. 13)). For an example
problem demonstrating this, see VM319: Nonlinear Harmonic Analysis of a Cyclic Chain of Oscillators.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 9
Modeling an HBM Analysis

3.1. Nonlinear Elements Supported in an HBM Analysis


The supported nonlinear elements are listed here, followed by tables detailing supported options for
each element. Any combination of these HBM supported nonlinear elements can be used to build the
nonlinear part of the model.

• Polynomial nonlinearity USER300 (KEYOPT(1) = 2)

– A predefined polynomial user element (USER300) is provided. For information on its inputs and
usage, see Example 1: 1-DOF Duffing Oscillator (p. 27).

• Nonlinear spring COMBIN39

• Combination COMBIN40

• Node-to-node contact CONTA178

Table 3.1: Supported Options for Nonlinear Spring Element COMBIN39

KEYOPTION / Real constant Details


Real Constants D value for the nth point on force-deflection curve

D1, F1, D2, F2, D3, F3, F value for the nth point on force-deflection curve
D4, F4, ..., D250, F250

KEYOPT(1) KEYOPT(1) = 0 - Unload along same loading curve

Unloading Path

KEYOPT(2) KEYOPT(2) = 0 - Compressive loading follows defined compressive


curve (or reflected tensile curve if not defined)
Element behavior under
compressive load

KEYOPT(3) KEYOPT(3) = 0,1 - UX (Displacement along nodal X axes)

Element degrees of KEYOPT(3) = 2 - UY (Displacement along nodal Y axes)


freedom (1D) (KEYOPT(4)
overrides KEYOPT(3)) KEYOPT(3) = 3 - UZ (Displacement along nodal Z axes)

KEYOPT(3) = 4 - ROTX (Rotation about nodal X axes)

KEYOPT(3) = 5 - ROTY (Rotation about nodal Y axes)

KEYOPT(3) = 6 - ROTZ (Rotation about nodal Z axes)


KEYOPT(4) KEYOPT(4) = 0 - Use any KEYOPT(3) option

Element degrees of KEYOPT(4) = 1 - 3D longitudinal element (UX, UY and UZ)


freedom (2D or 3D)
KEYOPT(4) = 2 - 3D torsional element (ROTX, ROTY and ROTZ)

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
10 of ANSYS, Inc. and its subsidiaries and affiliates.
Nonlinear Elements Supported in an HBM Analysis

KEYOPT(4) = 3 - 2D longitudinal element. (UX and UY) Element


must lie in an X-Y plane

Table 3.2: Supported Options for Combination Element COMBIN40

KEYOPTION / Real constant Description


[a]
Real Constants K1 - Spring constant

C - Damping coefficient

GAP - Gap size


KEYOPT(1) KEYOPT(1) = 0 - Standard gap capability

Gap behavior

KEYOPT(3) KEYOPT(3) = 0, 1 - UX (Displacement along nodal X axes)

Element degrees of KEYOPT(3) = 2 - UY (Displacement along nodal Y axes)


freedom
KEYOPT(3) = 3 - UZ (Displacement along nodal Z axes)
[a] The units for real constants depend on the KEYOPT(3) setting. See the COMBIN40 element
description for details.

Table 3.3: Supported Options for 3D Node-to-Node Contact Element CONTA178

KEYOPTION / Real constant Description


Real Constants FKN - Normal Stiffness

GAP - Gap size

FKS - Sticking stiffness

NX - Defined gap normal - X component

NY - Defined gap normal - Y component

NZ - Defined gap normal - Z component

CV1 - Damping coefficient

CV2 - Nonlinear damping coefficient


KEYOPT(1) KEYOPT(1) = 0 - Unidirectional gap

Gap type

KEYOPT(2) KEYOPT(2) = 1 - Pure penalty method

Contact algorithm

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 11
Modeling an HBM Analysis

KEYOPT(4) KEYOPT(4) = 0 - Gap size based on real constant GAP + initial node
locations
Gap size
KEYOPT(4) = 1 - Gap size based on real constant GAP (ignore
node locations)
KEYOPT(5) KEYOPT(5) = 0 - Node locations or real constants NX, NY, NZ

Basis for contact normal KEYOPT(5) = 1 - X component of nodal coordinate system


(average on two contact nodes)

KEYOPT(5) = 2 - Y component of nodal coordinate system


(averaging on two contact nodes)

KEYOPT(5) = 3 - Z component of nodal coordinate system


(averaging on two contact nodes)

KEYOPT(5) = 4 - X component of defined element coordinate


system (ESYS)

KEYOPT(5) = 5 - Y component of defined element coordinate


system (ESYS)

KEYOPT(5) = 6 - Z component of defined element coordinate


system (ESYS)
KEYOPT(6) KEYOPT(6) = 0 - UX, UY, UZ

Selects degrees of
freedom

KEYOPT(9) KEYOPT(9) = 0 - Initial gap size is step applied

Initial gap step size


application

KEYOPT(10) KEYOPT(10) = 0 - Standard

Behavior of contact
surface

3.2. Linear part of the Model


Anything that is not in the nonlinear part of the model is considered linear.

There are no specific guidelines for modeling the linear part of an HBM analysis. For general guidelines,
see the Modeling and Meshing Guide.

Similar to a linear harmonic analysis, some form of damping should be specified in an HBM analysis.
See Limitations (p. 13) for restrictions on damping definition.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
12 of ANSYS, Inc. and its subsidiaries and affiliates.
Limitations

Since HBM is a nonlinear analysis, it uses more time and disk space than a linear harmonic analysis. To
avoid prohibitive performance, the linear parts of the model can be reduced using component mode
synthesis substructuring (CMS). For an example using CMS in an HBM analysis, see Example 3: Two
jointed beams with frictional contact interface (p. 50).

3.3. Limitations
The following limitations exist for an HBM analysis:

• The nodes of nonlinear elements must be attached to linear elements. Chained nonlinear ele-
ments (p. 10) without connected linear elements (with unconstrained shared nodes and DOFs con-
nected to nonlinear elements only) are not supported.

• NROPT,UNSYM is ignored for HBM nonlinear elements. Unsymmetric matrices are used for CONTA178
only if the coefficient of friction specified for the element material is greater than or equal to 0.2.

• Distributed-memory parallel (DMP) processing is not supported.

• The HBM solution cannot be restarted (ANTYPE,,RESTART).

• Damping applied to non-linear elements: Rayleigh damping applied to the nonlinear elements is ig-
nored (BETAD, ALPHAD, MP with Lab = BETD/ALPD).

• Damping applied to linear elements: Damping is supported in linear elements except for structural
damping (DMPSTR, MP with DMPS, and TB,SDAMP with TBOPT = STRU). Also, frequency-dependent
damping is not supported.

• Linear perturbation HBM is not supported.

• Prestress in the linear elements can be included using a prestressed superelement (see Model with
Prestressed Superelement (p. 35)).

• The expansion pass of superelements is not supported for any result type.

• The cyclic symmetry procedure (initiated with CYCLIC), with or without superelements, is not supp-
ported.

• The multistage cyclic procedure (see the Multistage Cyclic Symmetry Analysis Guide) can be used to
reduce the size of cyclically symmetric structures. However, the procedure is limited to a single har-
monic index, HI = 0 stage without a duplicate sector. Multistage cyclic superelement is not supported.

• When using the multistage cyclic symmetry procedure, nonlinear elements must be located inside
the model sector. Nodes attached to nonlinear elements located on the cyclic sector edges are not
supported.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 13
Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
14 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 4: Applying Loads and Constraints in an HBM
Analysis
Consider the following distinctions and limitations when defining loads and constraints in an analysis.

• Constraints applied using D commands must be real. Tabular constraints are not supported.

• Loads must be defined either as a pressure (SF or SFE) or as a nodal force load (F). To apply different
loads on the harmonics, a table (*DIM) with primary variable name Var1 = NHINDEX can be used
as shown in the example below.
*dim,Ftab,TABLE,NH+1,1,,NHINDEX,FREQ
*vfill,Ftab(1,0),RAMP,0,1
Ftab(0,1) = Freq
Ftab(1,1) = F_H0 ! harmonic 0
Ftab(2,1) = F_H1 ! harmonic 1
F,2,FY,%Ftab%

• If the load is not tabular, it is implicitly taken as a harmonic 1 load.

• Loads other than pressure and nodal forces (temperature, etc.) are not supported.

• Constraint equations (CE,CP) applied on the nonlinear element nodes are not supported.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 15
Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
16 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 5: Solving an HBM Analysis
HBM is a nonlinear analysis. As such, it is recommended to carefully read the Tips (p. 20) and Limita-
tions (p. 13) before starting. For more general information, see also Guidelines for Nonlinear Analysis
in the Structural Analysis Guide.

Procedure Flow Diagram: Prestressed CMS HBM Analysis


The representative flow diagram below provides an overview of the HBM analysis procedure that includes
a prestress load on the linear part of the model and uses CMS to reduce its size. The linear perturbation
substructuring procedure is used to generate prestressed superelements which are used in the HBM
analysis. See Example 2: Two Cantilever Beams with Frictionless Gap Contact (p. 33) for an example
problem demonstrating the procedure.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 17
Solving an HBM Analysis

Figure 5.1: Procedural Workflow for Prestressed CMS HBM Analysis

5.1. HBM Initial Guess


By default, the initial guess of the nonlinear multiharmonic solver is a zero initial condition. You can
specify an initial guess by issuing HBMOPT,UINIT. Example 3: Two jointed beams with frictional contact
interface (p. 50) shows how to define the initial solution vector from a previous analysis. It can come
from any type of analysis, for example a static analysis or a previous HBM run. This procedure is partic-
ularly useful if a first HBM analysis fails to converge. A second one can be solved using one of the
solution points as the initial guess and changing the solution controls or number of harmonics to
achieve convergence.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
18 of ANSYS, Inc. and its subsidiaries and affiliates.
HBM Solution Controls

5.2. HBM Solution Controls


The commands used to set up an HBM analysis are listed here in two sets: those that are required for
an HBM analysis and those that are optional. Recommendations and default settings for solution options
are discussed briefly. For additional information, see their command descriptions in the Command
Reference.

Required Commands - The following commands must be issued to properly set up an HBM analysis.

• ANTYPE,HARM to specify a harmonic analysis.

• HROPT,HBM,NH to specify an HBM harmonic analysis and the number of harmonics NH retained
for the solution. In most cases, it is good practice to start with NH = 1, then check the solution
accuracy with higher harmonics at a few frequency points closer to resonance.

• HBMOPT,CONTSET,CorrMeth,DS,DSMIN,DSMAX to set up a numerical continuation solution.


Continuation is necessary for problems with complex nonlinearities where turning points or bi-
furcations are expected. Turning continuation off (by issuing HBMOPT,CONTSET,OFF) is not re-
commended. If you leave CorrMeth blank on HBMOPT,CONTSET, the corrector method is set
to the arc-length method by default. You must specify a value for the step size of the first substep
(DS) unless CorrMeth = OFF. The initial continuation step size DS can be estimated from the
expected order of magnitude of DOF values and the frequency.

Default values are set for DSMIN and DSMAX, but if you want to change them, keep the following
points in mind. Since the minimum step size DSMIN is a stopping criteria, it is recommended to
set its value several orders of magnitude lower than the initial step size. The maximum step size
DSMAX is not a stopping criteria, but rather a setting that acts on the frequency resolution.

• HARFRQ,FREQB,FREQE command to specify the beginning and ending simulation frequencies.


The beginning frequency can be larger than the ending frequency to run a simulation in a de-
creasing frequency direction. Note that if continuation is on (CorrMeth has any setting except
OFF on HBMOPT,CONTSET), the simulation may be allowed to go beyond these frequencies,
depending on the values specified on the HBMOPT, CONTTERM command.

Optional Commands - You can use the following commands to further customize solver options and
change defaults, but they are not required.

• HBMOPT, NR, MAXITER, MAXINITITER to specify the maximum number of iterations allowed
for the nonlinear equation solver at a frequency point (MAXITER) and the maximum number
of iterations for the initial continuation step (MAXINITITER). If continuation is used, a lower
MAXITER value (10-30) is recommended under most circumstances. The lower number means
that the solver has less iterations to converge to the solution, but it also means that continuation
will adjust the step size from the previous solution to be faster and waste less time iterating at
a larger step-size when convergence is unlikely. If continuation is off, a larger number (MAXITER
= 50-500) is recommended and may be decided based on the frequency resolution and tolerances
specified, to allow the solver to reach convergence at each frequency. The maximum number
of iterations at the initial step (MAXINITITER) should be much higher than the number specified
for the following steps (MAXITER).

• HBMOPT,TRTOL,UTOL,RTOL.GTOL to specify tolerances for the trust-region nonlinear equation


solver. The residual tolerance (RTOL) is a convergence criteria and may be used to adjust the
desired solution accuracy. Since the step (UTOL) and gradient (GTOL) tolerances are additional

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 19
Solving an HBM Analysis

stopping criteria, set their values sufficiently low so that they are not encountered during a
normal solution.

• HBMOPT,CONTTERM,MAXSTEPS, FREQMIN, FREQMAX to specify the termination criteria when


continuation is on. Set the maximum number of successful continuation steps (MAXSTEPS) high
enough to allow the solver to finish simulation over the frequency range. Also, use this command
to specify the minimum and maximum allowed simulation frequencies (FREQMIN and FREQMAX)
if turning points beyond the simulation range specified via HARFRQ are expected.

• HBMOPT,AFT,NP,NT to specify the maximum number of time periods (NP) and time-points (NT)
within a period of simulation for the AFT procedure. Set NP high enough to allow the nonlinear
transient force calculation to converge. For closed-form nonlinearities (without internal states)
such as polynomial stiffness nonlinearity, two periods are sufficient. Nonlinearities with internal
states such as friction may require more than two periods for convergence. An internal check is
done after each computed period to verify if convergence is reached. So, the actual number of
periods used by the solver might be lower than NP. The number of time points per periods
should ideally be ten times the highest harmonic. For example, a cubic nonlinearity may have
significant contributions from components up to the third harmonic, so a minimum of 30 points
should be used.

• HBMOPT,UINIT to provide a solution guess at the beginning frequency of solution. Usually, this
guess is obtained from a previously performed HBM analysis.

• HBMOPT,SCAL to linearly scale the solution vector to improve the convergence rate by a either
a constant value or values contained in a user-defined array. For example usage of this scaling
command, see Scaling the solution vector (p. 53) and VM320: Nonlinear Harmonic Analysis of a
Frictional Damper in the Mechanical APDL Verification Manual.

Use the following optional commands to ignore the nonlinearities for a preliminary run or to obtain
more information about solver options.

• HBMOPT,LINEAR to turn off the nonlinearity and enforce zero nonlinear forces from the AFT
procedure. This will solve the corresponding linear problem and can be used to understand the
system dynamics or build up an initial solution guess.

• HBMOPT,LIST and HBMOPT,CONTLIST to list parameters associated with the current HBM solution.
This is useful for checking if the default settings have been changed by previously issued com-
mands or automatically due to missing inputs or procedures.

5.3. Tips and Best Practices


In addition to general tips listed here, specific tips on the following topics are available:
5.3.1. Node-to-node Contact Definition
5.3.2. Basic Checks After an HBM analysis
5.3.3. Convergence
5.3.4. Scaling the Solution Vector

• Before performing an HBM analysis, it is advantageous to run a modal analysis and/or harmonic
analysis analysis on your model that has been slightly modified to operate in a linear or near-
linear regime, such as under small excitation and response or in a linear contact state (frictionless

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
20 of ANSYS, Inc. and its subsidiaries and affiliates.
Tips and Best Practices

sliding or fully bonded). This will help you gain insights on the structural dynamic behavior of
your model.

• If your model does not exhibit rigid body motion when ignoring the non-linear elements, you
may also start by running a preliminary HBM analysis where the non-linear elements are not
taken into account by issuing HBMOPT,LINEAR. In this case, the solution is similar to a linear
harmonic analysis as only the harmonic 1 solution is calculated.

• If HBM convergence problems arise, running the nonlinear model in a full transient analysis can
give useful information about the physics such as the contribution of subharmonics, the relative
contributions of harmonics, etc.

• In many practical cases, a solution using only a single harmonic is a good approximation of the
response. However, checking the convergence of the response with respect to the number of
harmonics by retaining more harmonics is recommended.

5.3.1. Node-to-node Contact Definition


Consider these tips when your model includes node-to-node contacts (CONTA178).

• When creating the node-to-node contacts (CONTA178), it is important to properly define the contact
normal. In particular, when the two nodes of the contact are coincident:

– use keyopt(5) to define the contact normal axis

– define the nodes of the contact element in the desired order such that the gap opens/closes in
the direction you expect. If you defined the contact elements using EINTF and the nodes are not
in the right desired order, you can delete/re-create contact using EINTF,,,HIGH instead or add
EINTF,,,REVE after EINTF (see Node-to-Node Contact in the Contact Technology Guide).

• When contact is frictional, a constant normal force contribution is likely present in the model
(preload). Because this force is essentially a stepped load, it may cause convergence failure at the
first substep. To overcome this issue, first run a static analysis applying the constant force, and then
use the static solution as an initial guess (HBMOPT,UINIT) in an HBM analysis. For an example
problem that demonstrates this procedure, see Example 3: Two jointed beams with frictional contact
interface (p. 50).

5.3.2. Basic Checks After an HBM analysis


It is good practice to check the following items in the output (Jobname.out) file.

• Check the size of the problem you are currently solving, for example:

• Check that the nonlinear elements present in your model have been correctly identified by
HBM, for example:

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 21
Solving an HBM Analysis

5.3.3. Convergence
Consider the following recommendations to improve convergence behavior or overcome convergence
issues.

• At the first substep, if the HBM solver does not converge (initial solution), it probably means that
the nonlinear behavior is very significant at the starting frequency. To facilitate convergence, try
starting from a frequency which is farther away from the resonance such that the initial solution
is close to a mostly linear range of the response.

• In general, if the HBM solver fails to converge, possible actions are:

– Use more harmonics.

– If continuation is on, decrease the continuation step size parameters (initial step size, DS, and
maximum step size, DSMAX on HBMOPT,CONTSET).

If continuation is off, reduce the fixed frequency step (when using HARFRQ and NSUBST) or
consider using a continuation method to help the convergence.

– Relax the convergence criterion. It is especially true if the norm of the residual is small but not
small enough to meet tolerance criterion during correction iterations. The reason may be that
the criterion is too tight.

– Use more time points for the AFT (increase NT on HBMOPT,AFT). It is recommended to check
that AFT transient periodic convergence is achieved by reviewing the output file (Job-
name_1.out). See Results from the alternating frequency-time (AFT) procedure (p. 25).

– Define a smaller amplitude of excitation force for initial runs.

• If the HBM solver takes too many iterations to converge at each substep, making the computational
time impractical, try reducing the maximum number of iterations (MAXITER on HBMOPT,NR). It
will reduce the number of iterations before the arc-length is decreased and may accelerate conver-
gence.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
22 of ANSYS, Inc. and its subsidiaries and affiliates.
Tips and Best Practices

• The definition of the step size DS and the maximum step size DSMAX of the continuation method
(HBMOPT,CONTSET) plays a key role in the convergence and the performance of the analysis. A
good DS/DSMAX should allow computing enough points on the response curve to accurately describe
the resonance peaks without compromising solution performance. It is good practice to tune this
parameter by first running a linear HBM analysis (HBMOPT,LINEAR,1) with solution vector scaling.

• Since solution vector scaling (HBMOPT,SCAL) affects the step size used by the solver, it should be
included in the linear HBM solution for a proper assessment of DS. The number of degrees of
freedom should be considered when defining the scaling (HBMOPT,SCAL).

5.3.4. Scaling the Solution Vector


In a Newton-Raphson continuation procedure, when the orders of magnitude of the components of
the solution vector are different, small numerical roundoff can lead to longer convergence patterns
and even cause convergence failure. This is the case for HBM when the forcing frequency amplitude
is very different from the response amplitude.

To circumvent this numerical issue, use the scaling feature (HBMOPT,SCAL) to linearly scale each
component of the solution vector by a scalar value or by values provided in scaling vector (a 1D APDL
array). Often, a unique scaling value for the displacements and a scaling value for the forcing frequency
are enough to improve the convergence rate.

The equations that determine solution scaling are detailed in Equation Solution (p. 3). For an example
problem demonstrating the use of scaling, see Scaling the solution vector in the Harmonic Balance
Method Analysis Guide (p. 53).

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 23
Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
24 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 6: Postprocessing Results of an HBM Analysis
For each harmonic, displacement solutions are available on a results file. The names of the files are the
following:

• Jobname.rst (harmonic 0)

• Jobname_1hi.rst (harmonic 1)

• Jobname_2hi.rst (harmonic 2)

• …

To postprocess each harmonic, there are no specific instructions. You first need to specify which file
(which harmonic) you want to postprocess using the FILE command. For more guidelines on postpro-
cessing a harmonic analysis, see Reviewing the Results in the Structural Analysis Guide.

To postprocess the total response by combining the harmonics, see HBM expansion and postprocessing
tips and limitations (p. 26).

Note:

Element results and reaction forces are not available.

The following solution items can be retrieved using *GET,,ACTIVE,0,SOLU:

• Number of equilibrium iterations (EQIT)

• Cumulative number of iterations (NCMIT)

• Convergence indicator (CNVG)

• Cumulative number of load steps (NCMLS)

• Number of substeps (NCMSS)

Results from the alternating frequency-time (AFT) procedure


Although results from the AFT transient procedure cannot be postprocessed, you can review its output
information in the output file (Jobname1.out) to verify that periodic convergence is achieved. If the
AFT procedure fails to achieve periodic convergence, try increasing the number of time-points per
period (NT) or periods simulated (NP) during AFT via the HBMOPT,AFT command.

Example output is illustrated below for a model that includes frictional CONTA178 elements:
>>> END OF AFT TRANSIENT ANALYSIS AT F = 166.6134Hz (HARMONIC SUBSTEP = 6)
PERIODIC CONVERGENCE REACHED AT END OF PERIOD 2

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 25
Postprocessing Results of an HBM Analysis

******** SUMMARY OF CONTACT ELEMENTS BEHAVIOR DURING LAST PERIOD ********


NO. OF ELEMENTS STICKING AT LEAST ONCE = 4 | AVERAGE % OF TIME = 4.7%
NO. OF ELEMENTS SLIDING AT LEAST ONCE = 4 | AVERAGE % OF TIME = 81.2%
NO. OF ELEMENTS OPENING AT LEAST ONCE = 4 | AVERAGE % OF TIME = 14.1%

It lists the average % of time when a particular status (sticking, sliding, or open) occurs during the last
period of the AFT transient analysis for all contact elements present in the model. The sum of the average
% of time calculated for the different states does not necessarily sum to 100% if more than one contact
element is used.

6.1. HBM expansion and postprocessing tips and limitations


A macro (HBM_EXPA.mac) is provided to expand the solution by combining harmonics. For detailed
description of the macro, see Appendix A: Macro to Expand HBM Solution by Combining Harmon-
ics (p. 61).

Download the macro at the following link.

HBM_EXPA.mac

The following example problems demonstrate usage of this macro:

Example 2: Two Cantilever Beams with Frictionless Gap Contact (p. 33)
Example 3: Two jointed beams with frictional contact interface (p. 50)

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
26 of ANSYS, Inc. and its subsidiaries and affiliates.
Chapter 7: Harmonic Balance Method Examples
The following example analyses demonstrate harmonic balance method capabilities and show how to
prepare, solve, and postprocess these analyses.
7.1. Example 1: 1-DOF Duffing Oscillator
7.2. Example 2: Two Cantilever Beams with Frictionless Gap Contact
7.3. Example 3: Two jointed beams with frictional contact interface

See also these example problems in the Mechanical APDL Verification Manual:

VM319: Nonlinear Harmonic Analysis of a Cyclic Chain of Oscillators


VM320: Nonlinear Harmonic Analysis of a Frictional Damper
.

7.1. Example 1: 1-DOF Duffing Oscillator


This example shows the nonlinear harmonic analysis of a forced response 1-DOF Duffing oscillator using
the harmonic balance method (HBM). Specifically, it demonstrates the following key points:

• Definition of a cubic non-linearity using a pre-defined user element (USER300).

• Continuation of the solution using the arc-length method.

• Direct postprocessing of individual harmonics and manual postprocessing of the total HBM solution.

The example problem is presented in the following sections:


7.1.1. Problem Description
7.1.2. Input for the Analysis
7.1.3. Results

7.1.1. Problem Description


The governing equation of a forced response 1-dof Duffing oscillator is:

(7.1)
In this example, the parameters of Equation 7.1 (p. 27) are = 1, = 0.05, = 1, = 3, and =
0.05.

This equation can be modeled using one MASS21 element linked to a linear spring-damper element
(COMBIN14) and a cubic spring. The cubic spring is modeled using the pre-defined polynomial user
element (USER300, KEYOPT(1) = 2) with real constants RK1 = and IK1 = 3 for the cubic spring (see
the command listing (p. 28) in the next section for details on the polynomial user element).

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 27
Harmonic Balance Method Examples

The harmonic 1 force is defined using a 2-variable table parameter whose rows depend on the fre-
quency (one value for constant load) and the harmonic index number.

The model is run with 3 harmonics in the frequency range rad/s.

7.1.2. Input for the Analysis


To download the .dat file used for this example problem, click the link below.

hbmexample1.dat

The contents of this file are listed below. The command listing shows in detail how to specify and
run the HBM analysis. You can use it as a template and modify it to create a custom HBM analysis.
/BATCH,LIST
/TITLE, 1-DOF Oscillator with Cubic Non-linearity
/com =============================================================
/com DESCRIPTION:
/com Harmonic balance analysis for Duffing oscillator's equation:
/com M*u'' + C*u' + K*u + KNL*u^3 = FEXT*cos(OMG*t)
/com =============================================================

! Model Parameters
PI = ACOS(-1)
M = 1 ! MASS
C = 0.05 ! DAMPING COEFFICIENT
K = 1 ! LINEAR SPRING CONSTANT
KNL = 3 ! CUBIC SPRING CONSTANT
FEXT = 0.05 ! FORCE AMPLITUDE

! HBM and Continuation Parameters


OMGS = 0.60 ! Starting omega
OMGE = 1.50 ! End omega
FMIN = OMGS/(2*PI) ! Starting frequency
FMAX = OMGE/(2*PI) ! Ending frequency

DS = 0.01 ! initial arc length (step length)


DSMIN = DS/50 ! minimum arc length (step length)
DSMAX = 5*DS ! maximum arc length (step length)

NH = 3 ! number of harmonics

! __________________ USER_ELEM ____________________


! Internal force
! Fint = RK0*u + RK1*u^IK1 + RK2*u^IK2

! UserElem parameters which cannot be modified


NNOD = 2 ! number of nodes
NDIM = 3 ! dimension
NNREAL = 5 ! number of REAL constants
NSAVEVARS = 0 ! number of saved variables (internal)
NRSLTVAR = 2 ! number of NMISC items
KEYANSMAT = 3 ! element characteristics key: non-linear and working in nodal CS

! UserElem parameters to modify


RK0 = 0
RK1 = KNL
IK1 = 3 ! cubic non-linearity
RK2 = 0
IK2 = 0

/PREP7

ET,1,300
KEYOPT,1,1,2 ! polynomial stiffness non-linearity

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
28 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 1: 1-DOF Duffing Oscillator

USRELEM, NNOD, NDIM, LINE, NNREAL, NSAVEVARS, NRSLTVAR, KEYANSMAT


USRDOF,DEFINE, UX
R,1, RK0, RK1, IK1, RK2, IK2

ET,2,14,0,1 ! linear spring/damper


R,2,K,C

ET,3,21,0,0,4 ! mass
R,3,M

! Geometry
N,1,0,0,0
N,2,1,0,0

TYPE,1
REAL,1
E,1,2

TYPE,2
REAL,2
E,1,2

TYPE,3
REAL,3
E,2

FINISH

/SOLU
ANTYPE,HARMIC

HROPT,HBM,NH ! HBM Solve and number of harmonics


HARFRQ,FMIN,FMAX
HBMOPT,CONTSET,,DS,DSMIN,DSMAX ! Continuation method and step size parameters

! HBMOPT,LIST ! List HBM options (optional)


! OUTPR,NSOL,ALL ! Print nodal solution (optional)

! Boundary conditions
D,1,ALL
D,2,UY

! Loading
! - Tabular loading definition can be used as a template for harmonic-dependent load.
! - Here, the force is applied to real part of harmonic 1 only and can be
! - directly defined as F,2,FX,FEXT
! - Imaginary loading can also be applied using Value2 on F command:
! > F,2,FX,,FEXT_IMAG for imaginary harmonic 1 load
! > F,2,FX,,%FORCE_TAB_IMAG% for imaginary harmonic-dependent load
!
*dim,FORCETAB,TABLE,1,NH+1,1,FREQ,NHINDEX ! define table with frequency and harmonic dependency
*DO,HH,0,NH
FORCETAB(0,HH+1) = HH ! COLUMNS: one for each harmonic index
*ENDDO
FORCETAB(1,0) = FMIN ! ROWS: one frequency point only for constant loading
FORCETAB(1,2) = FEXT ! VALUES: loading for harmonic 1

F,2,FX,%FORCETAB%
KBC,1

SOLVE
FINISH

/COM _________ POST-PROCESSING EACH HARMONIC SOLUTION _________

*get,rstname,ACTIVE,,JOBNAM ! RST file name

/POST1
FILE,%rstname%_1hi0,rst ! select result file containing harmonic 1 results
SET,LIST
SET,1,1 ! print results for 1st frequency point

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 29
Harmonic Balance Method Examples

PRNSOL,U,SUM
FINISH

/POST26
NUMVAR,200
FILE,%rstname%_3hi0,rst ! select result file containing harmonic 3 results

NSOL ,102,2,u,x ! store and print frequency history results for harmonic 3
ABS,102,102

/SHOW,png,rev
/AXLAB,X,Frequency (Hz)
/AXLAB,Y,Harmonic 3 - amplitude
PLVAR,102
/SHOW,close
FINISH

/COM _________ POST-PROCESSING CUMULATED HARMONICS SOLUTION _________

postnod = 2 ! node to postprocess


postitem = 'u' ! item to postprocess
postcomp = 'x' ! component to postprocess
ampltype = 'minmax'

HBM_EXPA,rstname,postnod,postitem,postcomp,NH,ampltype

/com
/com Pulsation (rad/s) Amplitude of the response
/com
*VWRITE,_hbm_omg(1),_hbm_ampl(1)
(F16.8,2X,F16.8)

*DIM ,harm_tab ,table,_Nss,4


*VFUN,harm_tab(1,1),COPY ,_hbm_coeff(1,2)
*VFUN,harm_tab(1,2),COPY ,_hbm_coeff(1,3)
*VFUN,harm_tab(1,3),COPY ,_hbm_coeff(1,6)
*VFUN,harm_tab(1,4),COPY ,_hbm_coeff(1,7)

/SHOW,png,rev
/AXLAB,X,Pulsation (rad/s)
/AXLAB,Y,Amplitude
/GCOLUMN,1,ampl
*VPLOT,_hbm_omg(1),_hbm_ampl(1) ! amplitude

/AXLAB,Y,Harmonic coefficients
/GCOLUMN,1,h1real
/GCOLUMN,2,h1imag
/GCOLUMN,3,h3real
/GCOLUMN,4,h3imag
*VPLOT,_hbm_omg(1),harm_tab(1,1),2,3,4 ! harmonic 1 real, 1 imag, 3 real, 3 imag
/SHOW,close
finish

/com
/com Pulsation (rad/s) Harmonic 1 real, 1 imag, 3 real, 3 imag
/com
*VWRITE,_hbm_omg(1),harm_tab(1,1),harm_tab(1,2),harm_tab(1,3),harm_tab(1,4)
(F16.8,2X,F16.8,2X,F16.8,2X,F16.8,2X,F16.8)

/exit,nosave

7.1.3. Results
The analysis results are shown below. Direct postprocessing of results for each harmonic can be carried
out separately by reading the proper result file (filename_0.rst for harmonic 0, file-
name_%h%HI0 for harmonic, h) in both /POST1 and /POST26.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
30 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 1: 1-DOF Duffing Oscillator

Figure 7.1: Direct Postprocessing of Harmonic 3 Results

The macro sums all harmonics as described in Appendix A: Macro to Expand HBM Solution by Com-
bining Harmonics (p. 61), and the combined harmonic results are plotted in the following figure.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 31
Harmonic Balance Method Examples

Figure 7.2: Frequency-Response Curve from Combined Harmonic Results

The resonance frequency of the associated linear model (Equation 7.1 (p. 27) with = 0) is .
The effect of the cubic non-linearity is observed here by a bending of the response curve toward the
right and occurrence of the resonance peak at a higher frequency (stiffening effect).

Because of the odd order of the nonlinearity, only odd harmonics contributions are significant (Fig-
ure 7.3: Add Harmonic Coefficients (p. 33) harmonics 1 and 3).

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
32 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 2: Two Cantilever Beams with Frictionless Gap Contact

Figure 7.3: Add Harmonic Coefficients

7.2. Example 2: Two Cantilever Beams with Frictionless Gap Contact


This example shows the nonlinear harmonic analysis of two cantilever beams with a gap contact between
them using the harmonic balance method (HBM). Specifically, it demonstrates the following key points:

• Frictionless gap contact using CONTA178 elements.

• A 3D solid model.

• Use of Component Mode Synthesis (CMS).

The example problem is presented in the following sections:


7.2.1. Problem Description and modeling
7.2.2. Input for the Analysis
7.2.3. Results

7.2.1. Problem Description and modeling


The example is modeled in two ways:

• Full model.

• Model with CMS reduction.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 33
Harmonic Balance Method Examples

7.2.1.1. Full model


Two facing solid cantilever beams of length 0.16 m are meshed with SOLID185 elements. They are
separated by a gap of size 1e-5 m and frictionless contact occurs on the last quarter of their length.
The gap contact is defined with node-to-node CONTA178 elements.

Figure 7.4: Full Model

An equivalent surface pressure is applied on the fourth quarter of the bottom beam to induce
bending such that contact occurs.

The first bending frequency of the beams alone is f1 = 110.67 Hz. The HBM solution is computed
in frequency range [0.80f1, 1.1f1] with NH = 9 harmonics to capture the contact response accurately.

7.2.1.2. Model with CMS Reduction


The size of the model is reduced by generating one superelement for each beam. The master nodes
are composed of the following:

• boundary condition nodes

• loading nodes

• nodes used for nonlinear contact

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
34 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 2: Two Cantilever Beams with Frictionless Gap Contact

• one “observation” node on the top beam.

Figure 7.5: Model with CMS Reduction

Like any CMS model, the number of modes used to generate the superelements must be sufficient
to adequately represent the dynamics in the frequency range of interest. Here, 6 modes are used.

The number of nonlinear equations is the same for both the full and CMS models: (30 contact
nodes)*(3 DOFs/node) = 90 transient equations.

However, CMS reduction of the linear part of the model further saves computation time by reducing
the number of linear equations. The number of linear equations are as follows:

• Full model: (192 nodes)*(3 DOFs/node)*(2*9+1 harmonics) = 10944 harmonic equations

• CMS model: ((46 nodes)*(3 DOFs/node)+(6 modes/substructure)*2 substructures) *(2*9+1 harmon-


ics) = 2850 harmonic equations

The number of equations information is printed in the output when the SOLVE command is issued.

7.2.1.3. Model with Prestressed Superelement


This model is identical to that in Model with CMS Reduction (p. 34) except that a prestress load is
applied on the tip of both beams. Linear perturbation substructuring analysis procedure is used to
generate the prestressed superelements which are used in HBM analysis.

7.2.2. Input for the Analysis


To download the .dat files used for this example problem, click the links below.

hbm_example2a.dat - Full model


hbm_example2b.dat - CMS reduced model
hbm_example2c.dat - prestressed CMS reduced model

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 35
Harmonic Balance Method Examples

The contents of these files are listed below. The command listing shows in detail how to specify and
run the HBM analysis. You can use them as templates and modify them to create a custom HBM
analysis.

Input for the full model


/BATCH,LIST
/TITLE, Two cantilever beams with frictionless gap contact
/com =============================================================
/com DESCRIPTION:
/com Harmonic Balance analysis of two facing solid cantilever
/com beams separated by a gap and interacting with frictionless
/com contact.
/com - Case a: full model
/com =============================================================

! Model Parameters
PI = ACOS(-1)
E = 1E10 ! Young's modulus
RHO = 2700 ! Density
L = 0.01 ! Unit length
OMG = 110.67*2*PI ! single beam 1st eigenfrequency

KN = -1E5 ! contact normal stiffness


GAP = 1E-5 ! gap size
FEXT = 40 ! external force

! HBM and Continuation Parameters


NH = 9 ! number of harmonics

DS = 2.0 ! initial arc length (step length)


DSMIN = DS/100 ! minimum arc length (step length)
DSMAX = 2*DS ! maximum arc length (step length)

FMIN = 0.80*OMG/(2*PI) ! Starting frequency


FMAX = 1.10*OMG/(2*PI) ! Ending frequency

/PREP7

! element type
ET,1,185

ET,2,178
KEYOPT,2,1 ,0 ! unidirectional
KEYOPT,2,2 ,1 ! penalty-based method
KEYOPT,2,4 ,0 ! gap size based on real constant GAP + node location
KEYOPT,2,10,0 ! standard contact
R,2,KN

! material
MP,EX ,1,E
MP,PRXY,1,0.3
MP,DENS,1,RHO
MP,BETD,1,0.00005

! model
BLOCK,0,L,0,16*L,0,2*L ! bottom beam
BLOCK,L+gap,2*L+gap,12*L,28*L,0,2*L ! top beam

ESIZE,L
TYPE,1
REAL,1
MAT ,1
VMESH,ALL

! gap contact
VSEL,S,VOLU,,1,,,1

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
36 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 2: Two Cantilever Beams with Frictionless Gap Contact

NSEL,R,LOC,X,L
NSEL,R,LOC,Y,12*L,16*L
CM,BEAM1_GAP,NODE
ALLSEL

VSEL,S,VOLU,,2,,,1
NSEL,R,LOC,X,L+GAP
NSEL,R,LOC,Y,12*L,16*L
CM,BEAM2_GAP,NODE
ALLSEL

CMSEL,S,BEAM1_GAP
CMSEL,A,BEAM2_GAP
TYPE,2
REAL,2
EINTF,1E-6,,,,GAP
ALLSEL

finish

/SOLU
ANTYPE,HARMIC

HROPT,HBM,NH ! HBM Solve and number of harmonics


HARFRQ,FMIN,FMAX

HBMOPT,NR,10
HBMOPT,CONTSET,,DS,DSMIN,DSMAX
HBMOPT,LIST

! boundary conditions
NSEL,S,LOC,Y,0
NSEL,A,LOC,Y,28*L
D,ALL,ALL
ALLSEL

! loading - surface pressure - harmonic 1 loading


NSEL,S,LOC,X,0
NSEL,R,LOC,Y,12*L,16*L
SF,ALL,PRES,FEXT
ALLSEL

ND_BOT = NODE(0,16*L,L)
ND_TOP = NODE(2*L+GAP,12*L,L)

KBC,1

SOLVE
FINISH

/com
/com _________ DIRECT POST-PROCESSING OF HARMONIC SOLUTION _________
/com

/POST1
*GET,JOBN,ACTIVE,,JOBNAM
FILE,%JOBN%_1hi0,rst
SET,LIST

SET,1,39
/VIEW,,0.1,0.25,1
/EDGE,,1
/DSCALE,,1E2
/TITLE, Two cantilever beams with frictionless gap contact
/SHOW,PNG,REV
PLNSOL,U,SUM
/SHOW,CLOSE

FINISH

/com

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 37
Harmonic Balance Method Examples

/com _________ POST-PROCESSING USING MACRO 'HBM_EXPA' _________


/com

*GET,JOBN,ACTIVE,,JOBNAM
HBM_EXPA,JOBN,ND_BOT,'U','X',NH,'minmax'
*DIM ,_HBM_AMPL_BEAM ,TABLE,_NSS,2
*VFUN,_HBM_AMPL_BEAM(1,1),COPY ,_HBM_AMPL(1) ! save results for node %ND_BOT% (bottom beam)

HBM_EXPA,JOBN,ND_TOP,'U','X',NH,'minmax'
*VFUN,_HBM_AMPL_BEAM(1,2),COPY,_HBM_AMPL(1) ! save results for node %ND_TOP% (top beam)

/SHOW,PNG,REV
/AXLAB,X,FREQUENCY (HZ)
/AXLAB,Y,AMPLITUDE
/GCOLUMN,1,BOT_BEAM
/GCOLUMN,2,TOP_BEAM
*VPLOT,_HBM_FREQ(1),_HBM_AMPL_BEAM(1,1),2
/SHOW,CLOSE

/com
/com Frequency (Hz) Amplitude of the response
/com Bot. Beam | Top Beam
/com
*VWRITE,_HBM_FREQ(1),_HBM_AMPL_BEAM(1,1),_HBM_AMPL_BEAM(1,2)
(F16.8,2X,E16.8,2X,E16.8)

Input for the CMS model


/BATCH,LIST
/TITLE, Two cantilever beams with frictionless gap contact
/com =============================================================
/com DESCRIPTION:
/com Harmonic Balance analysis of two facing solid cantilever
/com beams separated by a gap and interacting with frictionless
/com contact.
/com - Case b: CMS model
/com =============================================================

! Model Parameters
PI = ACOS(-1)
E = 1E10 ! Young's modulus
RHO = 2700 ! Density
L = 0.01 ! Unit length
OMG = 110.67*2*PI ! single beam 1st eigenfrequency

KN = -1E5 ! contact normal stiffness


GAP = 1E-5 ! gap size
FEXT = 40 ! external force

! HBM and Continuation Parameters


NH = 9 ! number of harmonics
NMODE = 6 ! number of modes for CMS reduction

DS = 2.0 ! initial arc length (step length)


DSMIN = DS/100 ! minimum arc length (step length)
DSMAX = 2*DS ! maximum arc length (step length)

FMIN = 0.80*OMG/(2*PI) ! Starting frequency


FMAX = 1.10*OMG/(2*PI) ! Ending frequency

/PREP7

! element type
ET,1,185

! material
MP,EX ,1,E

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
38 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 2: Two Cantilever Beams with Frictionless Gap Contact

MP,PRXY,1,0.3
MP,DENS,1,RHO
MP,BETD,1,0.00005

! model
BLOCK,0,L,0,16*L,0,2*L ! bottom beam
BLOCK,L+gap,2*L+gap,12*L,28*L,0,2*L ! top beam

ESIZE,L
TYPE,1
REAL,1
MAT ,1
VMESH,ALL

FINISH

SAVE,ALL3D,DB
PARSAV,,ALL3D,PARM

/com
/com ______________ GENERATION PASS - BOTTOM BEAM _____________
/com
/FILNAME,BEAM1

/SOLU
ANTYPE,SUBSTR
SEOPT,BEAM1,3,,,NONE ! generate stiffness, mass, and damping matrix
! (NONE = no files kept for expansion)
CMSOPT,FIX,NMODE

! master dofs
VSEL,S,VOLU,,1,,,1 ! gap contact nodes - bottom beam
NSEL,R,LOC,X,L
NSEL,R,LOC,Y,12*L,16*L
CM,BEAM1_GAP,NODE
ALLSEL

NSEL,S,LOC,Y,0 ! boundary conditions - bottom beam


CM,BEAM1_BC,NODE
ALLSEL

NSEL,S,LOC,Y,12*L,16*L ! loading - bottom beam


NSEL,R,LOC,X,0
CM,BEAM1_LOAD,NODE
ALLSEL

CMSEL,S,BEAM1_GAP
CMSEL,A,BEAM1_LOAD
CMSEL,A,BEAM1_BC
M,ALL,ALL
ALLSEL

VSEL,S,VOLU,,1,,,1 ! select only nodes and elements for bottom beam


CM,BEAM1_ELEM,ELEM

solve
finish

/com
/com ______________ GENERATION PASS - TOP BEAM _____________
/com
/FILNAME,BEAM2

/SOLU
ANTYPE,SUBSTR
SEOPT,BEAM2,3,,,NONE ! generate stiffness, mass, and damping matrix
! (NONE = no files kept for expansion)
CMSOPT,FIX,NMODE

! master dofs
VSEL,S,VOLU,,2,,,1 ! gap contact nodes - top beam

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 39
Harmonic Balance Method Examples

NSEL,R,LOC,X,L+GAP
NSEL,R,LOC,Y,12*L,16*L
CM,BEAM2_GAP,NODE
ALLSEL

NSEL,S,LOC,Y,28*L ! boundary conditions - top beam


CM,BEAM2_BCLOAD,NODE
ALLSEL

TIP_NODE = NODE(2*L+GAP,12*L,L) ! tip node

CMSEL,S,BEAM2_GAP
CMSEL,A,BEAM2_BCLOAD
NSEL,A,NODE,,TIP_NODE
M,ALL,ALL
ALLSEL

VSEL,S,VOLU,,2,,,1 ! select only nodes and elements for top beam


CM,BEAM2_ELEM,ELEM
SOLVE
FINISH

/com
/com ______________ USE PASS _____________
/com
/CLEAR,NOSTART
/FILNAME,USE

PARRES,,ALL3D,PARM

/PREP7

! load SE
ET,10,50
TYPE,10
SE,BEAM1
SE,BEAM2

! create NL elements
ET,2,178
KEYOPT,2,1 ,0 ! unidirectional
KEYOPT,2,2 ,1 ! penalty-based method
KEYOPT,2,4 ,0 ! gap size based on real constant GAP + node location
KEYOPT,2,10,0 ! standard contact
R,2,KN

! gap contact
SELTOL,1E-6
NSEL,S,LOC,X,L
NSEL,R,LOC,Y,12*L,16*L
CM,BEAM1_GAP,NODE
ALLSEL

NSEL,S,LOC,X,L+GAP
NSEL,R,LOC,Y,12*L,16*L
CM,BEAM2_GAP,NODE
ALLSEL

CMSEL,S,BEAM1_GAP
CMSEL,A,BEAM2_GAP
TYPE,2
REAL,2
EINTF,1E-6,,,,GAP
ALLSEL

FINISH

/SOLU
ANTYPE,HARMIC

HROPT,HBM,NH ! HBM Solve and number of harmonics

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
40 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 2: Two Cantilever Beams with Frictionless Gap Contact

HARFRQ,FMIN,FMAX

HBMOPT,NR,10
HBMOPT,CONTSET,,DS,DSMIN,DSMAX
HBMOPT,LIST

! boundary conditions
NSEL,S,LOC,Y,0
NSEL,A,LOC,Y,28*L
D,ALL,ALL
ALLSEL

! loading - surface pressure mimicked with nodal load


! FEXT is applied to nodes belonging to 1 loaded element
! 2*FEXT is applied to nodes belonging to 2 different loaded elements
! 4*FEXT is applied to nodes belonging to 4 different loaded elements

NSEL,S,LOC,X,0
NSEL,R,LOC,Y,12*L,16*L
NSEL,R,LOC,Z,L
NSEL,U,LOC,Y,12*L
NSEL,U,LOC,Y,16*L
CM,CENTER_NODE,NODE
F,ALL,FX,4*FEXT*(8*L**2)/32
ALLSEL

NSEL,S,LOC,Y,12*L
NSEL,A,LOC,Y,16*L
NSEL,R,LOC,X,0
NSEL,U,LOC,Z,L
CM,CORNER_NODE,NODE
F,ALL,FX,FEXT*(8*L**2)/32
ALLSEL

NSEL,S,LOC,X,0
NSEL,R,LOC,Y,12*L,16*L
CMSEL,U,CENTER_NODE
CMSEL,U,CORNER_NODE
CM,SIDE_NODE,NODE
F,ALL,FX,2*FEXT*(8*L**2)/32
ALLSEL

ND_BOT = NODE(0,16*L,L)
ND_TOP = NODE(2*L+GAP,12*L,L)

KBC,1

SOLVE
FINISH

/com
/com _________ POST-PROCESSING USING MACRO 'HBM_EXPA' _________
/com

/POST26
FILE,USE0,rst

JOBN='USE'
HBM_EXPA,JOBN,ND_BOT,'U','X',NH,'minmax'
*DIM ,_HBM_AMPL_BEAM ,TABLE,_NSS,2
*VFUN,_HBM_AMPL_BEAM(1,1),COPY ,_HBM_AMPL(1) ! save results for node %ND_BOT% (bottom beam)

HBM_EXPA,JOBN,ND_TOP,'U','X',NH,'minmax'
*VFUN,_HBM_AMPL_BEAM(1,2),COPY,_HBM_AMPL(1) ! save results for node %ND_TOP% (top beam)

/SHOW,PNG,REV
/AXLAB,X,FREQUENCY (HZ)
/AXLAB,Y,AMPLITUDE
/GCOLUMN,1,BOT_BEAM
/GCOLUMN,2,TOP_BEAM
*VPLOT,_HBM_FREQ(1),_HBM_AMPL_BEAM(1,1),2

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 41
Harmonic Balance Method Examples

/SHOW,CLOSE

/com
/com Frequency (Hz) Amplitude of the response
/com Bot. Beam | Top Beam
/com
*VWRITE,_HBM_FREQ(1),_HBM_AMPL_BEAM(1,1),_HBM_AMPL_BEAM(1,2)
(F16.8,2X,E16.8,2X,E16.8)

FINISH

Input for the prestress CMS model


/BATCH,LIST
/TITLE, Two cantilever beams with frictionless gap contact
/com =============================================================
/com DESCRIPTION:
/com Harmonic Balance analysis of two facing solid cantilever
/com beams separated by a gap and interacting with frictionless
/com contact.
/com - Case c: prestressed CMS model
/com =============================================================

! Model Parameters
PI = ACOS(-1)
E = 1E10 ! Young's modulus
RHO = 2700 ! Density
L = 0.01 ! Unit length
OMG = 110.67*2*PI ! single beam 1st eigenfrequency

KN = -1E5 ! contact normal stiffness


GAP = 1E-5 ! gap size
FEXT = 40 ! external force

! HBM and Continuation Parameters


NH = 9 ! number of harmonics
NMODE = 6 ! number of modes for CMS reduction

DS = 2.0 ! initial arc length


DSMIN = DS/100 ! minimum arc length
DSMAX = 2*DS ! maximum arc length

FMIN = 0.80*OMG/(2*PI) ! Starting frequency


FMAX = 1.10*OMG/(2*PI) ! Ending frequency

/PREP7

! element type
ET,1,185

! material
MP,EX ,1,E
MP,PRXY,1,0.3
MP,DENS,1,RHO
MP,BETD,1,0.00005

! model
BLOCK,0,L,0,16*L,0,2*L ! bottom beam
BLOCK,L+gap,2*L+gap,12*L,28*L,0,2*L ! top beam

ESIZE,L
TYPE,1
REAL,1
MAT ,1
VMESH,ALL

FINISH

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
42 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 2: Two Cantilever Beams with Frictionless Gap Contact

/com
/com ______________ PRESTRESS PASS _____________
/com

/SOLU
ANTYPE,STATIC

RESCONTROL,LINEAR,ALL,1

! boundary conditions
NSEL,S,LOC,Y,0
NSEL,A,LOC,Y,28*L
D,ALL,ALL
ALLSEL

! prestress load
NSEL,S,LOC,Y,16*L
NSEL,R,LOC,X,0,L
SF,ALL,PRES,2E6
ALLSEL

NSEL,S,LOC,Y,12*L
NSEL,R,LOC,X,L+GAP,2*L+GAP
SF,ALL,PRES,2E6
ALLSEL

SOLVE
FINISH

SAVE,ALL3D,DB
PARSAV,,ALL3D,PARM

/com
/com ______________ GENERATION PASS - BOTTOM BEAM _____________
/com
! /FILNAME,BEAM1

/SOLU
ANTYPE,STATIC,RESTART,,,PERTURB
PERTURB,SUBSTR,,,DZEROKEEP
SOLVE,ELFORM

SEOPT,BEAM1,3,,,NONE ! generate stiffness, mass and damping matrix


! (NONE = no files kept for expansion)
CMSOPT,FIX,NMODE

! master dofs
VSEL,S,VOLU,,1,,,1 ! gap contact nodes - bottom beam
NSEL,R,LOC,X,L
NSEL,R,LOC,Y,12*L,16*L
CM,BEAM1_GAP,NODE
ALLSEL

NSEL,S,LOC,Y,0 ! boundary conditions - bottom beam


CM,BEAM1_BC,NODE
ALLSEL

NSEL,S,LOC,Y,12*L,16*L ! loading - bottom beam


NSEL,R,LOC,X,0
CM,BEAM1_LOAD,NODE
ALLSEL

CMSEL,S,BEAM1_GAP
CMSEL,A,BEAM1_LOAD
CMSEL,A,BEAM1_BC
M,ALL,ALL
ALLSEL

VSEL,S,VOLU,,1,,,1 ! select only nodes and elements for bottom beam


CM,BEAM1_ELEM,ELEM

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 43
Harmonic Balance Method Examples

SOLVE
FINISH

/com
/com ______________ GENERATION PASS - TOP BEAM _____________
/com
/CLEAR,NOSTART
! /FILNAME,BEAM2
RESUME,ALL3D,DB

/SOLU
ANTYPE,STATIC,RESTART,,,PERTURB
PERTURB,SUBSTR,,,DZEROKEEP
SOLVE,ELFORM

SEOPT,BEAM2,3,,,NONE ! generate stiffness, mass and damping matrix


! (NONE = no files kept for expansion)
CMSOPT,FIX,NMODE

! master dofs
VSEL,S,VOLU,,2,,,1 ! gap contact nodes - top beam
NSEL,R,LOC,X,L+GAP
NSEL,R,LOC,Y,12*L,16*L
CM,BEAM2_GAP,NODE
ALLSEL

NSEL,S,LOC,Y,28*L ! boundary conditions - top beam


CM,BEAM2_BCLOAD,NODE
ALLSEL

TIP_NODE = NODE(2*L+GAP,12*L,L) ! tip node

CMSEL,S,BEAM2_GAP
CMSEL,A,BEAM2_BCLOAD
NSEL,A,NODE,,TIP_NODE
M,ALL,ALL
ALLSEL

VSEL,S,VOLU,,2,,,1 ! select only nodes and elements for top beam


CM,BEAM2_ELEM,ELEM
SOLVE
FINISH

/com
/com ______________ USE PASS _____________
/com
/CLEAR,NOSTART
/FILNAME,USE

PARRES,,ALL3D,PARM

/PREP7

! load SE
ET,10,50
TYPE,10
SE,BEAM1
SE,BEAM2

! create NL elements
ET,2,178
KEYOPT,2,1 ,0 ! unidirectional
KEYOPT,2,2 ,1 ! penalty-based method
KEYOPT,2,4 ,0 ! gap size based on real constant GAP + node location
KEYOPT,2,10,0 ! standard contact
R,2,KN

! gap contact
SELTOL,1E-6
NSEL,S,LOC,X,L

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
44 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 2: Two Cantilever Beams with Frictionless Gap Contact

NSEL,R,LOC,Y,12*L,16*L
CM,BEAM1_GAP,NODE
ALLSEL

NSEL,S,LOC,X,L+GAP
NSEL,R,LOC,Y,12*L,16*L
CM,BEAM2_GAP,NODE
ALLSEL

CMSEL,S,BEAM1_GAP
CMSEL,A,BEAM2_GAP
TYPE,2
REAL,2
EINTF,1E-6,,,,GAP
ALLSEL

FINISH

/SOLU
ANTYPE,HARMIC

HROPT,HBM,NH ! HBM Solve and number of harmonics


HARFRQ,FMIN,FMAX

HBMOPT,NR,10
HBMOPT,CONTSET,,DS,DSMIN,DSMAX
HBMOPT,LIST

! boundary conditions
NSEL,S,LOC,Y,0
NSEL,A,LOC,Y,28*L
D,ALL,ALL
ALLSEL

! loading - surface pressure mimicked with nodal load


! FEXT is applied to nodes belonging to 1 loaded element
! 2*FEXT is applied to nodes belonging to 2 different loaded elements
! 4*FEXT is applied to nodes belonging to 4 different loaded elements

NSEL,S,LOC,X,0
NSEL,R,LOC,Y,12*L,16*L
NSEL,R,LOC,Z,L
NSEL,U,LOC,Y,12*L
NSEL,U,LOC,Y,16*L
CM,CENTER_NODE,NODE
F,ALL,FX,4*FEXT*(8*L**2)/32
ALLSEL

NSEL,S,LOC,Y,12*L
NSEL,A,LOC,Y,16*L
NSEL,R,LOC,X,0
NSEL,U,LOC,Z,L
CM,CORNER_NODE,NODE
F,ALL,FX,FEXT*(8*L**2)/32
ALLSEL

NSEL,S,LOC,X,0
NSEL,R,LOC,Y,12*L,16*L
CMSEL,U,CENTER_NODE
CMSEL,U,CORNER_NODE
CM,SIDE_NODE,NODE
F,ALL,FX,2*FEXT*(8*L**2)/32
ALLSEL

ND_BOT = NODE(0,16*L,L)
ND_TOP = NODE(2*L+GAP,12*L,L)

KBC,1

SOLVE
FINISH

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 45
Harmonic Balance Method Examples

/com
/com _________ DIRECT POST-PROCESSING _________
/com

/POST26
NUMVAR,200
FILE,USE_1hi0,rst ! select result file containing harmonic 1 results

NSOL,102,ND_BOT,u,x ! store and print frequency history results for harmonic 1


ABS ,102,102

NSOL,103,ND_TOP,u,x ! store and print frequency history results for harmonic 1


ABS ,103,103

/SHOW,png,rev
/AXLAB,X,Frequency (Hz)
/AXLAB,Y,Harmonic 1 - amplitude
PLVAR,102,103
/SHOW,close

PRVAR,102,103
FINISH

/com
/com _________ POST-PROCESSING USING MACRO 'HBM_EXPA' _________
/com

/POST26
FILE,USE0,rst

JOBN='USE'
HBM_EXPA,JOBN,ND_BOT,'U','X',NH,'minmax'
*DIM ,_HBM_AMPL_BEAM ,TABLE,_NSS,2
*VFUN,_HBM_AMPL_BEAM(1,1),COPY ,_HBM_AMPL(1) ! save results for node %ND_BOT% (bottom beam)

HBM_EXPA,JOBN,ND_TOP,'U','X',NH,'minmax'
*VFUN,_HBM_AMPL_BEAM(1,2),COPY,_HBM_AMPL(1) ! save results for node %ND_TOP% (top beam)

/SHOW,PNG,REV
/AXLAB,X,FREQUENCY (HZ)
/AXLAB,Y,AMPLITUDE
/GCOLUMN,1,BOT_BEAM
/GCOLUMN,2,TOP_BEAM
*VPLOT,_HBM_FREQ(1),_HBM_AMPL_BEAM(1,1),2
/SHOW,CLOSE

/com
/com Frequency (Hz) Amplitude of the response
/com Bot. Beam | Top Beam
/com
*VWRITE,_HBM_FREQ(1),_HBM_AMPL_BEAM(1,1),_HBM_AMPL_BEAM(1,2)
(F16.8,2X,E16.8,2X,E16.8)
FINISH

7.2.3. Results
Output contains information on the convergence, the arc length, and the maximum amplitude of
each harmonic at each substep. The example output message below shows that the solver needed
two iterations to converge.
RESIDUAL INFINITE NORM VALUE = 0.003732
ITERATION 1 COMPLETED
RESIDUAL INFINITE NORM VALUE = 8.863e-08
ITERATION 2 COMPLETED
>>> SOLUTION CONVERGED

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
46 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 2: Two Cantilever Beams with Frictionless Gap Contact

CURRENT STEP SIZE = 10

** MAXIMUM AMPLITUDE OF DISPLACEMENT SOLUTIONS **


HARMONIC REAL IMAG
0 0.7646E-06
1 0.1620E-04 0.1836E-04
2 0.4504E-06 0.9648E-07
3 0.4688E-07 0.1278E-06
4 0.6442E-07 0.3625E-07
5 0.4176E-07 0.3909E-07
6 0.5943E-07 0.1138E-06
7 0.1696E-07 0.1060E-06
8 0.4490E-07 0.3106E-07
9 0.2315E-07 0.2209E-07
*** LOAD STEP 1 SUBSTEP 37 COMPLETED. FREQUENCY= 108.811

You can create displacement plots for a given harmonic at a selected frequency using direct postpro-
cessing in /POST1 as shown below.

Figure 7.6: Displacement

You can calculate the response amplitude using the HBM_EXPA.mac macro, which performs postpro-
cessing in a similar manner to example 1. To view the details of this macro and a link to download
it, see Appendix A: Macro to Expand HBM Solution by Combining Harmonics (p. 61).

The following figure shows the linear harmonic results for the bottom beam.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 47
Harmonic Balance Method Examples

Figure 7.7: Bottom Beam - Linear Harmonic Results

Effects of the contact on the bottom beam can be seen in the following figure which shows a reduction
in amplitude as well as an asymmetry of the peak. Contact between the two beams occurs around
96 Hz when the top beam starts to respond to harmonic excitation.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
48 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 2: Two Cantilever Beams with Frictionless Gap Contact

Figure 7.8: Effects of Contact on the Bottom Beam - Full model (A), CMS model (B)

Compared to the full model (p. 34), the CMS model (p. 34) gives similar results, but it reduces the
overall computation time by a factor of about 6.

The prestressed CMS model (p. 35) also gives quite similar results. The difference lies in the localization
of the peak which is shifted toward the high frequencies and the amplitude of the peak which is
smaller (stiffening behavior).

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 49
Harmonic Balance Method Examples

Figure 7.9: Effects of Prestress Load on Response Peak

7.3. Example 3: Two jointed beams with frictional contact interface


This example shows the nonlinear harmonic analysis of two jointed beams with a frictional contact in-
terface using Harmonic Balance Method (HBM). Specifically, it demonstrates the following key points:

• Frictional contact using CONTA178 elements.

• Component Mode Synthesis (CMS).

• Initial solution vector to apply a constant force (preload (p. 52)).

• Scaling of the solution vector to improve the convergence rate.

The example problem is presented in the following sections:


7.3.1. Problem Description
7.3.2. Input for the Analysis
7.3.3. Results

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
50 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 3: Two jointed beams with frictional contact interface

7.3.1. Problem Description


Two solid beams of respective sizes 40 x 20 x 5 mm and 140 x 20 x 5 mm are meshed with SOLID185
elements and linked by a frictional contact interface of 20 mm length. The left end of the top beam
is clamped, and a constant surface pressure of magnitude 1 N/mm2 is applied on each side of the
contact area to maintain contact between the two beams.

Figure 7.10: Finite Element Model of the Two Jointed Beams

All node-to-node contact elements have a normal and tangential stiffness of 103 N/m and a friction
coefficient of 0.3.

The first out-of-plane mode of the jointed beams (f2 = 318.7 Hz), which generates high friction in the
joint interface is under study in the nonlinear harmonic analysis. It is activated by applying a transverse
surface pressure of different magnitude levels at the end of the lower beam. To compute the response,
the frequency range for the HBM analysis is [310, 325] Hz and the number of harmonics NH = 3.

Figure 7.11: First Out-of-plane Mode (Mode 2) at 318.7 Hz

Model reduction
Before running the HBM analysis, the linear part of the model is condensed using Component Mode
Synthesis (CMS) to reduce the total number of equations and consequently the computational time.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 51
Harmonic Balance Method Examples

The 15 nodes on each substructure used to define contact and one observation node at the end of
the lower beam are selected as master nodes. Loads are defined using superelement load vectors to
apply pressure, avoiding extra master nodes for loading. Six modes are used to generate each super-
element so that the total number of HBM equations is 735.

Preload
To improve convergence at the first frequency point, a preliminary static analysis is run considering
only the constant pressure load. Then, the static solution is read from the results (Jobname.rst)
file and used as an initial guess for the HBM solution (HBMOPT,UINIT). The procedure to define the
HBM initial guess is as follows:

Combine the static Jobname.full files if using distributed-memory parallel (DMP) processing.

1. Read the static solution vector to be used as the 0th harmonic ( ) of the initial guess ( )
from the Jobname.rst file.

2. Create the multiharmonic solution vector ( in Equation 1.7 (p. 2) - Equation 1.9 (p. 2), re-
ferred to here as for clarity) using the *DIM command. The size of is related to
and the number of harmonics NH as follows:

size( ) = size( )*(2*NH + 1).

3. Fill the vector with values. is defined as

=[ ; ; ; ; ;…; ]

where

the subscripts and denote real and complex values

and the integer superscripts denote the time-domain harmonic index h (see Equa-
tion 1.9 (p. 2)).

4. Read the BACK nodal mapping vector from the Jobname.rst file and export it to an APDL
array named "UserBack".

5. Specify the initial guess for the HBM solution using and UserBack as inputs by issuing
HBMOPT,UINIT,APDL,umh,INT,UserBack.

The HBM initial guess can be retrieved from different preliminary analyses. See below for more details
about the procedure.

To restart from a linear harmonic analysis, use the linear solution as an initial guess to help the
solver converge towards the first solution. Follow the procedure described above except for steps
two and four to fill the multiharmonic solution vector :

2. Read the linear harmonic solution vector (real and imaginary ) from the Job-
name.rst file.
4. Fill the vector with and values.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
52 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 3: Two jointed beams with frictional contact interface

To resume a prior HBM analysis that stopped due to convergence failure or a stopping criterion,
restart the analysis at the last point computed. Changing some parameters (number of harmonics
NH, number of time points per period NT, etc. via HBMOPT) without recomputing the previous substeps
reduces the workflow and computation time. Follow the procedure described above except for steps
two and four to fill the multiharmonic solution vector umh (see Example 7.1: Command Input for Filling
umh from a Previous HBM Analysis (p. 53)):

2. For each harmonic of the initial run, read the solution vector (real and imaginary )
from the corresponding results file (Jobname0.rst, Jobname_1hi0.rst, etc.)
4. Fill the vector with and values.

Example 7.1: Command Input for Filling umh from a Previous HBM Analysis
! number of harmonics
NH = 3

*get,rstName,active,,jobnam
*VEC,u0,D,IMPORT,RST,%rstName%.rst,1,,NSL
uDim = u0_Dim ! size of the single harmonic solution vector

! size of the multiharmonic solution vector


umhDim = uDim*(1+2*NH)
*DIM,umh,ARRAY,umhDim

! fill vector with harmonic 0 solution


*DO,i,1,uDim
umh(i) = u0(i)
*ENDDO

! fill vector with other harmonic solutions (complex)


iloc = uDim
*DO,ih,1,NH
*VEC,uh,Z,IMPORT,RST,%rstName%_%ih%hi0.rst,iRestart,,NSL
*DO,i,1,uDim
iloc = iloc + 1
umh(iloc) = uh(i,1)
*ENDDO
*DO,i,1,uDim
iloc = iloc + 1
umh(iloc) = uh(i,2)
*ENDDO
*ENDDO

Scaling the solution vector


To improve convergence behavior in the Newton-Raphson continuation procedure, the use of HB-
MOPT,SCAL to linearly scale each component of the solution vector by providing a vector of scaling
factors is demonstrated here. (For scaling equations and tips on scaling the solution vector, see
Equation Solution (p. 3) and Scaling the Solution Vector (p. 23).)

Scaling the solution to improve convergence depends on the specifics of each model. Although there
is no universal rule for determining scaling factors, the approach and equations used in this problem
are often applicable. Since scaling does not affect solution accuracy, you can use typical or approximate
values (as exact values may be unknown a priori) or other strategies to determine scaling parameters
suitable for your application.

For this problem, the scaling vector is defined as an APDL array named "uscal" filled with a constant
scaling factor for the displacement, scal_disp. The number of physical equations, Neq_typ, and the

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 53
Harmonic Balance Method Examples

largest predicted displacement, Umax_typ, are used to calculate the displacement scaling factor by
scal_disp = Neq_typ*Umax_typ. A value of scal_freq =300*2*p, close to the frequency range of interest
(in rad/s) is used to scale the solution degree of freedom which corresponds to the forcing frequency.
Finally, the scaling is applied by issuing HBMOPT,SCAL,1,uscal,scal_freq,SOLU. Note that for this ex-
ample, a constant scaling value could be used (HBMOPT,SCAL,VALU,scal_disp,scal_freq), and a vector
is created only for demonstration purposes.

7.3.2. Input for the Analysis


To download the .dat file used for this example problem, click the link below.

hbmexample3.dat

The contents of this file are listed below. The command listing shows in detail how to specify and
run the HBM analysis. You can use it as a template and modify it to create a custom HBM analysis.
/batch,list
/title, Two jointed beams with frictional contact interface

! beam 1
Lb1 = 40 ! length
wb1 = 20 ! width
tb1 = 5 ! thickness

! beam 2
Lb2 = 140 ! length
wb2 = 20 ! width
tb2 = 5 ! thickness

! material
E = 116e3 ! Young's modulus
nu = 0.32 ! Poisson's ratio
rho = 4506e-12 ! density

alpd = 2e-6 ! alpha damping


betd = 1e-5 ! beta damping

! contact
Lc = 20 ! surface length
wc = 20 ! surface width
Kn = 1e3 ! normal stiffness
Kt = 1e3 ! tangential stiffness
mu = 0.3 ! friction coefficient

! load
FN0 = 1.0 ! static pressure
FT1 = 5.0e-4 ! harmonic tangential force
! 1.0e-4, 5.0e-4, 1.0e-3 or 2.0e-3 to reproduce figure 3 results

! mesh
esiz_x = Lb1/4 ! element size in x-direction
esiz_y = wb1/4 ! element size in y-direction
esiz_z = tb1/2 ! element size in z-direction

! CMS
Nmode = 6

! HBM
Fmin = 310
Fmax = 325

NH = 3 ! number of harmonics

ds = 0.5 ! initial step size


dsmin = ds/50 ! minimum step size

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
54 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 3: Two jointed beams with frictional contact interface

dsmax = ds*5 ! maximum step size

neq_hbm = (31*3+2*Nmode)*(2*NH+1) ! number of HBM equations:


! 113 equations = 31 nodes X 3 dofs + 20 CMS modes

pi = acos(-1)

! typical values of the problem


Neq_typ = 90 ! typical number of physical equations
Umax_typ = 0.10 ! typical value of maximum displacement (mm)
Fpeak_typ = 300 ! peak frequency (Hz)

! scaling values
scal_disp = Umax_typ*Neq_typ ! scaling for displacement DOFs
scal_freq = 2*pi*Fpeak_typ ! scaling for frequency DOF

/prep7

! material
mp,ex ,1,E
mp,prxy,1,nu
mp,dens,1,rho
mp,alpd,1,alpd
mp,betd,1,betd

mp,mu,2,mu

! geometry
block, 0,Lb1, 0,wb1, 0,tb1 ! beam 1
block, Lb1-Lc,Lb1+Lb2-Lc, 0,wb2, -tb2,0 ! beam 2

! element types
et,1,185

! mesh
vsel,s,volu,,1,,,1
lsel,r,loc,x,Lb1/2
lesize,all,esiz_x
allsel

vsel,s,volu,,2,,,1
lsel,r,loc,x,Lb1-Lc+Lb2/2
lesize,all,esiz_x
allsel

lsel,s,loc,y,wb1/2
lesize,all,esiz_y
allsel

lsel,s,loc,z, tb1/2
lsel,a,loc,z,-tb2/2
lesize,all,esiz_z
allsel

type,1
real,1
mat ,1
vmesh,all

vsel,s,volu,,1,,,1
cm,beam1_node,node
cm,beam1_elem,elem
allsel

vsel,s,volu,,2,,,1
cm,beam2_node,node
cm,beam2_elem,elem
allsel

finish

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 55
Harmonic Balance Method Examples

save,full,db
parsav,all,full,parm

/com
/com ______________ GENERATION PASS - BEAM 1 _____________
/com
/filname,beam1

/solu
antype,substr
seopt,beam1,3,,,NONE ! generate stiffness, damping, and mass matrix
! (NONE = no files kept for expansion)
cmsopt,fixed,Nmode

! boundary conditions
nsel,s,loc,x,0
d,all,all
allsel

! loading
nsel,s,loc,x,Lb1-Lc,Lb1
nsel,r,loc,z,tb1
sf,all,pres,1
allsel

! master dofs
cmsel,s,beam1_node
nsel,r,loc,z,0
nsel,r,loc,x,Lb1-Lc,Lb1
cm,contact_beam1,node
allsel

cmsel,s,contact_beam1
m,all,all
allsel

cmsel,s,beam1_node ! select only nodes and elements for beam 1


cmsel,s,beam1_elem
solve
finish

save

/com
/com ______________ GENERATION PASS - BEAM 2 _____________
/com
/filname,beam2

/solu
antype,substr
seopt,beam2,3,,,NONE ! generate stiffness, damping, and mass matrix
! (NONE = no files kept for expansion)
cmsopt,fixed,nmode

! master dofs
cmsel,s,beam2_node
nsel,r,loc,z,0
nsel,r,loc,x,Lb1-Lc,Lb1
cm,contact_beam2,node
allsel

nsel,s,loc,x,Lb1-Lc+Lb2
nsel,r,loc,y,wb2/2
nsel,r,loc,z,0
cm,load_beam2,node
allsel

cmsel,s,contact_beam2
cmsel,a,load_beam2
m,all,all
allsel

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
56 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 3: Two jointed beams with frictional contact interface

/com >>>>>> LOAD VECTOR 1


nsel,s,loc,x,Lb1-Lc,Lb1
nsel,r,loc,z,-tb2
sf,all,pres,1
allsel

cmsel,s,beam2_node ! select only nodes and elements for beam 2


cmsel,s,beam2_elem
solve

/com >>>>>> LOAD VECTOR 2


sfdele,all,all
nsel,s,loc,x,Lb1+Lb2-Lc
sfco,2,,0,1,0
sf,all,pres,1
allsel

cmsel,s,beam2_node ! select only nodes and elements for beam 2


cmsel,s,beam2_elem
solve

finish

save

/com
/com ______________ USE PASS _____________
/com
/clear,nostart
/filname,hbm

parres,,full,parm

/prep7

! load SE
et,10,50
type,10
se,beam1
se,beam2

! contact
et,2,178
keyopt,2,2 ,1 ! pure penalty method
keyopt,2,5 ,3 ! contact normal along z-direction
r,2,-Kn,,,-Kt

mp,mu,2,mu

type,2
real,2
mat ,2
nsel,s,loc,z,0
nsel,r,loc,x,Lb1-Lc,Lb1
eintf,,,HIGH
allsel

finish

/solu
antype,static

rescontrol,define,last,last
nropt,unsym

! boundary conditions
nsel,s,loc,x,0
d,all,all
allsel

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 57
Harmonic Balance Method Examples

! loading - constant pressure


sfe,1,1,SELV,0,FN0 ! SE 1 - LV 1
sfe,2,1,SELV,0,FN0 ! SE 2 - LV 1

solve
finish
save

/clear,nostart
/filname,hbm

resume,hbm,db

/com
/com ---- READ STATIC RESULTS AND WRITE CORRESPONDING HBM INITIAL SOLUTION VECTOR
/com

! read harmonic 0 solution (real)


*get,jobn,active,,jobnam
*VEC,u0,D,IMPORT,RST,%jobn%.rst,1,,NSL
uDim = u0_Dim ! size of the single harmonic solution vector
umhDim = uDim*(1+2*NH) ! size of the multiharmonic solution vector

! fill multiharmonic vector with harmonic 0 solution


*DIM,umh,ARRAY,umhDim
*DO,i,1,uDim
umh(i) = u0(i)
*ENDDO

! read the mapping


*xpl,open,%jobn%.rst
*xpl,read,nod,BackVecI
*xpl,close
*vec,BackVecD,D,copy,BackVecI
*export,BackVecD,apdl,UserBack

/solu
antype,harmic

hropt,hbm,NH ! hbm solve and number of harmonics


harfrq,Fmin,Fmax

hbmopt,contset,,ds,dsmin,dsmax
hbmopt,uinit,APDL,umh,INT,UserBack
hbmopt,contterm,100,50
hbmopt,nr,10

kbc,1

! boundary conditions
nsel,s,loc,x,0
d,all,all
allsel

! loading - constant pressure - harmonic 0


*dim,FNtab,TABLE,NH+1,1,,NHINDEX,FREQ
*vfill,FNtab(1,0),RAMP,0,1
FNtab(0,1) = 100
FNtab(1,1) = FN0
sfe,1,1,SELV,0,%FNtab% ! SE 1 - LV 1
sfe,2,1,SELV,0,%FNtab% ! SE 2 - LV 1

! loading - tangential pressure - harmonic 1


sfe,2,2,SELV,0,FT1 ! SE 2 - LV 2

! scaling
*dim,uscal,array,neq_hbm
*vfill,uscal(1),RAMP,scal_disp,0

hbmopt,scal,1,uscal,scal_freq,SOLU

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
58 of ANSYS, Inc. and its subsidiaries and affiliates.
Example 3: Two jointed beams with frictional contact interface

solve
finish

/post26

nsel,s,loc,x,Lb1-Lc+Lb2
nsel,r,loc,y,wb2/2
nsel,r,loc,z,0
nd_load = ndnext(0)
allsel

HBM_EXPA,'hbm',nd_load,'u','y',NH,'minmax'

*vfact,1/(FT1*wb2*tb2)
*vfun,_hbm_ampl(1),COPY,_hbm_ampl(1)

/gmarker,,4
/xrange,310,325
/yrange,0,3
/axlab,X,Frequency (Hz)
/axlab,Y,Amplitude (mm/N)
/plopt,info,0
/title,Ft = %FT1% N
/show,png,rev
*vplot,_hbm_freq(1),_hbm_ampl(1)
/show,close

/nopr
/out,results_FT%FT1%,txt
*vwrite,_hbm_freq(1),_hbm_ampl(1)
(F10.5,' , ',E12.6)
/out,scratch

finish

7.3.3. Results
The amplitude of UY displacement at the tip of the lower beam is computed using the HBM_EXPA
macro (p. 61). The amplitude of the response scaled by the excitation amplitude is shown in the figure
below for different levels of excitations.

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 59
Harmonic Balance Method Examples

Figure 7.12: Scaled Response for Different Levels of Excitation

It shows that friction dissipates energy because of the contact stick-slip phenomenon. When increasing
the excitation amplitude from 0.01 N to 0.20 N, the scaled amplitude of the response decreases. This
corresponds to an increase of frictional damping due to the contact elements spending more time
in the sliding state.

Information about the contact status is provided in the jobname1.out file for each iteration. For
example, for Ft = 0.10 N and close to the natural frequency, the summary shows that sliding occurs
on average 12.5% of time for 2 of the 15 contact elements:
******** SUMMARY OF CONTACT ELEMENTS BEHAVIOR DURING LAST PERIOD ********
NO. OF ELEMENTS STICKING AT LEAST ONCE = 15 | AVERAGE % OF TIME = 98.3%
NO. OF ELEMENTS SLIDING AT LEAST ONCE = 2 | AVERAGE % OF TIME = 12.5%

For Ft = 0.20 N and around the same frequency, there are still only 2 elements sliding but they spend
a greater time sliding, on average of 20% of the time:
******** SUMMARY OF CONTACT ELEMENTS BEHAVIOR DURING LAST PERIOD ********
NO. OF ELEMENTS STICKING AT LEAST ONCE = 15 | AVERAGE % OF TIME = 97.3%
NO. OF ELEMENTS SLIDING AT LEAST ONCE = 2 | AVERAGE % OF TIME = 20.3%

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
60 of ANSYS, Inc. and its subsidiaries and affiliates.
Appendix A. Macro to Expand HBM Solution by Combining
Harmonics
You can expand the solution from an analysis solved with the harmonic balance method by combining
harmonics using the macro listed here and provided in the HBM_EXPA.mac file in the Example_In-
puts_and_Macro folder.

The macro combines the results of each harmonic result file. The time signal is calculated by summing
the computed harmonics at each frequency point using the following equation,

(1)

where

is dispacement.
is 0th harmonic solution.
is the time-domain harmonic index.
is the number of harmonics (specified as NH on HROPT,HBM,NH).
The subscripts and denote real and complex values.
is the frequency.
is time.

The amplitude of the time signal is determined to plot the combined frequency-response curve (for
example, see Figure 7.2: Frequency-Response Curve from Combined Harmonic Results (p. 32).

Download the macro at the following link.

HBM_EXPA.mac

Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 61
Release 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
62 of ANSYS, Inc. and its subsidiaries and affiliates.

You might also like