Skip to content

Axial Cooling Fan (80 x 80 x 25, cutaway) ​

Axial Cooling Fan (80 x 80 x 25, cutaway), rendered in the brepjs playground
Mechanical · 176 lines▶ Run it in the playground

An 80 x 80 x 25 mm brushless axial fan in cutaway: flanged frame, seven lofted aerofoil blades, and the outer-rotor motor with its ring magnet, four wound poles, bearing tube and two ball bearings. The frame size, the 71.5 mm hole pitch and the 82 g mass are published figures. The kernel measures the mass from the solid volumes. The blades, the motor and the leads are a display model.

Code ​

This is the full program. The playground runs it in your browser without a change.

ts
import { box, clone, compound, cut, cutAll, cylinder, edgeFinder, fillet, fuseAll, interpolateCurve, intersect, loft, measureVolume, polygon, revolve, rotate, sphere, unwrap, wire } from 'brepjs/quick';
import { color } from 'brepjs/playground';

// 80 x 80 x 25 mm brushless axial fan, in cutaway. The axis is Z, air moves toward -Z, units are millimetres.
// The frame size, the mounting holes and the mass are published figures. The blades, the motor,
// the bearings and the leads are a display model.
interface FanParams {
  cutaway?: number; // degrees of the frame and the rotor to cut away (0 = closed fan)
  blades?: number; // impeller blade count
  spin?: number; // rotor angle in degrees (it moves the blades)
}

type P2 = [number, number]; // [r, z]
type P3 = [number, number, number];
type Shape = ReturnType<typeof cylinder>;

// Kernel shapes live in WASM memory. Every temporary goes through own(). freeing() runs a build and then frees them all.
const owned: { delete(): void }[] = [];
const own = <T extends { delete(): void }>(s: T): T => {
  owned.push(s);
  return s;
};
const freeing = <T,>(build: () => T): T => { try { return build(); } finally { owned.splice(0).forEach((s) => s.delete()); } }; // also when the build throws

// ---- published figures (80 x 80 x 25 mm frame size)
const FRAME = 80;
const DEPTH = 25;
const HOLES = { pitch: 71.5, diameter: 4.5 };
const FLANGE = 4; // thickness of each mounting flange
const CATALOGUE_G = 82;
const DENSITY = { pbt: 1.53e-3, steel: 7.85e-3, copper: 8.96e-3, ferrite: 3.7e-3, brass: 8.5e-3, board: 1.85e-3 }; // grams per cubic millimetre

// ---- display model
const BORE = 38; // radius of the air duct
const WALL = 1.5; // duct wall
const HUB = { radius: 19, wall: 1.2, top: 24.5, bottom: 4.6 };
const BASE = { radius: 19, height: 3 }; // motor base that the struts carry
const STRUT = { lean: 6, width: 3, leadWidth: 4.4 }; // each strut is tangent to a circle of this radius
const TUBE = { inner: 4, outer: 4.6, top: 19 }; // brass bearing tube
const STATOR = { radius: 14.6, hub: 7, arm: 4, z: 7, stack: 7, fill: 0.55 }; // four poles. fill is the copper share of a coil
const COIL = { inner: 7.6, outer: 12.2, over: 2.1 };
const YOKE = { inner: 17, top: 23.1, sheet: 0.8 }; // steel cup that carries the ring magnet
const MAGNET = { inner: 15.3, z: 5.5, height: 10 };
const BEARING = { ring: 0.5, width: 4, ball: 0.75, count: 6 };
const SHAFT = 1.5;
const LEAD = 0.65; // radius of one insulated lead
const OPEN_AT = -9; // centre of the cutaway, clear of the struts

// A closed profile in the (r, z) half-plane, revolved about the axis.
const lathe = (pts: P2[], angle = 2 * Math.PI): Shape => {
  const profile = own(unwrap(polygon(pts.map(([r, z]): P3 => [r, 0, z]))));
  return unwrap(revolve(profile, { axis: [0, 0, 1], angle })) as Shape;
};
const ring = (r0: number, r1: number, z0: number, z1: number, angle?: number): Shape => lathe([[r0, z0], [r1, z0], [r1, z1], [r0, z1]], angle);
const turn = (s: Shape, deg: number): Shape => rotate(s, deg, { axis: [0, 0, 1] }) as Shape;
const quarter = (s: Shape, offset = 0): Shape[] => [0, 90, 180, 270].map((a) => own(turn(s, a + offset)));
const volume = (parts: Shape[]): number => parts.reduce((sum, s) => sum + unwrap(measureVolume(s)), 0);

