Issues on preCICE for CHT problem: icoReactingMultiphaseInterFoam and laplacianFoam

Hello all,

I’m just starting with Precice to run CHT model using incompressible icoReactingMultiphaseInterFoam with laplacianFoam on OF 2106.

I started from tutorial “flow-over-heated-plate” OF<=> OF models. which works well.

Then I tried to couple my icoReactingMultiphaseInterFoam case (fluid case tested separately and works well, with fixed temperature condition on the interface). I did same for the solid model (laplacianFoam) with fixed temperature condition and works too.

when coupling both model with Precice 2.2.1, the solid is waiting but for the fluid, I got the bellow error. it looks like the access to turbulent diffusivity for incompressile model is not working. do you have any input to fix such issue ?

thanks

Starting time loop
*---[preciceAdapter] Loaded the OpenFOAM-preCICE adapter - unreleased version.*
*Invalid MIT-MAGIC-COOKIE-1 key---[preciceAdapter] Reading preciceDict...*
*---[precice]  This is preCICE version 2.2.1*
*---[precice]  Revision info: v2.2.1*
*---[precice]  Configuration: Release (Debug and Trace log unavailable)*
*---[precice]  Configuring preCICE with configuration "../precice-config.xml"*
*---[precice]  I am participant "Fluid"*


*--> FOAM FATAL ERROR: (openfoam-2106)*

*    lookup of turbulenceProperties from objectRegistry region0 successful*
*    but it is not a incompressibleTurbulenceModel, it is a kEpsilon*

*    From const Type& Foam::objectRegistry::lookupObject(const Foam::word&, bool) const [with Type = Foam::IncompressibleTurbulenceModel<Foam::transportModel>]*
*    in file /usr/src/packages/BUILD/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 450.*

*FOAM aborting*

*#0  Foam::error::printStack(Foam::Ostream&) at ??:?*
*#1  Foam::error::exitOrAbort(int, bool) at ??:?*
*#2  Foam::IncompressibleTurbulenceModel<Foam::transportModel> const& Foam::objectRegistry::lookupObject<Foam::IncompressibleTurbulenceModel<Foam::transportModel> >(Foam::word const&, bool) const at ??:?*
*#3  preciceAdapter::CHT::KappaEff_Incompressible::KappaEff_Incompressible(Foam::fvMesh const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at ??:?*
*#4  preciceAdapter::CHT::HeatFlux_Incompressible::HeatFlux_Incompressible(Foam::fvMesh const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at ??:?*
*#5  preciceAdapter::CHT::ConjugateHeatTransfer::addReaders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, preciceAdapter::Interface*) at ??:?*
*#6  preciceAdapter::Adapter::configure() at ??:?*
*#7  Foam::functionObjects::preciceAdapterFunctionObject::read(Foam::dictionary const&) at ??:?*
*#8  Foam::functionObjects::preciceAdapterFunctionObject::preciceAdapterFunctionObject(Foam::word const&, Foam::Time const&, Foam::dictionary const&) at ??:?*
*#9  Foam::functionObject::adddictionaryConstructorToTable<Foam::functionObjects::preciceAdapterFunctionObject>::New(Foam::word const&, Foam::Time const&, Foam::dictionary const&) at ??:?*
*#10  Foam::functionObject::New(Foam::word const&, Foam::Time const&, Foam::dictionary const&) at ??:?*
*#11  Foam::functionObjectList::read() at ??:?*
*#12  Foam::Time::run() const at ??:?*
*#13  ? in /usr/lib/openfoam/openfoam2106/platforms/linux64GccDPInt32Opt/bin/icoReactingMultiphaseInterFoam*
*#14  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6*
*#15  ? in /usr/lib/openfoam/openfoam2106/platforms/linux64GccDPInt32Opt/bin/icoReactingMultiphaseInterFoam*
*[palabos-HP:124198] *** Process received signal ****
*[palabos-HP:124198] Signal: Aborted (6)*
*[palabos-HP:124198] Signal code:  (-6)*

Your problem is probably related to the multi-phase solver. Have you already looked through the forum for other people using multi-phase flows with OpenFOAM and preCICE?
In general, one can specify the solver type in the preciceDict as follows:

CHT
{
   solverType "compressible";
};

