

May 11, 2021 at 5:12 am

May 11, 2021 at 4:40 pmGreg BaethgeAnsys Employee
Thank you for posting your question. I think you should be able to create such structure using a planar solid object. It's a bit tricky, as you have to:
divide the structure in n facets each made of 4 vertices.
define all the vertices needed to define the facets (there should be 4*res vertices, that can be defined in a similar way as in your current code)
connect the vertices to create the facets (there should be (res1)*4+2 facets to cover front, back, top, bottom and sides)
the latter is usually the painful part! We have this example that could be helpful:
Drawing truncated cone in finite element
Let me know if you run into any issue.

May 12, 2021 at 2:50 amphillSubscriberthank you for your reply. The solution you gave seems to be a bit difficult. If you can solve this problem through ÔÇ£addpolyÔÇØ, thank you.

May 12, 2021 at 10:30 amGreg BaethgeAnsys EmployeeI definitely agree it's not simple. The limitation of addpoly is it can only create a shape that is extruded in the z direction, so it can't have any angle in the vertical walls. I had a bit of time, so I wrote this script:
## Definition of the vertices coordinates
z_bot = matrix(res);
z_top = z_bot + thickness;
x1_top = rad1 * cos(t1);
y1_top = rad1 * sin(t1);
z1_top = z_top;
x2_top = rad2 * cos(t1);
y2_top = rad2 * sin(t1);
z2_top = z_top;
x2_bot = rad2 * cos(t1);
y2_bot = rad2 * sin(t1);
z2_bot = z_bot;
x1_bot = (rad1  thickness*tan(thetarad)) * cos(t1);
y1_bot = (rad1  thickness*tan(thetarad)) * sin(t1);
z1_bot = z_bot;
##################################################
x = matrix(4*res);
y = matrix(4*res);
z = matrix(4*res);
x(1:res) = x1_top; # top R1
y(1:res) = y1_top;
z(1:res) = z1_top;
x(res+1:2*res) = x2_top; # top R2
y(res+1:2*res) = y2_top;
z(res+1:2*res) = z2_top;
x(2*res+1:3*res) = x2_bot; # bot R2
y(2*res+1:3*res) = y2_bot;
z(2*res+1:3*res) = z2_bot;
x(3*res+1:4*res) = x1_bot; # bot R1angle
y(3*res+1:4*res) = y1_bot;
z(3*res+1:4*res) = z1_bot;
vtx = [x,y,z];
## Definition of the facets
fct = cell((res1)*4+2);
for(i=1:length(fct)){
fct{i} = cell(1);
}
fct{1}{1} = [1, res+1, 2*res+1, 3*res+1];
fct{2}{1} = [res, 4*res, 3*res, 2*res];
for(i=1:res1){
j = i+2;
fct{j}{1} = [3*res+i, 3*res+i+1, i+1, i];
fct{j+res1}{1} = [i, i+1, res+1+i, res+i];
fct{j+2*(res1)}{1} = [2*res+i, res+i, res+i+1, 2*res+i+1];
fct{j+3*(res1)}{1} = [3*res+i, 2*res+i, 2*res+i+1, 3*res+i+1];
}
addplanarsolid(vtx, fct);
Where thetarad is the angle of wall in radian, rad1 and rad2 the 2 radii (taken from the top surface). This should create a object like this:
Let me know if you have any question

May 13, 2021 at 6:24 amphillSubscriberThank you for taking the time to help, the problem has been resolved. I may need your help if I face difficulties.

 You must be logged in to reply to this topic.
Simulation World 2022
Check out more than 70 different sessions now available on demand. Get inspired as you hear from visionary companies, leading researchers and educators from around the globe on a variety of topics from lifesaving improvements in healthcare, to bold new realities of space travel. Take a leap of certainty and check out a session today here.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
 “Import optical generation” or “delta generation rate”?
 Why am I getting “process exited without calling finalize”, and how do I fix it?
 Error on Lumerical device
 Using a license file on a new license server
 Ansys Insight: Diverging Simulations
 Ansys Insight: About override mesh in FDTD: its use and settings
 Error: addfdtd is not a valid function or a variable name
 Ansys Insight: Convergence issues in CHARGE
 Ansys Insight: Transmission results greater than one
 Is there a Lumerical script command to output the Simulation and Memory requirements?

1862

1661

913

650

349
© 2022 Copyright ANSYS, Inc. All rights reserved.