MAPDL server connection terminated #652
-
Good day Could somebody give me some insight into why my script keeps failing.It an acoustic harmonic analysis of a fluid filled pipe. It really only seams to fail during the mapdl.solve command. It works fine when I run it from Mechanical APDL. Thanks in advance. from ansys.mapdl import core as pymapdl
from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl( loglevel="DEBUG")
print(mapdl)
mapdl.run("/CLEAR")
mapdl.run("/UIS,MSGPOP,2")
mapdl.keyw("PR_SGVOF", 1)
mapdl.run("/NERR,5,10000, ,0,5,")
Radius = 0.0359/2
Height = 1.03
Thickness = 0.00325
Dens_Fluid = 998
Sonc_Fluid = 1482
Ex_Solid = 200e9
PRXY_Solid = 1482
Dens_Solid = 7850
mapdl.prep7()
mapdl.mute
mapdl.cylind(Radius, 0, 0, Height, 0, 360)
mapdl.et(1, 220, 0, 0)
mapdl.mp("DENS", 1, Dens_Fluid)
mapdl.mp("SONC", 1, Sonc_Fluid)
mapdl.et(2, 281)
mapdl.mp("EX", 2, Ex_Solid)
mapdl.mp("DENS", 2, Dens_Solid)
mapdl.mp("PRXY", 2, PRXY_Solid)
mapdl.sectype(2, "SHELL")
mapdl.secdata(Thickness, 2)
mapdl.type(1)
mapdl.mat(1)
mapdl.secnum(1)
mapdl.vsel("", "", "", 1)
mapdl.vsweep("ALL")
mapdl.type(2)
mapdl.mat(2)
mapdl.secnum(2)
mapdl.asel("S", "", "", 1)
mapdl.asel("A", "", "", 2)
mapdl.asel("A", "", "", 3)
mapdl.asel("A", "", "", 4)
mapdl.nsla("S", 1)
mapdl.esurf()
mapdl.sfa(1, "", "FSI")
mapdl.sfa(2, "", "FSI") ,
mapdl.sfa(3, "", "FSI")
mapdl.sfa(4, "", "FSI")
mapdl.allsel("ALL")
mapdl.finish()
mapdl.run("/SOLU")
mapdl.antype("HARMIC")
mapdl.hropt("VT")
mapdl.hrout("OFF")
mapdl.outpr("BASIC", 1)
mapdl.nsubst(80)
mapdl.harfrq(50, 1500)
mapdl.kbc(1)
mapdl.f(100, "FX", 1)
mapdl.solve() |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
you need triple backticks to get formatted block-code in markdown; I edited the post for you to set this up. Otherwise I'll give your code a proper look now :) |
Beta Was this translation helpful? Give feedback.
-
@alexanderludick The code seems to run OK for me, although there are a couple of errors in the code snippet you provided that could be affecting things (although I'm not sure how they'd make the script fail). My revised version is below: # import isn't used
# from ansys.mapdl import core as pymapdl
from ansys.mapdl.core import launch_mapdl
mapdl = launch_mapdl( loglevel="DEBUG")
print(mapdl)
mapdl.run("/CLEAR")
mapdl.run("/UIS,MSGPOP,2")
mapdl.keyw("PR_SGVOF", 1)
mapdl.run("/NERR,5,10000, ,0,5,")
Radius = 0.0359/2
Height = 1.03
Thickness = 0.00325
Dens_Fluid = 998
Sonc_Fluid = 1482
Ex_Solid = 200e9
PRXY_Solid = 1482
Dens_Solid = 7850
mapdl.prep7()
# to mute the output, mapdl.mute needs to be set to True. Just calling the property isn't enough.
# mapdl.mute
mapdl.mute = True
mapdl.cylind(Radius, 0, 0, Height, 0, 360)
mapdl.et(1, 220, 0, 0)
mapdl.mp("DENS", 1, Dens_Fluid)
mapdl.mp("SONC", 1, Sonc_Fluid)
mapdl.et(2, 281)
mapdl.mp("EX", 2, Ex_Solid)
mapdl.mp("DENS", 2, Dens_Solid)
mapdl.mp("PRXY", 2, PRXY_Solid)
mapdl.sectype(2, "SHELL")
mapdl.secdata(Thickness, 2)
mapdl.type(1)
mapdl.mat(1)
mapdl.secnum(1)
mapdl.vsel("", "", "", 1)
mapdl.vsweep("ALL")
mapdl.type(2)
mapdl.mat(2)
mapdl.secnum(2)
mapdl.asel("S", "", "", 1)
mapdl.asel("A", "", "", 2)
mapdl.asel("A", "", "", 3)
mapdl.asel("A", "", "", 4)
mapdl.nsla("S", 1)
mapdl.esurf()
mapdl.sfa(1, "", "FSI")
# rogue comma on next line?
# mapdl.sfa(2, "", "FSI") ,
mapdl.sfa(2, "", "FSI")
mapdl.sfa(3, "", "FSI")
mapdl.sfa(4, "", "FSI")
mapdl.allsel("ALL")
mapdl.finish()
mapdl.run("/SOLU")
mapdl.antype("HARMIC")
mapdl.hropt("VT")
mapdl.hrout("OFF")
mapdl.outpr("BASIC", 1)
mapdl.nsubst(80)
mapdl.harfrq(50, 1500)
mapdl.kbc(1)
mapdl.f(100, "FX", 1)
mapdl.solve() |
Beta Was this translation helpful? Give feedback.
@alexanderludick The code seems to run OK for me, although there are a couple of errors in the code snippet you provided that could be affecting things (although I'm not sure how they'd make the script fail).
My revised version is below: