# Configuring a Solid-Solid-Fluid CHT case in OpenFOAM

**URL:** <https://precice.discourse.group/t/configuring-a-solid-solid-fluid-cht-case-in-openfoam/2258>\
**Category:** Official adapters and tutorials\
**Tags:** openfoam, configuration, cht\
**Created:** [December 7, 2024, 1:28pm UTC](https://precice.discourse.group/t/configuring-a-solid-solid-fluid-cht-case-in-openfoam/2258 "2024-12-07T13:28:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr.junfu444](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/mr.junfu444/32/2584_2.png) [@mr.junfu444](https://precice.discourse.group/u/mr.junfu444)\
**Post date:** [December 7, 2024, 1:29pm UTC](https://precice.discourse.group/t/configuring-a-solid-solid-fluid-cht-case-in-openfoam/2258/1 "2024-12-07T13:29:00Z")

</div>

- my system:Ubuntu 20.04.4
- preCICE:v2.4.0
- OpenFOAM:v2006
- OpenFOAM-adapter-v1.0.0
- participants: fuel(solid) - cladding(solid) - coolant(liquid)

**I don’t know how to set the `0/T` folder type for the participant**  
_OpenFOAM:cladding:'0’folder:“T”_

```
FoamFile
{
    version 2.0;
    format ascii;
    class volScalarField;
    object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 1 0 0 0];

internalField uniform 700;

boundaryField
{
    fuelwall
    {
        type fixedGradient;
        gradient uniform 0;
    }
    claddinginlet
    {
        type zeroGradient;
    }
    claddingoutlet
    {
        type zeroGradient;
    }
    claddingwall
    {
        type fixedValue;
        value $internalField;
    }
    
}

// ************************************************************************* //

```

**log:**

```
xie@xie-Z790-D:~/OpenFOAM/xie-v2006/run/tlk/CHT-Nuclear-couplling/222-fixgradient/cladding-openfoam$ mpirun -np 2 laplacianFoam -parallel |tee log
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : v2006 OPENFOAM=2006
Arch : "LSB;label=32;scalar=64"
Exec : laplacianFoam -parallel
Date : Dec 07 2024
Time : 15:33:20
Host : xie-Z790-D
PID : 837252
I/O : uncollated
Case : /home/xie/OpenFOAM/xie-v2006/run/tlk/CHT-Nuclear-couplling/222-fixgradient/cladding-openfoam
nProcs : 2
Hosts :
(
    (xie-Z790-D 2)
)
Pstream initialized with:
    floatTransfer : 0
    nProcsSimpleSum : 0
    commsType : nonBlocking
    polling iterations : 0
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

Create time

Create mesh for time = 0

SIMPLE: no convergence criteria found. Calculations will run for 0.3 steps.

Reading field T

Reading diffusivity DT

No finite volume options present

Calculating temperature distribution

---[preciceAdapter] Loaded the OpenFOAM-preCICE adapter v1.0.0.
---[preciceAdapter] Reading preciceDict...
---[precice] This is preCICE version 2.4.0
---[precice] Revision info: no-info [Git failed/Not a repository]
---[precice] Build type: Release (without debug log)
---[precice] Configuring preCICE with configuration "../precice-config.xml"
---[precice] I am participant "cladding"
---[precice] Connecting Primary rank to 1 SecondaryRanks
---[precice] Setting up primary communication to coupling partner/s
---[precice] Primary ranks are connected
---[precice] Setting up preliminary secondary communication to coupling partner/s
---[precice] Prepare partition for mesh cladding-to-fuel-Mesh
---[precice] Prepare partition for mesh cladding-to-liquid-Mesh
---[precice] Gather mesh cladding-to-liquid-Mesh
---[precice] Send global mesh cladding-to-liquid-Mesh
---[precice] Receive global mesh fuel-Mesh
---[precice] Receive global mesh liquid-Mesh
---[precice] Broadcast mesh fuel-Mesh
---[precice] Filter mesh fuel-Mesh by bounding box on secondary ranks
---[precice] Mapping distance min:7.83971e-06 max:0.000249152 avg: 0.000126059 var: 5.17308e-09 cnt: 5040
---[precice] Filter mesh fuel-Mesh by mappings
---[precice] Feedback distribution for mesh fuel-Mesh
---[precice] Broadcast mesh liquid-Mesh
---[precice] Filter mesh liquid-Mesh by bounding box on secondary ranks
---[precice] Mapping distance min:6.01013e-06 max:0.000249098 avg: 0.000125419 var: 5.11197e-09 cnt: 6280
---[precice] Filter mesh liquid-Mesh by mappings
---[precice] Feedback distribution for mesh liquid-Mesh
---[precice] Setting up secondary communication to coupling partner/s
---[precice] Secondary ranks are connected
---[precice] liquid: iteration: 1, time-window: 1, time: 0 of 1, time-window-size: 0.0001, max-timestep-length: 0.0001, ongoing: yes, time-window-complete: no, write-initial-data 
fuel: iteration: 1, time-window: 1, time: 0 of 1, time-window-size: 0.0001, max-timestep-length: 0.0001, ongoing: yes, time-window-complete: no, 
--> FOAM Warning : 
    From void adapterInfo(std::string, std::string)
    in file Utilities.C at line 50
    Error (deferred - will exit later) in the preCICE adapter: 
Attempt to cast type fixedGradient to type fixedValue

Time = 0.0001

DICPCG: Solving for T, Initial residual = 0.595024, Final residual = 8.40796e-07, No Iterations 37
DICPCG: Solving for T, Initial residual = 0.537021, Final residual = 7.1532e-07, No Iterations 36
DICPCG: Solving for T, Initial residual = 0.521095, Final residual = 7.09068e-07, No Iterations 36
ExecutionTime = 0.35 s ClockTime = 51 s

[0] 
[0] 
[0] --> FOAM FATAL ERROR: 
[0] [1] 
[1] 
[1] --> FOAM FATAL ERROR: 
[1] Error in the preCICE adapter: 
There was a problem while configuring the adapter. See the log for details.
[1] 
[1] 
[1] From void adapterInfo(std::string, std::string)
[1] in file Utilities.C at line 32Error in the preCICE adapter: 
There was a problem while configuring the adapter. See the log for details.
[0] 
[0] 
[0] From void adapterInfo(std::string, std::string)
[0] in file Utilities.C at line 32.
[0] 
FOAM parallel run exiting
[0] 
.
[1] 
FOAM parallel run exiting
[1] 
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
[xie-Z790-D:837247] 1 more process has sent help message help-mpi-api.txt / mpi-abort

```

 ![屏幕截图 2024-12-07 213434](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/2/204cd1abb8aae7d1c436b37846c9df66df4b8922.png)  
 ![屏幕截图 2024-12-07 213449](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/e/e0e176b8fc3e1b40bc31a8c4b61667e8bc2ab8e6.png)  
 ![屏幕截图 2024-12-07 213502](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/a/ad84b53a2f4b791492ab80fad01bbd5bb2932d82.png)

---

<div class="post-metadata">

**Author:** ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)\
**Post date:** [March 21, 2025, 6:54pm UTC](https://precice.discourse.group/t/configuring-a-solid-solid-fluid-cht-case-in-openfoam/2258/2 "2025-03-21T18:54:58Z")

</div>

@mr.junfu444 I edited your topic to make it more easily readable:

- I used backtickts (not single quotes) to format code snippets (see [Extended Syntax | Markdown Guide](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks))
- I gave it a shorter, more descriptive title

Did you make any progress on this issue in the meantime?

In general, the configuration is described in the OpenFOAM adapter documentation:

> **[Configure the OpenFOAM adapter](https://precice.org/adapter-openfoam-config.html#cht)**
>
> Write a system/preciceDict, set compatible boundary conditions, and activate the adapter in your system/controlDict.

For reading temperature, you define a `fixedValue`. For reading heat flux, you define a `fixedGradient`.

In your case, the cladding participant has two interfaces: one to the fuel, and one to the coolant. For this reason, you need to define two coupling meshes.

See how we define something very similar in this tutorial:

> **[Heat exchanger (simplified)](https://precice.org/tutorials-heat-exchanger-simplified.html)**
>
> This tutorial describes how to run a conjugate heat transfer simulation with three participants, with CalculiX as solid solver and Dirichlet-Neumann coupling.