but I’m not sure if this will help in your case.

icoReactingMultiphaseInterFoam is an incompressible solver. so I did include solverType “Incompressible”.

Did you turn off turbulence for the test case? If yes, could you try turning it off again?

To me it looks like a OpenFOAM error. It seems that you try to run an incompressible solver with the k-epsilon turbulence model. I am not sure if this gets manipulated by the OpenFOAM adapter.

Thank your for the support.

without CHT, by imposing the interface boundary condition as fixed temperature, the fluid case run very well. with K-epsilon model and with laminar model also.

the issue comes from Openfaom Adapter to get the Keff (turbulent diffusivity) that is needed to compute the heat transfer flux on the interface.
thanks

I did turn the turbulent model to laminar, and get the same error

Welcome, @Mak57!

I edited your post to format the log using three backticks before and three after: this makes it much easier to read it, please do the same in the future.

The error essentially points to openfoam-adapter/KappaEffective.C at 0c368d717bc5ec0fbd0aa4925c48a8164487fc3f · precice/openfoam-adapter · GitHub

mesh.lookupObject<incompressible::turbulenceModel>(turbulenceModel::propertiesName)

Your solver is icoReactingMultiphaseInterFoam (code), indeed an incompressible solver, at least physics-wise.

Turbulence modelling implementation in OpenFOAM is complicated and affects more than turbulence modelling. In my master’s thesis (page 24), I distinguished between incompressible and compressible solvers based on the class of physical models the solver uses. However, this solver seems to be doing something unusual:

     // Construct incompressible turbulence model
     autoPtr<CompressibleTurbulenceModel<multiphaseSystem>> turbulence
     (
         CompressibleTurbulenceModel<multiphaseSystem>::New
         (
             rho,
             U,
             rhoPhi,
             fluid
         )
     );

(I am not sure if I should read the comment or the typename here)

As @DavidSCN already wrote, one way to work around this is to manually configure the solver type. I hope that setting the solverType to compressible will work. Even if the solver is modelling incompressible flow, the implementation can sometimes be not in line with the expectation.

If this does not work, then I am afraid that one would need to modify the adapter code to make it work for this solver (I am not sure how much).

Hello Makis, and thanks for the Welcome,

unfortunately setting solverType to compressible did’t work. I had the same issue.

there was a similar post 1 year ago: Need help with icoReactingMul... solver

Do we know if this reported issue was fixed ?

what kind of modification on the adapter should be made to fix the issue ?

thanks for your support

Blockquote

---[precice]  I am participant "Fluid"


--> FOAM FATAL ERROR: (openfoam-2106)

    lookup of turbulenceProperties from objectRegistry region0 successful
    but it is not a compressibleTurbulenceModel, it is a kEpsilon

    From const Type& Foam::objectRegistry::lookupObject(const Foam::word&, bool) const [with Type = Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> >]
    in file /usr/src/packages/BUILD/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 450.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::exitOrAbort(int, bool) at ??:?
