CalculiX setup and coupling strategy
Thank you for the question. Below I describe my CalculiX setup and the overall coupling workflow.
1. General coupling strategy
The objective of the coupling is to compute the mechanical displacement field induced by thermal stresses. To achieve this, the temperature field must be available at each mesh node and at each time step of the simulation, since thermal strains directly depend on the local temperature.
The coupling is therefore sequential and thermally driven:
-
The temperature field is computed in FEniCS Legacy.
-
This temperature field is transferred to CalculiX at every time step using preCICE.
-
CalculiX then uses the received temperature field to compute thermal stresses and the resulting mechanical displacements.
The coupling is applied on the complete structural domain, not only on a boundary.
2.
Thermal solver - FEniCS Legacy - and data export
The temperature field resulting from Joule heating is computed using FEniCS legacy.
For each time step:
-
FEniCS solves the transient heat equation.
-
The nodal temperature field is written to preCICE using the writeData API.
-
The temperature is provided at the mesh nodes corresponding to the FEniCS discretization.
The preCICE mapping method used to transfer temperature from FEniCS to CalculiX is nearest-neighbor mapping, which is appropriate here since both meshes represent the same physical domain but different meshes.
3.
CalculiX model and mesh handling
In CalculiX, I prepared a mesh corresponding to the same physical domain as in FEniCS.
To facilitate temperature coupling:
-
I defined a node set containing all mesh nodes of the CalculiX model (referred to as CalculiXMesh).
-
This node set is used as the interface on which temperature values are applied.
-
The coupling is therefore done on the entire domain, not restricted to a surface or boundary.
This choice ensures that the thermal field is available everywhere in the solid, which is required for a consistent evaluation of thermal strains.
4.
Multi-step CalculiX analysis
The CalculiX input file is structured into two successive analysis steps:
Step 1: Heat transfer step
-
This step is defined as a pure heat transfer (conduction) step.
-
The temperature values received from FEniCS through preCICE are imposed on the previously defined node set. ReadData
-
The temperature boundary condition is time-dependent, since preCICE updates the nodal temperatures at each coupling time step.
-
In practice, preCICE overwrites the temperature values at the nodes of the set at every iteration, based on the data received from FEniCS.
This step ensures that the temperature field inside CalculiX is fully synchronized with the thermal solution computed in FEniCS legacy.
Step 2: Mechanical step
-
In the second step, a mechanical analysis is performed.
-
Thermal strains are computed internally by CalculiX based on the temperature field obtained in Step 1.
-
From these thermal strains, CalculiX computes the stress field and the resulting mechanical displacement field.
No additional coupling is required in this step, since all the necessary thermal information has already been transferred.
5.
Summary
To summarize:
-
The coupling transfers nodal temperature values from FEniCS legacy to CalculiX at every time step.
-
The coupling is performed on the full domain, using a node set containing all CalculiX mesh nodes.
-
A nearest-neighbor mapping is used in preCICE.
-
CalculiX is run with two steps: a heat transfer step driven by the coupled temperature field, followed by a thermo-mechanical step computing thermally induced displacements.
I hope this clarifies the setup and the rationale behind the coupling strategy. I would be happy to provide more details if needed, and I agree that documenting this type of workflow in the adapter documentation could be useful! 