Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ANSYS.pdf
Скачиваний:
875
Добавлен:
31.08.2019
Размер:
31.29 Mб
Скачать

vk.com/club152685050 | vk.com/id446425943

Chapter 14: User-Programmable Features and Nonstandard Uses

The ANSYS program's open architecture allows you to link it to your own Fortran routines and subroutines. In fact, some standard ANSYS features began as user-programmed features.

Typically, you can obtain good results with the ANSYS program when you exercise documented features using standard, recommended procedures. In some cases, however, you may need to employ nonstandard procedures that ANSYS, Inc. Quality Assurance has not or cannot fully test.

The following topics concerning the ANSYS program's open architecture are available:

14.1.User-Programmable Features (UPFs)

14.2.Nonstandard Uses of the ANSYS Program

14.1. User-Programmable Features (UPFs)

User-programmable features (UPFs) are ANSYS capabilities for which you can write your own Fortran routines. UPFs allow you to customize the ANSYS program to your needs, which may be a user-defined material-behavior option, element, failure criterion (for composites), and so on. You can even write your own design-optimization algorithm that calls the entire ANSYS program as a subroutine. UPFs are available in the ANSYS Multiphysics, ANSYS Mechanical, ANSYS Structural, ANSYS Emag - Low Frequency, ANSYS Emag - High Frequency, and ANSYS PrepPost products. For detailed information, see the Guide

to User-Programmable Features.

Caution

By linking in your own Fortran routines, you are creating a custom, site-specific version of the ANSYS program. When you use UPFs, you are using ANSYS in a nonstandard way, one that ANSYS, Inc. verification testing does not cover. You are responsible for verifying that the

results produced are accurate and that the routines you link to ANSYS do not adversely affect other, standard areas of the program.

Exercise care when using UPFs on parallel systems. Do not use the /CONFIG command or a config150.ans file to activate parallelism on a system with UPFs.

The following topics concerning UPFs are available:

14.1.1.Understanding UPFs

14.1.2.Types of UPFs Available

14.1.1. Understanding UPFs

UPFs can range from a simple element output routine for custom output to a much more complex user element or user-optimization algorithm; therefore, it is difficult to present the process without describing specific programming details. This section presents a general sequence of steps to follow. The Guide to User-Programmable Features contains more detail on UPFs.

A typical UPF involves the following steps:

Release 15.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information

 

of ANSYS, Inc. and its subsidiaries and affiliates.

337

vk.com/club152685050User-Programmable Features| vkand.com/id446425943N nstandard Uses

1.Design and program the desired user routine in Fortran. For more information on Fortran compilers please refer to either the ANSYS, Inc. Windows Installation Guide or the ANSYS, Inc. Linux Installation Guide for details specific to your platform or operating system. The source codes for all user routines are available on your ANSYS, Inc. distribution medium. Most of them demonstrate at least simple functionality.

2.Compile and link your user routine into the ANSYS program. The Guide to User-Programmable Features describes how to do this on your system.

3.Verify that the changes you have made do not affect other, standard ANSYS features. (One way to do so is by running a set of Mechanical APDL Verification Manual problems.)

4.Verify the user routine using whatever procedures you feel are adequate.

The ANSYS program activates some UPFs (such as user elements) automatically when you use them. For example, to activate a user element, all you need to do is specify it as one of the element types in the model (via the ET command), set the element type attribute pointer (via the TYPE command) ), and define elements using the solid modeling (AMESH, VMESH, etc.) or direct generation (ET, etc.) method.

For other UPFs, you must issue the USRCAL command to activate them. If you fail to issue the command, standard ANSYS logic applies by default.

For example, when you apply a convection load, the default is to use standard ANSYS logic even if you have linked a user convection routine. You must activate the appropriate user routine with the USRCAL command if you want the user convection routine to be used. Refer to the USRCAL command description for a list of user routines affected by the command. Use the NSVR command to define the number of extra variables that need to be saved for such user-programmable element options as user plasticity. (The NSVR command has no equivalent GUI path.)

Another useful command is /UCMD, which allows you to create your own command from a user routine. Suppose you link in a user routine for a parabolic distribution of pressure. If you name the routine USERnn (where nn = 01 to 10), you can create your own command to call the routine:

/UCMD,PARAB,1

PARAB now becomes a valid ANSYS command that simply calls the user routine USER01. You can call up to ten such user routines as commands. By including /UCMD commands in your start-up file (start150.ans), you can make the user routines available in all of your ANSYS sessions.

14.1.2. Types of UPFs Available

Many UPFs are available in the ANSYS program. Following is a brief description of each:

User-Programmable Features Available in ANSYS

User-defined elements Allows you to define your own element type. You can add it to the element library and use it as you would any other element. See User-Defined Elements in the Element Reference, and Creating a New Element in the Guide to UserProgrammable Features.

User-defined materials Allows you to define your own material model. See User-Defined Material Model, and Subroutines for Customizing Material Behavior in the Guide to UserProgrammable Features.

 

Release 15.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information

338

of ANSYS, Inc. and its subsidiaries and affiliates.