HFSS: choke#

This example shows how you can use PyAEDT to create a choke setup in HFSS.

Perform required imports#

Perform required imports.

import json
import os

from pyaedt import generate_unique_project_name
from pyaedt import Hfss
from pyaedt.modules.Mesh import Mesh


project_name = generate_unique_project_name(project_name="choke")

Set non-graphical mode#

Set non-graphical mode. "PYAEDT_NON_GRAPHICAL" is needed to generate documentation only. You can set non_graphical either to True or False.

non_graphical = os.getenv("PYAEDT_NON_GRAPHICAL", "False").lower() in ("true", "1", "t")

Launch HFSS#

Launches HFSS 2022 R2 in graphical mode.

hfss = Hfss(projectname=project_name, specified_version="2022.2", non_graphical=non_graphical, new_desktop_session=True,
            solution_type="Terminal")

Rules and information of use#

The dictionary values contain the different parameter values of the core and the windings that compose the choke. You must not change the main structure of the dictionary. The dictionary has many primary keys, including "Number of Windings", "Layer", and "Layer Type", that have dictionaries as values. The keys of these dictionaries are secondary keys of the dictionary values, such as "1", "2", "3", "4", and "Simple".

You must not modify the primary or secondary keys. You can modify only their values. You must not change the data types for these keys. For the dictionaries from "Number of Windings" through "Wire Section", values must be Boolean. Only one value per dictionary can be True. If all values are True, only the first one remains set to True. If all values are False, the first value is chosen as the correct one by default. For the dictionaries from "Core" through "Inner Winding", values must be strings, floats, or integers.

Descriptions follow for primary keys:

  • "Number of Windings": Number of windings around the core

  • "Layer": Number of layers of all windings

  • "Layer Type": Whether layers of a winding are linked to each other

  • "Similar Layer": Whether layers of a winding have the same number of turns and same spacing between turns

  • "Mode": When there are only two windows, whether they are in common or differential mode

  • "Wire Section": Type of wire section and number of segments

  • "Core": Design of the core

  • "Outer Winding": Design of the first layer or outer layer of a winding and the common parameters for all layers

  • "Mid Winding": Turns and turns spacing (“Coil Pit”) for the second or mid layer if it is necessary

  • "Inner Winding": Turns and turns spacing (“Coil Pit”) for the third or inner layer if it is necessary

  • "Occupation(%)": An informative parameter that is useless to modify

The following parameter values work. You can modify them if you want.

values = {
    "Number of Windings": {"1": False, "2": True, "3": False, "4": False},
    "Layer": {"Simple": False, "Double": True, "Triple": False},
    "Layer Type": {"Separate": False, "Linked": True},
    "Similar Layer": {"Similar": False, "Different": True},
    "Mode": {"Differential": False, "Common": True},
    "Wire Section": {"None": False, "Hexagon": True, "Octagon": False, "Circle": False},
    "Core": {
        "Name": "Core",
        "Material": "ferrite",
        "Inner Radius": 20,
        "Outer Radius": 30,
        "Height": 10,
        "Chamfer": 0.8,
    },
    "Outer Winding": {
        "Name": "Winding",
        "Material": "copper",
        "Inner Radius": 20,
        "Outer Radius": 30,
        "Height": 10,
        "Wire Diameter": 1.5,
        "Turns": 20,
        "Coil Pit(deg)": 0.1,
        "Occupation(%)": 0,
    },
    "Mid Winding": {"Turns": 25, "Coil Pit(deg)": 0.1, "Occupation(%)": 0},
    "Inner Winding": {"Turns": 4, "Coil Pit(deg)": 0.1, "Occupation(%)": 0},
}

Convert dictionary to JSON file#

Convert a dictionary to a JSON file. You must supply the path of the JSON file as an argument.

json_path = os.path.join(hfss.working_directory, "choke_example.json")

with open(json_path, "w") as outfile:
    json.dump(values, outfile)

Verify parameters of JSON file#

Verify parameters of the JSON file. The check_choke_values method takes the JSON file path as an argument and does the following:

  • Checks if the JSON file is correctly written (as explained in the rules)

  • Checks in equations on windings parameters to avoid having unintended intersections

dictionary_values = hfss.modeler.check_choke_values(json_path, create_another_file=False)
print(dictionary_values)
[True, {'Number of Windings': {'1': False, '2': True, '3': False, '4': False}, 'Layer': {'Simple': False, 'Double': True, 'Triple': False}, 'Layer Type': {'Separate': False, 'Linked': True}, 'Similar Layer': {'Similar': False, 'Different': True}, 'Mode': {'Differential': False, 'Common': True}, 'Wire Section': {'None': False, 'Hexagon': True, 'Octagon': False, 'Circle': False}, 'Core': {'Name': 'Core', 'Material': 'ferrite', 'Inner Radius': 20, 'Outer Radius': 30, 'Height': 10, 'Chamfer': 0.8}, 'Outer Winding': {'Name': 'Winding', 'Material': 'copper', 'Inner Radius': 17.525, 'Outer Radius': 32.475, 'Height': 14.95, 'Wire Diameter': 1.5, 'Turns': 20, 'Coil Pit(deg)': 2.699, 'Occupation(%)': 59.977777777777774}, 'Mid Winding': {'Turns': 25, 'Coil Pit(deg)': 2.466, 'Occupation(%)': 68.50000000000001}, 'Inner Winding': {'Turns': 4, 'Coil Pit(deg)': 0.1, 'Occupation(%)': 0}}]

Create choke#

Create the choke. The create_choke method takes the JSON file path as an argument.

