# No. 442 (Brown 1868): the pot wheel of the river Eisach.
# Model (cm, gravity on, side view). A wheel on a fixed axle carries 10 open pots (2.6 cm across, 3.2 cm deep) fixed at its rim,
# each mouth facing the way the rim moves (tilted 30 degrees inward). The water is
# particles in the wheel's plane (src/fluid/, about 0.5 cm apart): a river 11 cm deep, kept up upstream, runs under the wheel and out
# of the picture; the current on the pots is the only input (nothing is driven). Each pot is dipped and filled at the bottom,
# rises mouth-up on the right, and over the top turns its mouth down and empties into the trough. As in Brown's figure the trough lies
# across the wheel's plane, inside the wheel above the axle, so it is seen end-on; the water stands in it behind a low board and spills
# over into the trough's drain end, which runs back out of the picture behind the wheel (in this plane the water leaves the domain there,
# in view, because its way out is along the line of sight). The load on the axle: 0.006 N m s. Generator: opencode-runs/water/gen442.py with cfg442.
number: 442
slug: eisach-pot-wheel
name: Pot wheel of the Eisach
brown: "Machine of ancient origin, still employed on the river Eisach, in the Tyrol, for raising water. A current keeping the wheel in motion, the pots on its periphery are successively immersed, filled, and emptied into a trough above the stream."
units: cm
sim:
  timestep: 0.002
  integrator: implicitfast
  iterations: 50
  duration_s: 12
  floor: false
