ansys via scripts - cerngarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3....

20
Ansys via scripts Although perfectly possible, running Ansys via the GUI is not possibly less than perfect: not easy to send a model to a friend; laborious to make small modifications; picking areas requires training; difficult to ensure reproducibility. For the GEM, we'll use a script instead. The GUI is useful to get a skeleton script: See what you have done: File  List  Log File ...

Upload: others

Post on 25-Feb-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

Ansys via scripts

Although perfectly possible, running Ansys via the GUI is not possibly less than perfect:

not easy to send a model to a friend;laborious to make small modifications;picking areas requires training;difficult to ensure reproducibility.

For the GEM, we'll use a script instead.The GUI is useful to get a skeleton script:See what you have done:  File  List  Log File ...

Page 2: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

Good ideas:/CLEAR at the start;mouse­copy & paste from an editor into the Ansys command window;restart regularly.

Format conventions:! comment;/command: higher level;case insensitive;comma­separated keywords.

Exercise:try an inner radius of 0.0100 and understand why this fails.

Page 3: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

Making a GEMStrategy:

initialisation;define materials;define parameters;identify smallest unit;construct the GEM sheet:

assemble a copper­polyimide­copper sheet;assemble a drill;subtract;

construct the gas volume:start with a gas volume that occupies the entire unit;subtract the GEM sheet;

eliminate double boundaries;associate a material description with every part;assign boundary conditions;mesh the problem domain;solve;export solution;

Page 4: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – initialisation

Commands:

You'll be asked to confirm you really want to delete everything you've done sofar.

Reset

No elements Garfield can't handle

We're doing electromagnetics

Curved parabolic tetrahedra

Page 5: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – materials

Commands:

RSVX: resistivityPERX: dielectric constant

Page 6: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – parameters

Commands:

This is what makes scripts superior to GUI input. Ansys also has loops and conditional statements.

Page 7: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – unit cell

Modeling more than ½ hole would be a waste !

Page 8: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – building blocks

Commands:

Note the volume numbers – we will need them:

Page 9: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

Command descriptions

Ansys has a built­in help facility.

Click: Help  Help topics, a new window opens, go there; Click: Mechanical APDL   Command Reference   PREP7 Commands

If this is too cumbersome:                                                        http://www.kxcad.net/ansys/ANSYS/ansyshelp/Hlp_C_CmdTOC.html     

Beware ... use exclusively the dark blue underlined links.This documentation is for Ansys version 11, but the differenceswith version 12 are not significant for our purposes.

Page 10: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – making a drill bit

Commands:

Viewing just the piece:vsel,s,,,9vplot

beware of the side­effects !

Page 11: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – second cut­out

Commands:

Viewing both pieces:vsel,s,,,9,10vplot

Do not forget to reselect all other relevant volumes !

Page 12: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – drilling

Commands:

To visualise:vsel,s,,,1,3 vsel,s,,,5vplot vplotvsel,all vsel,all

Page 13: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – contact surfaces

We'll soon apply boundary conditions – to surface areas. Different materials meet in numerous places.  To ensure that the same boundary conditions apply on both sides of such interfaces, we “glue” all volumes:

This changes the volume numbers:

Exercise: work out which volume is which.

Page 14: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – material attributes

Commands:

Volumes:1 – polyimide4 – lower metal5 – gas6 – upper metal

Materials:1 – metal2 – gas3 – polyimide

Page 15: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – boundary conditions

Boundary conditions on the “gas”:

On the GEM metal layers: Volumes:1 – polyimide4 – lower metal5 – gas6 – upper metal

Page 16: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – boundary conditions

Request E­field ∥ surface on gas and polyimide:

Note: This seems to have no effect.

Volumes:1 – polyimide4 – lower metal5 – gas6 – upper metal

Page 17: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – meshing

Commands:

More efficient:

All volumes and areas are to be part of the model.

Fine meshingAll volumes are meshed

Fine meshingOnly gas and polyimide are meshed

Page 18: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – solving and displaying

Commands to solve:

Display the potential:

Enter solution processorSolveLeave solution processor

Enter post­processorShow the solution

Page 19: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

GEM – writing field maps

Commands:

Page 20: Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3. 5. · Ansys via scripts Although perfectly possible, running Ansys via the GUI is not

Warning

“The Finite Element Method is a very useful tool which can make a good engineer better, but it can make a bad engineer dangerous.”

      [Robert D. Cook, Professor of Mechanical Engineering University of Wisconsin, Madison]