#2  Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > const& Foam::objectRegistry::lookupObject<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > >(Foam::word const&, bool) const at ??:?
#3  preciceAdapter::CHT::KappaEff_Compressible::KappaEff_Compressible(Foam::fvMesh const&) at ??:?
#4  preciceAdapter::CHT::HeatFlux_Compressible::HeatFlux_Compressible(Foam::fvMesh const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) at ??:?
#5  preciceAdapter::CHT::ConjugateHeatTransfer::addReaders(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, preciceAdapter::Interface*) at ??:?
#6  preciceAdapter::Adapter::configure() at ??:?
```Preformatted text

> Blockquote

I am not sure if that helps much, but @TEFEdotCC had a blog post on his simulation. This blog post also links to a GitHub repository that contains the setup files.

Maybe the user also shows up here after us mentioning them. :wink:

1 Like

Hi,

Yes I’m aware about the blog of tefedotcc. I download his cases. The CHT based on precice is not working on my plate-form. Looks likes he developed some specific models or made modification (for boundary conditions, apiTemperature…).

Thanks again for your support

Hello,

I had the same issue one year ago (couple icoReactiong… and laplacianFoam with the preCICE openfoam adapter).
Short answer. It’s not possible yet.

I changed the adapter code. I removed any code at the adapter side that need information about compressible/incompressible or turbulence model, … and moved the code to an additional boundary condition. The boundary condition does handle any task (that was removed from the adapter) with openfoam code. So, all things works well :slightly_smiling_face:

My adapter code

The test case

Docker container with modified adapter

1 Like

The pull request with all relevant informations

1 Like

My results and test case description

1 Like

Thank You Thomas,

Are there any special commands or steps to compile the modified CHT adapter ?

I got this error when, I run Allwmake

palabos@palabos-HP:~/OpenFOAM/openfoam-adapter-develop_cht_rework$ ./Allwmake
./Allwmake: 13: [[: not found
./Allwmake: 13: v2012: not found
./Allwmake: 18: [[: not found
./Allwmake: 23: Bad substitution

Hallo Makis,

there are no special commands needed. Only one openfoam installation with correct setup of path’s and env. variables … and a preCICE installation.
The error looks like an shell error. I used [[ ]] for testing stuff with strings. Maybe your shell (bash, sh, …) does not support the bash extension?

A quick fix would be to change the first line of the Allwmake file from “#!/bin/sh” to “#!/bin/bash” and ensure bash (or zsh) is installed at your system.

Today a test build of TEFEdotCC/ Containered-OpenFOAM.com v2012 (preCICE and my custom openfoam adapter is included) was successfull.

Hi Thomas,

Yes it was a shell issues.

I tried to compile with OF2012 and OF2006 and PreCICE2.2.1, but had some issues:

message after Allwmake:
ADAPTER_BC_LIB_LIBS_FLAGS =
-lcompressibleTransportModels
-lcompressibleTurbulenceModels \

build boundary conditions …
=== ERROR: Building failed. See BoundaryConditions/wmake.log for more. ===

BoundaryCondition/

ow I succeed to compile with OF2106. I had issues on FF headers files but CHT files are well compiled.

Hi Thomas,

Yes it was a shell issue.

I tried to compile with OF2012 and OF2006 and PreCICE2.2.1, but had some issues:

message after Allwmake:
ADAPTER_BC_LIB_LIBS_FLAGS =
-lcompressibleTransportModels
-lcompressibleTurbulenceModels \

build boundary conditions …
=== ERROR: Building failed. See BoundaryConditions/wmake.log for more. ===

BoundaryCondition/Allwmake.log shows this message:
=== ERROR: Building failed. See BoundaryConditions/wmake.log for more. ===

BoundaryCondition/wmake.log shows this message

wmake libso (BoundaryConditions)

make: *** missed « /usr/lib/openfoam/openfoam2006/src/OpenFOAM/lnInclude/uint8.H », needed for « Make/linux64GccDPInt32Opt/apiCoupledTemperature/apiCoupledTemperatureFvPatchScalarField.C.dep ».

I installed OF from ubuntu package, do I need other files to install ?

I succeed to compile with OF2106. I had issues on FF headers files but CHT files are well compiled. but when I run the tutorial case, it run but look like the solid and fluid are not coupled,

Thanks for your support

I’m trying to install OF from your Docker but get this error

root@palabos-HP:/home/palabos/Téléchargements/Containered-OpenFOAM.com-master# docker container run -ti --rm tefe/openfoam.com
Unable to find image ‘tefe/openfoam.com:latest’ locally
docker: Error response from daemon: pull access denied for tefe/openfoam.com, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied.
See ‘docker run --help’.

For docker image

  1. clone the github repository to an local directory
  2. build the image
    2.1 cd local directory
    2.2 execute the build script with ‘hooks/build’
  3. create and start a new container from the builded image

P.S. I do not upload the images to docker hub. If I would upload a images, always I must ensure the images is up-to-date + no bugs / zero days + …

I installed OF from ubuntu package, do I need other files to install ?

Yes. Normally a installation with package manager only install the binary files. The source files are not installed by default. Sometimes there is a …-src or …-dev or …-devel or … package availabe, which includes the sources.
If no package is available, you can download the sources manually and put it into the src directory of openfoam.

Installation of openfoam .org and .com allways difficult to install (if you will both and different versions). I prefer an download and build of the openfoam software from git repository. One additional advantage is, you get updates / fixes of released versions (e.g. v2012.xxx).