Early step termination

Hi I am running a coupled temperature-displacement, I want to cool down the part, but I want to cut the step 2, if the temperature is near 200 degrees, is that option possible? it is not like a termination of the job, I want to jump to step 3.

thank you.

I’m not sure if there is an option like that in ccx at the moment. However, you could probably use a fortran subroutine to do this.

any recommendation to implement that subroutine?

Yes, what you’re trying to do is possible — while you can’t directly “jump” to the next step from within utemp.f, you can force CalculiX to terminate Step 2 early when a certain temperature condition is met. This will cause it to move on to Step 3 if it’s defined in your input file.

You can do this by adding a temperature check inside the utemp.f subroutine and forcing a condition to trigger early step termination. Here’s a Fortran pseudo-code example to get you started:

      real*8 avg_temp, threshold
      integer ntemp_nodes, i

      if (kstep .eq. 2) then
         threshold = 200.d0
         # Monitor temperature at node 100
         if (node .eq. 100) then
            avg_temp = vold(0, node)
            if (avg_temp .ge. threshold) then
               # Force to terminate the step -- Add something meaningful below
               write(*,*) '>>> Early termination triggered: T >= 200C at node 100'
            endif
         endif
      endif

Just swap in the node number(s) you care about. You could also average multiple nodes if needed.

:warning: This won’t gracefully exit the step — it causes a controlled failure, but CalculiX will move to Step 3 as long as it’s set up correctly in your .inp file.