BFE load in coupled field simulation

Hello I try to apply a moving heat source in a transient structural simulation via coupled field elements.

Element definition:






Heat source code:


*GET,EMAX,ELEM,,NUM,MAX     !Retrieves a value and stores it as a scalar parameter or part of an array parameter. Name of Parameter = EMAX, Entity=Element,

*GET,EMIN,ELEM,,NUM,MIN     !Retrieves a value and stores it as a scalar parameter or part of an array parameter. Name of Parameter = EMAX, Entity=Element










time_weld=2                      ! welding time

time_inc=1                        !


NROPT, FULL                       !NROPT= Specifies the Newton-Raphson options in a static or full transient analysis.Use full Newton-Raphson.


*DO,i,1,time_steps,1              !TIME INCREMENT






X=CENTRX(jj)                       !Centroid X-coordinate of jj-th element in global Cartesian coordinate system.Centroid is determined from the selected nodes on the element.

Y=CENTRY(jj)                       !Centroid Y-coordinate of jj-th element in global Cartesian coordinate system.Centroid is determined from the selected nodes on the element.














BFE,jj,HGEN,,qfsw                           ! Defines an element body force load.BFE, Elem, Lab, STLOC, VAL1, VAL2, VAL3, VAL4





CMSEL,ALL                                 ! Selects a subset of components and assemblies

BFEDELE,ALL,ALL                           ! Deletes element body force loads.BFEDELE, ELEM, Lab


The BFE is not applied and I don’t know why. Is the coupled field element 226 not valid for BFE HGEN load? The APDL loop is valid and is running well in transient thermal module. I get some error warning.


*** WARNING ***                         CP =       1.406   TIME= 11:52:52
 The specified heat generations from the BFE command can not be applied 
 because element 2401 is undefined.  

Best Answer

  • BenjaminStarlingBenjaminStarling AustraliaPosts: 101Member
    edited December 2020 Accepted Answer

    It is not clear to me which part you are struggling with? This method just replaces the loop you already have with the jj variable.

    Is it the use of components? this method checks each element within a component only once. Therefore if you need to loop through all elements more than once, you will need to reset the component selection at some point. i.e. between your *do loop with i, and your *do loop with jj, reselect the master set of elements you wish to apply the load to either through esel, or cmsel. This is one of the reasons a temporary component is created for looping, such that the original master component remains unaltered.

    Another issue may be the lack of ALLSEL command. I forgot to put it in my example, but as we are selecting and deselecting elements, you need to ensure all elements and nodes that you would like to participate in the solve, are selected before issuing the solve command.

    If you have any more info/code, or a model to share, feel free, it will give me a better idea of what the issue is.


  • akhemkaakhemka Posts: 719Forum Coordinator

    Hi @ANSYS_FEM_Guy ,

    The warning indicates that there is no 2401 element defined. Can you please look for this element number in your model?


    Ashish Khemka

  • ANSYS_FEM_GuyANSYS_FEM_Guy Posts: 16Member
    edited December 2020

    Hi Ashish,

    thank you for your answer. I checked the model, there is no element with the number 2401. The model only consists of 2400 elements.

    I don't know why it's not working, because when I run the code in transient thermal, it's working like intended.

    Best regards

    Sam Donell

  • rkumbharrkumbhar PunePosts: 188Forum Coordinator

    Hi @ANSYS_FEM_Guy try using value EMAX-1 in the *DO loop

  • ANSYS_FEM_GuyANSYS_FEM_Guy Posts: 16Member
    edited December 2020

    Hi @rkumbhar,

    when I try to change the script from




    The result it the same. It doesn't work either way.

  • BenjaminStarlingBenjaminStarling AustraliaPosts: 101Member

    What is the value of EMAX? Although there are only 2400 elements, your method requires that there are no gaps in numbering in your model. Try using the following. elements you want to loop.
    CM,E_TEMP,ELEM                 !Temporary Component for Looping. In your case should be all elements you want to apply BFE.
    E_NEXT=ELNEXT(0)               !ELNEXT(0) is a FORTRAN routine that returns first element number, or 0 when there are no more elements.
    *DOWHILE,E_NEXT                !Dowhile loops end when 0 is returned.
        BFE,E_NEXT,HGEN,,qfsw      !Apply load to E_NEXT Element.
       CMSEL,S,E_TEMP,ELEM         !Remove the most recent checked/load applied element from the temporary set.
       ESEL,U,ELEM,,E_NEXT         !""
       CM,E_TEMP,ELEM              !""

    Body Loads, HGEN, is valid for Element 226.

    This method also has the advantage that the E_TEMP component is updated through each iteration. This allows for many other interesting logic loops within APDL.

  • ANSYS_FEM_GuyANSYS_FEM_Guy Posts: 16Member

    Hello @BenjaminStarling,

    thank you for your answer. I'm struggling a lil'bit to implement you method in my thermal loop.

    In my approach, I'm selecting the centroids of the elements and moving in Y direction with specified velocity. I'm confused how to convert it to your approach.

    Best regards

    Sam Donell

  • ANSYS_FEM_GuyANSYS_FEM_Guy Posts: 16Member


    I upload the model. Sorry for the language, but I'm momentarily living in Germany and due to this I have only access to a German ANSYS WB 19.2 Version.

    I tried my code separately, thermal and structural only, and it's running fine. But when I let them run simultaneously , the thermal code is neglected.

    Best regards

    Sam Donell

Sign In or Register to comment.