0% found this document useful (0 votes)
5 views30 pages

Mech HeatTransfer 15.0 L08 CommandObjects

The document discusses using Command Objects in ANSYS Mechanical to perform advanced thermal analyses by leveraging APDL features. It provides an introduction to APDL commands and using Command Objects to customize model inputs. An example is presented of modeling radiating fins with internal convection using Command Objects.

Uploaded by

invasor86
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)
5 views30 pages

Mech HeatTransfer 15.0 L08 CommandObjects

The document discusses using Command Objects in ANSYS Mechanical to perform advanced thermal analyses by leveraging APDL features. It provides an introduction to APDL commands and using Command Objects to customize model inputs. An example is presented of modeling radiating fins with internal convection using Command Objects.

Uploaded by

invasor86
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/ 30

Lecture 8

APDL and Command Objects


15.0 Release

ANSYS Mechanical Heat Transfer

1 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


Chapter Contents
A. Introduction to APDL commands, solver input files and ACT

B. Using Command Objects

C. Named Selections

D. Examining the Input File

E. Demonstration – Radiating Fin Model with Command Objects

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 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


A. APDL 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 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 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


ACT Extensions
• 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
• Convection to extra/nodes
• Coupled field element (e.g. temperature-
displacement)
• Disclaimer: these are “use at your own risk”

4 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


ACT Extensions for Thermal Analysis

5 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


ANSYS Parametric Design Language (APDL)
• 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

6 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


. . . ANSYS 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.
7 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential
ANSYS APDL Command Language

All the APDL commands and their


fields are documented in the
Mechanical APDL Command
Reference

8 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


B. Using Command Objects
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

• In some cases useful local variables are made available within a command object

9 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


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

10 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


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
11 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential
. . . 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

12 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


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

13 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


GET Functions
Some*GET functions have shortcut forms:

14 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


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

15 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


C. 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
• Revision 15 supports the concept of “Nodal Named Selection,” for explicit reference to node entities

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
16 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential
. . . 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

17 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


D. 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
18 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential
… Examining the Model Input

ds.dat file viewed with


Notepad++

19 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


Radiating Fins with Internal Convection
Command Objects Demonstration
15.0 Release

ANSYS Mechanical Heat Transfer

20 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


E. 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=80C
Space ambient 250C

Periodicity (for
radiation view
factors)

21 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


Temperature Results

• Part cools 20-25C


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

4X

22 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


Simple Command Object to 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).

23 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


Adding Features – advecting 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 elements are added to the model through a Command Object

24 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


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
25 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential
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

26 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


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

27 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


Solution: for 𝒎= 1.E-5 kg/s & Tinlet=80C

Note that internal


Input Arguments
temperatures drop is less
than before, 12-20C

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


from 106 W/s to ~ 66 W/s before
after
28 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential
Post Processing 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.3C and mean
fluid temp is 144C

29 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential


Post Processing Command Objects - Figures

• 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

30 © 2013 ANSYS, Inc. September 15, 2014 ANSYS Confidential

You might also like