Restart simulation and add contact

Hi,

I am trying to restart (continue) a CalculiX simulation after the first load step has completed. In this restarted simulation, I want to add a surface interaction (contact) between two surfaces. However, I am getting an error when running the restarted simulation

*ERROR reading *SURFACE: *SURFACE should be placed
        before all step definitions
 *ERROR reading *SURFACE INTERACTION:
        *SURFACE INTERACTION should be placed
        before all step definitions
 *ERROR reading *SURFACE BEHAVIOR:
        *SURFACE BEHAVIOR should be placed
        before all step definitions
 *ERROR reading *FRICTION:
        *FRICTION should be placed
        before all step definitions
 *ERROR reading *CONTACT PAIR: *CONTACT PAIR should
   be placed before all step definitions

This seems to imply that I should have already defined all my contact behaviors in my initial simulation. Unfortunately, I cannot do this because these simulations involve the inflation of a pillow, which starts in a completely flat state, with the upper and lower surfaces coplanar, which directly triggers the contact algorithm and ends up blowing the simulation.

Is there a way to restart a simulation and add a contact definition in the calculix_restart.inp file? Alternatively, can I switch off the contact computation for the n-second of the initial simulation?

Note: I am able to carry out the simulation fine without the contact definition, so I suspect my input files and methodology are correct, except for the contact definition.

Thanks a lot in advance,

Marin


For your reference, my caluclix.inp file looks something like this (I removed a lot of stuff obviously)

**
** calculix initial inflation
**
*INCLUDE, INPUT=geom.inp

*STEP, NLGEOM, INC=1000000
*DYNAMIC
...
*RESTART,WRITE,FREQUENCY=1,OVERLAY
...
*END STEP

and the restart_calculix.inp looks like this

**
** Restart file after initial inflation
**
*RESTART,READ

*SURFACE INTERACTION,NAME=IN1
*SURFACE BEHAVIOR,PRESSURE-OVERCLOSURE=LINEAR
 3000000, 3000, 1e-3
*FRICTION
 1, 1000000

*SURFACE,NAME=SURF_2,TYPE=ELEMENT
 SRF_2,SNEG
*SURFACE,NAME=SURF_7,TYPE=ELEMENT
 SRF_7,SNEG

*CONTACT PAIR,INTERACTION=IN1,TYPE=SURFACE TO SURFACE
 SURF_2,SURF_7

*STEP, NLGEOM, INC=100
*DYNAMIC
 ...
*END STEP

Hi @Marin ,

I don’t think you are allowed to add new surfaces or contact interactions during a restart. One way to handle this would be to define those surfaces ahead of time and simply use a model change during the restart. This approach may be your best option.

Best of luck with your simulation!

@jbr,

Thank you for your reply; I will have a go at this.

Could you clarify what you mean by a model change during restart? If I understand your suggestion, I define all my surface interactions in the initial setup file, but the *SURFACE keyword contains empty element labels. I then populate those with the element IDs from the actual surface in the restart file?

There is a *MODEL CHANGE keyword that can be used to activate and deactivate elements and contact pairs:

*MODEL CHANGE, TYPE=CONTACT PAIR, ADD/REMOVE
slave_surface_name, master_surface_name

@Calc_em

That seems like a very handy keyword, indeed! I will keep you updated on the progress.

Thanks a lot for your help!

Marin

Hi @Marin ,

What you’ve described—using empty element labels for *SURFACE—is not the correct approach. Surfaces must have valid labels in the initial setup because the solver requires proper definitions for initialization.

Instead, the recommended approach is to define all potential surfaces and interactions in the initial setup file with valid and realistic definitions. During the restart, you can then use a model change to update or activate the specific surfaces or interactions as needed. This ensures that all definitions are complete from the outset and avoids issues with undefined or invalid surfaces.

Let me know if you’d like further clarification on implementing a model change or setting up your surface definitions.

@jbr
Thanks, I think I understand now; the answer from @Calc_em also helped a lot.

I am trying something like

*INCLUDE, INPUT=geom.inp

*SURFACE INTERACTION,NAME=IN1
*SURFACE BEHAVIOR,PRESSURE-OVERCLOSURE=LINEAR
 3000000, 3000, 1e-3
*FRICTION
 1, 1000000

*SURFACE,NAME=SURF_2,TYPE=ELEMENT
 SRF_2,SNEG
*SURFACE,NAME=SURF_7,TYPE=ELEMENT
 SRF_7,SPOSS

*CONTACT PAIR,INTERACTION=IN1,TYPE=SURFACE TO SURFACE
 SURF_2,SURF_7

** step, no contact
*STEP, NLGEOM, INC=1000000

*MODEL CHANGE,TYPE=CONTACT PAIR,REMOVE
 SURF_2,SURF_7

*DYNAMIC
 0.01, 10.0, 0.00005, 0.1
...
*END STEP

It seems to be doing what I expect. I will try add the contact for a 2nd step.

Marin

Well, actually, this is stalling,

I am getting very large numbers of iterations for every step, and the timestep reduces below the minimum time step, although all contact should be removed (which means it should run like the non-contact simulation) is seems that something is still done differently.

Is there a way to share your input file completely to take a look? Or even the portion of concern. I may have some time this weekend.

@jbr

Unfortunately, I cannot share the geometry itself. I will see if I can develop a MWE of my case if you want to check it.

Marin

1 Like