Skip to content

Inputs

openwaam.Process dataclass

Welding parameters. SI units: A, V, m/s, m.

Source code in openwaam/process.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
@dataclass
class Process:
    """Welding parameters. SI units: A, V, m/s, m."""
    # The default current, voltage and wire feed are a measured set for 1.2 mm ER70S-6 wire
    # (Elsokaty et al. 2023). Current and wire feed are not independent: see equilibrium_current.
    current: float = 164.0          # A
    voltage: float = 17.8           # V
    efficiency: float = 0.8         # arc thermal efficiency
    wire_feed_speed: float = 4.0 / 60.0   # m/s  (4.0 m/min)
    wire_diameter: float = 1.2e-3   # m
    travel_speed: float = 8.0e-3    # m/s
    deposition_efficiency: float = 0.98  # fraction of fed wire that ends up in the bead
    melting_a: Optional[float] = None    # m/(s A); None: steel reference scaled to the wire diameter
    melting_b: Optional[float] = None    # 1/(s A^2); for wires other than steel both must be given

    @property
    def power(self) -> float:
        """Net arc power delivered to the workpiece, W."""
        return self.efficiency * self.voltage * self.current

    @property
    def volume_rate(self) -> float:
        """Deposited metal volume per second, m3/s."""
        return (np.pi * self.wire_diameter ** 2 / 4.0 * self.wire_feed_speed
                * self.deposition_efficiency)

    @property
    def bead_area(self) -> float:
        """Bead cross-section area from mass conservation, m2."""
        return self.volume_rate / self.travel_speed

    @property
    def heat_input(self) -> float:
        """Net line energy, J/m."""
        return self.power / self.travel_speed

    # ---- wire melting: how current, wire feed and torch height hang together ----
    def melting_constants(self):
        """(a, b) of WFS = a I + b L I^2 for this wire. The built-in values are for steel."""
        r = MELTING_REFERENCE["diameter"] / self.wire_diameter
        a = MELTING_REFERENCE["a"] * r ** 2 if self.melting_a is None else self.melting_a
        b = MELTING_REFERENCE["b"] * r ** 4 if self.melting_b is None else self.melting_b
        return a, b

    def melting_rate(self, current, extension, rms_current=None):
        """Wire feed speed (m/s) that a current melts off at an electrode extension (m).
        The resistive term takes the RMS current where it differs from the mean (short circuit, pulse)."""
        a, b = self.melting_constants()
        rms = current if rms_current is None else rms_current
        return a * current + b * extension * rms ** 2

    def equilibrium_current(self, extension, wire_feed_speed=None):
        """Current (A) a constant-voltage source settles at for this wire feed and extension."""
        a, b = self.melting_constants()
        v = self.wire_feed_speed if wire_feed_speed is None else wire_feed_speed
        if b * extension <= 0:
            return v / a
        return (-a + np.sqrt(a * a + 4 * b * extension * v)) / (2 * b * extension)

    def extension_for_current(self, current, wire_feed_speed=None):
        """Electrode extension (m) at which this wire feed draws the given current."""
        a, b = self.melting_constants()
        v = self.wire_feed_speed if wire_feed_speed is None else wire_feed_speed
        return (v - a * current) / (b * current ** 2)

    def self_regulation_slope(self, extension, current=None):
        """dI/dL at constant wire feed, A/m (negative). With a constant arc length this is dI/dCTWD."""
        a, b = self.melting_constants()
        I = self.equilibrium_current(extension) if current is None else current
        return -b * I * I / (a + 2 * b * extension * I)

bead_area property

Bead cross-section area from mass conservation, m2.

heat_input property

Net line energy, J/m.

power property

Net arc power delivered to the workpiece, W.

volume_rate property

Deposited metal volume per second, m3/s.

equilibrium_current(extension, wire_feed_speed=None)

Current (A) a constant-voltage source settles at for this wire feed and extension.

Source code in openwaam/process.py
68
69
70
71
72
73
74
def equilibrium_current(self, extension, wire_feed_speed=None):
    """Current (A) a constant-voltage source settles at for this wire feed and extension."""
    a, b = self.melting_constants()
    v = self.wire_feed_speed if wire_feed_speed is None else wire_feed_speed
    if b * extension <= 0:
        return v / a
    return (-a + np.sqrt(a * a + 4 * b * extension * v)) / (2 * b * extension)

extension_for_current(current, wire_feed_speed=None)

Electrode extension (m) at which this wire feed draws the given current.

Source code in openwaam/process.py
76
77
78
79
80
def extension_for_current(self, current, wire_feed_speed=None):
    """Electrode extension (m) at which this wire feed draws the given current."""
    a, b = self.melting_constants()
    v = self.wire_feed_speed if wire_feed_speed is None else wire_feed_speed
    return (v - a * current) / (b * current ** 2)