// One aerofoil section on the cylinder of radius r: NACA-style thickness on a parabolic camber line.
// pitch is the angle between the chord and the plane of rotation. The leading edge is up and ahead.
const section = (r: number, chord: number, pitch: number, lead: number, z0: number) => {
  const N = 10;
  const cs = Math.cos(pitch);
  const sn = Math.sin(pitch);
  const at = (x: number, side: 1 | -1): P3 => {
    const yc = 0.28 * x * (1 - x);
    const yt = 0.3 * (0.2969 * Math.sqrt(x) - 0.126 * x - 0.3516 * x * x + 0.2843 * x ** 3 - 0.1036 * x ** 4);
    const a = (0.5 - x) * chord;
    const b = (yc + side * yt) * chord;
    const angle = lead + (a * cs - b * sn) / r;
    return [r * Math.cos(angle), r * Math.sin(angle), z0 + a * sn + b * cs];
  };
  const xs = Array.from({ length: N + 1 }, (_, i) => 0.5 * (1 - Math.cos((Math.PI * i) / N)));
  const upper = own(unwrap(interpolateCurve(xs.map((x) => at(x, 1)))));
  const lower = own(unwrap(interpolateCurve(xs.map((x) => at(x, -1)).reverse())));
  return own(unwrap(wire([upper, lower])));
};