make_double_linked_winding
[True, <pyaedt.modeler.Object3d.Object3d object at 0x0000021DF1BF8970>, [<pyaedt.modeler.Primitives.Polyline object at 0x0000021DF1935940>, [[-9.105371275769, 16.875213744732, -14.95], [-9.105371275769, 16.875213744732, 4.541726188958], [-9.714742044895, 18.004575927489, 5.825], [-15.133715602029, 25.37093294107, 5.825], [-15.791114589875, 26.473030144081, 4.541726188958], [-15.791114589875, 26.473030144081, -4.541726188958], [-15.133715602029, 25.37093294107, -5.825], [-11.2266867204, 17.102703663736, -5.825], [-10.522477108869, 16.029912678905, -4.541726188958], [-10.522477108869, 16.029912678905, 4.541726188958], [-11.2266867204, 17.102703663736, 5.825], [-17.258906742015, 23.975898821395, 5.825], [-18.008622682363, 25.017396628832, 4.541726188958], [-18.008622682363, 25.017396628832, -4.541726188958], [-17.258906742015, 23.975898821395, -5.825], [-12.655496321043, 16.074183655653, -5.825], [-11.861662630842, 15.065908025475, -4.541726188958], [-11.861662630842, 15.065908025475, 4.541726188958], [-12.655496321043, 16.074183655653, 5.825], [-19.256293433567, 22.403320053593, 5.825], [-20.0927745824, 23.376506038775, 4.541726188958], [-20.0927745824, 23.376506038775, -4.541726188958], [-19.256293433567, 22.403320053593, -5.825], [-13.990590325955, 14.926632227628, -5.825], [-13.113010998777, 13.990338364241, -4.541726188958], [-13.113010998777, 13.990338364241, 4.541726188958], [-13.990590325955, 14.926632227628, 5.825], [-21.111084768533, 20.664841787905, 5.825], [-22.028136874184, 21.562509382078, 4.541726188958], [-22.028136874184, 21.562509382078, -4.541726188958], [-21.111084768533, 20.664841787905, -5.825], [-15.222082190441, 13.668547147193, -5.825], [-14.267255815306, 12.811168428391, -4.541726188958], [-14.267255815306, 12.811168428391, 4.541726188958], [-15.222082190441, 13.668547147193, 5.825], [-22.809545775916, 18.773337681929, 5.825], [-23.800377948308, 19.588839539842, 4.541726188958], [-23.800377948308, 19.588839539842, -4.541726188958], [-22.809545775916, 18.773337681929, -5.825], [-16.340852557128, 12.309244697942, -5.825], [-15.315849747489, 11.537130124616, -4.541726188958], [-15.315849747489, 11.537130124616, 4.541726188958], [-16.340852557128, 12.309244697942, 5.825], [-24.339099131124, 16.742814569501, 5.825], [-25.396374129191, 17.470111793866, 4.541726188958], [-25.396374129191, 17.470111793866, -4.541726188958], [-24.339099131124, 16.742814569501, -5.825], [-17.338616785984, 10.85879069125, -5.825], [-16.25102782092, 10.177657872207, -4.541726188958], [-16.25102782092, 10.177657872207, 4.541726188958], [-17.338616785984, 10.85879069125, 5.825], [-25.688418292686, 14.588308738278, 5.825], [-26.804306857601, 15.222015598584, 4.541726188958], [-26.804306857601, 15.222015598584, -4.541726188958], [-25.688418292686, 14.588308738278, -5.825], [-18.207986303167, 9.327925927625, -5.825], [-17.065864920371, 8.74281873995, -4.541726188958], [-17.065864920371, 8.74281873995, 4.541726188958], [-18.207986303167, 9.327925927625, 5.825], [-26.847511376774, 12.325774584072, 5.825], [-28.013750208625, 12.861198398624, 4.541726188958], [-28.013750208625, 12.861198398624, -4.541726188958], [-26.847511376774, 12.325774584072, -5.825], [-18.942523314365, 7.727986659686, -5.825], [-17.754327071178, 7.24323789818, -4.541726188958], [-17.754327071178, 7.24323789818, 4.541726188958], [-18.942523314365, 7.727986659686, 5.825], [-27.807795148393, 9.971966466468, 5.825], [-29.015748096995, 10.405142352304, 4.541726188958], [-29.015748096995, 10.405142352304, -4.541726188958], [-27.807795148393, 9.971966466468, -5.825], [-19.536788477508, 6.070820645737, -5.825], [-18.311316121598, 5.690019938005, -4.541726188958], [-18.311316121598, 5.690019938005, 4.541726188958], [-19.536788477508, 6.070820645737, 5.825], [-28.562158581358, 7.544314640622, 5.825], [-29.80288059807, 7.872034873984, 4.541726188958], [-29.80288059807, 7.872034873984, -4.541726188958], [-28.562158581358, 7.544314640622, -5.825], [-19.986381181793, 4.368699415575, -5.825], [-18.732707495294, 4.094666640371, -4.541726188958], [-18.732707495294, 4.094666640371, 4.541726188958], [-19.986381181793, 4.368699415575, 5.825], [-29.105015516366, 5.060796183947, 5.825], [-30.369318893333, 5.280633953898, 4.541726188958], [-30.369318893333, 5.280633953898, -4.541726188958], [-29.105015516366, 5.060796183947, -5.825], [-20.28797213479, 2.63422739822, -5.825], [-19.015380734353, 2.468991803875, -4.541726188958], [-19.015380734353, 2.468991803875, 4.541726188958], [-20.28797213479, 2.63422739822, 5.825], [-29.43234602723, 2.539801873523, 5.825], [-30.710868433561, 2.650129252793, 4.541726188958], [-30.710868433561, 2.650129252793, -4.541726188958], [-29.43234602723, 2.539801873523, -5.825], [-20.43932801628, 0.880248584479, -5.825], [-19.157242606687, 0.825033762051, -4.541726188958], [-19.157242606687, 0.825033762051, 4.541726188958], [-20.43932801628, 0.880248584479, 5.825], [-29.541726188958, 0.0, 5.825], [-30.825, 0.0, 4.541726188958], [-30.825, 0.0, -4.541726188958], [-29.541726188958, 0.0, -5.825], [-20.43932801628, -0.880248584479, -5.825], [-19.157242606687, -0.825033762051, -4.541726188958], [-19.157242606687, -0.825033762051, 4.541726188958], [-20.43932801628, -0.880248584479, 5.825], [-29.43234602723, -2.539801873523, 5.825], [-30.710868433561, -2.650129252792, 4.541726188958], [-30.710868433561, -2.650129252792, -4.541726188958], [-29.43234602723, -2.539801873523, -5.825], [-20.28797213479, -2.634227398221, -5.825], [-19.015380734353, -2.468991803875, -4.541726188958], [-19.015380734353, -2.468991803875, 4.541726188958], [-20.28797213479, -2.634227398221, 5.825], [-29.105015516366, -5.060796183947, 5.825], [-30.369318893333, -5.280633953898, 4.541726188958], [-30.369318893333, -5.280633953898, -4.541726188958], [-29.105015516366, -5.060796183947, -5.825], [-19.986381181793, -4.368699415574, -5.825], [-18.732707495294, -4.094666640371, -4.541726188958], [-18.732707495294, -4.094666640371, 4.541726188958], [-19.986381181793, -4.368699415574, 5.825], [-28.562158581358, -7.544314640621, 5.825], [-29.802880598069, -7.872034873984, 4.541726188958], [-29.802880598069, -7.872034873984, -4.541726188958], [-28.562158581358, -7.544314640621, -5.825], [-19.536788477508, -6.070820645736, -5.825], [-18.311316121599, -5.690019938005, -4.541726188958], [-18.311316121599, -5.690019938005, 4.541726188958], [-19.536788477508, -6.070820645736, 5.825], [-27.807795148393, -9.971966466468, 5.825], [-29.015748096996, -10.405142352304, 4.541726188958], [-29.015748096996, -10.405142352304, -4.541726188958], [-27.807795148393, -9.971966466468, -5.825], [-18.942523314366, -7.727986659686, -5.825], [-17.754327071178, -7.243237898179, -4.541726188958], [-17.754327071178, -7.243237898179, 4.541726188958], [-18.942523314366, -7.727986659686, 5.825], [-26.847511376774, -12.325774584072, 5.825], [-28.013750208624, -12.861198398624, 4.541726188958], [-28.013750208624, -12.861198398624, -4.541726188958], [-26.847511376774, -12.325774584072, -5.825], [-18.207986303167, -9.327925927625, -5.825], [-17.065864920372, -8.74281873995, -4.541726188958], [-17.065864920372, -8.74281873995, 4.541726188958], [-18.207986303167, -9.327925927625, 5.825], [-25.688418292687, -14.588308738279, 5.825], [-26.804306857601, -15.222015598585, 4.541726188958], [-26.804306857601, -15.222015598585, -4.541726188958], [-25.688418292687, -14.588308738279, -5.825], [-17.338616785984, -10.85879069125, -5.825], [-16.25102782092, -10.177657872207, -4.541726188958], [-16.25102782092, -10.177657872207, 4.541726188958], [-17.338616785984, -10.85879069125, 5.825], [-24.339099131124, -16.7428145695, 5.825], [-25.396374129192, -17.470111793866, 4.541726188958], [-25.396374129192, -17.470111793866, -4.541726188958], [-24.339099131124, -16.7428145695, -5.825], [-16.340852557127, -12.309244697941, -5.825], [-15.31584974749, -11.537130124616, -4.541726188958], [-15.31584974749, -11.537130124616, 4.541726188958], [-16.340852557127, -12.309244697941, 5.825], [-22.809545775917, -18.773337681929, 5.825], [-23.800377948308, -19.588839539842, 4.541726188958], [-23.800377948308, -19.588839539842, -4.541726188958], [-22.809545775917, -18.773337681929, -5.825], [-15.222082190442, -13.668547147192, -5.825], [-14.267255815306, -12.811168428391, -4.541726188958], [-14.267255815306, -12.811168428391, 4.541726188958], [-15.222082190442, -13.668547147192, 5.825], [-21.111084768533, -20.664841787906, 5.825], [-22.028136874184, -21.562509382079, 4.541726188958], [-22.028136874184, -21.562509382079, -4.541726188958], [-21.111084768533, -20.664841787906, -5.825], [-13.990590325954, -14.926632227629, -5.825], [-13.113010998776, -13.990338364241, -4.541726188958], [-13.113010998776, -13.990338364241, 4.541726188958], [-13.990590325954, -14.926632227629, 5.825], [-19.256293433567, -22.403320053593, 5.825], [-20.0927745824, -23.376506038774, 4.541726188958], [-20.0927745824, -23.376506038774, -4.541726188958], [-19.256293433567, -22.403320053593, -5.825], [-12.655496321043, -16.074183655653, -5.825], [-11.861662630842, -15.065908025475, -4.541726188958], [-11.861662630842, -15.065908025475, 4.541726188958], [-12.655496321043, -16.074183655653, 5.825], [-17.258906742015, -23.975898821395, 5.825], [-18.008622682363, -25.017396628833, 4.541726188958], [-18.008622682363, -25.017396628833, -4.541726188958], [-17.258906742015, -23.975898821395, -5.825], [-11.2266867204, -17.102703663735, -5.825], [-10.522477108869, -16.029912678905, -4.541726188958], [-10.522477108869, -16.029912678905, 4.541726188958], [-11.2266867204, -17.102703663735, 5.825], [-15.13371560203, -25.37093294107, 5.825], [-15.791114589875, -26.473030144081, 4.541726188958], [-15.791114589875, -26.473030144081, -4.541726188958], [-15.13371560203, -25.37093294107, -5.825], [-9.714742044896, -18.004575927489, -5.825], [-9.105371275768, -16.875213744733, -4.541726188958], [-9.105371275768, -16.875213744733, 5.225178566873], [-9.714742044896, -18.004575927489, 7.475], [-15.58926893233, -25.894712077079, 7.475], [-16.749661460472, -27.822193766121, 5.225178566873], [-16.749661460472, -27.822193766121, -5.225178566873], [-15.58926893233, -25.894712077079, -7.475], [-10.985728205065, -16.442546594626, -7.475], [-9.73585968626, -14.571844810094, -5.225178566873], [-9.73585968626, -14.571844810094, 5.225178566873], [-10.985728205065, -16.442546594626, 7.475], [-17.956142197798, -24.313337425616, 7.475], [-19.292713741404, -26.123108955334, 5.225178566873], [-19.292713741404, -26.123108955334, -5.225178566873], [-17.956142197798, -24.313337425616, -7.475], [-12.483818155694, -15.336161415673, -7.475], [-11.063508913009, -13.591335310844, -5.225178566873], [-11.063508913009, -13.591335310844, 5.225178566873], [-12.483818155694, -15.336161415673, 7.475], [-20.163753424001, -22.516315579052, 7.475], [-21.664649259082, -24.192325177232, 5.225178566873], [-21.664649259082, -24.192325177232, -5.225178566873], [-20.163753424001, -22.516315579052, -7.475], [-13.871182856134, -14.093752122261, -7.475], [-12.293030325246, -12.490277435773, -5.225178566873], [-12.293030325246, -12.490277435773, 5.225178566873], [-13.871182856134, -14.093752122261, 7.475], [-22.192522198737, -20.519585226266, 7.475], [-23.844430126671, -22.046967522412, 5.225178566873], [-23.844430126671, -22.046967522412, -5.225178566873], [-22.192522198737, -20.519585226266, -7.475], [-15.135517072389, -12.726338266111, -7.475], [-13.413518680339, -11.278437019915, -5.225178566873], [-13.413518680339, -11.278437019915, 5.225178566873], [-15.135517072389, -12.726338266111, 7.475], [-24.024454353285, -18.340856371127, 7.475], [-25.81272277339, -19.706064244899, 5.225178566873], [-25.81272277339, -19.706064244899, -5.225178566873], [-24.024454353285, -18.340856371127, -7.475], [-16.26560678959, -11.246048127164, -7.475], [-14.415035804573, -9.966562484271, -5.225178566873], [-14.415035804573, -9.966562484271, 5.225178566873], [-16.26560678959, -11.246048127164, 7.475], [-25.643301561725, -15.999453253591, 7.475], [-27.55206942366, -17.190377991011, 5.225178566873], [-27.55206942366, -17.190377991011, -5.225178566873], [-25.643301561725, -15.999453253591, -7.475], [-17.251428674722, -9.666011141781, -7.475], [-15.288698739804, -8.566289502666, -5.225178566873], [-15.288698739804, -8.566289502666, 5.225178566873], [-17.251428674722, -9.666011141781, 7.475], [-27.034705455491, -13.516142953308, 7.475], [-29.047042938873, -14.522221645027, 5.225178566873], [-29.047042938873, -14.522221645027, -5.225178566873], [-27.034705455491, -13.516142953308, -7.475], [-18.084238978596, -8.000241451173, -7.475], [-16.026758530875, -7.090037799125, -5.225178566873], [-16.026758530875, -7.090037799125, 5.225178566873], [-18.084238978596, -8.000241451173, 7.475], [-28.186324974955, -10.91295119597, 7.475], [-30.284383648435, -11.725260425013, 5.225178566873], [-30.284383648435, -11.725260425013, -5.225178566873], [-28.186324974955, -10.91295119597, -7.475], [-18.756651088551, -6.263513602957, -7.475], [-16.622668954988, -5.550900991092, -5.225178566873], [-16.622668954988, -5.550900991092, 5.225178566873], [-18.756651088551, -6.263513602957, 7.475], [-29.087945828478, -8.212966996095, 7.475], [-31.253116956441, -8.824301984124, 5.225178566873], [-31.253116956441, -8.824301984124, -5.225178566873], [-29.087945828478, -8.212966996095, -7.475], [-19.262701044027, -4.471231508266, -7.475], [-17.071144583438, -3.962530455577, -5.225178566873], [-17.071144583438, -3.962530455577, 5.225178566873], [-19.262701044027, -4.471231508266, 7.475], [-29.731571088089, -5.440137868962, 7.475], [-31.94465068087, -5.845076379075, 5.225178566873], [-31.94465068087, -5.845076379075, -5.225178566873], [-29.731571088089, -5.440137868962, -7.475], [-19.597900433927, -2.639291816738, -7.475], [-17.368207660739, -2.339014248232, -5.225178566873], [-17.368207660739, -2.339014248232, 5.225178566873], [-19.597900433927, -2.639291816738, 7.475], [-30.111492118256, -2.619057428082, 7.475], [-32.352851261964, -2.814007857349, 5.225178566873], [-32.352851261964, -2.814007857349, -5.225178566873], [-30.111492118256, -2.619057428082, -7.475], [-19.759276206593, -0.783942921145, -7.475], [-17.511223385332, -0.694752149319, -5.225178566873], [-17.511223385332, -0.694752149319, 5.225178566873], [-19.759276206593, -0.783942921145, 7.475], [-30.22433920864, 0.225252747914, 7.475], [-32.474098163852, 0.242019512715, 5.225178566873], [-32.474098163852, 0.242019512715, -5.225178566873], [-30.22433920864, 0.225252747914, -7.475], [-19.745397039283, 1.078359157762, -7.475], [-17.498923278961, 0.955672055179, -5.225178566873], [-17.498923278961, 0.955672055179, 5.225178566873], [-19.745397039283, 1.078359157762, 7.475], [-30.069111461747, 3.06756504421, 7.475], [-32.307315986892, 3.295900290226, 5.225178566873], [-32.307315986892, 3.295900290226, -5.225178566873], [-30.069111461747, 3.06756504421, -7.475], [-19.556386033299, 2.931096727954, -7.475], [-17.331416437442, 2.597619924464, -5.225178566873], [-17.331416437442, 2.597619924464, 5.225178566873], [-19.556386033299, 2.931096727954, 7.475], [-29.647185670387, 5.882669566189, 7.475], [-31.853984005939, 6.320548073498, 5.225178566873], [-31.853984005939, 6.320548073498, -5.225178566873], [-29.647185670387, 5.882669566189, -7.475], [-19.19391962214, 4.757836929835, -7.475], [-17.010188563043, 4.216528198615, -5.225178566873], [-17.010188563043, 4.216528198615, 5.225178566873], [-19.19391962214, 4.757836929835, 7.475], [-28.962304106216, 8.645597738643, 7.475], [-31.118123049907, 9.289135742944, 5.225178566873], [-31.118123049907, 9.289135742944, -5.225178566873], [-28.962304106216, 8.645597738643, -7.475], [-18.661212702364, 6.542377487516, -7.475], [-16.538088787041, 5.798037967445, -5.225178566873], [-16.538088787041, 5.798037967445, 5.225178566873], [-18.661212702364, 6.542377487516, 7.475], [-28.020541327642, 11.331843764601, 7.475], [-30.106259839023, 12.175333404273, 5.225178566873], [-30.106259839023, 12.175333404273, -5.225178566873], [-28.020541327642, 11.331843764601, -7.475], [-17.962990119069, 8.26889041494, -7.475], [-15.919304399347, 7.328122026885, -5.225178566873], [-15.919304399347, 7.328122026885, 5.225178566873], [-17.962990119069, 8.26889041494, 7.475], [-26.830250301518, 13.917581979542, 7.475], [-28.827369096067, 14.953541921535, 5.225178566873], [-28.827369096067, 14.953541921535, -5.225178566873], [-26.830250301518, 13.917581979542, -7.475], [-17.105444758856, 9.922062402231, -7.475], [-15.15932370933, 8.793209293298, -5.225178566873], [-15.15932370933, 8.793209293298, 5.225178566873], [-17.105444758856, 9.922062402231, 7.475], [-25.401988316491, 16.379878173181, 7.475], [-27.292793945051, 17.599119968709, 5.225178566873], [-27.292793945051, 17.599119968709, -5.225178566873], [-25.401988316491, 16.379878173181, -7.475], [-16.096182622021, 11.487230637129, -7.475], [-14.264887367244, 10.180305172235, -5.225178566873], [-14.264887367244, 10.180305172235, 5.225178566873], [-16.096182622021, 11.487230637129, 7.475], [-23.748423345104, 18.696893004485, 7.475], [-25.516145303356, 20.088602585995, 5.225178566873], [-25.516145303356, 20.088602585995, -5.225178566873], [-23.748423345104, 18.696893004485, -7.475], [-14.944155361111, 12.950512856834, -7.475], [-13.243928578022, 11.477106814012, -5.225178566873], [-13.243928578022, 11.477106814012, 5.225178566873], [-14.944155361111, 12.950512856834, 7.475], [-21.884221685187, 20.848075705756, 7.475], [-23.513181159677, 22.399909302321, 5.225178566873], [-23.513181159677, 22.399909302321, -5.225178566873], [-23.513181159677, 22.399909302321, -14.95]]], [<pyaedt.modeler.Primitives.Polyline object at 0x0000021DF1BF84F0>, [[9.105371275769, 16.875213744732, -14.95], [9.105371275769, 16.875213744732, 4.541726188958], [9.714742044895, 18.004575927489, 5.825], [15.133715602029, 25.37093294107, 5.825], [15.791114589875, 26.473030144081, 4.541726188958], [15.791114589875, 26.473030144081, -4.541726188958], [15.133715602029, 25.37093294107, -5.825], [11.2266867204, 17.102703663736, -5.825], [10.522477108869, 16.029912678905, -4.541726188958], [10.522477108869, 16.029912678905, 4.541726188958], [11.2266867204, 17.102703663736, 5.825], [17.258906742015, 23.975898821395, 5.825], [18.008622682363, 25.017396628832, 4.541726188958], [18.008622682363, 25.017396628832, -4.541726188958], [17.258906742015, 23.975898821395, -5.825], [12.655496321043, 16.074183655653, -5.825], [11.861662630842, 15.065908025475, -4.541726188958], [11.861662630842, 15.065908025475, 4.541726188958], [12.655496321043, 16.074183655653, 5.825], [19.256293433567, 22.403320053593, 5.825], [20.0927745824, 23.376506038775, 4.541726188958], [20.0927745824, 23.376506038775, -4.541726188958], [19.256293433567, 22.403320053593, -5.825], [13.990590325955, 14.926632227628, -5.825], [13.113010998777, 13.990338364241, -4.541726188958], [13.113010998777, 13.990338364241, 4.541726188958], [13.990590325955, 14.926632227628, 5.825], [21.111084768533, 20.664841787905, 5.825], [22.028136874184, 21.562509382078, 4.541726188958], [22.028136874184, 21.562509382078, -4.541726188958], [21.111084768533, 20.664841787905, -5.825], [15.222082190441, 13.668547147193, -5.825], [14.267255815306, 12.811168428391, -4.541726188958], [14.267255815306, 12.811168428391, 4.541726188958], [15.222082190441, 13.668547147193, 5.825], [22.809545775916, 18.773337681929, 5.825], [23.800377948308, 19.588839539842, 4.541726188958], [23.800377948308, 19.588839539842, -4.541726188958], [22.809545775916, 18.773337681929, -5.825], [16.340852557128, 12.309244697942, -5.825], [15.315849747489, 11.537130124616, -4.541726188958], [15.315849747489, 11.537130124616, 4.541726188958], [16.340852557128, 12.309244697942, 5.825], [24.339099131124, 16.742814569501, 5.825], [25.396374129191, 17.470111793866, 4.541726188958], [25.396374129191, 17.470111793866, -4.541726188958], [24.339099131124, 16.742814569501, -5.825], [17.338616785984, 10.85879069125, -5.825], [16.25102782092, 10.177657872207, -4.541726188958], [16.25102782092, 10.177657872207, 4.541726188958], [17.338616785984, 10.85879069125, 5.825], [25.688418292686, 14.588308738278, 5.825], [26.804306857601, 15.222015598584, 4.541726188958], [26.804306857601, 15.222015598584, -4.541726188958], [25.688418292686, 14.588308738278, -5.825], [18.207986303167, 9.327925927625, -5.825], [17.065864920371, 8.74281873995, -4.541726188958], [17.065864920371, 8.74281873995, 4.541726188958], [18.207986303167, 9.327925927625, 5.825], [26.847511376774, 12.325774584072, 5.825], [28.013750208625, 12.861198398624, 4.541726188958], [28.013750208625, 12.861198398624, -4.541726188958], [26.847511376774, 12.325774584072, -5.825], [18.942523314365, 7.727986659686, -5.825], [17.754327071178, 7.24323789818, -4.541726188958], [17.754327071178, 7.24323789818, 4.541726188958], [18.942523314365, 7.727986659686, 5.825], [27.807795148393, 9.971966466468, 5.825], [29.015748096995, 10.405142352304, 4.541726188958], [29.015748096995, 10.405142352304, -4.541726188958], [27.807795148393, 9.971966466468, -5.825], [19.536788477508, 6.070820645737, -5.825], [18.311316121598, 5.690019938005, -4.541726188958], [18.311316121598, 5.690019938005, 4.541726188958], [19.536788477508, 6.070820645737, 5.825], [28.562158581358, 7.544314640622, 5.825], [29.80288059807, 7.872034873984, 4.541726188958], [29.80288059807, 7.872034873984, -4.541726188958], [28.562158581358, 7.544314640622, -5.825], [19.986381181793, 4.368699415575, -5.825], [18.732707495294, 4.094666640371, -4.541726188958], [18.732707495294, 4.094666640371, 4.541726188958], [19.986381181793, 4.368699415575, 5.825], [29.105015516366, 5.060796183947, 5.825], [30.369318893333, 5.280633953898, 4.541726188958], [30.369318893333, 5.280633953898, -4.541726188958], [29.105015516366, 5.060796183947, -5.825], [20.28797213479, 2.63422739822, -5.825], [19.015380734353, 2.468991803875, -4.541726188958], [19.015380734353, 2.468991803875, 4.541726188958], [20.28797213479, 2.63422739822, 5.825], [29.43234602723, 2.539801873523, 5.825], [30.710868433561, 2.650129252793, 4.541726188958], [30.710868433561, 2.650129252793, -4.541726188958], [29.43234602723, 2.539801873523, -5.825], [20.43932801628, 0.880248584479, -5.825], [19.157242606687, 0.825033762051, -4.541726188958], [19.157242606687, 0.825033762051, 4.541726188958], [20.43932801628, 0.880248584479, 5.825], [29.541726188958, 0.0, 5.825], [30.825, 0.0, 4.541726188958], [30.825, 0.0, -4.541726188958], [29.541726188958, 0.0, -5.825], [20.43932801628, -0.880248584479, -5.825], [19.157242606687, -0.825033762051, -4.541726188958], [19.157242606687, -0.825033762051, 4.541726188958], [20.43932801628, -0.880248584479, 5.825], [29.43234602723, -2.539801873523, 5.825], [30.710868433561, -2.650129252792, 4.541726188958], [30.710868433561, -2.650129252792, -4.541726188958], [29.43234602723, -2.539801873523, -5.825], [20.28797213479, -2.634227398221, -5.825], [19.015380734353, -2.468991803875, -4.541726188958], [19.015380734353, -2.468991803875, 4.541726188958], [20.28797213479, -2.634227398221, 5.825], [29.105015516366, -5.060796183947, 5.825], [30.369318893333, -5.280633953898, 4.541726188958], [30.369318893333, -5.280633953898, -4.541726188958], [29.105015516366, -5.060796183947, -5.825], [19.986381181793, -4.368699415574, -5.825], [18.732707495294, -4.094666640371, -4.541726188958], [18.732707495294, -4.094666640371, 4.541726188958], [19.986381181793, -4.368699415574, 5.825], [28.562158581358, -7.544314640621, 5.825], [29.802880598069, -7.872034873984, 4.541726188958], [29.802880598069, -7.872034873984, -4.541726188958], [28.562158581358, -7.544314640621, -5.825], [19.536788477508, -6.070820645736, -5.825], [18.311316121599, -5.690019938005, -4.541726188958], [18.311316121599, -5.690019938005, 4.541726188958], [19.536788477508, -6.070820645736, 5.825], [27.807795148393, -9.971966466468, 5.825], [29.015748096996, -10.405142352304, 4.541726188958], [29.015748096996, -10.405142352304, -4.541726188958], [27.807795148393, -9.971966466468, -5.825], [18.942523314366, -7.727986659686, -5.825], [17.754327071178, -7.243237898179, -4.541726188958], [17.754327071178, -7.243237898179, 4.541726188958], [18.942523314366, -7.727986659686, 5.825], [26.847511376774, -12.325774584072, 5.825], [28.013750208624, -12.861198398624, 4.541726188958], [28.013750208624, -12.861198398624, -4.541726188958], [26.847511376774, -12.325774584072, -5.825], [18.207986303167, -9.327925927625, -5.825], [17.065864920372, -8.74281873995, -4.541726188958], [17.065864920372, -8.74281873995, 4.541726188958], [18.207986303167, -9.327925927625, 5.825], [25.688418292687, -14.588308738279, 5.825], [26.804306857601, -15.222015598585, 4.541726188958], [26.804306857601, -15.222015598585, -4.541726188958], [25.688418292687, -14.588308738279, -5.825], [17.338616785984, -10.85879069125, -5.825], [16.25102782092, -10.177657872207, -4.541726188958], [16.25102782092, -10.177657872207, 4.541726188958], [17.338616785984, -10.85879069125, 5.825], [24.339099131124, -16.7428145695, 5.825], [25.396374129192, -17.470111793866, 4.541726188958], [25.396374129192, -17.470111793866, -4.541726188958], [24.339099131124, -16.7428145695, -5.825], [16.340852557127, -12.309244697941, -5.825], [15.31584974749, -11.537130124616, -4.541726188958], [15.31584974749, -11.537130124616, 4.541726188958], [16.340852557127, -12.309244697941, 5.825], [22.809545775917, -18.773337681929, 5.825], [23.800377948308, -19.588839539842, 4.541726188958], [23.800377948308, -19.588839539842, -4.541726188958], [22.809545775917, -18.773337681929, -5.825], [15.222082190442, -13.668547147192, -5.825], [14.267255815306, -12.811168428391, -4.541726188958], [14.267255815306, -12.811168428391, 4.541726188958], [15.222082190442, -13.668547147192, 5.825], [21.111084768533, -20.664841787906, 5.825], [22.028136874184, -21.562509382079, 4.541726188958], [22.028136874184, -21.562509382079, -4.541726188958], [21.111084768533, -20.664841787906, -5.825], [13.990590325954, -14.926632227629, -5.825], [13.113010998776, -13.990338364241, -4.541726188958], [13.113010998776, -13.990338364241, 4.541726188958], [13.990590325954, -14.926632227629, 5.825], [19.256293433567, -22.403320053593, 5.825], [20.0927745824, -23.376506038774, 4.541726188958], [20.0927745824, -23.376506038774, -4.541726188958], [19.256293433567, -22.403320053593, -5.825], [12.655496321043, -16.074183655653, -5.825], [11.861662630842, -15.065908025475, -4.541726188958], [11.861662630842, -15.065908025475, 4.541726188958], [12.655496321043, -16.074183655653, 5.825], [17.258906742015, -23.975898821395, 5.825], [18.008622682363, -25.017396628833, 4.541726188958], [18.008622682363, -25.017396628833, -4.541726188958], [17.258906742015, -23.975898821395, -5.825], [11.2266867204, -17.102703663735, -5.825], [10.522477108869, -16.029912678905, -4.541726188958], [10.522477108869, -16.029912678905, 4.541726188958], [11.2266867204, -17.102703663735, 5.825], [15.13371560203, -25.37093294107, 5.825], [15.791114589875, -26.473030144081, 4.541726188958], [15.791114589875, -26.473030144081, -4.541726188958], [15.13371560203, -25.37093294107, -5.825], [9.714742044896, -18.004575927489, -5.825], [9.105371275768, -16.875213744733, -4.541726188958], [9.105371275768, -16.875213744733, 5.225178566873], [9.714742044896, -18.004575927489, 7.475], [15.58926893233, -25.894712077079, 7.475], [16.749661460472, -27.822193766121, 5.225178566873], [16.749661460472, -27.822193766121, -5.225178566873], [15.58926893233, -25.894712077079, -7.475], [10.985728205065, -16.442546594626, -7.475], [9.73585968626, -14.571844810094, -5.225178566873], [9.73585968626, -14.571844810094, 5.225178566873], [10.985728205065, -16.442546594626, 7.475], [17.956142197798, -24.313337425616, 7.475], [19.292713741404, -26.123108955334, 5.225178566873], [19.292713741404, -26.123108955334, -5.225178566873], [17.956142197798, -24.313337425616, -7.475], [12.483818155694, -15.336161415673, -7.475], [11.063508913009, -13.591335310844, -5.225178566873], [11.063508913009, -13.591335310844, 5.225178566873], [12.483818155694, -15.336161415673, 7.475], [20.163753424001, -22.516315579052, 7.475], [21.664649259082, -24.192325177232, 5.225178566873], [21.664649259082, -24.192325177232, -5.225178566873], [20.163753424001, -22.516315579052, -7.475], [13.871182856134, -14.093752122261, -7.475], [12.293030325246, -12.490277435773, -5.225178566873], [12.293030325246, -12.490277435773, 5.225178566873], [13.871182856134, -14.093752122261, 7.475], [22.192522198737, -20.519585226266, 7.475], [23.844430126671, -22.046967522412, 5.225178566873], [23.844430126671, -22.046967522412, -5.225178566873], [22.192522198737, -20.519585226266, -7.475], [15.135517072389, -12.726338266111, -7.475], [13.413518680339, -11.278437019915, -5.225178566873], [13.413518680339, -11.278437019915, 5.225178566873], [15.135517072389, -12.726338266111, 7.475], [24.024454353285, -18.340856371127, 7.475], [25.81272277339, -19.706064244899, 5.225178566873], [25.81272277339, -19.706064244899, -5.225178566873], [24.024454353285, -18.340856371127, -7.475], [16.26560678959, -11.246048127164, -7.475], [14.415035804573, -9.966562484271, -5.225178566873], [14.415035804573, -9.966562484271, 5.225178566873], [16.26560678959, -11.246048127164, 7.475], [25.643301561725, -15.999453253591, 7.475], [27.55206942366, -17.190377991011, 5.225178566873], [27.55206942366, -17.190377991011, -5.225178566873], [25.643301561725, -15.999453253591, -7.475], [17.251428674722, -9.666011141781, -7.475], [15.288698739804, -8.566289502666, -5.225178566873], [15.288698739804, -8.566289502666, 5.225178566873], [17.251428674722, -9.666011141781, 7.475], [27.034705455491, -13.516142953308, 7.475], [29.047042938873, -14.522221645027, 5.225178566873], [29.047042938873, -14.522221645027, -5.225178566873], [27.034705455491, -13.516142953308, -7.475], [18.084238978596, -8.000241451173, -7.475], [16.026758530875, -7.090037799125, -5.225178566873], [16.026758530875, -7.090037799125, 5.225178566873], [18.084238978596, -8.000241451173, 7.475], [28.186324974955, -10.91295119597, 7.475], [30.284383648435, -11.725260425013, 5.225178566873], [30.284383648435, -11.725260425013, -5.225178566873], [28.186324974955, -10.91295119597, -7.475], [18.756651088551, -6.263513602957, -7.475], [16.622668954988, -5.550900991092, -5.225178566873], [16.622668954988, -5.550900991092, 5.225178566873], [18.756651088551, -6.263513602957, 7.475], [29.087945828478, -8.212966996095, 7.475], [31.253116956441, -8.824301984124, 5.225178566873], [31.253116956441, -8.824301984124, -5.225178566873], [29.087945828478, -8.212966996095, -7.475], [19.262701044027, -4.471231508266, -7.475], [17.071144583438, -3.962530455577, -5.225178566873], [17.071144583438, -3.962530455577, 5.225178566873], [19.262701044027, -4.471231508266, 7.475], [29.731571088089, -5.440137868962, 7.475], [31.94465068087, -5.845076379075, 5.225178566873], [31.94465068087, -5.845076379075, -5.225178566873], [29.731571088089, -5.440137868962, -7.475], [19.597900433927, -2.639291816738, -7.475], [17.368207660739, -2.339014248232, -5.225178566873], [17.368207660739, -2.339014248232, 5.225178566873], [19.597900433927, -2.639291816738, 7.475], [30.111492118256, -2.619057428082, 7.475], [32.352851261964, -2.814007857349, 5.225178566873], [32.352851261964, -2.814007857349, -5.225178566873], [30.111492118256, -2.619057428082, -7.475], [19.759276206593, -0.783942921145, -7.475], [17.511223385332, -0.694752149319, -5.225178566873], [17.511223385332, -0.694752149319, 5.225178566873], [19.759276206593, -0.783942921145, 7.475], [30.22433920864, 0.225252747914, 7.475], [32.474098163852, 0.242019512715, 5.225178566873], [32.474098163852, 0.242019512715, -5.225178566873], [30.22433920864, 0.225252747914, -7.475], [19.745397039283, 1.078359157762, -7.475], [17.498923278961, 0.955672055179, -5.225178566873], [17.498923278961, 0.955672055179, 5.225178566873], [19.745397039283, 1.078359157762, 7.475], [30.069111461747, 3.06756504421, 7.475], [32.307315986892, 3.295900290226, 5.225178566873], [32.307315986892, 3.295900290226, -5.225178566873], [30.069111461747, 3.06756504421, -7.475], [19.556386033299, 2.931096727954, -7.475], [17.331416437442, 2.597619924464, -5.225178566873], [17.331416437442, 2.597619924464, 5.225178566873], [19.556386033299, 2.931096727954, 7.475], [29.647185670387, 5.882669566189, 7.475], [31.853984005939, 6.320548073498, 5.225178566873], [31.853984005939, 6.320548073498, -5.225178566873], [29.647185670387, 5.882669566189, -7.475], [19.19391962214, 4.757836929835, -7.475], [17.010188563043, 4.216528198615, -5.225178566873], [17.010188563043, 4.216528198615, 5.225178566873], [19.19391962214, 4.757836929835, 7.475], [28.962304106216, 8.645597738643, 7.475], [31.118123049907, 9.289135742944, 5.225178566873], [31.118123049907, 9.289135742944, -5.225178566873], [28.962304106216, 8.645597738643, -7.475], [18.661212702364, 6.542377487516, -7.475], [16.538088787041, 5.798037967445, -5.225178566873], [16.538088787041, 5.798037967445, 5.225178566873], [18.661212702364, 6.542377487516, 7.475], [28.020541327642, 11.331843764601, 7.475], [30.106259839023, 12.175333404273, 5.225178566873], [30.106259839023, 12.175333404273, -5.225178566873], [28.020541327642, 11.331843764601, -7.475], [17.962990119069, 8.26889041494, -7.475], [15.919304399347, 7.328122026885, -5.225178566873], [15.919304399347, 7.328122026885, 5.225178566873], [17.962990119069, 8.26889041494, 7.475], [26.830250301518, 13.917581979542, 7.475], [28.827369096067, 14.953541921535, 5.225178566873], [28.827369096067, 14.953541921535, -5.225178566873], [26.830250301518, 13.917581979542, -7.475], [17.105444758856, 9.922062402231, -7.475], [15.15932370933, 8.793209293298, -5.225178566873], [15.15932370933, 8.793209293298, 5.225178566873], [17.105444758856, 9.922062402231, 7.475], [25.401988316491, 16.379878173181, 7.475], [27.292793945051, 17.599119968709, 5.225178566873], [27.292793945051, 17.599119968709, -5.225178566873], [25.401988316491, 16.379878173181, -7.475], [16.096182622021, 11.487230637129, -7.475], [14.264887367244, 10.180305172235, -5.225178566873], [14.264887367244, 10.180305172235, 5.225178566873], [16.096182622021, 11.487230637129, 7.475], [23.748423345104, 18.696893004485, 7.475], [25.516145303356, 20.088602585995, 5.225178566873], [25.516145303356, 20.088602585995, -5.225178566873], [23.748423345104, 18.696893004485, -7.475], [14.944155361111, 12.950512856834, -7.475], [13.243928578022, 11.477106814012, -5.225178566873], [13.243928578022, 11.477106814012, 5.225178566873], [14.944155361111, 12.950512856834, 7.475], [21.884221685187, 20.848075705756, 7.475], [23.513181159677, 22.399909302321, 5.225178566873], [23.513181159677, 22.399909302321, -5.225178566873], [23.513181159677, 22.399909302321, -14.95]]]]