melting_constants()

(a, b) of WFS = a I + b L I^2 for this wire. The built-in values are for steel.

Source code in openwaam/process.py
54
55
56
57
58
59
def melting_constants(self):
    """(a, b) of WFS = a I + b L I^2 for this wire. The built-in values are for steel."""
    r = MELTING_REFERENCE["diameter"] / self.wire_diameter
    a = MELTING_REFERENCE["a"] * r ** 2 if self.melting_a is None else self.melting_a
    b = MELTING_REFERENCE["b"] * r ** 4 if self.melting_b is None else self.melting_b
    return a, b

melting_rate(current, extension, rms_current=None)

Wire feed speed (m/s) that a current melts off at an electrode extension (m). The resistive term takes the RMS current where it differs from the mean (short circuit, pulse).

Source code in openwaam/process.py
61
62
63
64
65
66
def melting_rate(self, current, extension, rms_current=None):
    """Wire feed speed (m/s) that a current melts off at an electrode extension (m).
    The resistive term takes the RMS current where it differs from the mean (short circuit, pulse)."""
    a, b = self.melting_constants()
    rms = current if rms_current is None else rms_current
    return a * current + b * extension * rms ** 2

self_regulation_slope(extension, current=None)

dI/dL at constant wire feed, A/m (negative). With a constant arc length this is dI/dCTWD.

Source code in openwaam/process.py
82
83
84
85
86
def self_regulation_slope(self, extension, current=None):
    """dI/dL at constant wire feed, A/m (negative). With a constant arc length this is dI/dCTWD."""
    a, b = self.melting_constants()
    I = self.equilibrium_current(extension) if current is None else current
    return -b * I * I / (a + 2 * b * extension * I)

openwaam.Material dataclass

Thermophysical and mechanical properties of one alloy. SI units.

Source code in openwaam/materials.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@dataclass(frozen=True)
class Material:
    """Thermophysical and mechanical properties of one alloy. SI units."""
    name: str
    rho: float            # density, kg/m3 (single value used for solid and liquid)
    cp_solid: float       # J/kg/K
    cp_liquid: float      # J/kg/K
    k_solid: float        # W/m/K
    k_liquid: float       # W/m/K
    T_solidus: float      # K
    T_liquidus: float     # K
    latent_fusion: float  # J/kg
    viscosity: float      # Pa s (liquid)
    surface_tension: float     # N/m at liquidus
    dsigma_dT: float      # N/m/K
    expansion: float      # volumetric thermal expansion of the liquid, 1/K
    T_boil: float         # K
    latent_vapor: float   # J/kg
    molar_mass: float     # kg/mol
    emissivity: float
    # solid mechanics (room temperature)
    youngs: float         # Pa
    poisson: float
    cte: float            # linear thermal expansion, 1/K
    yield_stress: float   # Pa

    def with_(self, **kw) -> "Material":
        return replace(self, **kw)

    # -- enthalpy helpers (specific enthalpy, reference h(0 K) = 0) ----------
    @property
    def cp_mushy(self) -> float:
        return 0.5 * (self.cp_solid + self.cp_liquid) + self.latent_fusion / (
            self.T_liquidus - self.T_solidus)

    def enthalpy(self, T):
        T = np.asarray(T, dtype=float)
        hs = self.cp_solid * self.T_solidus
        hl = hs + self.cp_mushy * (self.T_liquidus - self.T_solidus)
        return np.where(
            T <= self.T_solidus, self.cp_solid * T,
            np.where(T >= self.T_liquidus, hl + self.cp_liquid * (T - self.T_liquidus),
                     hs + self.cp_mushy * (T - self.T_solidus)))

    def thermal_array(self) -> np.ndarray:
        """Packed parameters for the compiled kernels."""
        return np.array([self.rho, self.cp_solid, self.cp_liquid, self.T_solidus,
                         self.T_liquidus, self.latent_fusion, self.k_solid,
                         self.k_liquid], dtype=np.float64)

thermal_array()

Packed parameters for the compiled kernels.

Source code in openwaam/materials.py
58
59
60
61
62
def thermal_array(self) -> np.ndarray:
    """Packed parameters for the compiled kernels."""
    return np.array([self.rho, self.cp_solid, self.cp_liquid, self.T_solidus,
                     self.T_liquidus, self.latent_fusion, self.k_solid,
                     self.k_liquid], dtype=np.float64)

openwaam.get_material(name)

Look up a built-in alloy by name (see openwaam.MATERIALS).