function fan({ cutaway = 80, blades = 7, spin = 0 }: FanParams = {}) {
  const d2r = Math.PI / 180;
  const half = HOLES.pitch / 2;

  // Frame: two flanges and a duct, then the flared bore, the lead slot and the four mounting holes.
  const plate = own(box(FRAME, FRAME, FLANGE, { at: [0, 0, FLANGE / 2] }));
  const flange = own(unwrap(fillet(plate, edgeFinder().inDirection('Z').findAll(plate), (FRAME - HOLES.pitch) / 2)) as Shape);
  const far = own(rotate(flange, 180, { axis: [1, 0, 0], at: [0, 0, DEPTH / 2] }) as Shape);
  const blank = own(unwrap(fuseAll([flange, far, own(ring(BORE - 1, BORE + WALL, 1, DEPTH - 1))])) as Shape);
  const duct = own(lathe([[0, -1], [BORE + 1.6, -1], [BORE, 1.6], [BORE, DEPTH - 2.2], [BORE + 2.2, DEPTH + 1], [0, DEPTH + 1]]));
  const leadSlot = own(turn(own(box(30, 3.2, 1.5, { at: [BORE + 13, -STRUT.lean, BASE.height + 0.75] })), -45));
  const screwHoles = quarter(own(cylinder(HOLES.diameter / 2, DEPTH + 2, { at: [half, half, -1] })));
  const shell = own(unwrap(cutAll(blank, [duct, leadSlot, ...screwHoles])) as Shape);

  // Four leaning struts carry the motor base. The wide one carries the leads.
  const strut = (width: number): Shape => own(box(BORE + 0.9 - 10, width, BASE.height, { at: [(BORE + 0.9 + 10) / 2, -STRUT.lean, BASE.height / 2] }));
  const struts = [own(turn(strut(STRUT.leadWidth), -45)), ...[45, 135, 225].map((a) => own(turn(strut(STRUT.width), a)))];
  const frame = own(unwrap(fuseAll([shell, own(cylinder(BASE.radius, BASE.height)), ...struts])) as Shape);

  // Stator: a four-pole lamination stack on the bearing tube, with a coil on each pole.
  const zs = STATOR.z;
  const zm = zs + STATOR.stack / 2;
  const arm = own(box(7, STATOR.arm, STATOR.stack, { at: [10, 0, zm] }));
  const shoe = own(turn(own(ring(13, STATOR.radius, zs, zs + STATOR.stack, 70 * d2r)), -35));
  const stack = unwrap(fuseAll([own(ring(TUBE.outer, STATOR.hub, zs, zs + STATOR.stack)), ...quarter(arm), ...quarter(shoe)])) as Shape;
  const wound = own(box(COIL.outer - COIL.inner, STATOR.arm + 2 * COIL.over, STATOR.stack + 2 * COIL.over, { at: [(COIL.inner + COIL.outer) / 2, 0, zm] }));
  const coils = quarter(own(unwrap(cut(wound, arm)) as Shape));
  const board = ring(TUBE.outer, 16.5, BASE.height, BASE.height + 1);
  const tube = ring(TUBE.inner, TUBE.outer, BASE.height, TUBE.top);

  // Two ball bearings in the tube, and the shaft.
  const bearing = (z: number): Shape[] => {
    const rp = (SHAFT + TUBE.inner) / 2;
    const ball = own(sphere(BEARING.ball, { at: [rp, 0, z + BEARING.width / 2] }));
    const balls = Array.from({ length: BEARING.count }, (_, i) => own(turn(ball, (360 * i) / BEARING.count)));
    return [own(ring(SHAFT, SHAFT + BEARING.ring, z, z + BEARING.width)), own(ring(TUBE.inner - BEARING.ring, TUBE.inner, z, z + BEARING.width)), ...balls];
  };
  const bearings = [...bearing(BASE.height), ...bearing(TUBE.top - BEARING.width)];
  const shaft = own(cylinder(SHAFT, YOKE.top - BASE.height, { at: [0, 0, BASE.height] }));

  // Rotor: a steel yoke with the ring magnet, in a plastic hub that carries the blades.
  const ro = YOKE.inner + YOKE.sheet;
  const yoke = own(lathe([[SHAFT, YOKE.top - YOKE.sheet], [YOKE.inner, YOKE.top - YOKE.sheet], [YOKE.inner, 5], [ro, 5], [ro, YOKE.top], [SHAFT, YOKE.top]]));
  const magnet = own(ring(MAGNET.inner, YOKE.inner, MAGNET.z, MAGNET.z + MAGNET.height));
  const cup = own(lathe([[0, YOKE.top], [ro, YOKE.top], [ro, HUB.bottom], [HUB.radius, HUB.bottom], [HUB.radius, HUB.top - 0.8], [HUB.radius - 0.8, HUB.top], [0, HUB.top]]));

  // Blade: a loft through four sections, trimmed to the hub and to the tip circle.
  // It leans forward and its pitch falls from root to tip.
  const solidity = Math.min(7 / blades, 1.15); // fewer blades get a longer chord
  const stations: [number, number, number, number][] = [[16.5, 19, 55, -1], [24, 25, 42, 4], [31.5, 29, 33, 10], [39.5, 31, 26, 19]]; // r, chord, pitch, lead
  const raw = own(unwrap(loft(stations.map(([r, chord, pitch, lead]) => section(r, chord * solidity, pitch * d2r, lead * d2r, 14.5)), { ruled: false })) as Shape);
  const blade = own(unwrap(intersect(raw, own(ring(HUB.radius, BORE - 1, 0, DEPTH)))) as Shape);
  const angles = Array.from({ length: blades }, (_, i) => (360 * i) / blades + spin);
  const allBlades = angles.map((a) => own(turn(blade, a)));

  // Leads: from the board, along the wide strut, through the slot in the frame.
  const lead = (side: number): Shape => turn(own(cylinder(LEAD, 39.5, { at: [16.5, -STRUT.lean + side * (LEAD + 0.05), BASE.height + LEAD], axis: [1, 0, 0] })), -45);
  const tip = (side: number): Shape => own(turn(own(cylinder(0.35, 2.5, { at: [56, -STRUT.lean + side * (LEAD + 0.05), BASE.height + LEAD], axis: [1, 0, 0] })), -45));

  // Mass from the kernel volumes of the closed fan.
  const grams =
    volume([frame, cup, ...allBlades]) * DENSITY.pbt + volume([yoke, shaft, stack, ...bearings]) * DENSITY.steel + volume(coils) * STATOR.fill * DENSITY.copper +
    volume([magnet]) * DENSITY.ferrite + volume([tube]) * DENSITY.brass + volume([board]) * DENSITY.board;

  // Cutaway: one wedge opens the rotor, a hollow one opens the frame and keeps the motor base whole.
  const sweep = Math.max(cutaway, 1) * d2r;
  const start = OPEN_AT - cutaway / 2;
  const wedge = own(turn(own(ring(0, 60, -5, 30, sweep)), start));
  const outerWedge = own(turn(own(ring(BASE.radius + 1.5, 60, -5, 30, sweep)), start));
  const open = (s: Shape, tool = wedge): Shape => (cutaway > 0 ? (unwrap(cut(s, tool)) as Shape) : (unwrap(clone(s)) as Shape));

  // A blade with its root in the cut goes away with the cut. The other blades stay whole.
  const away = (a: number): boolean => Math.abs(((((a - OPEN_AT) % 360) + 540) % 360) - 180) < cutaway / 2 + 20 * solidity;
  const kept = allBlades.filter((_, i) => cutaway <= 0 || !away(angles[i]!));

  return {
    frame: open(frame, outerWedge), impeller: compound([own(open(cup)), ...kept]) as Shape, stack, board, tube, magnet: open(magnet),
    steel: compound([own(open(yoke)), shaft, ...bearings]) as Shape, coils: compound(coils) as Shape,
    red: lead(1), black: lead(-1), tips: compound([tip(1), tip(-1)]) as Shape, grams,
  };
}

const part = freeing(() => fan());
console.log('Mass: ' + part.grams.toFixed(0) + ' g from the kernel volumes. The catalogue has ' + CATALOGUE_G + ' g.');

export default [
  color(part.frame, '#f5f2ea'),
  color(part.impeller, '#12b5b0'),
  color(part.steel, '#c3c9d1'),
  color(part.stack, '#8d96a0'),
  color(part.coils, '#c9743a'),
  color(part.magnet, '#2b2f36'),
  color(part.tube, '#d3a956'),
  color(part.board, '#2f7d5b'),
  color(part.red, '#d8322a'),
  color(part.black, '#1d2024'),
  color(part.tips, '#d3a956'),
];

Functions used ​

box clone compound cut cutAll cylinder edgeFinder fillet fuseAll interpolateCurve intersect loft measureVolume polygon revolve rotate sphere unwrap wire color

▶ Run Axial Cooling Fan (80 x 80 x 25, cutaway) in the playground

Released under the Apache 2.0 License.