Weld analysis. Done simply
Humble advice on how to accelerate structural weld assessment
Weld analysis. Done simply
There is no other topic in structural mechanics where the number of approaches and standards varies so much. From this zoo, an engineer can pick their favorite approach and appropriate norm depending on available time and the accuracy required in the current project.

most miserable feeling when reality does not represent results of the analysis, on which 20 hours is spent
You could have heard or worked with four main levels of complexity:
- Nominal stresses;
- Hot spot (multiple algorithms exist; it is all about linearisation);
- Effective notch (only 3d numerical model), introducing radius to weld is not a bad idea after all;
- Fracture mechanics (you must be very stubborn to go to this mine field);
Here, I would like to focus on the most basic one (nominal stresses), because it is tailored for most applications.
Important condition for future endeavour: I am utilising ANSYS for the initial assessment. The most helpful part of this article is how to use ANSYS when you have multiple fillet welds and you are not patient enough to go over all of them with your spreadsheet or Mathcad file and kick them one by one.
Out there, several expensive weld evaluation add-ons are available; if you can afford that (after all, you managed to get ANSYS license), you may skip further reading.
I have tried to come up with a conventional approach to find the most stressed weld joint. When the culprit is identified, you can sort out if this particular weld seam is strong enough. The rest of the welds could be considered safe, or you could try to identify the second and third most stressful seams if you are not having compelling safety factors. The further provided code accounts for that.
Let us consider ANSYS shell model containing multiple fillet welds. For example, here is a construction without special meaning behind it:

shell model with fillet welds
I haven’t tried to automate the same analysis with hex or tet volume elements. So far, I rely on shell-element modelling of the fillets. The shell thickness (yellow in the example above) is assumed to be equal to throat thickness. How far should the shell, which represents the seam, be placed from the connected parts? There is no definitive answer; in my opinion, it would not be wrong to locate it between the lines dividing weld feet on both parts in two:

*Disclaimer: The weld here is obviously too thick in comparison with thickness of welded pipe, but this way is better for illustrative purposes
Most importantly, the design of shells substituting the welds shall be chosen similarly across the same numerical model, so that the stiffness of the welds allows for the correct distribution of load between multiple load paths.
The welds themself can be defined as a separate part and connected to the main bodies with bonded contact, or they may belong to a welded assembly (one part with shared topology). The latter is a better alternative in my view: no extra contact set-up is needed, but sometimes it results in complex mesh creation. In order to be able to estimate the stresses in weld fillets, these shells shall be detached from the main bodies and constitute separate bodies in SpaceClaim.
To automate the whole process, we need to create a Named selection with all faces that belong to weld seams. This is the only manual, but a relatively simple task. Can be done in SpaceClaim or in Mechanical directly. If all the seams have the same side edge, selection is straightforward:

After Named Selection is added, the next step will be to use Object Generator in Automation Tab (“weld seams” is the name of Named Selection created in the previous step):

Then I will quickly rename all new components to shorten the name, let us say “WE”:

ANSYS always uses a space sign when multiple instances are created between the common name and the number that is assigned to each individual instance.

This raises a problem, because in APDL you can not address the component name that contains a space.
To resolve this problem, I have prepared a short code that removes all these spaces. This code shall be run within Scripting windows available on Automation tab:
def GetNSbyName(name,AcceptPartial = False):
try:
NSs = ExtAPI.DataModel.Project.Model.NamedSelections.Children
except:
return None
for ns in NSs:
if ns.Name.ToLower() == name.ToLower():
return ns
if AcceptPartial and (name.ToLower() in ns.Name.ToLower()):
return ns
ExtAPI.Log.WriteWarning("Named Selection not found: "+str(name))
return None
WeldTotalNumber = 99
for k in range(1,WeldTotalNumber+1):
NS1 = DataModel.Project.Model.AddNamedSelection()
NS1.ScopingMethod = GeometryDefineByType.Worksheet
GenerationCriteria = NS1.GenerationCriteria
Criterion1 = Ansys.ACT.Automation.Mechanical.NamedSelectionCriterion()
Criterion1.Action = SelectionActionType.Add
Criterion1.EntityType = SelectionType.GeoFace
Criterion1.Criterion = SelectionCriterionType.NamedSelection
Criterion1.Operator = SelectionOperatorType.Equal
Criterion1.Value = GetNSbyName("WE "+str(k))
GenerationCriteria.Add(Criterion1)
NS1.Name = "WE"+str(k)
NS1.Generate()
The only thing that needs to be adjusted is the parameter WeldTotalNumber. As a result, there is a clean list of welds waiting for assessment:

