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

vk.com/club152685050 | vk.com/id446425943

Modifying the Adaptive Meshing Process

Figure 3.1: Selective Adaptivity

Selective adaptivity can improve the performance of models having concentrated loads.

If you select a set of keypoints, the ADAPT macro will still include all your keypoints (that is, the ADAPT macro will modify the mesh at both selected and non-selected keypoints), unless you also set KYKPS

= 1 in the ADAPT command (Main Menu> Solution> Solve> Adaptive Mesh).

If you select a set of areas or volumes, the ADAPT macro will adjust element sizes only in those regions that are in the selected set. You will have to mesh your entire model in PREP7 before executing ADAPT.

3.3.2. Customizing the ADAPT Macro with User Subroutines

The standard ADAPT macro might not always be applicable to your particular analysis needs. For instance, you might need to mesh both areas and volumes, which is not possible with the standard macro. For

this and other such situations, you can modify the ADAPT macro to suit your analysis needs. By using a macro to perform the adaptive meshing task, we have intentionally given you access to the logic involved, and have thereby furnished you with the capability for modifying the technique as you might desire.

Fortunately, you do not always need to change the coding within the ADAPT macro to customize it. Three specific portions of the macro can be readily modified by means of user subroutines, which are separate user files that you can create and that will be called by the ADAPT macro. The three features that can be modified by user subroutines are:

the meshing command sequence

the boundary condition command sequence,

the solution command sequence

The corresponding user subroutine files must be named ADAPTMSH.MAC, ADAPTBC.MAC, and ADAPTSOL.MAC, respectively.

3.3.2.1. Creating a Custom Meshing Subroutine (ADAPTMSH.MAC)

By default, if your model contains one or more selected volumes, the ADAPT macro will mesh only volumes (no area meshing will be done). If you have no selected volumes, then the ADAPT macro will

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

 

of ANSYS, Inc. and its subsidiaries and affiliates.

81

! Mesh areas 3 and 5 (no other areas will be meshed by ADAPT) ! Change element type for volume mesh
! Mesh all volumes

vk.com/club152685050Adaptive Meshing | vk.com/id446425943

mesh only areas. If you desire to mesh both volumes and areas, you can create a user subroutine, ADAPTMSH.MAC, to perform all the desired operations. You will need to clear any specially-meshed entities before remeshing. Such a subroutine might look like this:

C*** Subroutine ADAPTMSH.MAC

- Your name

- Job

Name -

Date Created

TYPE,1

! Set element

TYPE attribute

for area meshing

ACLEAR,3,5,2

! Clear areas

and volumes

to

be

meshed

by this subroutine

VCLEAR,ALL

AMESH,3,5,2

TYPE,2

VMESH,ALL

Please see the TYPE, ACLEAR, VCLEAR, AMESH, and VMESH command descriptions for more information.

We strongly recommend that you include a comment line (C***) to identify your macro uniquely. This comment line will be echoed in the job printout, and will provide assurance that the ADAPT macro has used the correct user subroutine.

3.3.2.2. Creating a Custom Subroutine for Boundary Conditions (ADAPTBC.MAC)

The ADAPT macro clears and remeshes with every new solution loop. As a result, your model's nodes and elements will be repeatedly changing. This situation generally precludes the use of finite element loads, DOF coupling, and constraint equations, all of which must be defined in terms of specific nodes and elements. If you need to include any of these finite-element-supported items, you can do so by writing a user subroutine, ADAPTBC.MAC. In this subroutine, you can select nodes by their location,

and can then define finite element loads, DOF coupling, and constraint equations for the selected nodes. A sample ADAPTBC.MAC subroutine follows:

C*** Subroutine ADAPTBC.MAC - Your name -

Job Name - Date Created

NSEL,S,LOC,X,0

! Select nodes @ X=0.0

 

D,ALL,UX,0

! Specify UX=0.0 for all

selected nodes

NSEL,S,LOC,Y,0

! Select nodes @ Y=0.0

 

D,ALL,UY,0

! Specify UY=0.0 for all

selected nodes

NSEL,ALL

! Select all nodes

 

3.3.2.3. Creating a Custom Solution Subroutine (ADAPTSOL.MAC)

The default solution command sequence included in the ADAPT macro is simply:

/SOLU SOLVE FINISH

This default sequence will solve only a single load step. You might be able to implement other solution sequences by incorporating them into the user subroutine ADAPTSOL.MAC.

3.3.2.4. Some Further Comments on Custom Subroutines

You can create the ADAPTMSH.MAC, ADAPTBC.MAC, and ADAPTSOL.MAC subroutine files as you would any user files.

You can use either the APDL command *CREATE (Utility Menu> Macro> Create Macro), the APDL command *END, or a third-party text editor. When the ADAPT macro calls the subroutines, the program will search first through the ANSYS root directory, then through your root directory, and last through the current directory. Thus, you should take care to ensure that no identically-named files from another directory will be read in place of your intended files. The comment lines (C***) shown in the example subroutines above would be echoed in your printout, and would provide one means of checking that

the proper files were used. Additionally, executing /PSEARCH,OFF (Utility Menu> Macro> Macro Search

 

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

82

of ANSYS, Inc. and its subsidiaries and affiliates.