bodies:
  - id: wheel
    shape: part
    pos: [0, 0, 14]
    density: 700
    friction: 0.3
    color: "#b49a70"
    pieces:
      - {kind: poly, points: [[11.4264, 14.5695], [8.7936, 13.0495], [8.6836, 13.24], [11.3164, 14.76]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}   # pot 0: its bottom
      - {kind: poly, points: [[8.8742, 13.35], [7.2742, 16.1213], [7.0836, 16.0113], [8.6836, 13.24]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[11.3164, 14.76], [9.7164, 17.5313], [9.5258, 17.4213], [11.1258, 14.65]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[9.1, 13.9], [10, 13.9], [10, 14.1], [9.1, 14.1]], y: [2.6, 2.9], color: "#8f7a58"}   # its strap to the ring (behind)
      - {kind: poly, points: [[8.9094, 21.177], [7.6729, 18.3998], [7.4719, 18.4893], [8.7084, 21.2664]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}   # pot 1: its bottom
      - {kind: poly, points: [[7.5614, 18.6902], [4.6381, 19.9918], [4.5486, 19.7908], [7.4719, 18.4893]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[8.7084, 21.2664], [5.7851, 22.568], [5.6956, 22.367], [8.6189, 21.0655]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[7.4208, 19.2679], [8.1489, 19.797], [8.0314, 19.9588], [7.3033, 19.4297]], y: [2.6, 2.9], color: "#8f7a58"}   # its strap to the ring (behind)
      - {kind: poly, points: [[2.9893, 25.0431], [3.6214, 22.0695], [3.4062, 22.0238], [2.7741, 24.9973]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}   # pot 2: its bottom
      - {kind: poly, points: [[3.3605, 22.239], [0.2304, 21.5737], [0.2761, 21.3585], [3.4062, 22.0238]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[2.7741, 24.9973], [-0.3559, 24.332], [-0.3102, 24.1168], [2.8199, 24.7822]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[2.9072, 22.6237], [3.1853, 23.4797], [2.9951, 23.5415], [2.7169, 22.6855]], y: [2.6, 2.9], color: "#8f7a58"}   # its strap to the ring (behind)
      - {kind: poly, points: [[-4.0725, 24.6911], [-1.8134, 22.657], [-1.9606, 22.4935], [-4.2198, 24.5276]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}   # pot 3: its bottom
      - {kind: poly, points: [[-2.1241, 22.6407], [-4.2653, 20.2626], [-4.1018, 20.1154], [-1.9606, 22.4935]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[-4.2198, 24.5276], [-6.361, 22.1496], [-6.1975, 22.0024], [-4.0563, 24.3804]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[-2.7169, 22.6855], [-2.9951, 23.5415], [-3.1853, 23.4797], [-2.9072, 22.6237]], y: [2.6, 2.9], color: "#8f7a58"}   # its strap to the ring (behind)
      - {kind: poly, points: [[-9.5788, 20.2555], [-6.5555, 19.9378], [-6.5785, 19.719], [-9.6018, 20.0367]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}   # pot 4: its bottom
      - {kind: poly, points: [[-6.7973, 19.742], [-7.1318, 16.5595], [-6.913, 16.5365], [-6.5785, 19.719]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[-9.6018, 20.0367], [-9.9363, 16.8543], [-9.7175, 16.8313], [-9.383, 20.0137]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[-7.3033, 19.4297], [-8.0314, 19.9588], [-8.1489, 19.797], [-7.4208, 19.2679]], y: [2.6, 2.9], color: "#8f7a58"}   # its strap to the ring (behind)
      - {kind: poly, points: [[-11.4264, 13.4305], [-8.7936, 14.9505], [-8.6836, 14.76], [-11.3164, 13.24]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}   # pot 5: its bottom
      - {kind: poly, points: [[-8.8742, 14.65], [-7.2742, 11.8787], [-7.0836, 11.9887], [-8.6836, 14.76]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[-11.3164, 13.24], [-9.7164, 10.4687], [-9.5258, 10.5787], [-11.1258, 13.35]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[-9.1, 14.1], [-10, 14.1], [-10, 13.9], [-9.1, 13.9]], y: [2.6, 2.9], color: "#8f7a58"}   # its strap to the ring (behind)
      - {kind: poly, points: [[-8.9094, 6.823], [-7.6729, 9.6002], [-7.4719, 9.5107], [-8.7084, 6.7336]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}   # pot 6: its bottom
      - {kind: poly, points: [[-7.5614, 9.3098], [-4.6381, 8.0082], [-4.5486, 8.2092], [-7.4719, 9.5107]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[-8.7084, 6.7336], [-5.7851, 5.432], [-5.6956, 5.633], [-8.6189, 6.9345]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[-7.4208, 8.7321], [-8.1489, 8.203], [-8.0314, 8.0412], [-7.3033, 8.5703]], y: [2.6, 2.9], color: "#8f7a58"}   # its strap to the ring (behind)
      - {kind: poly, points: [[-2.9893, 2.9569], [-3.6214, 5.9305], [-3.4062, 5.9762], [-2.7741, 3.0027]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}   # pot 7: its bottom
      - {kind: poly, points: [[-3.3605, 5.761], [-0.2304, 6.4263], [-0.2761, 6.6415], [-3.4062, 5.9762]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[-2.7741, 3.0027], [0.3559, 3.668], [0.3102, 3.8832], [-2.8199, 3.2178]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[-2.9072, 5.3763], [-3.1853, 4.5203], [-2.9951, 4.4585], [-2.7169, 5.3145]], y: [2.6, 2.9], color: "#8f7a58"}   # its strap to the ring (behind)
      - {kind: poly, points: [[4.0725, 3.3089], [1.8134, 5.343], [1.9606, 5.5065], [4.2198, 3.4724]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}   # pot 8: its bottom
      - {kind: poly, points: [[2.1241, 5.3593], [4.2653, 7.7374], [4.1018, 7.8846], [1.9606, 5.5065]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[4.2198, 3.4724], [6.361, 5.8504], [6.1975, 5.9976], [4.0563, 3.6196]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[2.7169, 5.3145], [2.9951, 4.4585], [3.1853, 4.5203], [2.9072, 5.3763]], y: [2.6, 2.9], color: "#8f7a58"}   # its strap to the ring (behind)
      - {kind: poly, points: [[9.5788, 7.7445], [6.5555, 8.0622], [6.5785, 8.281], [9.6018, 7.9633]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}   # pot 9: its bottom
      - {kind: poly, points: [[6.7973, 8.258], [7.1318, 11.4405], [6.913, 11.4635], [6.5785, 8.281]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[9.6018, 7.9633], [9.9363, 11.1457], [9.7175, 11.1687], [9.383, 7.9863]], y: [0.3, 2.5], collide: 2, color: "#9a6b45"}
      - {kind: poly, points: [[7.3033, 8.5703], [8.0314, 8.0412], [8.1489, 8.203], [7.4208, 8.7321]], y: [2.6, 2.9], color: "#8f7a58"}   # its strap to the ring (behind)
      - {kind: poly, points: [[1.6, 13.85], [9.1, 13.85], [9.1, 14.15], [1.6, 14.15]], y: [2.6, 2.9], color: "#8f7a58"}   # a spoke (behind the water)
      - {kind: poly, points: [[1.2374, 15.0253], [6.5407, 20.3286], [6.3286, 20.5407], [1.0253, 15.2374]], y: [2.6, 2.9], color: "#8f7a58"}   # a spoke (behind the water)
      - {kind: poly, points: [[0.15, 15.6], [0.15, 23.1], [-0.15, 23.1], [-0.15, 15.6]], y: [2.6, 2.9], color: "#8f7a58"}   # a spoke (behind the water)
      - {kind: poly, points: [[-1.0253, 15.2374], [-6.3286, 20.5407], [-6.5407, 20.3286], [-1.2374, 15.0253]], y: [2.6, 2.9], color: "#8f7a58"}   # a spoke (behind the water)
      - {kind: poly, points: [[-1.6, 14.15], [-9.1, 14.15], [-9.1, 13.85], [-1.6, 13.85]], y: [2.6, 2.9], color: "#8f7a58"}   # a spoke (behind the water)
      - {kind: poly, points: [[-1.2374, 12.9747], [-6.5407, 7.6714], [-6.3286, 7.4593], [-1.0253, 12.7626]], y: [2.6, 2.9], color: "#8f7a58"}   # a spoke (behind the water)
      - {kind: poly, points: [[-0.15, 12.4], [-0.15, 4.9], [0.15, 4.9], [0.15, 12.4]], y: [2.6, 2.9], color: "#8f7a58"}   # a spoke (behind the water)
      - {kind: poly, points: [[1.0253, 12.7626], [6.3286, 7.4593], [6.5407, 7.6714], [1.2374, 12.9747]], y: [2.6, 2.9], color: "#8f7a58"}   # a spoke (behind the water)
      - {kind: disc, center: [0, 14], radius: 9.4, inner: 8.9, y: [2.6, 2.9], color: "#8f7a58"}   # the inner ring (behind)
      - {kind: disc, center: [0, 14], radius: 1.6, y: [-0.6, 3.6], color: "#6f6a60"}   # the axle
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    friction: 0
    color: "#c8b98f"
    pieces:
      - {kind: poly, points: [[-35, -1], [38, -1], [38, 0], [-35, 0]], y: [0.3, 2.5], collide: 2}   # the river's bed
      - {kind: poly, points: [[-36, -1], [-35, -1], [-35, 15], [-36, 15]], y: [0.0, 2.8], collide: 2}   # upstream (out of the picture)
      - {kind: poly, points: [[-2.25, 17.25], [3.75, 17.25], [3.75, 17.5], [-2.25, 17.5]], y: [0.3, 2.5], collide: 2, color: "#a08a62"}   # the trough's bottom (it runs back, across the wheel's plane)
      - {kind: poly, points: [[-2.25, 17.5], [-2, 17.5], [-2, 19.4], [-2.25, 19.4]], y: [0.3, 2.5], collide: 2, color: "#a08a62"}   # its sides
      - {kind: poly, points: [[3.5, 17.5], [3.75, 17.5], [3.75, 19.4], [3.5, 19.4]], y: [0.3, 2.5], collide: 2, color: "#a08a62"}
      - {kind: poly, points: [[-2.25, 17.25], [3.75, 17.25], [3.75, 18.1], [-2.25, 18.1]], y: [2.5, 16], color: "#a08a62"}   # the trough going back (out of the picture, behind the wheel)
      - {kind: poly, points: [[-2.25, 17.25], [-2, 17.25], [-2, 19.4], [-2.25, 19.4]], y: [2.5, 16], color: "#a08a62"}
      - {kind: poly, points: [[3.5, 17.25], [3.75, 17.25], [3.75, 19.4], [3.5, 19.4]], y: [2.5, 16], color: "#a08a62"}
      - {kind: poly, points: [[-1.3, 17.5], [-1.15, 17.5], [-1.15, 18.8], [-1.3, 18.8]], y: [0.3, 2.5], collide: 2, color: "#a08a62"}   # a low board: the water stands behind it and spills over into the trough's drain end
      - {kind: poly, points: [[-0.8, 0], [0.8, 0], [0.5, 13.4], [-0.5, 13.4]], y: [3.6, 4.4], color: "#b7ad98"}   # the trestle carrying the axle (behind)
joints:
  - {id: j_w, type: hinge, body: wheel, axis: [0, -1, 0], damping: 0.006}   # + : anticlockwise as drawn (the river runs left to right)
contact: {solref: [0.004, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_w, kind: torque, torque: 0, max_torque: 0.001}   # no hand on the wheel: the river is the only input
checks:
  - {type: turning, joint: j_w, direction: 1, min_mean: 0.3, min_fraction: 0.9, settle_s: 3.0, window_s: 8.5}
  - {type: penetration, max: 0.003}
camera: {target: [4, 0, 13], position: [4, -110, 13], fov: 17}
fluid:
  plane: xz
  slab: [0.3, 2.5]
  spacing: 0.5
  dt: 0.002
  friction: 0.005
  draw: surface
  domain: [-35.5, -1.5, 39, 31.2]
  reservoir: {box: [-35, 0, -29, 12], head: 11}
  sinks: [[37, -1.5, 39, 14], [-2, 17.2, -1.3, 19.4]]
  controls: {head: [6, 12], label: "Depth of the river"}
  tiers: [{id: light, label: "Lighter water (fewer particles)", spacing: 0.5769, iterations: 1}]
display:
  output: j_w
  labels: {j_w: "Pot wheel"}
  proof: {label: "Pots out of the water", sub: "the river runs under the wheel and the wheel stands"}
  caption: right
