// First shape
CompositeCurve cc1 = new CompositeCurve(new ICurve[]
{
new Line(Plane.XY, 0, 0,96,0),
new Line(Plane.XY,96,0,96,24),
new Line(Plane.XY,96,24,76,24),
new Arc(Plane.XY,new Point2D(76,32),new Point2D(76,40),new Point2D(76,24)),
new Line(Plane.XY,76,40,96,40),
new Line(Plane.XY,96,40,96,64),
new Line(Plane.XY,96,64,0,64),
new Line(Plane.XY,0,64,0,0),
});
devDept.Eyeshot.Entities.Region r1 = new devDept.Eyeshot.Entities.Region(cc1, Plane.XY, true);
Brep ext1 = r1.ExtrudeAsBrep(16);
design1.Entities.Add(ext1, Color.Salmon);
// Second shape
CompositeCurve cc2 = new CompositeCurve(new ICurve[]
{
new Line(Plane.YZ,0,0,0,34),
new Line(Plane.YZ,0,34,20,64),
new Line(Plane.YZ,20,64,64,64),
new Line(Plane.YZ,64,64,64,0),
new Line(Plane.YZ,64,0,0,0),
});
devDept.Eyeshot.Entities.Region r2 = new devDept.Eyeshot.Entities.Region(cc2, Plane.YZ, true);
ext1.ExtrudeAdd(r2, 16);
// Third shape
CompositeCurve cc3 = new CompositeCurve(new ICurve[]
{
new Line(Plane.XZ,16,16,56,16),
new Line(Plane.XZ,56,16,56,44),
new Line(Plane.XZ,56,44,48,44),
new Arc(Plane.XZ,new Point2D(36,44),new Point2D(24,44),new Point2D(48,44)),
new Line(Plane.XZ,24,44,16,44),
new Line(Plane.XZ,16,44,16,16),
});
devDept.Eyeshot.Entities.Region r3 = new devDept.Eyeshot.Entities.Region(cc3, Plane.XZ, true);
r3.Translate(0, 22, 0);
ext1.ExtrudeAdd(r3, -42);
// Final shape
CompositeCurve cc4 = new CompositeCurve(new ICurve[]
{
new Line(Plane.XZ,56,16,96,16),
new Line(Plane.XZ,96,16,56,44),
new Line(Plane.XZ,56,44,56,16),
});
devDept.Eyeshot.Entities.Region r4 = new devDept.Eyeshot.Entities.Region(cc4, Plane.XZ, true);
r4.Translate(0, 52, 0);
ext1.ExtrudeAdd(r4, -12);
design1.Entities.Add(ext1);
design1.Entities.Regen();
Simulation
Problem definition
// Adds the material
simulation1.Materials.Add(Material.Copper);
ext1.MaterialName = Material.Copper.Name;
// Mesh generation
VolumeMesher vm = new VolumeMesher(ext1, 5, false, simulation1.Materials);
vm.DoWork();
FemMesh fm = vm.Result;
fm.Regen(0); // prepares boundary nodes
// Sets boundary conditions
fm.SetRestraintOnFace(true, true, true, 6, ext1, 0, 0, 0);
fm.SetForceOnFace(new Vector3D(0, 0, -10), 12, ext1);
// Adds to scene
simulation1.Entities.Add(fm);
// Changes size of boundary condition symbols
fm.SymbolSize = 1;
Solution and Results plot
// Solves the system of equations
Solver s = new Solver(fm);
s.DoWork();
// Computes the results plot (Von Mises)
fm.PlotMode = FemMesh.plotType.VonMises;
fm.ComputePlot(simulation1, simulation1.Legend);
// Hides boundary conditions before display
simulation1.ShowLoad = false;
simulation1.ShowRestraint = false;
Result Animation
// Sets the Simulation workspace properties for results animation
simulation1.SimulationResult = fm;
simulation1.Start();
Comments
Please sign in to leave a comment.