Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3....
Transcript of Ansys via scripts - CERNgarfieldpp.web.cern.ch/.../examples/gem/fem_gem_part2.pdf · 2018. 3....
![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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/1.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/2.jpg)
Good ideas:/CLEAR at the start;mousecopy & paste from an editor into the Ansys command window;restart regularly.
Format conventions:! comment;/command: higher level;case insensitive;commaseparated 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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/3.jpg)
Making a GEMStrategy:
initialisation;define materials;define parameters;identify smallest unit;construct the GEM sheet:
assemble a copperpolyimidecopper 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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/4.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/5.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/6.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/7.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/8.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/9.jpg)
Command descriptions
Ansys has a builtin 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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/10.jpg)
GEM – making a drill bit
Commands:
Viewing just the piece:vsel,s,,,9vplot
beware of the sideeffects !
![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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/11.jpg)
GEM – second cutout
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/12.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/13.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/14.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/15.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/16.jpg)
GEM – boundary conditions
Request Efield ∥ 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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/17.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/18.jpg)
GEM – solving and displaying
Commands to solve:
Display the potential:
Enter solution processorSolveLeave solution processor
Enter postprocessorShow 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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/19.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081619/60f97032578b120f2025060f/html5/thumbnails/20.jpg)
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]