## General Mechanical

#### Problems with esel

• John Miller
Subscriber

Hello together,

I’m struggling a little bit with the element selection of in /prep7-created thermal surface elements.

The model is really simple a cube with convection load at the surfaces, except the top surface.

Model:

Cube 10 mm x 10 mm x 10 mm

208 nodes

40 nodes on the top surface

27 elements

148 nodes at the exterior surface, except the top surface (I know the corner nodes)

And 9 elements contain the nodes of the top surface

The code for the creation of surf152 elements looks like:

/prep7

/GOPR

/com,*********************Start surf152*********************

nsel,none

esel,none

esel,s,ename,,surf152         ! Element selection of surf152 elements

nsel,stat

esel,stat

cm,ELsurf152,elements         ! Create a component which includes surf152 elements

nsel,stat

esel,stat

edele,ELsurf152               ! Deletion of former surf152 elements

nsel,stat

esel,stat

et,100,152,,,,,0              ! KEYOPT(5) = 0, No extra nodes.

cmsel,s,external,node         ! Select nodes for esurf

nsel,stat

esel,stat

esln,s,0                      ! Select the elements of the selected nodes

nsel,stat

esel,stat

type,100                      ! Asign element type 100

esurf                         ! Surface Elements generation

nsel,stat

esel,stat

allsel,all

/com,*********************Ende surf152*********************

/solu

And the corresponding solver output is:

***** ANSYS ANALYSIS DEFINITION (PREP7) *****

*********************Start surf152*********************

NONE SELECT  FOR ITEM=NODE COMPONENT=

IN RANGE         1 TO        208 STEP          1

0  NODES (OF        208  DEFINED) SELECTED BY NSEL  COMMAND.

NONE SELECT  FOR ITEM=ELEM COMPONENT=

IN RANGE         1 TO        126 STEP          1

0  ELEMENTS (OF         72  DEFINED) SELECTED BY ESEL  COMMAND.

SELECT       FOR ITEM=ENAM COMPONENT=

IN RANGE       152 TO        152 STEP          1

45  ELEMENTS (OF         72  DEFINED) SELECTED BY  ESEL  COMMAND.

****** STATUS OF NODES ******

NUMBER OF SELECTED NODES=         0

NUMBER OF DEFINED NODES=        208

MAXIMUM NODE NUMBER=            208

****** STATUS OF ELEMENTS ******

NUMBER OF SELECTED ELEMENTS=        45

NUMBER OF DEFINED ELEMENTS=         72

MAXIMUM ELEMENT NUMBER=            126

DEFINITION OF COMPONENT = ELSURF152  ENTITY=ELEM

****** STATUS OF NODES ******

NUMBER OF SELECTED NODES=         0

NUMBER OF DEFINED NODES=        208

MAXIMUM NODE NUMBER=            208

****** STATUS OF ELEMENTS ******

NUMBER OF SELECTED ELEMENTS=        45

NUMBER OF DEFINED ELEMENTS=         72

MAXIMUM ELEMENT NUMBER=            126

*** WARNING ***                         CP =       0.547   TIME= 11:00:35

Assembly ELSURF152 is deleted.

****** STATUS OF NODES ******

NUMBER OF SELECTED NODES=         0

NUMBER OF DEFINED NODES=        208

MAXIMUM NODE NUMBER=            208

****** STATUS OF ELEMENTS ******

NUMBER OF SELECTED ELEMENTS=         0

NUMBER OF DEFINED ELEMENTS=         27

MAXIMUM ELEMENT NUMBER=            126

ELEMENT TYPE        100 IS SURF152      3-D THERMAL SURFACE

KEYOPT( 1- 6)=        0      0      0        0      0      0

KEYOPT( 7-12)=        0      0      0        0      0      0

KEYOPT(13-18)=        0      0      0        0      0      0

CURRENT NODAL DOF SET IS  TEMP

THREE-DIMENSIONAL MODEL

SELECT      COMPONENT EXTERNAL

****** STATUS OF NODES ******

NUMBER OF SELECTED NODES=        16

NUMBER OF DEFINED NODES=        208

MAXIMUM NODE NUMBER=            208

****** STATUS OF ELEMENTS ******

