Sie sind auf Seite 1von 33

17.

0 Release

Module 04: APDL and Commands Objects


ANSYS Mechanical Heat Transfer

1 © 2016 ANSYS, Inc. July 14, 2016


Module 04 Topics
1. ANSYS Parametric Design Language Introduction
2. ACT Extensions for Thermal Analysis
3. APDL Command Language
4. Using Command Objects
5. Named Selections
6. Examining the Input File
7. Demonstration – Radiating Fin Model with Command Objects
8. Workshop 04.1 – Cup of Coffee
9. Workshop 04.2 – Surface to Surface Radiation
OBJECTIVE: To provide some insight and awareness about how Command Objects can be used
to do advanced thermal analyses and access MAPDL features while leveraging the usability of
ANSYS/Mechanical.
2 © 2016 ANSYS, Inc. July 14, 2016
04.01 ANSYS Parametric Design Language Introduction
Despite the streamlined user interface the Mechanical solver (ANSYS/MAPDL) is command
driven behind the scenes.
A sequence of commands are submitted to the program as a result of the object details in the
model tree, however commands can also be input directly.
In many cases very few commands are required to leverage additional features (loads, BCs,
elements, materials, interfacial physics etc., not yet available through Workbench’s
ANSYS/Mechanical interface.
Examples
• Convection conditions to remote points or extra nodes.
Built-in interface supports prescribe fluid or bulk temperature.
Useful if fluid temperature is a solution variable or tied to a thermal network.
• Through thickness heat conduction for thermal shells.
• Coupled temperature-displacement solutions with coupled field elements.
• No longer needed for phase change, since the recent implementation of enthalpy curve in Engineering Data.

3 © 2016 ANSYS, Inc. July 14, 2016


04.02 ACT Extensions for Thermal Analysis
What is ACT?

• Some users will encapsulate command


objects into the ANSYS/Mechanical GUI
through the Application Customization
Toolkit (ACT).
• This allows these add-on features to behave
like native features.
• Some ACT Extensions are available from the
Customer Portal in the Application.
• Convection 17
• Piezo and MEMS 17
Disclaimer: these are “use at your own risk”

4 © 2016 ANSYS, Inc. July 14, 2016


04.02 ACT Extensions for Thermal Analysis

• You can access the ANSYS ACT


Application Store from the Customer
Portal.
• Most of the Applications are free. You
can recognize them from the blue
triangle on the top left.

5 © 2016 ANSYS, Inc. July 14, 2016


04.02 ACT Extensions for Thermal Analysis

You can find below some extensions that can be used in a Thermal Analysis.

6 © 2016 ANSYS, Inc. July 14, 2016


04.02 APDL Command Language
Command Structure:
• Commands are comma ‘,’ delimited.
• Extra spaces are unimportant (e.g. “N,1” is no different than “N, 1”).
• Commands are not case sensitive (e.g. del = DeL).
- Note: we will use caps here simply to differentiate the actual commands.
• The “ANSYS Mechanical APDL Command Reference” contains descriptions and
syntax for all commands.
• Command files can be created, edited and viewed in simple text editors like
Notepad.

7 © 2016 ANSYS, Inc. July 14, 2016


04.02 APDL Command Language

Command Structure:
• Let’s look at the “N” command. This command is used to
create a node.
• From the commands manual we see the structure is:
– N, NODE, X, Y, Z, THXY, THYZ, THZX:
• N: the command name to create a node.
• NODE: enter a number which will identify the node being created.
• X, Y, Z: coordinate locations in the active coordinate system.
• THXY, THYZ, THZX: rotations about active coordinate axes.
– For example “N, 250, 10, 0, 15” would result in node number 250 being created at x=10, y=0 and z=15 in the active
coordinate system (also note that no entry was required for rotations since none were desired).

When Mechanical executes a “solve” command, an input file (ds.dat) comprised of APDL
commands is read and processed.

8 © 2016 ANSYS, Inc. July 14, 2016


04.02 APDL Command Language

All the APDL commands


and their fields are
documented in the
Mechanical APDL
Command Reference

9 © 2016 ANSYS, Inc. July 14, 2016


04.03 APDL Command Language
When a command object is inserted in the Mechanical tree, the commands are
executed in a specific order.
• Each command object indicates where it will be executed in its header.

- The model must be solved with the same Unit System that was active when the
commands were created.
• In some cases useful local variables are made available within a command object.

10 © 2016 ANSYS, Inc. July 14, 2016


04.04 Using Command Objects
Another example: Command Objects and Bodies.
• Separate Command Objects for each Body.
• Command Object preloads matid (material id) for linking the commands to a
specific body.
• Often used to change element types, element options or material properties.

11 © 2016 ANSYS, Inc. July 14, 2016


04.04 Using Command Objects

• Command Objects are persistent features and tied to the model and its tree.
• Command Objects can be suppressed or active, like any other model feature.
• Multiple command objects can be inserted in the tree at their usual locations.

WITHOUT COMMAND OBJECT FEATURES THE USER WOULD NEED TO MODIFY THE INPUT
FILES BEFORE EACH ANALYSIS EXECTION, EITHER MANUALLY OR THROUGH SCRIPTING

COMMAND OBJECTS PROVIDE A NATURAL WAY TO CUSTOMIZE MODEL INPUTS AND


RENDER THEM PERSISTENT

12 © 2016 ANSYS, Inc. July 14, 2016


04.04 Using Command Objects
Command objects can be parameterized via their details.
Up to 9 input arguments are available as local variables.
For example, “ARG1” is used to enter node number data into the “N”
command below.
The value in the details for ARG1 is substituted in the expression in the
command object.

13 © 2016 ANSYS, Inc. July 14, 2016


04.04 Using Command Objects
Command objects may also be used to retrieve information Data is extracted using the *GET
command (see the “ANSYS Parametric Design Language Guide” for full details).
• *GET retrieves information and assigns a parameter name to the values.
• Thus: *GET, parameter name, . . .

An output search prefix allows users to retrieve this parametric data to a command object
(default is “my_” but is user controlled).
• For example “MY_temperature” could be included in a command object and the result would be retrieved.
• The search prefix is not case sensitive.

14 © 2016 ANSYS, Inc. July 14, 2016


04.04 Using Command Objects
Some*GET functions have shortcut forms:

15 © 2016 ANSYS, Inc. July 14, 2016


04.04 Using Command Objects
In this example a command object is included in the Solution
branch.
The *GET command is written to retrieve the temperature at node
number 250.
That value is to be returned in a parameter called
“MY_temperature”.

The result is returned to the details of the command object.

16 © 2016 ANSYS, Inc. July 14, 2016


04.05 Named Selection Control
Workbench’s ANSYS/Mechanical:
• Named selections are groups of entities (e.g vertices, surfaces, etc.) which are related to one another by a
common name.
• A named selection allows users to control all related entities as a group rather than individually.
• In addition to the common Workbench Mechanical uses above, a named selection is “recognized” by the
ANSYS APDL solver in special ways.
• “Nodal Named Selection” and “Elemental Named Selection “ are also possible.
Mechanical APDL:
• In ANSYS APDL groups like named selections are referred to as “components”.
• A named selection created in Workbench Mechanical will become a component (of the same name) within
ANSYS Mechanical APDL.
• Named Selection to Component transfer:
- Vertex, Line or Surface NS = Nodal component.
- Body NS = Element component.

17 © 2016 ANSYS, Inc. July 14, 2016


04.05 Named Selection Control
A named selection provides a “bridge” from Workbench to APDL
for identifying parts of a model.
• Example: we would like to use the “SF” command to apply a
heat flux using a command branch.
• First the surfaces where the heat flux will be applied are grouped as a
named selection.
• The “name” is then used in the APDL command.

18 © 2016 ANSYS, Inc. July 14, 2016


04.06 Examining the Model Input

Two most common methods:


1. RMB on Solution branch and Use text editor to view input file (ds.dat) in the
“Solver Files Directory”.
2. Write the input file before executing solve, and peruse with a text editor.

Method 1 Method 2
19 © 2016 ANSYS, Inc. July 14, 2016
04.06 Examining the Model Input

ds.dat file viewed with


Notepad++

20 © 2016 ANSYS, Inc. July 14, 2016


Demonstration: Radiating Fins with
Internal Convection Commands Objects
ANSYS Mechanical Heat Transfer

21 © 2016 ANSYS, Inc. July 14, 2016


04.07 Demonstration – Radiating Fin Model
Consider Thermal Boundary Conditions for Baseline Model:
• Fins radiate to each other and to space (uses periodic symmetric for viewfactor calculations).
• Internal convection with prescribed film coefficient and internal temperature.
• Note: Model uses cyclic symmetry conditions.
• Conductivity = 0.185 W/mm2-C, h=2.0E-5 W/mm2-C, Tf=80°C.
Space ambient 250C

Periodicity (for
radiation view
factors)

22 © 2016 ANSYS, Inc. July 14, 2016


04.07 Demonstration – Radiating Fin Model
Temperature Results

• Part cools 20-25C with


convection to
prescribed 80C fluid
temperature.
• Total heat radiated and
convected is ~106 W/s.

4X

23 © 2016 ANSYS, Inc. July 14, 2016


04.07 Demonstration – Radiating Fin Model
Override Material Property of Body

• MATID is loaded into the Command Object’s attached body.


– In this way the Command Object is a child of a part/body.
– Command object is a persistent feature of the model.
• Convenient for changing element options, materials on a body/part basis.
– Example MP command below simply overwrites the conductivity with a value.
• Must take care with units (ANSYS/MAPDL will not convert units).

24 © 2016 ANSYS, Inc. July 14, 2016


04.07 Demonstration – Radiating Fin Model
Adding fluid pipe element

• Instead of convection to a prescribed


temperature, let us convect to a fluid pipe
element defined by pair of nodes.
• Prescribe the inlet temperature.
• Prescribe mass flow rate from node I to node J.
• ANSYS will calculate outlet temperature.
• Convects to a 𝑻𝒇 temperature by an
interpolated location on the FLUID116 element
(2 extra nodes) or a node on the FLUID116
element (1 extra node).

FLUID116 fluid-pipe element is now available in Workbench Mechanical. Check Workshop 05.1.

25 © 2016 ANSYS, Inc. July 14, 2016


04.07 Demonstration – Radiating Fin Model
Command Object to Insert Pipe Element and Nodes
Input arguments,
(e.g. Mass Flow
Rate, Inlet
Temperature,
axial location of
nodes)

ADPL Commands
to assign IDs and
create the extra
Command to create an element nodes
26 © 2016 ANSYS, Inc. July 14, 2016
04.07 Demonstration – Radiating Fin Model
Adding Features – convection to external node
ANSYS/Mechanical Supports convection to a
prescribed temperature, and relies on the
SURF152 element type.
ANSYS/MAPDL’s SURF152 Element support
convection to either one extra node, or two
extra nodes.
USE a command object to add 2 extra nodes
to the convection surface, SURF152 elements.
These nodes, in this case, are shared with the
fluid pipe element.
Allows fluid temperature for convection to be
a temperature DOF or interpolated
therefrom.
Note: this feature is also accessible through an ACT Extension

27 © 2016 ANSYS, Inc. July 14, 2016


04.07 Demonstration – Radiating Fin Model
Modifying Convection
• Convection is handled with “Surface Effect Elements”
SURF 152.
• When using Command Object to modify loads and BCs,
we often assign regions to Named Selections that can be
reused with APDL “selection logic”.
– Here, InsideSurface and InsideSurfaceNodes are available as APDL
components.

1. Select nodes involved in convection

2. Specify that SURF element has 2


extra nodes for convection

3. Add the nodes with EMODIF command

28 © 2016 ANSYS, Inc. July 14, 2016


04.07 Demonstration – Radiating Fin Model
ሶ 1.E-5 kg/s & Tinlet=80C
Solution: for 𝒎=

Note that internal Input Arguments


temperatures drop is less
than before, 12-20°C.

Gradient in direction of flow


(i.e. fluid picks up heat in
advection direction).

Bulk fluid temperature for


convection varies along axis.

Total Heat Transfer Drop after


from 106 W/s to ~ 66 W/s. before

29 © 2016 ANSYS, Inc. July 14, 2016


04.07 Demonstration – Radiating Fin Model
Postprocessing Command Objects

Can create plots with MAPDL and


store the figures/plots in the model
tree.
Can use APDL to carry out
calculations, retrieve results and do
operations on retrieved results …
for cases.
Augments user-defined results
feature.
Retrieving fluid node temperatures
shows that Toutlet =208.3°C and
mean fluid temp is 144°C.
30 © 2016 ANSYS, Inc. July 14, 2016
04.07 Demonstration – Radiating Fin Model
Postprocessing Command Objects

• This example from a phase


change simulation shows access
to a graphical results plot
generated in ANSYS/MAPDL.

• The plot figure is persistent and


maintained in the model tree.
31 © 2016 ANSYS, Inc. July 14, 2016
04.08 Workshop 04.1 – Cup of Coffee
Please refer to your Workshop Supplement for instructions on:
Workshop 04.1 – Cup of Coffee

32 © 2016 ANSYS, Inc. July 14, 2016


04.09 Workshop 04.2 – Surface to Surface Radiation
Please refer to your Workshop Supplement for instructions on:
Workshop 04.2 – Surface to Surface Radiation

33 © 2016 ANSYS, Inc. July 14, 2016

Das könnte Ihnen auch gefallen