Nota Bene! The named selections shall be created before the solution is launched; otherwise, the components would not be available for the solver in post-processing.
Then there comes the next code, which shall be inserted as APDL command under Solution in the project tree:
/POST1 ! Enter post-processor
allsell,all
my_max_stress=0 !maximum stress in current seam
my_max_number1=0 !first most stressed seam
my_max_number2=0 !second most stressed seam
my_max_number3=0 !third most stressed seam
my_substep = 0 !code can be extended if multiply time steps need to be checked
vonmises1 = 0.0000001 !To avoid dividing by zero
vonmises2 = 0.0000001 !To avoid dividing by zero
WENUMBER = 99 !Number of seam welds
SET,LIST,1 ! list available time points (in output windows)
*DO,SS,1,1,1 ! here can be implemented the loop over time points
SET,NEAR,,,,2 ! Specify solution time in seconds from which results will be taken
*DO,K,1,WENUMBER,1
/gopr
mystep = K
/NOPR
string_var = chrval(K)
concat_str=STRCAT('WE',string_var) ! Select nodes associated with the named selection 'WE '
CMSEL, S,concat_str,node ! Select nodes in named selection
Atot=0.0001 ! area of current shell that models weld
*GET,NNUM,NODE,0,COUNT !provisionary for iterating over nodes of shell
SHELL, BOT !two sides of shell are considered, first go is for top side
tot_stress1=0.0 !stress parameter for integrating over area
ncounter =0 !iterating over nodes
*DO, I, 1,NNUM,1 ! Loop through selected nodes to get stress and associated area
!/gopr
ncounter = ndnext(ncounter)
narea = arnode(ncounter)
*GET,vonmises1,NODE,ncounter,s,EQV
tot_stress1=tot_stress1+narea*vonmises1
Atot=narea+Atot
*ENDDO
SHELL, TOP ! second go is for lower side
tot_stress2=0.0
ncounter =0
*DO, I, 1,NNUM,1
ncounter = ndnext(ncounter)
narea = arnode(ncounter)
*GET,vonmises2,NODE,ncounter,s,EQV
tot_stress2=tot_stress2+narea*vonmises2
*ENDDO
my_averstress1=tot_stress1/Atot
my_averstress2=tot_stress2/Atot
*IF,my_averstress2,GT,my_max_stress,THEN !block to find THREE most loaded welds
my_max_number3=my_max_number2
my_max_number2=my_max_number1
my_max_number1=K
my_max_stress=my_averstress2
my_substep = SS
*ENDIF
*IF,my_averstress1,GT,my_max_stress,THEN
*IF,K,NE,my_max_number1,THEN
my_max_number3=my_max_number2
my_max_number2=my_max_number1
my_max_number1=K
my_substep = SS
*ENDIF
my_max_stress=my_averstress1
*ENDIF
*ENDDO
*ENDDO
Again, the only parameter that requires adjustment is WENUMBER (number of welds). As you may notice, the code iterates separately over the top and bottom surfaces of the shells and consequently compares these stresses with each other.
In case the solution contains multiple load steps, or results shall be taken from the middle of a load step, at the beginning of the presented code, you can specify the necessary time (SET,NEAR,,,,TIME). If you want to loop as well through time points (let us say from 3 seconds to 4 seconds in 13 points), you can replace just one line:
!Substituting this
!*DO,SS,1,1,1 !
!with that:
TIMEPOINTS = 13
INITIALTIME = 3
*DO,SS,1,TIMEPOINTS,1 !Timestamp
SET,NEAR,,,,INITIALTIME+(SS-1)/(TIMEPOINTS-1) !Results rom substep next to specified time
The following commands can be placed outside bigger loops or inside smaller loops, but it turned out to be computationally inefficient to do so.
SHELL, BOT
SHELL, TOP
When the number of welds is considerable, it may take sufficient time to run the script. In order to control the progress, the command block calls the number of currently estimated welds to be explicitly shown in Solver output / Post output window.
/gopr
mystep = K
/NOPR
As a result, the following data is shown in the sidebar after the post processor is done:

Here you can spot the number (equal to the prefix of the corresponding named selection ) of the first three most loaded fillet welds alongside average stress on the most stressful seams. This average stress gives an approximate idea of how big the maximum weld stresses are; it is just an indication which should not be directly used for subsequent hand-calculation analysis. “my_substep” is only useful if you are comparing multiple time points.
A few more tricks to find stresses in seams. Let's assume you are following EN 1993–1–8:

To get these stresses, you first need to obtain moments and forces acting on the weld throat. If you use large deflections in ANSYS (as you should), then to get moment reactions correctly, you need to specify two coordinate systems for this reason.

If you use only one coordinate system, your moment reaction arm would be huge
One coordinate system is where your provisional cutting surface is located, and the second coordinate system shall be where your weld is located at the end of loading (by doing so, you are defining the summation point).

cutting surface for extracting reaction forces/moments (defined by Z-axis of CS)

previous and additional coordinate systems, additional CS defines directions and the zero point for retrieval of moment/forces
Here comes the tricky point: the extracted moments shall be checked thoroughly. Mz and Mx, extracted with regard to the second coordinate system, shall be negligible compared to My (green axis in lower CS on picture above). Otherwise, you need to slice the fillet weld seam and check every piece separately with the same approach.

sliced weld seam. The process should be reiterated, but the amount of calculated weld faces can be reduced to the newly created set of small faces
How to get σ and τ from moments and forces deserves a separate topic (probably following soon).
And the cherry on the cake: find allowable stresses. It has nothing to do with the main topic, but it is rather a reminder to myself: the allowable stresses heavily depend on the art of loading. In most mechanical engineering applications, such as cars or planes, the welds experience cycling or random varying loads, whereas in building construction, the load is stable enough to be considered static. Obviously, there are edge cases and exceptions. Let’s take ships; the loads are rather slow, but highly cyclic. Or a rocket launch site. Once in a while, there comes a sudden change in stresses when a rocket is put on a platform / launched. The rest of the time, there is wind action in power.
Before even looking for an appropriate standard, engineer can roughly compare the outcome of simulations, i.e. stresses in weld seams, with:
a. fatigue strength of base material in case of CYCLING loading;
b. yield stress of base material in case of premature STATIC loading.
That’s all, hopefully this will help you accelerate your projects, or at least you will get the feeling that you are not struggling alone with these foggy topics!
When you have questions or suggestions, please feel free to connect via LinkedIn.
메타데이터
- post_id
- 70c60ff2baa9
- slug
- weld-analysis-done-simply-70c60ff2baa9
- url
- https://medium.com/@dvmatyas/weld-analysis-done-simply-70c60ff2baa9
- canonical_url
- https://medium.com/@dvmatyas/weld-analysis-done-simply-70c60ff2baa9
- author_url
- https://medium.com/@dvmatyas
- status
- ok
- fetched_at
- 2026-06-24 11:06:28