Create ground#

Create a ground.

ground_radius = 1.2 * dictionary_values[1]["Outer Winding"]["Outer Radius"]
ground_position = [0, 0, first_winding_list[1][0][2] - 2]
ground = hfss.modeler.create_circle("XY", ground_position, ground_radius, name="GND", matname="copper")
coat = hfss.assign_coating(ground, isinfgnd=True)

Create lumped ports#

Create lumped ports.

port_position_list = [
    [first_winding_list[1][0][0], first_winding_list[1][0][1], first_winding_list[1][0][2] - 1],
    [first_winding_list[1][-1][0], first_winding_list[1][-1][1], first_winding_list[1][-1][2] - 1],
    [second_winding_list[1][0][0], second_winding_list[1][0][1], second_winding_list[1][0][2] - 1],
    [second_winding_list[1][-1][0], second_winding_list[1][-1][1], second_winding_list[1][-1][2] - 1],
]
port_dimension_list = [2, dictionary_values[1]["Outer Winding"]["Wire Diameter"]]
for position in port_position_list:
    sheet = hfss.modeler.create_rectangle("XZ", position, port_dimension_list, name="sheet_port")
    sheet.move([-dictionary_values[1]["Outer Winding"]["Wire Diameter"] / 2, 0, -1])
    hfss.create_lumped_port_to_sheet(
        sheet.name, portname="port_" + str(port_position_list.index(position) + 1), reference_object_list=[ground]
    )

