Abaqus DFLUX Subroutine: Practical Guide to Moving Heat Sources

Abaqus DFLUX Subroutine: Practical Guide to Moving Heat Sources

Table of Contents

Your welding or additive manufacturing model is ready — geometry, mesh, material data, boundary conditions. Then the real problem: the heat has to move along the weld line, and Abaqus has no built-in moving heat source for a general weld path.

That is what the DFLUX subroutine is for. It lets you define the heat flux at every integration point as a function of position and time, so you can drive a Goldak double-ellipsoid source along a path, pause it between passes, or switch it off.

This guide covers the interface, a working Goldak implementation, the settings that decide whether the result is usable, and the mistakes that waste the most time.

What the DFLUX subroutine actually does

DFLUX is a user subroutine for Abaqus/Standard. In a heat transfer or coupled temperature-displacement analysis, Abaqus calls it at every integration point of the element set (or surface) where you applied a nonuniform flux, in every increment. Your job is to return the flux magnitude at that point, at that moment.

Two things follow. The subroutine is called a very large number of times, so keep it arithmetic only — no file reading, no writing, no table searches per call. And Abaqus only tells you where the point is and what time it is; where the torch is remains your responsibility.

For Abaqus/Explicit the equivalent is VDFLUX: same physics, vectorised interface. Our UMAT vs VUMAT guide explains the same Standard/Explicit split for material models.

The DFLUX interface, argument by argument

The Fortran header looks like this:

      SUBROUTINE DFLUX(FLUX,SOL,KSTEP,KINC,TIME,NOEL,NPT,COORDS,
     1 JLTYP,TEMP,PRESS,SNAME)

      INCLUDE 'ABA_PARAM.INC'

      DIMENSION FLUX(2), TIME(2), COORDS(3)
      CHARACTER*80 SNAME

The arguments you will actually use:

  • FLUX(1) — the value you must set. For a nonuniform body flux (BFNU) it is power per unit volume, W/m3 in SI; for a nonuniform surface flux it is W/m2. Mixing the two up is a common cause of temperatures that are wrong by orders of magnitude.
  • FLUX(2) — the derivative of flux with respect to temperature. Leave it zero unless the flux depends on temperature; if it does and you leave it zero, the analysis still converges, just more slowly.
  • TIME(1) — step time. TIME(2) — total time. Use step time when each weld pass is its own step, which is almost always the cleaner setup.
  • COORDS — the current coordinates of the point. In a large-displacement analysis these are deformed coordinates, which for welding is normally what you want.
  • TEMP — current temperature at the point. Useful for switching the source off above a limit, or for temperature-dependent absorption.
  • JLTYP and SNAME — which flux type and which surface triggered the call. You need them when a model has more than one nonuniform flux, because the same subroutine handles all of them.

The Goldak double-ellipsoid heat source

For arc welding the standard volumetric source is Goldak’s double ellipsoid: two quarter-ellipsoids joined at the torch centre, a shorter and more intense one in front, a longer and gentler one behind. For the front half:

q(x,y,z) = 6√3 · ff · Q / (af b c π3/2) · exp(-3x²/af² - 3y²/b² - 3z²/c²)

The rear half is identical with ar and fr. The total power is Q = η V I, where η is arc efficiency. The fractions must satisfy ff + fr = 2; typical values are 0.6 and 1.4.

The coordinates x, y, z are measured from the torch, not the global origin. That substitution is the whole trick: replace the along-travel coordinate with x = X - v·t and a fixed source becomes a moving one.

Choosing the Goldak parameters

Reasonable starting points, to be calibrated against a macrograph:

  • b — half the weld bead width at the top surface.
  • c — the penetration depth.
  • af — roughly equal to b; ar — two to four times af, longer at faster travel speeds.
  • η — process dependent: submerged arc highest, gas tungsten arc lowest, shielded and gas metal arc in between. Published ranges overlap widely, so treat it as a calibration parameter rather than a constant.

The original formulation is in Goldak, Chakravarti and Bibby (1984). Our Goldak heat input guide goes deeper into the model itself, including how it is used for additive manufacturing.

A minimal DFLUX for one straight weld pass

Travel along global X, transverse direction Y, depth measured down from the top surface at ZTOP. SI units throughout.

      SUBROUTINE DFLUX(FLUX,SOL,KSTEP,KINC,TIME,NOEL,NPT,COORDS,
     1 JLTYP,TEMP,PRESS,SNAME)

      INCLUDE 'ABA_PARAM.INC'

      DIMENSION FLUX(2), TIME(2), COORDS(3)
      CHARACTER*80 SNAME

