ConfigTree error: "Key <type> has already been processed" when defining multiple Dirichlet BCs for displacement (vector variable) in THM process - OGS 6.5.6

Hello OGS community,

I’m setting up a 3D coupled Thermo-Hydro-Mechanical (THM) process with additional ComponentTransport (reactive transport) in a simple rectangular reservoir domain (1000m × 500m × 10m), End goal to have fully working 3D THMC model.

The model uses hexahedral elements generated from Gmsh, converted to VTU (with subdomain meshes for boundaries).

I have successfully fixed the earlier MaterialID mismatch by using a high physical volume tag (100) in Gmsh and reindexing during conversion.

However, I’m now stuck on a persistent parsing error when defining Dirichlet boundary conditions for the displacement process variable (vector with 3 components):

This error occurs specifically in the displacement block, which requires multiple <boundary_condition> entries:

  • Bottom face: fixed in all 3 components (X,Y,Z)
  • Left face: fixed in all 3 components
  • Front and back faces: fixed only in Z component (to prevent rigid body motion)

I need 8 separate <boundary_condition> blocks (singular per block, as plural triggers “Specifying the component id () for a boundary condition of type Dirichlet is mandatory”).

The error appears regardless of ordering:

  • Grouping by mesh (3 consecutive blocks for bottom, then left, etc.) → error
  • Grouping by component (all component 0 first, then 1, then 2) → still error
  • Reducing to minimal (only bottom fixed in 3 components) → no error, but adding more triggers it

Scalar variables (pressure, temperature, concentration) have single BCs each and parse fine.

Questions:

  1. Is this a known parsing quirk/bug in ConfigTree for repetitive <boundary_condition> blocks under vector process variables?
  2. Is there a supported way to group multiple components or multiple meshes in one Dirichlet BC for displacement?
  3. Alternatives: Can I use Python boundary conditions to reduce the number of blocks? (I tried, but would appreciate confirmation if that’s recommended here.)
  4. Any other workaround (e.g., geometry-based BCs with .gml)?

OGS version: 6.5.6 (serial mode, with embedded Python)

Full error log (from ogs -l debug main.prj):

