I am adjusting the CHT tutorial for OpenFOAM and Nutils. I have 2 questions about this.

The first is about OpenFOAM. I am using the buoyantBoussinesqSimpleFoam solver, since i want to solve the heat transfer in a turbulent fluid. (i have neglected the buoyancy term by putting the gravity to 0 and the buoyancy by putting beta to 0). I have tested this with a constant heat flux on the ‘interface’ boundary only in OpenFOAM and compared it to ansys, which validated the case. Now i am trying to run it with preCICE and get the heat flux from Nutils (I am not yet using the solver, but I first want to exchange a constant value from nutils to see if it works), however i get an error i do not know how to solve. It states:

-> 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:
Error in the preCICE adapter:
Cannot find the Prandtl number in preciceDict/CHT using the name Pr

I do state the Prandtl number however in my transportProperties. Do you maybe know what i am doing wrong here? I have left the xml file untouched, since i want to interchange the heat flux.

The second question is about the nutils part.
The heat flux is computed using:

I am not sure if this is a good reason to select this solver, but it is definitely supported. For the future reader: this is an incompressible (with the Boussinesq approximation for density) steady-state solver.

This is unfortunately a bit ugly, but we currently need to read the Prandtl number to compute the heat flux. As far as I know (please correct me/refer to resources if I am wrong), this solver does not read the Prandtl number from the transportProperties, so we read it separately from the preciceDict.

I added a point in the documentation (this was previously undocumented, but I don’t remember the reason), please try modifying your preciceDict:

modules (CHT);
interfaces
{
Interface1
{
mesh OpenFOAM-Mesh;
patches (interface);
readData
(
Heat-Flux
);
writeData
(
Temperature
);
};
};
CHT
{
rho [ 1 -3 0 0 0 0 0 ] 50; // set your value
Cp [ 0 2 -2 -1 0 0 0 ] 5; // set your value
Pr 0.71;
};

It is a question how you could distinguish between the laminar and turbulent Prandtl, but the turbulent part should be already provided by OpenFOAM in alphat (see code I linked to above).

This is something we could improve in the future, but we currently don’t have many users using the Boussinesq solvers, so we lack some experience here.

I would strongly suggest to not handle this question here, but open a separate topic.

I might try that out so i just add another temperature equation? Another option for me would be to modify the simpleFoam solver, however with some parameteres adjusted in the buoyantBoussinesqSimpleFoam, the equations will be the same as simpleFoam with a temperature equation added.

Adding temperature to simpleFoam should also be supported if it registers temperature the same way as the standard OpenFOAM solvers, but why not use the full buoyantSimpleFoam? Why do you need the Boussinesq approximation?

Okay, good to know for future other solver uses! In the problem I am facing, the temperature difference/ pressure difference is not very high. Therefore incompressibility is assumed to reduce computation time. It is indeed interesting to check difference in computation time with the coupling, so I will probably do that.

I have implemented it and the coupling worked! Thank you