Plot of field lines in Ansys Maxwell (2D Electrostatic)

Lucie
Lucie Member Posts: 3
First Comment
**

I would like to plot the field lines on of the surface of my system. After making the Analyze, I tried to plot lines with this :

app = Maxwell2d()

# Get face IDs of the air block
face_ids = app.modeler.get_object_faces("AirBloc")

   oModule = oDesign.GetModule("FieldsReporter")
    seeding_faces_str = str(seeding_faces[0])

    oModule.CreateFieldPlot(
        [
            "NAME:FieldLineTrace_Plot1",
            "SolutionName:="    , "Setup1 : LastAdaptive",
            "UserSpecifyName:=" , 0,
            "UserSpecifyFolder:="   , 0,
            "QuantityName:="    , "QuantityName_FieldLineTrace",
            "PlotFolder:="      , "Field line trace plot",
            "IntrinsicVar:="    , "",
            "Trace Step Length:="   , "0.001mm",
            "Use Adaptive Step:="   , True,
            "Seeding Faces:="   , f"[1,{seeding_faces_str}]",
            "Seeding Markers:=" , [0],
            "Surface Tracing Objects:=", [0],
            "Volume Tracing Objects:=", f"[1,{seeding_faces_str}]",
            "Seeding Sampling Option:=", True,
            "Seeding Points Number:=", 100,
            "Fractional of Maximal:=", 0.2,
            "Discrete Seeds Option:=", "Maximal Field Point",
            [
                "NAME:InceptionEvaluationSettings",
                "Gas Type:="        , 0,
                "Gas Pressure:="    , 1,
                "Use Inception:="   , True,
                "Potential U0:="    , 0,
                "Potential K:="     , 0,
                "Potential A:="     , 1
            ],
            [
                "NAME:FieldLineTracePlotSettings",
                [
                    "NAME:LineSettingsID",
                    "Width:="       , 1,
                    "Style:="       , "Solid"
                ],
                "IsoValType:="      , "Tone"
            ]
        ], "FieldLineTrace")

But, I get an message on Ansys that said the plot have been removed because of a geometry/Value change :

[warning] Plot 'FieldLineTrace_Plot1' has been removed due to deletion of quantity expression.
Tagged:

Answers

  • James Derrick
    James Derrick Administrator, Employee Posts: 357
    Ancient Membership 100 Comments 100 Likes 25 Answers
    admin

    When you create the plot, is that object stored in a variable somewhere? Perhaps it is being stored as a local variable that is being lost when context moves outside of the function the plot happens in?

  • Lucie
    Lucie Member Posts: 3
    First Comment
    **

    I think the problem simply came from the type of the surface number I was calling — I was retrieving it as a string, but the function was expecting an integer. Thank you for the Help