how to create a PEC cuboid in prefeko?

resiter com
resiter com Altair Community Member
edited May 22 in Community Q&A

Hello!

When i create a model in prefeko,i can use QU CARD to create a dielectric cuboid,but i can't find a CARD to create a PEC cuboid.

Does anyone know how to create a PEC cuboid in prefeko?

Thanks!

Resiter

Tagged:

Best Answer

  • Torben Voigt
    Torben Voigt
    Altair Employee
    edited May 18 Answer ✓

    You can change the value of avariable using 

    cadfeko_batch modelname -#variable=value

    For example take the attached model cuboid.cfx and save the attached .bat file in the same folder. When you run the .bat file the value of edgelength is changed and the simulation runs. All without any GUI.

    Note the path to the executables may need to be changed on your machine.

    Hope this helps!

    Best regards,
    Torben

Answers

  • Torben Voigt
    Torben Voigt
    Altair Employee
    edited May 15

    Hi resiter com,

    Like most Feko users, I am not super familiar with EDITFEKO. Most of the functions have been available in CADFEKO for decades.

    May I ask why you want to use EDITFEKO? Would it be an option for you to create the cuboid in CADFEKO and then use the created mesh in EDITFEKO (that would be the normal procedure)?

    I quickly tried to create a PEC cuboid in EDITFEKO, but it doesn't seem to be that easy. I imagine you could only do it by creating six rectangular polygons.

    Best regards,
    Torben

  • resiter com
    resiter com Altair Community Member
    edited May 15

    Hi resiter com,

    Like most Feko users, I am not super familiar with EDITFEKO. Most of the functions have been available in CADFEKO for decades.

    May I ask why you want to use EDITFEKO? Would it be an option for you to create the cuboid in CADFEKO and then use the created mesh in EDITFEKO (that would be the normal procedure)?

    I quickly tried to create a PEC cuboid in EDITFEKO, but it doesn't seem to be that easy. I imagine you could only do it by creating six rectangular polygons.

    Best regards,
    Torben

    Hello Torben,

    Thank you for your suggestions and help!

    The normal procedure you suggested is completely right. I'm applying an algorithm in feko these days, and when i try to compare cuboids of different sizes, i have to change it manually in CADFEKO, and use the created mesh in EDITFEKO. I felt it was so time-consuming.So i have been considering how to change the size of PEC cuboid automatically through editing .pre file(in MATLAB).

    Btw, is there any other way to change the size of PEC cuboid automatically? I have tried the Lua script, but every time i run it in MATLAB, the CADFEKO and script editor will be displayed. And i'm still thinking how to close the CADFEKO and script editor in MATLAB to run the following code(Btw, even if i have done this, since my algorithm needs to launch simulation many times, i don't want to see the CADFEKO open and close XD).Or is it possible to run the script without launching the CADFEKO? I am attaching the project file for more info.(testlua is the matlab code)

    Creating six rectangular polygons is an alternative way i have tested, it's slightly different from the PEC cuboid(Farfield).

    Best regards,
    Resiter

  • Torben Voigt
    Torben Voigt
    Altair Employee
    edited May 18 Answer ✓

    You can change the value of avariable using 

    cadfeko_batch modelname -#variable=value

    For example take the attached model cuboid.cfx and save the attached .bat file in the same folder. When you run the .bat file the value of edgelength is changed and the simulation runs. All without any GUI.

    Note the path to the executables may need to be changed on your machine.

    Hope this helps!

    Best regards,
    Torben

  • Torben Voigt
    Torben Voigt
    Altair Employee
    edited May 15

    The parameter sweep in Feko might also be a good option.

  • resiter com
    resiter com Altair Community Member
    edited May 15

    The parameter sweep in Feko might also be a good option.

    Thank you Torben!

    The algorithm I apply is supposed to change multiple planewave motivations several times of one cuboid. So the whole process should be implemented in MATLAB(I used prefeko and runfeko to run the simulation).

    Your advice about using the .bat file is worth to try(I haven’t used this to change parameter before, maybe I can use the .bat file to change the size of cuboid, then change the settings of plane waves and run the simulation and algorithm in MATLAB). I sincerely appreciate your suggestion, and I will try this tomorrow.

    Best regards,

    Resiter

  • resiter com
    resiter com Altair Community Member
    edited May 16

    You can change the value of avariable using 

    cadfeko_batch modelname -#variable=value

    For example take the attached model cuboid.cfx and save the attached .bat file in the same folder. When you run the .bat file the value of edgelength is changed and the simulation runs. All without any GUI.

    Note the path to the executables may need to be changed on your machine.

    Hope this helps!

    Best regards,
    Torben

    Hello Torben!

    I successfully change the size of the PEC cuboid in CADFEKO using .bat file, and the mesh is automatically done. Amazing!

    Btw, i have another question that when i simulate a PEC cuboid on a dielectric substrate(such as metasurface), should i change the mesh size on the boundary between PEC and dielectric? because there is slight difference between CST and FEKO.

    Thanks!

    Resiter

  • Torben Voigt
    Torben Voigt
    Altair Employee
    edited May 18

    Hello Torben!

    I successfully change the size of the PEC cuboid in CADFEKO using .bat file, and the mesh is automatically done. Amazing!

    Btw, i have another question that when i simulate a PEC cuboid on a dielectric substrate(such as metasurface), should i change the mesh size on the boundary between PEC and dielectric? because there is slight difference between CST and FEKO.

    Thanks!

    Resiter

    Hi resiter com,

    Good to know that the original problem has been solved! Normally, using the "standard" mesh is sufficient, but of course it can sometimes happen that the user has to refine the mesh locally. 

    You could try to see if the results change significantly with a global "fine" mesh. Or with local manual refinement (I have no concrete idea of the model).

    As always, feel free to attach your model jhere to let me check.

    (In fact, strictly speaking, it is ALWAYS recommended to perform a mesh convergence study. This means refining the mesh step by step and checking whether results change significantly. But of course nobody does this in reality because it takes some time... ;))

    Best regards,
    Torben

  • resiter com
    resiter com Altair Community Member
    edited May 18

    Hi resiter com,

    Good to know that the original problem has been solved! Normally, using the "standard" mesh is sufficient, but of course it can sometimes happen that the user has to refine the mesh locally. 

    You could try to see if the results change significantly with a global "fine" mesh. Or with local manual refinement (I have no concrete idea of the model).

    As always, feel free to attach your model jhere to let me check.

    (In fact, strictly speaking, it is ALWAYS recommended to perform a mesh convergence study. This means refining the mesh step by step and checking whether results change significantly. But of course nobody does this in reality because it takes some time... ;))

    Best regards,
    Torben

    Hello Torben,

    I am comparing the result of CST and FEKO, and the result of a PEC thin patch on a substrate is attached in fig.1, the substrate size is 20mm, the result is pretty similar. And when i change the substrate size to 60mm and PEC patch to 30mm, the difference will become relatively large.(fig.2)

    I also test a simple metasurface(Beam deflection of 10 degrees.), the pointing angle is the same, but the side lobe is slightly different(fig.3), Btw, the mesh size can't be set to standard cuz the triangles is too many, so i slightly increase the triangle edge length.(maybe this matters).

    The CST projects are also attached below if you can check it.

    Best regards,

    Resiter

  • Torben Voigt
    Torben Voigt
    Altair Employee
    edited May 21

    Hello Torben,

    I am comparing the result of CST and FEKO, and the result of a PEC thin patch on a substrate is attached in fig.1, the substrate size is 20mm, the result is pretty similar. And when i change the substrate size to 60mm and PEC patch to 30mm, the difference will become relatively large.(fig.2)

    I also test a simple metasurface(Beam deflection of 10 degrees.), the pointing angle is the same, but the side lobe is slightly different(fig.3), Btw, the mesh size can't be set to standard cuz the triangles is too many, so i slightly increase the triangle edge length.(maybe this matters).

    The CST projects are also attached below if you can check it.

    Best regards,

    Resiter

    Hi @resiter com,

    I would like to point out that the differences in your result are quite small. You have to consider the data range in which the differences occur here. You could try to see if a slightly finer mesh changes the results significantly. You could also compare different solvers (MoM, FDTD, FEM). Of course, there will always be slight differences.

    Personally, I would remove the physical thickness of your PEC regions so that there are only PEC faces. This requires less memory and runtime. It is very unlikely that the 100 µm thickness will make a difference with lossless metal (PEC).

    Best regards,
    Torben

  • resiter com
    resiter com Altair Community Member
    edited May 22

    Hi @resiter com,

    I would like to point out that the differences in your result are quite small. You have to consider the data range in which the differences occur here. You could try to see if a slightly finer mesh changes the results significantly. You could also compare different solvers (MoM, FDTD, FEM). Of course, there will always be slight differences.

    Personally, I would remove the physical thickness of your PEC regions so that there are only PEC faces. This requires less memory and runtime. It is very unlikely that the 100 µm thickness will make a difference with lossless metal (PEC).

    Best regards,
    Torben

    Thank you Torben!

    Your suggestions have helped me a lot, and i really appreciate that. I have almost solved the problem these days, Thank you again for your help and guidance.

    Best regards,

    Resiter 

  • Torben Voigt
    Torben Voigt
    Altair Employee
    edited May 22

    Thank you Torben!

    Your suggestions have helped me a lot, and i really appreciate that. I have almost solved the problem these days, Thank you again for your help and guidance.

    Best regards,

    Resiter 

    Always happy to help! :)
    Don't hesitate if you have more questions!