C     --- process data (SI: m, s, W) ---
      PARAMETER (CURR  = 200.D0,   VOLT = 24.D0,  ETA = 0.80D0)
      PARAMETER (VWELD = 0.004D0,  XSTART = 0.0D0)
      PARAMETER (AF = 0.003D0, AR = 0.009D0)
      PARAMETER (BW = 0.003D0, CD = 0.004D0)
      PARAMETER (FF = 0.6D0,   FRR = 1.4D0)
      PARAMETER (ZTOP = 0.010D0)
      PARAMETER (PI = 3.141592653589793D0)

      Q = ETA * VOLT * CURR

C     torch position at this step time
      XT = XSTART + VWELD * TIME(1)

C     coordinates relative to the torch
      XL = COORDS(1) - XT
      YL = COORDS(2)
      ZL = COORDS(3) - ZTOP

      IF (XL .GE. 0.D0) THEN
         AA = AF
         FF1 = FF
      ELSE
         AA = AR
         FF1 = FRR
      END IF

      C1 = 6.D0 * DSQRT(3.D0) * FF1 * Q
      C2 = AA * BW * CD * PI * DSQRT(PI)

      EX = -3.D0*XL*XL/(AA*AA) - 3.D0*YL*YL/(BW*BW)
     1     -3.D0*ZL*ZL/(CD*CD)

      IF (EX .LT. -50.D0) THEN
         FLUX(1) = 0.D0
      ELSE
         FLUX(1) = (C1/C2) * DEXP(EX)
      END IF

      FLUX(2) = 0.D0

      RETURN
      END

The EX < -50 cut-off is not cosmetic: without it you call DEXP at every point far from the torch for no benefit.

On the input side, apply it to the weld region element set:

*STEP, INC=100000
Weld pass 1
*HEAT TRANSFER, END=PERIOD, DELTMX=50.
0.05, 12.5, 1.E-5, 0.2
*DFLUX
WELD_ZONE, BFNU
*SFILM
TOP_SURF, F, 20., 25.
*SRADIATE
TOP_SURF, R, 25., 0.8
*END STEP

For the NU flux types the subroutine returns the full value, not a multiplier on a magnitude field. In Abaqus/CAE the equivalent is a Body Heat Flux with distribution set to User-defined.

Step, mesh and increment settings that decide accuracy

A correct subroutine with a careless step definition still gives a wrong answer. Three rules carry most of the weight.

The increment must be smaller than the time the torch needs to cross one element. Otherwise elements get skipped and the heat input is smeared. Use a maximum increment of roughly 0.5 · Le / v, with Le the element length along the weld — about 0.25 s at 4 mm/s with 2 mm elements.

Resolve the source with the mesh. Aim for three to four elements across the half-width b and through the depth c. Coarser than that and peak temperature becomes mesh-dependent. Refine the weld zone and bias outwards; the far field can be much coarser.

Use temperature-dependent properties and latent heat. Conductivity and specific heat change substantially up to melting, and the latent heat of fusion absorbs a large share of the energy, so define *LATENT HEAT between solidus and liquidus. Raising conductivity above the solidus by a factor of two to five is a common cheap stand-in for stirring in the pool — it is calibration, not physics, so say so in your report. If the thermal properties you need depend on history rather than temperature alone — a phase fraction you track yourself, for example — the property tables run out and you need the UMATHT subroutine to define the thermal behaviour directly.

Multi-pass work adds bookkeeping: one step per pass, a cooling step between passes, and element activation with *MODEL CHANGE if you deposit material rather than remelt it. Because the increment is fixed by torch speed and cannot simply be increased, long multi-pass runs are where HPC resources pay off.

Compiling and running

Fortran is the documented language for Abaqus user subroutines, and DFLUX is no exception. Keep to fixed-form layout: statements from column 7, continuation marker in column 6. You need a compatible Intel Fortran compiler linked to Abaqus, plus matching Visual Studio build tools on Windows. Check the link before debugging physics:

abaqus verify -user_std

Then run:

abaqus job=weld_pass1 user=dflux.f cpus=4 interactive

Compilation failures are usually mundane: free-form code in a fixed-form file, a line past column 72, a missing INCLUDE 'ABA_PARAM.INC' so reals default to single precision, or an unsupported compiler version. Check the Intel Fortran compiler version against the support chart for your Abaqus release.

How to check your heat input is right

