# Welding analysis with DFLUX

**URL:** <https://calculix.discourse.group/t/welding-analysis-with-dflux/1435>\
**Category:** Advanced features\
**Created:** [January 6, 2023, 3:07am UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435 "2023-01-06T03:07:35Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brahmendra](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@Brahmendra](https://calculix.discourse.group/u/Brahmendra)\
**Post date:** [January 6, 2023, 3:07am UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/1 "2023-01-06T03:07:35Z")

</div>

Hi All,

I am trying to model welding process in transient thermal analysis. I tried with sample dflux.f downloaded from web site. The heat source is not moving but it is heating the complete weld path at the same time. Can anyone give a sample deck file and an input file to try at my end? As I am new to coding, can anyone help me how to write dflux.f file for a sample problem?

Best regards,  
Brahma.

---

<div class="post-metadata">

**Author:** ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)\
**Post date:** [January 6, 2023, 8:48am UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/2 "2023-01-06T08:48:08Z")

</div>

Are you using this tool ?

[https://www.researchgate.net/project/Welding-tool-for-CalculiX](https://www.researchgate.net/project/Welding-tool-for-CalculiX)

---

<div class="post-metadata">

**Author:** ![Brahmendra](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@Brahmendra](https://calculix.discourse.group/u/Brahmendra)\
**Post date:** [January 6, 2023, 10:13am UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/3 "2023-01-06T10:13:47Z")

</div>

Yes, I am using this tool only. I am following the instructions shared in pdf file as well. But, the heat is being applied on the complete weld path. I did the following in a sample setup.

1. Added this in the INP file. Weld\_elems include all the elements of the weld from start to end.  
\*Dflux  
Weld\_elems, BFNU, 1

2. Uncoupled thermal structural step is modelled as below.  
\*Step, Inc=10000  
\*Uncoupled temperature-displacement  
0.1, 10, 1E-05, 1

3. In dflux.f, I have referred to the first and last node numbers and two reference node numbers.

4. Compiled CCX and final ccx executable is copied to /usr/local/bin/

5. In the output file, I can see the “length of weld trajectory: 70.117255599999993”

I can share the input files for your reference. Please let me know.

 ![weld_tool_output](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/e/e254e28eef2c6c43b1ff943d8625b83be77449d8.jpeg)

---

<div class="post-metadata">

**Author:** ![vicmw](https://avatars.discourse-cdn.com/v4/letter/v/6de8d8/32.png) [@vicmw](https://calculix.discourse.group/u/vicmw)\
**Post date:** [January 6, 2023, 7:45pm UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/4 "2023-01-06T19:45:15Z")

</div>

I think a moving heat source requires a separate \*DFLUX card for each element face, and each one has either a unique \*AMPLITUDE card or a different value for its TIME DELAY parameter, so that it’s applied at the correct time. Can you check your .inp file to see if it has these features? If it’s all one big \*DFLUX card, it won’t move.

---

<div class="post-metadata">

**Author:** ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)\
**Post date:** [January 6, 2023, 9:52pm UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/5 "2023-01-06T21:52:01Z")

</div>

Not necessarily, the DFLUX subroutine (used here) defines the variation of heat flux in both space and time and should be sufficient to simulate moving heat source.

---

<div class="post-metadata">

**Author:** ![vicmw](https://avatars.discourse-cdn.com/v4/letter/v/6de8d8/32.png) [@vicmw](https://calculix.discourse.group/u/vicmw)\
**Post date:** [January 6, 2023, 10:07pm UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/6 "2023-01-06T22:07:48Z")

</div>

@Calc_em Oh, it’s a user subroutine, sorry, I didn’t notice all that. I guess the problem is probably in that code somewhere?

---

<div class="post-metadata">

**Author:** ![Disla](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/disla/32/3548_2.png) [@Disla](https://calculix.discourse.group/u/Disla)\
**Post date:** [January 6, 2023, 10:27pm UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/7 "2023-01-06T22:27:45Z")

</div>

We managed to build moving loads (ccx) and heat sources (internal solver) using Heaviside functions in Mecway without introducing subroutines.  
As Victor says it requires an individual load and \*AMPLITUDE to activate it at the right moment.  
It’s like all the elements have their load assigned “a priori” but it is only activated when the two shifted Heaviside’s passes on top of the element.

![Moving-heat-source](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/9/9d5fa0e684251a9a000fa6ebfc8daa4743843735.gif)  
 ![Moving-load](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/3/3758edcc2a7afd72ed7792710073821c1b2d6afd.gif)

---

<div class="post-metadata">

**Author:** ![Brahmendra](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@Brahmendra](https://calculix.discourse.group/u/Brahmendra)\
**Post date:** [January 7, 2023, 1:49am UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/8 "2023-01-07T01:49:22Z")

</div>

@Disla , I also simulated by defining the amplitude for each element and it worked as given below.

\*Cflux, Amplitude=Node1, Add  
N1, 11, 100000  
…

\*Amplitude, Name=Tabular-1, Time=Total time  
0, 0, 5, 0, 25, 1, 30, 1,  
35, 0, 75, 0, 80, 1, 85, 1,  
90, 0, 100, 0  
\*Amplitude, Name=Node1  
0, 0, 5, 1, 10, 1, 15, 0,  
500, 0  
\*Amplitude, Name=Node2  
0, 0, 15, 0, 20, 1, 25, 1,  
30, 0, 500, 0  
…

Here, I did not use dflux.f.

But, my interest is to use dlux.f and avoid individual element or node definitions. If I am not wrong, we can do the moving heat source using the dflux file as referred by @Calc_em . Here we can avoid individual element definitions.

@Calc_em, can you please post an inp file and corresponding dflux file for my reference? alternatively, If you give me your mail ID, I will send my deck files  
 ![temp weld](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/1/110350219611dc03b9bb51141fce6f80b1a63d3f.gif)  
for your verification.

---

<div class="post-metadata">

**Author:** ![Brahmendra](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@Brahmendra](https://calculix.discourse.group/u/Brahmendra)\
**Post date:** [January 7, 2023, 2:13am UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/9 "2023-01-07T02:13:40Z")

</div>

@Disla , I tried it in Mecway, the heaviside function is very cool. But it is not supported in CCX. I am looking for a similar thing in CalculiX.  
 ![Mecway result](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/7/7299f7f65334bbe2f08799ae10dfb4ff5fa02d22.gif)

---

<div class="post-metadata">

**Author:** ![Calc\_em](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Calc\_em](https://calculix.discourse.group/u/Calc_em)\
**Post date:** [January 7, 2023, 10:32am UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/10 "2023-01-07T10:32:28Z")

</div>

> [@Brahmendra](#):
>
> can you please post an inp file and corresponding dflux file for my reference?

I’ve never used this tool in CalculiX and I have no experience with its subroutines. Unfortunately, it seems that the .inp file is not available for download from that project. Only a subroutine file is provided. I can take a look at your .inp file but if the problem is with the subroutine then I probably won’t be able to help.

I use similar functionality and perform welding and additive manufacturing simulations in Abaqus but there everything is built in and there’s no need to use subroutines directly.

---

<div class="post-metadata">

**Author:** ![Brahmendra](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@Brahmendra](https://calculix.discourse.group/u/Brahmendra)\
**Post date:** [January 7, 2023, 1:42pm UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/11 "2023-01-07T13:42:40Z")

</div>

@Calc_em, yes, we can do it in Abaqus with much ease. But, my project requires me to perform it in CalculiX. The input file is not given on the site, which is the reason for all the confusion. I will send you the deck file for your reference. Please review it and let me know if it can be made to simulate a moving heat source. Thank you.

---

<div class="post-metadata">

**Author:** ![PGA](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@PGA](https://calculix.discourse.group/u/PGA)\
**Post date:** [March 31, 2023, 7:17pm UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/12 "2023-03-31T19:17:04Z")

</div>

@Brahmendra I am trying to use this routine as well, do you have any update on this topic, some advises, thanks.

---

<div class="post-metadata">

**Author:** ![SergioP](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/sergiop/32/10_2.png) [@SergioP](https://calculix.discourse.group/u/SergioP)\
**Post date:** [April 2, 2023, 1:51am UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/13 "2023-04-02T01:51:18Z")

</div>

@Brahmendra Have you compiled CCX with DFLUX rutine for Windows? Would be nice to have this version of CCX available for downloading

---

<div class="post-metadata">

**Author:** ![NorbertH](https://avatars.discourse-cdn.com/v4/letter/n/74df32/32.png) [@NorbertH](https://calculix.discourse.group/u/NorbertH)\
**Post date:** [December 6, 2024, 4:05pm UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/14 "2024-12-06T16:05:45Z")

</div>

If anybody is still interested in this topic. I will include heatflux trajectories in the next update for the cubit plugin. Defining a moving heatsource will then just be a single command.

> ccx create trajectory curve 13 vertex 16 surface 1 direction 0 0 -1 magnitude 50 time\_begin 0 time\_end 10 radius 0.1

 ![image](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/e/e293118ac6a41698574f88fef569772113616986.png)

![trajectory](https://global.discourse-cdn.com/free1/uploads/calculix/original/2X/d/de134768a3be1f1cc78154dce233a9086e8f903f.gif)

---

<div class="post-metadata">

**Author:** ![Matej](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Matej](https://calculix.discourse.group/u/Matej)\
**Post date:** [September 5, 2025, 1:46pm UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/15 "2025-09-05T13:46:00Z")

</div>

May I ask how this is done in CalculiX? Using Amplitudes?

---

<div class="post-metadata">

**Author:** ![NorbertH](https://avatars.discourse-cdn.com/v4/letter/n/74df32/32.png) [@NorbertH](https://calculix.discourse.group/u/NorbertH)\
**Post date:** [September 5, 2025, 2:05pm UTC](https://calculix.discourse.group/t/welding-analysis-with-dflux/1435/16 "2025-09-05T14:05:40Z")

</div>

Hi @Matej,

well the main code for this feature is here

> <https://github.com/calculix/Cubit-CalculiX/blob/main/src/Core/CoreLoadsTrajectory.cpp#L880>

First you will need a way to select the faces along a trajectory. In cubit the fire ray can be used for this. Without a way to proper select faces and be able to order them i couldn’t get it done.

Once you have the faces you can start creating sidesets, dflux and amplitude definitions. Which is not really hard when you know at which time a certain face should have a dlfux magnitude.