info: Parsing the OGS commandline …
info: Parsing the OGS commandline passed
debug: OGSSimulation::OGSSimulation(std::vectorstd::string&)
info: This is OpenGeoSys-6 version 6.5.6. Log version: 2, Log level: debug.
info: OGS starts on 2026-01-05 19:18:57+0000 in serial mode / Python embedded mode.
warning: OMP_NUM_THREADS is not set, falling back to: 20
info: Eigen use 20 threads
info: Reading project file main.prj.
debug: Project file: /workspace/input/ogs/main.prj.
debug: Project configuration from file ‘main.prj’ read.
debug: Reading multiple meshes.
debug: Reading mesh file ‘reservoir_3d_domain.vtu’.
debug: Reading mesh file ‘reservoir_3d_bottom.vtu’.
debug: Reading mesh file ‘reservoir_3d_back.vtu’.
debug: Reading mesh file ‘reservoir_3d_front.vtu’.
debug: Reading mesh file ‘reservoir_3d_left.vtu’.
debug: Reading mesh file ‘reservoir_3d_right.vtu’.
debug: Reading mesh file ‘reservoir_3d_top.vtu’.
info: readRasters …
info: readRasters done
info: ConstantParameter: initial_pressure
info: ConstantParameter: initial_temperature
info: ConstantParameter: initial_displacement
info: ConstantParameter: zero_displacement
info: ConstantParameter: initial_concentration
info: ConstantParameter: bc_inlet_concentration
info: ConstantParameter: molecular_diffusion
info: ConstantParameter: longitudinal_dispersivity
info: ConstantParameter: transversal_dispersivity
info: ConstantParameter: bc_left_pressure
info: ConstantParameter: bc_top_temperature
info: ConstantParameter: bc_bottom_temperature
info: ConstantParameter: fluid_density
info: ConstantParameter: fluid_viscosity
info: ConstantParameter: fluid_specific_heat_capacity
info: ConstantParameter: fluid_thermal_conductivity
info: ConstantParameter: youngs_modulus
info: ConstantParameter: poissons_ratio
info: ConstantParameter: biot_coefficient
info: ConstantParameter: solid_density
info: ConstantParameter: solid_specific_heat_capacity
info: ConstantParameter: solid_thermal_conductivity
info: No source terms for process variable ‘displacement’ found.
info: No source terms for process variable ‘pressure’ found.
info: No source terms for process variable ‘temperature’ found.
info: No source terms for process variable ‘concentration’ found.
info: Threads used for ParallelVectorMatrixAssembler: 1. This is the default when OGS_ASM_THREADS environment variable is not set.
info: ThermoHydroMechanicsProcess process initializeSubmeshOutput().
info: Initialize processes.
critical: /project/BaseLib/ConfigTree.cpp:244 onerror()
error: ConfigTree: In file `main.prj’ at path <process_variables/process_variable/boundary_conditions/boundary_condition>: Key has already been processed.
Could not construct OGSSimulation object

Any help or pointers to similar issues would be greatly appreciated!

Thanks in advance,
VB

Please provide the main.prj for further investigation.

Below is the main.prj file content. I am not allowed to upload the file yet in OpenGeoSys community.

<?xml version="1.0" encoding="UTF-8"?>
<OpenGeoSysProject>
    <meshes>
        <mesh>reservoir_3d_domain.vtu</mesh>
        <mesh>reservoir_3d_bottom.vtu</mesh>
        <mesh>reservoir_3d_back.vtu</mesh>
        <mesh>reservoir_3d_front.vtu</mesh>
        <mesh>reservoir_3d_left.vtu</mesh>
        <mesh>reservoir_3d_right.vtu</mesh>
        <mesh>reservoir_3d_top.vtu</mesh>
    </meshes>

    <python_script>zero_displacement_bc.py</python_script>

    <parameters>
        <parameter>
            <name>initial_pressure</name>
            <type>Constant</type>
            <value>15e6</value>
        </parameter>
        <parameter>
            <name>initial_temperature</name>
            <type>Constant</type>
            <value>80</value>
        </parameter>
        <parameter>
            <name>initial_displacement</name>
            <type>Constant</type>
            <values>0 0 0</values>
        </parameter>
        <parameter>
            <name>zero_displacement</name>
            <type>Constant</type>
            <value>0</value>
        </parameter>
        <parameter>
            <name>initial_concentration</name>
            <type>Constant</type>
            <value>0</value>
        </parameter>
        <parameter>
            <name>bc_inlet_concentration</name>
            <type>Constant</type>
            <value>1</value>
        </parameter>
        <parameter>
            <name>molecular_diffusion</name>
            <type>Constant</type>
            <value>1e-9</value>
        </parameter>
        <parameter>
            <name>longitudinal_dispersivity</name>
            <type>Constant</type>
            <value>10</value>
        </parameter>
        <parameter>
            <name>transversal_dispersivity</name>
            <type>Constant</type>
            <value>1</value>
        </parameter>
        <parameter>
            <name>bc_left_pressure</name>
            <type>Constant</type>
            <value>20e6</value>
        </parameter>
        <parameter>
            <name>bc_top_temperature</name>
            <type>Constant</type>
            <value>20</value>
        </parameter>
        <parameter>
            <name>bc_bottom_temperature</name>
            <type>Constant</type>
            <value>150</value>
        </parameter>
        <parameter>
            <name>fluid_density</name>
            <type>Constant</type>
            <value>1000</value>
        </parameter>
        <parameter>
            <name>fluid_viscosity</name>
            <type>Constant</type>
            <value>0.001</value>
        </parameter>
        <parameter>
            <name>fluid_specific_heat_capacity</name>
            <type>Constant</type>
            <value>4180</value>
        </parameter>
        <parameter>
            <name>fluid_thermal_conductivity</name>
            <type>Constant</type>
            <value>0.6</value>
        </parameter>
        <parameter>
            <name>youngs_modulus</name>
            <type>Constant</type>
            <value>30e9</value>
        </parameter>
        <parameter>
            <name>poissons_ratio</name>
            <type>Constant</type>
            <value>0.3</value>
        </parameter>
        <parameter>
            <name>biot_coefficient</name>
            <type>Constant</type>
            <value>1.0</value>
        </parameter>
        <parameter>
            <name>solid_density</name>
            <type>Constant</type>
            <value>2500</value>
        </parameter>
        <parameter>
            <name>solid_specific_heat_capacity</name>
            <type>Constant</type>
            <value>1000</value>
        </parameter>
        <parameter>
            <name>solid_thermal_conductivity</name>
            <type>Constant</type>
            <value>3.0</value>
        </parameter>
    </parameters>

    <media>
        <medium>
            <phases>
                <phase>
                    <type>Solid</type>
                    <properties>
                        <property>
                            <name>density</name>
                            <type>Constant</type>
                            <value>2500</value>
                        </property>
                        <property>
                            <name>specific_heat_capacity</name>
                            <type>Parameter</type>
                            <parameter_name>solid_specific_heat_capacity</parameter_name>
                        </property>
                        <property>
                            <name>thermal_conductivity</name>
                            <type>Parameter</type>
                            <parameter_name>solid_thermal_conductivity</parameter_name>
                        </property>
                        <property>
                            <name>thermal_expansivity</name>
                            <type>Constant</type>
                            <value>1e-6</value>
                        </property>
                    </properties>
                </phase>
                <phase>
                    <type>AqueousLiquid</type>
                    <properties>
                        <property>
                            <name>density</name>
                            <type>Parameter</type>
                            <parameter_name>fluid_density</parameter_name>
                        </property>
                        <property>
                            <name>viscosity</name>
                            <type>Parameter</type>
                            <parameter_name>fluid_viscosity</parameter_name>
                        </property>
                        <property>
                            <name>specific_heat_capacity</name>
                            <type>Parameter</type>
                            <parameter_name>fluid_specific_heat_capacity</parameter_name>
                        </property>
                        <property>
                            <name>thermal_conductivity</name>
                            <type>Parameter</type>
                            <parameter_name>fluid_thermal_conductivity</parameter_name>
                        </property>
                    </properties>
                </phase>
            </phases>
            <properties>
                <property>
                    <name>porosity</name>
                    <type>Constant</type>
                    <value>0.2</value>
                </property>
                <property>
                    <name>permeability</name>
                    <type>Constant</type>
                    <value>1e-13</value>
                </property>
                <property>
                    <name>biot_coefficient</name>
                    <type>Parameter</type>
                    <parameter_name>biot_coefficient</parameter_name>
                </property>
                <property>
                    <name>thermal_conductivity</name>
                    <type>EffectiveThermalConductivityPorosityMixing</type>
                </property>
                <property>
                    <name>molecular_diffusion</name>
                    <type>Parameter</type>
                    <parameter_name>molecular_diffusion</parameter_name>
                </property>
                <property>
                    <name>longitudinal_dispersivity</name>
                    <type>Parameter</type>
                    <parameter_name>longitudinal_dispersivity</parameter_name>
                </property>
                <property>
                    <name>transversal_dispersivity</name>
                    <type>Parameter</type>
                    <parameter_name>transversal_dispersivity</parameter_name>
                </property>
            </properties>
        </medium>
    </media>

    <processes>
        <process>
            <name>THM_process</name>
            <type>THERMO_HYDRO_MECHANICS</type>
            <integration_order>2</integration_order>
            <coupling_scheme>staggered</coupling_scheme>
            <process_variables>
                <temperature>temperature</temperature>
                <pressure>pressure</pressure>
                <displacement>displacement</displacement>
            </process_variables>
            <constitutive_relation>
                <type>LinearElasticIsotropic</type>
                <youngs_modulus>youngs_modulus</youngs_modulus>
                <poissons_ratio>poissons_ratio</poissons_ratio>
            </constitutive_relation>
            <specific_body_force>0 0 0</specific_body_force>
        </process>
        <process>
            <name>RT_process</name>
            <type>ComponentTransport</type>
            <integration_order>2</integration_order>
            <process_variables>
                <pressure>pressure</pressure>
                <concentration>concentration</concentration>
            </process_variables>
            <specific_body_force>0 0 0</specific_body_force>
        </process>
    </processes>

    <process_variables>
        <process_variable>
            <name>displacement</name>
            <components>3</components>
            <order>1</order>
            <initial_condition>initial_displacement</initial_condition>
            <boundary_conditions>
                <!-- Bottom face:- zero in X, Y, Z -->
                <boundary_condition>
                    <mesh>reservoir_3d_bottom</mesh>
                    <type>Python</type>
                    <component>0</component>
                    <bc_object>zero_disp_bc</bc_object>
                </boundary_condition>
                <boundary_condition>
                    <mesh>reservoir_3d_bottom</mesh>
                    <type>Python</type>
                    <component>1</component>
                    <bc_object>zero_disp_bc</bc_object>
                </boundary_condition>
                <boundary_condition>
                    <mesh>reservoir_3d_bottom</mesh>
                    <type>Python</type>
                    <component>2</component>
                    <bc_object>zero_disp_bc</bc_object>
                </boundary_condition>

                <!-- Left face:- zero in X, Y, Z -->
                <boundary_condition>
                    <mesh>reservoir_3d_left</mesh>
                    <type>Python</type>
                    <component>0</component>
                    <bc_object>zero_disp_bc</bc_object>
                </boundary_condition>
                <boundary_condition>
                    <mesh>reservoir_3d_left</mesh>
                    <type>Python</type>
                    <component>1</component>
                    <bc_object>zero_disp_bc</bc_object>
                </boundary_condition>
                <boundary_condition>
                    <mesh>reservoir_3d_left</mesh>
                    <type>Python</type>
                    <component>2</component>
                    <bc_object>zero_disp_bc</bc_object>
                </boundary_condition>

                <!-- Front and back:- zero only in Z -->
                <boundary_condition>
                    <mesh>reservoir_3d_front</mesh>
                    <type>Python</type>
                    <component>2</component>
                    <bc_object>zero_disp_bc</bc_object>
                </boundary_condition>
                <boundary_condition>
                    <mesh>reservoir_3d_back</mesh>
                    <type>Python</type>
                    <component>2</component>
                    <bc_object>zero_disp_bc</bc_object>
                </boundary_condition>
            </boundary_conditions>
        </process_variable>

        <process_variable>
            <name>pressure</name>
            <components>1</components>
            <order>1</order>
            <initial_condition>initial_pressure</initial_condition>
            <boundary_conditions>
                <boundary_condition>
                    <type>Dirichlet</type>
                    <mesh>reservoir_3d_left</mesh>
                    <parameter>bc_left_pressure</parameter>
                </boundary_condition>
            </boundary_conditions>
        </process_variable>
        <process_variable>
            <name>temperature</name>
            <components>1</components>
            <order>1</order>
            <initial_condition>initial_temperature</initial_condition>
            <boundary_conditions>
                <boundary_condition>
                    <type>Dirichlet</type>
                    <mesh>reservoir_3d_top</mesh>
                    <parameter>bc_top_temperature</parameter>
                </boundary_condition>
                <boundary_condition>
                    <type>Dirichlet</type>
                    <mesh>reservoir_3d_bottom</mesh>
                    <parameter>bc_bottom_temperature</parameter>
                </boundary_condition>
            </boundary_conditions>
        </process_variable>
        <process_variable>
            <name>concentration</name>
            <components>1</components>
            <order>1</order>
            <initial_condition>initial_concentration</initial_condition>
            <boundary_conditions>
                <boundary_condition>
                    <type>Dirichlet</type>
                    <mesh>reservoir_3d_left</mesh>
                    <parameter>bc_inlet_concentration</parameter>
                </boundary_condition>
            </boundary_conditions>
        </process_variable>
    </process_variables>

    <nonlinear_solvers>
        <nonlinear_solver>
            <name>basic_newton</name>
            <type>Newton</type>
            <max_iter>50</max_iter>
            <linear_solver>general_linear_solver</linear_solver>
        </nonlinear_solver>
    </nonlinear_solvers>

    <linear_solvers>
        <linear_solver>
            <name>general_linear_solver</name>
            <eigen>
                <solver_type>BiCGSTAB</solver_type>
                <precon_type>ILUT</precon_type>
                <max_iteration_step>10000</max_iteration_step>
                <error_tolerance>1e-12</error_tolerance>
            </eigen>
        </linear_solver>
    </linear_solvers>

    <time_loop>
        <processes>
            <process ref="THM_process">
                <nonlinear_solver>basic_newton</nonlinear_solver>
                <convergence_criterion>
                    <type>PerComponentDeltaX</type>
                    <norm_type>NORM2</norm_type>
                    <abstols>1e-6 1e-6 1e-8 1e-8 1e-8</abstols>
                </convergence_criterion>
                <time_discretization>
                    <type>BackwardEuler</type>
                </time_discretization>
                <time_stepping>
                    <type>FixedTimeStepping</type>
                    <t_initial>0</t_initial>
                    <t_end>31536000</t_end>
                    <timesteps>
                        <pair>
                            <repeat>365</repeat>
                            <delta_t>86400</delta_t>
                        </pair>
                    </timesteps>
                </time_stepping>
            </process>
            <process ref="RT_process">
                <nonlinear_solver>basic_newton</nonlinear_solver>
                <convergence_criterion>
                    <type>PerComponentDeltaX</type>
                    <norm_type>NORM2</norm_type>
                    <abstols>1e-6 1e-6</abstols>
                </convergence_criterion>
                <time_discretization>
                    <type>BackwardEuler</type>
                </time_discretization>
                <time_stepping>
                    <type>FixedTimeStepping</type>
                    <t_initial>0</t_initial>
                    <t_end>31536000</t_end>
                    <timesteps>
                        <pair>
                            <repeat>365</repeat>
                            <delta_t>86400</delta_t>
                        </pair>
                    </timesteps>
                </time_stepping>
            </process>
        </processes>
        <global_process_coupling>
            <max_iter>10</max_iter>
            <convergence_criteria>
                <convergence_criterion>
                    <type>DeltaX</type>
                    <norm_type>NORM2</norm_type>
                    <reltol>1e-6</reltol>
                </convergence_criterion>
                <convergence_criterion>
                    <type>DeltaX</type>
                    <norm_type>NORM2</norm_type>
                    <reltol>1e-6</reltol>
                </convergence_criterion>
            </convergence_criteria>
        </global_process_coupling>
        <output>
            <type>VTK</type>
            <prefix>output/reservoir_3d/</prefix>
            <variables>
                <variable>temperature</variable>
                <variable>pressure</variable>
                <variable>velocity</variable>
                <variable>displacement</variable>
                <variable>concentration</variable>
                <variable>strain</variable>
            </variables>
            <timesteps>
                <pair>
                    <repeat>365</repeat>
                    <each_steps>1</each_steps>
                </pair>
            </timesteps>
        </output>
    </time_loop>
</OpenGeoSysProject>

Thank You!

I took a look at the boundary_conditions section of your main.prj. It seems to be okay. Please provide all files of the project including meshes and the python script (best would be to use zip or tar) such that it is possible to run your example in a debugger?

Hi, I have attached zip folder, please have a look at it. I am using docker image (registry.opengeosys.org/ogs/tools/ogstools/main-3.10-feflow-10.0:latest) to run the simulation, because I am using windows and I tried all the possible ways to install OpenGeoSys locally on windows.
Share.zip (109.3 KB)

Thank You!

Hi, I see now what you tried to do, staggered coupling of THM and ComponentTransport, but this is not the way it is implemented in OGS. It would be to nice if it would work this way actually.
There are processes in OGS, which beside the monolithic coupling have staggered coupling implemented, but one cannot mix arbitrary processes.
So for now if the THM part gives you the pressure field, you could use it in the ComponentTransport for the evolution of the chemistry (by setting the pressure field as Dirichlet-type boundary condition on the whole domain).

In the project file there were few things missing and I converted it pure THM, so it at least runs with /path/to/bin/ogs main.prj -o output
THM.zip (2.0 KB)

– d

Hi, now I understood the issue. Thank you for solving the error and your help. I appreciate it.

I followed your suggestion it appears to be working currently, but will contact you if any help is required.

Thank you!