TAGGED: heat-transfer, parameter-sweep
-
-
June 3, 2024 at 10:15 amLeon NeymeyerSubscriber
Hi,
I am working on a thermal simulation of heating electrodes inside substrate. Here you can see my structure:
I want to sweep over the length (x span) of the electrodes which works fine if I run the simulation, lock the mesh and then run the sweep. If I do not lock the mesh before running the sweep, the simulation will not be able to save the results due to the different sizes of the temperature array, as you can see in the third picture. This is the recommended method in this tutorial: Thermally Tuned Waveguide (second image). If I lock the mesh, I no longer have the error, but the sweep does not work properly. As you can see in the second picture, changes to the geometry are not reflected in the simulation. This is fine when I sweep over the power, but is a problem when I want to sweep over the geometry (x-span). You can see that the results do not change when I use the sweep method, but they do change when I change the x-span by hand. How can I solve this? Can I lock/unlock the mesh during the sweep?
Error without locking the mesh:
Result (with locked mesh) after Sweeping are the same:
I have manually adjusted the x-span in this result. So I would expect this result on the last sweep:
Thanks in advance!
-
June 3, 2024 at 7:10 pmAmrita PatiAnsys Employee
Hi Leon,
Thanks for sharing detailed information! Here are my thoughts so far:
- We should not lock the mesh if the geometry is expected to change through the sweep.
- If we keep the mesh unlocked, as you observe, the different sizes of results can not be combined to create a single dataset.
- I believe one approach would be to see if we can perform some post-processing on the sweep results to be able to use the data.
- But I believe the simplest solution would be to go for a fully scripted solution. In other words, instead of using the sweep utility, we can create for loops and sweep through the geometry and create an unstructured dataset to store the final data.
I haven't tested either of these approaches in HEAT or the DEVICE suite in general. So, let me test at least one of these and get back to you.
Regards,
Amrita -
June 3, 2024 at 9:03 pmAmrita PatiAnsys Employee
Hi Leon,
I thought about it a little bit. Just to reiterate, if we don't lock the mesh, (which we should not do when the geomtery is changing) we can not create a combined dataset out of all the sweep results as the underlying grid will be different. The indivdual simulations will run, but we just can not combine the results.
- If you want to create a single dataset, what we can do is interpolate the results of the triangular mesh into a rectangular grid. Then create a combined dataset with these interpolated results.
- If you do not have any preferences about creating a single dataset, then we can individually access each result manually or using script, and save them as different datasets.
Let me know which one do you prefer and I can write and share an example script.
Regards,
Amrita -
June 5, 2024 at 9:32 amLeon NeymeyerSubscriber
Hi Amrita,
Thanks for your quick feedback. I have already written a script that sweeps the parameter manually, but I want to have a single data set so that I can use the results in MODE. So I would be very grateful if you could write me a sample script for the first option. Perhaps the code I have already written will help me understand the problem better.
Â
Â
deleteall;
deletesweep("spacing_sweep");
clear; clc;
# Material erstellen ########################
# Silizium
addmodelmaterial;
set("name","Silicon");
set("color",[0.5;0.5;0.5;1]);
addhtmaterialproperty("Solid");
set("name","Silicon");
select("::model::materials::Silicon::Silicon");
set("mass density.constant", 2330);
set("specific heat.constant", 711);
set("thermal conductivity.constant", 148);
Â
# Gold Â
addmodelmaterial;Â Â
set("name","Gold");
set("color",[1;1;0;1]);
addhtmaterialproperty("Solid");
set("name","Gold");
select("::model::materials::Gold::Gold");
set("mass density.constant", 19300);
set("specific heat.constant", 129);
set("thermal conductivity.constant", 0.317);
Â
# Polymer Â
addmodelmaterial;
set("name","Polymer");
set("color",[0.5;1;1;0.33]);
addhtmaterialproperty("Solid");
set("name","Polymer");
select("::model::materials::Polymer::Polymer");
set("mass density.constant", 1200);
set("specific heat.constant", 1300);
set("thermal conductivity.constant", 0.2);
Â
# Luft
addmodelmaterial;Â Â
set("name","Air");
set("color",[0.5;0.5;1;0.2]);
addhtmaterialproperty("Fluid");
set("name","Air");
select("::model::materials::Air::Air");
set("mass density.constant", 1.17659);
set("specific heat.constant", 1006.43);
set("thermal conductivity.constant", 0.0263);
set("dynamic viscosity.constant", 1.85e-05);
set("thermal expansivity.constant", 1/300);
set("thermal expansivity.active model","Ideal Gas");
set("thermal expansivity.ideal gas.alpha", 1);
Â
# Geometrie erstellen ########################
# Substrat
addrect;
set("name","substrate");
set("material","Silicon");
set("x span", 260e-6);
set("y span", 20e-6);
set("y", -30e-6);
set("z span", 1e-6);
set("mesh order", 2);
Â
# Polymer
addrect;
set("name","polymer");
set("material","Polymer");
set("x span", 260e-6);
set("y span", 60e-6);
set("y", 10e-6);
set("z span", 1e-6);
set("mesh order", 4);
Â
# Gas
addrect;
set("name","gas");
set("material","Air");
set("x span", 260e-6);
set("y span", 20e-6);
set("y", 50e-6);
set("z span", 1e-6);
set("mesh order", 2);
Â
# Waveguide
for(i=0:11){
   x_position = -90e-6 + (i-1) * 20e-6;
   waveguide_name = "WG" + num2str(i);
   addrect;
   set("name", waveguide_name);
   set("material", "Polymer");
   set("x", x_position);
   set("y", 20e-6);
   set("x span", 3.2e-6);
   set("y span", 3.2e-6);
   set("y", 20e-6);
   set("z span", 1e-6);
   set("mesh order", 2);
}
   Â