NUMBER OF SELECTED ELEMENTS=         0

NUMBER OF DEFINED ELEMENTS=         27

MAXIMUM ELEMENT NUMBER=            126

SELECT      ALL ELEMENTS HAVING ANY NODE IN NODAL SET.

9 ELEMENTS (OF         27  DEFINED) SELECTED FROM

16 SELECTED NODES BY  ESLN COMMAND.

****** STATUS OF NODES ******

NUMBER OF SELECTED NODES=        16

NUMBER OF DEFINED NODES=        208

MAXIMUM NODE NUMBER=            208

****** STATUS OF ELEMENTS ******

NUMBER OF SELECTED ELEMENTS=         9

NUMBER OF DEFINED ELEMENTS=         27

MAXIMUM ELEMENT NUMBER=            126

ELEMENT TYPE SET TO       100

GENERATE ELEMENTS ON SURFACE DEFINED BY SELECTED NODES

TYPE=      100  REAL=        1  MATERIAL=        1  ESYS=    0

NUMBER OF ELEMENTS GENERATED=          1

****** STATUS OF NODES ******

NUMBER OF SELECTED NODES=        16

NUMBER OF DEFINED NODES=        208

MAXIMUM NODE NUMBER=            208

****** STATUS OF ELEMENTS ******

NUMBER OF SELECTED ELEMENTS=        10

NUMBER OF DEFINED ELEMENTS=         28

MAXIMUM ELEMENT NUMBER=            127

SELECT ALL ENTITIES OF TYPE= ALL  AND BELOW

*********************Ende surf152*********************

Why are 45 elements selected via esel ?

SELECT       FOR ITEM=ENAM COMPONENT=
IN RANGE       152 TO        152 STEP          1

45  ELEMENTS (OF         72  DEFINED) SELECTED BY  ESEL  COMMAND.

There shouldn'be any surf152 elements because it's the first step!

The output indicated that one surface element is created, I guess at the centre of the top surface. Because all external nodes of the element surface are necessary to create a surf152 element at the exterior element surface.

After re-entering the /solu I try to select the in /prep7 created surf152 elements with this code:

nsel,none

esel,none

esel,s,type,,100

esel,s,ename,,152

esel,s,mat,,100

cm,surf_test,elem

allsel,all

outres,all,all

*enddo

The solver output is this:

NONE SELECT  FOR ITEM=NODE COMPONENT=

IN RANGE         1 TO        208 STEP          1

0  NODES (OF        208  DEFINED) SELECTED BY NSEL  COMMAND.

NONE SELECT  FOR ITEM=ELEM COMPONENT=

IN RANGE         1 TO        126 STEP          1

0  ELEMENTS (OF         72  DEFINED) SELECTED BY ESEL  COMMAND.

*** WARNING ***                         CP =       0.797   TIME= 11:00:37

Entity 100 is undefined.  The ESEL command is ignored.

SELECT       FOR ITEM=ENAM COMPONENT=

IN RANGE       152 TO        152 STEP          1

45  ELEMENTS (OF         72  DEFINED) SELECTED BY  ESEL  COMMAND.

SELECT       FOR ITEM=MAT  COMPONENT=

IN RANGE       100 TO        100 STEP          1

0  ELEMENTS (OF         72  DEFINED) SELECTED BY  ESEL  COMMAND.

DEFINITION OF COMPONENT = SURF_TEST  ENTITY=ELEM

SELECT ALL ENTITIES OF TYPE= ALL  AND BELOW

WRITE ALL  ITEMS TO THE DATABASE WITH A FREQUENCY OF ALL

FOR ALL APPLICABLE ENTITIES

*ENDDO  INDEX= I

I don’t understand this, because one surf152 element is created in the /prep7, but in the /solu I can’t select it via esel.

I also don't understand why 45 surf152 are selected prior in the /prep7 in the first step, there shouldn't be any of these

With best regards

John

• Daniel Shaw
Ansys Employee

It is difficult to debug MAPDL scripting in Mechanical without the model and full access to the script?  For example, it is not clear why you believe that there are no SURF154 in the 1st load step. Did you create the surf elements in 2nd load step?  I recommend that you open a Service Request through the Customer Portal, so that you can provide the model to us.