-
Get nodal stresses while incorporating power/full graphics
Hello, I'm currently attempting to retrieve nodal stresses from a model utilizing PyMAPDL. My approach involves employing both mapdl.result.nodal_stress and mapdl.post_processing.nodal_component_stress commands. While these commands successfully fetch stress values at the nodes, I aim to integrate the options 'power…
-
Getting "MapdlConnectionError" often when runnung PyMAPDL
Hi Team, We have developed a PyMAPDL script. When we run the script we get frequently the following error: " Error using mapdl_grpc>_multi_connect Python Error: MapdlConnectionError: Unable to connect to MAPDL gRPC instance at 127.0.0.1:50053. Reached either maximum amount of connection attempts (5) or timeout (45 s).The…
-
How can I plot an element table with averaged values in PyMAPDL?
PyVista has a method to convert cell data (one value per element) to point data (averaged value at nodes). The example is a solid mesh of a short stubby beam; and skipping the modeling and solution: import matplotlib as mplcmap1 = (mpl.colors.ListedColormap(['blue','royalblue', 'cyan', '#00FA9A','#7CFC00',…
-
How can I gather element table data of a sub-set of elements?
PyMAPDL has additional methods of retrieving just the data from Mechanical APDL listings. As an example we want to gather a list of lists of some result, like Y deformation, for a sub-set of elements from a full harmonic analysis. This example is a simple 24x4 square shell mesh with one end fixed and the other end an…
-
PyMAPDL exits intermittently when run in a loop
Hi, I'm currently running a PyMAPDL script in a for loop. During each iteration, the script makes slight modifications to the mesh and performs a pre-stressed modal analysis. However, I'm encountering an intermittent issue where PyMAPDL exits with the following error message after few iterations: CRITICAL - pymapdl_global…
-
pymapdl jupyter notebook example
I used the old training example and brought it into jupyternotebook/pymapdl: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v231/en/ans_tut/structural_cb.html The jupyternotebook file is in the attached zip.
-
PyMAPDL exits intermittently while running in a loop when mapdl.input() command is used
Hello, I'm encountering an issue while running a PyMAPDL script in a for-loop for a large number of iterations (approximately 8000). In each iteration, I modify the node locations using an input file and then solve the problem. To change the node locations, I utilize the "mapdl.input(update_nodes.inp)" command, which…
-
PyMAPDL exits intermittently while running in a loop when mapdl.input() command is used
Hello, I'm encountering an issue while running a PyMAPDL script in a for-loop for a large number of iterations (approximately 8000). In each iteration, I modify the node locations using an input file and then solve the problem. To change the node locations, I utilize the "mapdl.input(update_nodes.inp)" command, which…
-
Unable to solve .inp file using pymapdl
Hi, I am trying to access a mechanical model and change the co-eff of friction for contact. But while doing so I am not able to solve the .inp file which I created from mechanical. Can anyone help me with this. The error says "SOLVE is not a recognized BEGIN command" My code is as below: from ansys.mapdl.core import…
-
Modify multiple node positions in PyMAPDL
Hi, I need to modify multiple node positions for a particular model. For this currently, I'm using the command mapdl.n() (also tried mapdl.ngen()) in a loop. This works fine but takes a longer time appx. 70 seconds (since the number of nodes to be modified is large). Whereas when I perform the same task through…
-
Update the mesh in PyAnsys
Hello, I would like to update one mesh with another mesh using a PyMAPDL command. Specifically, I have a .db file that I'll load using the PyMAPDL command mapdl.resume(). After loading it, I save the mesh as a new parameter, let's call it original_mesh. Next, I make some modifications to node locations using the mapdl.n()…
-
Modify multiple node positions in PyMAPDL
Hi, I need to modify multiple node positions for a particular model. For this currently, I'm using the command mapdl.n() (also tried mapdl.ngen()) in a loop. This works fine but takes a longer time appx. 70 seconds (since the number of nodes to be modified is large). Whereas when I perform the same task through…
-
How to read total deformation results for harmonic analysis in MAPDL?
At a particular frequency and particular phase angle, I get one total deformation result in WB Mechanical. I read the same .rst file in MAPDL and I see the results for the same frequency and phase angle, to my dismay, I observe a different result in MAPDL. For example, for 73.859Hz and 20°, I used SET,,,1,3,73.859,20,, in…
-
How does WB Mechanical calculates total deformation for harmonic results?
At a particular frequency and particular phase angle, I get one total deformation result in WB Mechanical. I read the same .rst file in MAPDL and I see the results for the same frequency and phase angle, to my dismay, I observe a different result in MAPDL. For example, for 73.852Hz and 20°, I used SET,,,1,3,73.859,20,, in…
-
How do I get the nearest node to (X,Y,Z) using mapdl.get?
I have some 3D geometry I've constructed in pymapdl and I'm trying to get the nearest node to the coordinates (X, Y, Z). I understand in APDL you would use the N=NODE(X, Y, Z) command as a shortcut for the *GET command. PyMAPDL does not have an equivalent for this (Yet), so I'm trying to write the explicit get command out…
-
Is it possible to do cylindrical simulations using APDL?
Is it possible to do cylindrical simulations using APDL (or pyansys)? And when I say cylindrical, I know you can do periodic simulations on a sector, but can you do it on a 2D mesh? For example, suppose I wanted to model the axial compression of a cylinder of material, is it possible to model that in 2D with cylindrical,…
-
Which element types can I use to mesh areas in PyMAPDL?
So I have a short script, below, that creates 3 areas and I want to mesh the three with elements of size 0.04. However, I need to specify an element type to do so, and I can't find which ones work. Some won't work with amesh at all, and some will say you can't use it with amesh if the areas aren't parallel to the xyz axes.…
-
in pyansys how do I specify two element types?
I have a pyansys script that creates a triangle area, with a 1D link to it. How do I give the area element one element type and the linking line another? (e.g. SOLID186 and LINK1). I think an additional, relevant, question is what does the element type number mean? from ansys.mapdl.core import launch_mapdlmapdl =…
-
What does "PREP7" mean in PyMAPDL?
In pyansys examples I keep seeing the following line at the start of many examples: mapdl.prep7() After some searching I found some documentation in the APDL docs that explains "PREP = PREProcessor", But I can't find any documentation that explains what the "7" means. Can anyone help? The best I've found is this third…