How do I compute the current through a plane or along a surface in Feko?

tobias_from_edag
tobias_from_edag Altair Community Member

Hello, I am trying to find a way to compute the total current through a small plane. Or alternatively to compute the current along a geometric object.

For example, if I have a connecting element represented by a 1D-wire, I can read the current in the currents results. I am looking for a procedure that produces the same number for the same element if it is represented by a 3D-zylinder. And ideally one that can be generalized for non-cylindrical objects.

Tagged:

Best Answer

  • tobias_from_edag
    tobias_from_edag Altair Community Member
    Answer ✓

    Hello future Readers,

    I did end up re-asking this question to support and got an answer:

    One can split the conductor and add an edge port to the split point. Then adding a voltage source allows one to read the current.

    They also wrote a script that finds the current using Ampere's law from a previously defined nearfield :

    -- Compute common mode current vs. distance along the cable
    app = pf.GetApplication()

    -- Retrieve near field request. Assume cylindrical coordinates around cable
    model = "EMC_BCI_DUT_2024.1"
    request = "FE_Around"
    feRequest = app.Models[model].Configurations[1].NearFields[request]
    feData = feRequest:GetDataSet()

    --Create a new (empty) result set to store commonm ode current
    iSumData = pf.DataSet.New()

    --Add axes to the new result set - using the frequency axis from the original nearfield
    iSumData.Axes:Add(feData.Axes[1]) -- Frequency
    iSumData.Axes:Add(feData.Axes[2]) -- rho
    iSumData.Axes:Add(feData.Axes[4]) -- X

    --Add quantities to the new result set
    iSumData.Quantities:Add('Ix', 'complex', 'A') -- Ix

    --Show the structure of the new dataset
    print(iSumData)

    -- Number of phi samples -- assume it is te same for all near-field requests
    nphi = #feData.Axes[3]

    -- Number of frequency samples -- assume it is te same for all near-field requests
    nfreq = #feData.Axes[1]

    -- Loop over the number of frequency points
    for freq_count = 1, nfreq do
    rho = 0
    for u_count = 1, #feData.Axes[2] do
    rho = feData.Axes[2][u_count]
    -- print(rho)
    for n_count = 1, #feData.Axes[4] do
    sum_Hphi=0+i0
    Hphi=0+i
    0
    -- Sum Hphi over phi
    for v_count = 1, nphi do
    Hphi = feData[freq_count][u_count][v_count][n_count].hfieldcomp2
    sum_Hphi = sum_Hphi + Hphi
    end -- v_count
    -- Set the values in the new dataset
    iSumData[freq_count][u_count][n_count].Ix = 2math.pirho*sum_Hphi/nphi
    end -- n_count
    end -- u_count
    end -- freq_count

    -- inspect(iSumData)
    ISumStoredData = iSumData:StoreData("Custom")

    ISumStoredData.Label = app.StoredData:UniqueName("Ix_" .. string.gsub(model, "%p", "_"))

Answers

  • Torben Voigt
    Torben Voigt
    Altair Employee

    Hello Tobias,

    The Method of Moments (MoM) only calculates the currents on the boundary surfaces of objects. In the case of metallic objects, the currents only run on the surface anyway; in the case of dielectric objects, the Surface Equivalence Principle (SEP) is applied. In this case, the currents on the surfaces represent the currents that would actually run inside.

    Accordingly, you can only calculate surface currents.

    You might expect that FEM or MoM VEP (Volume Equivalence Principle) would also allow you to analyze volume currents, but unfortunately this is not supported. The exportes .ol and .os files will be empty.

    You can request (surface and line) currents in CADFEKO here:

    Best regards,
    Torben

  • tobias_from_edag
    tobias_from_edag Altair Community Member

    Yes, I know that the currents are only nonzero on the surfaces. I was hoping that a post-processing macro was possible to find those surfaces that penetrate the target plane and calculate their sum. But as it seems impossible to do that using the documented post-processing api, I have given up.

    I am currently attempting to write a field macro to calculate the currents using ampere's law after defining a near-field request on the target plane. I was hoping such a macro already exists in some form, like it does for other field simulation programs.

    Is there some sort of recommended package for such vector math operations provided with feko? Or is it necessary to import an external lua package or to code the integration by hand?

  • Torben Voigt
    Torben Voigt
    Altair Employee

    Hi Tobias,
    In this case I would recommend to create a support request on Altair One.

    Best regards,
    Torben

  • Georgi_GC
    Georgi_GC Altair Community Member

    Hello, Tobias!

    In POSTFEKO, in Results menu, submenu Requests, right click on CURRENTS and select "Add new" 3D View ( file).

    Set "Instantaneous magnitude" in Quantity "electric currents"'. To view arrows - select "Show arrows" in the "Result" tab.

  • tobias_from_edag
    tobias_from_edag Altair Community Member
    Answer ✓

    Hello future Readers,

    I did end up re-asking this question to support and got an answer:

    One can split the conductor and add an edge port to the split point. Then adding a voltage source allows one to read the current.

    They also wrote a script that finds the current using Ampere's law from a previously defined nearfield :

    -- Compute common mode current vs. distance along the cable
    app = pf.GetApplication()

    -- Retrieve near field request. Assume cylindrical coordinates around cable
    model = "EMC_BCI_DUT_2024.1"
    request = "FE_Around"
    feRequest = app.Models[model].Configurations[1].NearFields[request]
    feData = feRequest:GetDataSet()

    --Create a new (empty) result set to store commonm ode current
    iSumData = pf.DataSet.New()

    --Add axes to the new result set - using the frequency axis from the original nearfield
    iSumData.Axes:Add(feData.Axes[1]) -- Frequency
    iSumData.Axes:Add(feData.Axes[2]) -- rho
    iSumData.Axes:Add(feData.Axes[4]) -- X

    --Add quantities to the new result set
    iSumData.Quantities:Add('Ix', 'complex', 'A') -- Ix

    --Show the structure of the new dataset
    print(iSumData)

    -- Number of phi samples -- assume it is te same for all near-field requests
    nphi = #feData.Axes[3]

    -- Number of frequency samples -- assume it is te same for all near-field requests
    nfreq = #feData.Axes[1]

    -- Loop over the number of frequency points
    for freq_count = 1, nfreq do
    rho = 0
    for u_count = 1, #feData.Axes[2] do
    rho = feData.Axes[2][u_count]
    -- print(rho)
    for n_count = 1, #feData.Axes[4] do
    sum_Hphi=0+i0
    Hphi=0+i
    0
    -- Sum Hphi over phi
    for v_count = 1, nphi do
    Hphi = feData[freq_count][u_count][v_count][n_count].hfieldcomp2
    sum_Hphi = sum_Hphi + Hphi
    end -- v_count
    -- Set the values in the new dataset
    iSumData[freq_count][u_count][n_count].Ix = 2math.pirho*sum_Hphi/nphi
    end -- n_count
    end -- u_count
    end -- freq_count

    -- inspect(iSumData)
    ISumStoredData = iSumData:StoreData("Custom")

    ISumStoredData.Label = app.StoredData:UniqueName("Ix_" .. string.gsub(model, "%p", "_"))