Do not go straight to residual stress. Verify the thermal model first.

  1. Energy check. Hold the source stationary for one second and compare the energy that entered the model with η V I · 1 s. Out by a factor of 1000 or 109? That is units, not physics.
  2. Fusion zone shape. Plot NT11 on a cross-section at mid-length and contour the solidus temperature. The enclosed region is your computed fusion zone. Compare width and depth to a macrograph and adjust af, b, c and η.
  3. Thermal cycle at a point. Plot temperature against time a few millimetres from the fusion line and compare with thermocouple data. Cooling rate governs microstructure, so it matters more than the peak. Then halve the maximum increment — if the peak moves noticeably, the original increment was too large.

Only once the thermal history is credible should you map it into the mechanical analysis, reading temperatures from the heat transfer ODB as a predefined field on a matching mesh. Our guide to sequentially coupled thermal-stress analysis in Abaqus walks through that mapping step by step, the welding simulation guide covers the wider workflow, and the P91 residual stress case study adds phase transformation.

Common mistakes

  • Unit inconsistency. In an mm-tonne-s-N model, power is in milliwatts. A 4 kW arc is 4×106 in that system. This is the number one cause of nonsense temperatures.
  • Surface flux where a volume source belongs. A surface flux cannot reproduce penetration. Use BFNU for arc and laser welding, and never apply both to the same region.
  • ff + fr not equal to 2. Then the total power is not η V I and every calibration afterwards is fitting the wrong quantity.
  • Total time instead of step time. In a multi-pass model TIME(2) keeps growing, so pass 2 starts where pass 1 finished. Use TIME(1) with a per-pass start position.
  • No cooling boundary conditions. Without film and radiation the plate never cools and the interpass temperature is meaningless.
  • Calibrating on peak temperature alone. Peak temperature inside the pool is neither measurable nor meaningful. Calibrate on fusion zone geometry and cooling rate. And do not assume an efficiency of 1.0 — much of the arc energy never enters the workpiece.

Ready-to-use models

If you would rather start from a model that already runs, these packages include input files, Fortran source and results:

FAQ

What is the difference between DFLUX and VDFLUX?

DFLUX is for Abaqus/Standard, called one integration point at a time. VDFLUX is for Abaqus/Explicit and receives blocks of points, so it must be vectorised. Welding and AM thermal analyses normally run in Standard, so DFLUX is the usual choice.

Can I write DFLUX in C or C++?

Fortran is the official and documented language for Abaqus user subroutines, and every published DFLUX interface is a Fortran one. Use Fortran — routing around it creates linking problems far harder to debug than the subroutine itself.

Do I still need DFLUX if I use the Abaqus AM plug-in?

Not necessarily. The plug-in handles a moving source and element activation from toolpath data, which is convenient for printing simulations. DFLUX stays useful when you need a source shape or switching rule the plug-in does not offer, or when you must reproduce a published model exactly.

How do I know my Goldak parameters are right?

You calibrate them. Start from bead geometry, run the model, compare the computed fusion zone with a macrograph, adjust, repeat. With no macrograph, take parameters from a published study on the same process, material and heat input — and state in your report that they are not calibrated to your own data.

Why does my model show unrealistically high temperatures?

In order of likelihood: unit mismatch in the power, latent heat not defined, mesh too coarse to resolve the source, or increments so large that a whole increment of heat lands in a few elements. Run the stationary energy check first.

DFLUX controls the moving heat source, but it does not control when the weld metal exists. For that you need element activation — see our guide to Abaqus model change and birth and death elements, which pairs directly with the DFLUX workflow above.

Where to go next

DFLUX is not hard once the interface is clear — calibration and run management are what take the time. For a validated starting point, browse the welding and subroutine models in our shop. If you have a specific joint, material and code requirement, our simulation and consulting services cover welding residual stress, distortion and fitness-for-service work end to end.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related  articles

Abaqus Integration Point vs Nodal Stress: Why Peaks Differ
Compare integration-point, element-nodal and unique-nodal stress in Abaqus, and check whether a contour peak depends on extrapolation, averaging or mesh size.
Abaqus Linear Perturbation vs General Step: What Actually Changes
Abaqus Linear Perturbation vs General Step: What Actually Changes

You run a frequency extraction after a static step and the frequencies come out the same whether or not the part had yielded. You run a static linear perturbation step and the reaction force is a fraction of what you

Harmonic Response Analysis in ANSYS Workbench: A Practical Guide
Harmonic Response Analysis in ANSYS Workbench: A Practical Guide
How to set up harmonic response analysis in ANSYS Workbench: modal link, frequency range, solution method, damping, loads and results, plus the common mistakes.

See more

Related  Products

See more