Skip to content

Boundary Condition Input

A number of different methods of applying boundary conditions are provided. Besides specifying constant scalar, vector, or tensor values as value="..." [phase=""], you can prescribe field values from other PDEs, previous simulations, or other external sources. Just use the corresponding XML tags within the boundary condition tag. Below, you can find a description of some of the available methods.


<fileData> can be used to define the right-hand side vector nodal quantities. For this purpose, one needs to provide a dat-file with node numbers and corresponding RHS values.

This input is only tested for right-hand side nodal values, like nodal forces in mechanics (<force> in MechPDE). Dirichlet BC in MechPDE was proven not to work correctly with it.
For further information, please refer to the test case. It can be found here. This folder represents how to load element-number based rhs from text file. The file is generated by

  • Here, we have spacial dependent rhs (for mech-heat problem)
  • In data file excitation example -We need to know the element numbers for the named nodes inclusion_nodes
  • we could use from NodalForceExpression and make use of the stored mesh.bc
  • In this example: assume
    cfs NodalDataFile -g
    performed, where the -g creates the .cfs file without parsing the pdes. Then use

To use the generated .dat file as RHS, refer to the lines in NodalDataFile.xml

<force name="inclusion_nodes">
  <fileData file="nodal.dat"/>


The <grid> input allows specifying inhomogeneous Dirichlet BC. One may use the output results of openCFS (.cfs) as input for another model.

Another possible application would be to modify the openCFS result file (with python script) and specify needed BC manually for each node. For this purpose, a "fake" results file should be generated, modified, and finally applied as a BC to the matching model using the following code structures.

<displacement name="V_plate">
  <grid dofs="all">
    <defaultGrid quantity="mechDisplacement" dependtype="GENERAL">

The grid input can be used e.g. as <displacement> BC in SmoothPDE and MechPDE.


One can appy this to incorporate boundary conditions according to system state calculated in a previous step. This is especially useful when solving a forward coupled system, such as a typical heat-mechanics problem. Another example can be found for an electrostatic capacitor.

    <thermalStrain name="S_beam">
        <sequenceStep index="1">
            <quantity name="heatTemperature" pdeName="heatConduction"/>
                <constant step="1"/>


Perform first a simulation run (e.g. a transient one) where allowPostProc-status is set. This activates saving of all data, in order to postprocess data afterwards.


Within the next simulation in a first multisequence step forces of the previous simulation can be applied as force density on the RHS of the considered PDE. Calculate respective quantity from the previous simulation run and apply it as force term on the RHS.

      <forceDensity name="plateV">
        <externalSimulation inputId="input" sequenceStep="1">
          <quantity name="magForceLorentzDensity" pdeName="magneticEdge"/>
            <continuous interpolation="linear" />

Examples can be found here