CalculiX setup - sltmyr/precice GitHub Wiki

Setup of FEM simulation with CalculiX

After installing and configuring CalculiX, we can use it to run the coupled simulation. Similar to SU2, CalculiX requires mesh and configuration files in the working directory. In the following we briefly describe the files used for our example. The general layout of configuration files is described in the tutorial for the preCICE adapter for CaculiX.

Mesh files include all.msh, fix1.nam, fix2.nam, fix3.nam and interface.nam. The actual mesh that includes node coordinates and element definitions is placed in all.msh. The files fix_[1-3].nam contain indices of boundary nodes and are used to simplify the definition of boundary conditions. Finally, interface.nam defines the set of all points that lie on the wet surface -- i.e. the part exposed to the fluid flow. At the nodes defined here, data between both solvers is exchanged during the coupled simulation.

The first configuration file, config.yml, is used to provide input to preCICE adapter for CalculiX:

participants:
    Calculix:
        interfaces:
        - nodes-mesh: Calculix_Mesh
          patch: interface
          read-data: [Forces0]
          write-data: [DisplacementDeltas0]

precice-config-file: ./precice-config.xml

For our example we need one participating instance of CalculiX, as there is only one solid object. We define a single exchange interface with the name "Calcilix_Mesh". The nodes are provided in the set "interface" defined in the corresponding file interface.nam. For the example of fluid-structure interaction, CalculiX gets forces as input -- read-data -- and outputs the resulting displacements -- write-data. Note that the names of participants, nodes-mesh, read-data and write-data must match the names given in the precice-config.xml file, the path to which is provided in the last line. Contents of this preCICE configuration file are described in the next section.

The second file, flap.inp, is used to configure the CalculiX solver:

*INCLUDE, INPUT=all.msh
*INCLUDE, INPUT=fix1.nam
*INCLUDE, INPUT=fix2.nam
*INCLUDE, INPUT=fix3.nam
*INCLUDE, INPUT=interface.nam
*MATERIAL, Name=EL
*ELASTIC
 100000000, 0.3
*DENSITY
 10000.0
*SOLID SECTION, Elset=Eall, Material=EL
*STEP, NLGEOM, INC=1000000
*DYNAMIC
0.01, 5.0
*BOUNDARY
 Nfix1, 3, 3, 0
 Nfix2, 1, 1, 0
 Nfix2, 3, 3, 0
 Nfix3, 1, 3, 0
*CLOAD
 Ninterface, 1, 0.0
*NODE FILE
 U
*EL FILE
 S, E
*END STEP

The content of this file barely differs from configuration files that are used in CalculiX for FEM simulations without coupling and is explained on the developers' website. Note that, as mentioned in the description of the preCICE adapter for CaculiX, we can only couple the non-linear CalculiX solver (keyword "NLGEOM") and have to provide artificial load of zero magnitude at the interface nodes ("CLOAD") to initialize the data structure used by CalculiX.

With the described files in the working directory, the adapted version of CalculiX can be used in the coupled setup.