Create mesh#

Create the mesh.

cylinder_height = 2.5 * dictionary_values[1]["Outer Winding"]["Height"]
cylinder_position = [0, 0, first_winding_list[1][0][2] - 4]
mesh_operation_cylinder = hfss.modeler.create_cylinder(
    "XY", cylinder_position, ground_radius, cylinder_height, numSides=36, name="mesh_cylinder"
)
mesh = Mesh(hfss)
mesh.assign_length_mesh([mesh_operation_cylinder], maxlength=15, maxel=None, meshop_name="choke_mesh")
<pyaedt.modules.Mesh.MeshOperation object at 0x0000021DFA7F0AF0>

Create boundaries#

Create the boundaries. A region with openings is needed to run the analysis.

region = hfss.modeler.create_region(pad_percent=1000)

Create setup#

Create a setup with a sweep to run the simulation. Depending on your machine’s computing power, the simulation can take some time to run.

setup = hfss.create_setup("MySetup")
setup.props["Frequency"] = "50MHz"
setup["MaximumPasses"] = 10
hfss.create_linear_count_sweep(
    setupname=setup.name,
    unit="MHz",
    freqstart=0.1,
    freqstop=100,
    num_of_freq_points=100,
    sweepname="sweep1",
    sweep_type="Interpolating",
    save_fields=False,
)
<pyaedt.modules.SetupTemplates.SweepHFSS object at 0x0000021DFA970250>

Save project#

Save the project.

hfss.modeler.fit_all()
hfss.plot(show=False, export_path=os.path.join(hfss.working_directory, "Image.jpg"), plot_air_objects=True)
HFSS Choke
<pyaedt.generic.plot.ModelPlotter object at 0x0000021DF134E970>

Close AEDT#

After the simulation completes, you can close AEDT or release it using the pyaedt.Desktop.release_desktop() method. All methods provide for saving the project before closing.

if os.name != "posix":
    hfss.release_desktop()

Total running time of the script: ( 0 minutes 29.472 seconds)

Gallery generated by Sphinx-Gallery