# Simulations-Setup ########################
# Simulationsregion festlegen
select("simulation region");
set("dimension", "2D Z-Normal");
set("x span", 250e-6);
set("y span", 40e-6);
set("y", 15e-6);
Â
# Solver hinzufügen
addheatsolver;
set("norm length", 200e-6);
set("max refine steps", 800000);
Â
# Monitore setzen Â
addtemperaturemonitor("HEAT");
set("name", "wg_monitor");
set("monitor type", "2D z-normal");
set("x span", 5e-6);
set("x", 30e-6);
set("y span", 5e-6);
set("y", 20e-6);
Â
# Randbedingungen setzen
addtemperaturebc("HEAT");
set("surface type","solid");
set("temperature", 300);
set("surface type", "simulation region");
set("y min", true);
Â
addconvectionbc("HEAT");
set("convection model", "constant");
set("ambient temperature", 300);
set("h convection", 10);
set("surface type", "material:material");
set("material 1", "Polymer");
set("material 2", "Air");
Â
length_electrodes = linspace(5e-6, 40e-6, 7);
for(j=1:length(length_electrodes)){
   switchtolayout;
   # Daten Speichern
   file_name = "01_T_" + num2str(j);
   select("HEAT::wg_monitor");
   set("save data", true);
   set("filename", file_name);
   for(i=0:5){
       # Elektroden
       x_position = -60e-6 + (i-1) * 40e-6;
       electrode_name = "EL" + num2str(i);
       addrect;
       set("name", electrode_name);
       set("material", "Gold");
       set("x", x_position);
       set("y", 20e-6);
       set("x span", length_electrodes(j));
       set("y span", 0.2e-6);
       set("y", 30e-6);
       set("z span", 2e-6);
       set("mesh order", 2);
       if (j == 1){       Â
           # Heizquelle
           adduniformheat;
           name = "uniform_heat_EL" + num2str(i);
           set("name", name);
           set("geometry type", "volume");
           set("volume solid", electrode_name);
           set("total power", 0.00421);
           set("use solver norm length", true);
       }
   }
   run;
}
-
- The topic ‘HEAT: Sweeping over geometry gives wrong/same results’ is closed to new replies.
- Difference between answers in version 2024 and 2017 lumerical mode solution
- Errors Running Ring Modulator Example on Cluster
- INTERCONNECT – No results unless rerun simulation until it gives any
- Import material .txt file with script
- Help for qINTERCONNECT
- Trapezoidal ring
- Issues with getting result from interconnent analysis script
- How to measure transmission coefficients on a given plane .
- Topology Optimization Error
- Edge Coupler EME Example Issue
-
1281
-
591
-
544
-
524
-
366
© 2024 Copyright ANSYS, Inc. All rights reserved.