OpenFoam CHT with non-Newtonian fluids, non constant Prandtl

Hello,

I would like to use the CHT module of the OpenFoam adapter to couple my user defined non-Newtonian solver with a solid region. My solver is just a modified version of simpleFoam with added the temperature equation and a couple of modified viscosity models.

My problem is that, from what i can understand from this discussion, the CHT module for an incompressible flow calculates the laminar part of the effective thermal diffusion with the relation viscosity/Prandtl number: the problem is that in my flow viscosity is not constant, this mean that I can’t define just one Prantl number for the fluid.

My case-study is perfectly laminar, so I tried to get around the problem changing the solver type from “incompressible” to “basic”: this way I just have to give to the solver a thermal conductivity that in my fluid is constant (and I don’t have additional diffusion due to turbulence). With this approach I end up with a strange problem that I can’t figure out how to solve: when I execute the calculations after any coupling between the two regions the time of my simulation restarts from the beginning. So if I impose time-window-size value=“4” the solvers iterate untill time=4, then they couple but then they restart to iterate from time 1, not 5. But at this point another thing happens: the two solvers couple each other three times and then the solver for the fluid just stops without giving error messages while the solid solver just idles waiting for a response from the fluid solver. So, to sum up: the solvers iterate untill time 4, the couple then they restart from time 1, the do this three times and then the fluid solver stops.

I attach the outputs on the terminals for both of the solvers and the precice configuration files. Note that if I run exactly the same case using for the fluid a solver type “incompressible” and not “basic” it runs smoothly without problems.

If someone please could help me to figure out how to solve this problem or can suggest a different approach.

log-fluid.txt (10.6 KB)
log-solid.txt (8.5 KB)
precice-config.xml (1.9 KB)
log-fluid.txt (10.6 KB)
log-solid.txt (8.5 KB)

Hi @Paolo,

sorry for the delay getting any answer. I typically look into OpenFOAM-related questions, but lately I had no time to look into the forum, especially not into tricky questions.

Some interesting information I gather from the files you uploaded:

  • The solver is plasticFoam, which implements a SIMPLE loop (steady-state).

  • preCICE uses an implicit scheme, coupling every two steps:

        <coupling-scheme:parallel-implicit>
          <time-window-size value="2" />
          <max-time value="200" />
          <max-iterations value="10" />
    

The Fluid log looks as follows:

Time = 1
...
(0) 11:38:58 [impl::SolverInterfaceImpl]:476 in advance: iteration: 1 of 10, time-window: 1, time: 1 of 200, time-window-size: 2, max-timestep-length: 1, ongoing: yes, time-window-complete: no,

Time = 2
...
(0) 11:38:59 [impl::SolverInterfaceImpl]:476 in advance: iteration: 2 of 10, time-window: 1, time: 0 of 200, time-window-size: 2, max-timestep-length: 2, ongoing: yes, time-window-complete: no, read-iteration-checkpoint

(reading checkpoint)

Time = 1
...
(0) 11:38:59 [impl::SolverInterfaceImpl]:476 in advance: iteration: 2 of 10, time-window: 1, time: 1 of 200, time-window-size: 2, max-timestep-length: 1, ongoing: yes, time-window-complete: no,

TIme = 2
...
(0) 11:38:59 [impl::SolverInterfaceImpl]:476 in advance: iteration: 3 of 10, time-window: 1, time: 0 of 200, time-window-size: 2, max-timestep-length: 2, ongoing: yes, time-window-complete: no, read-iteration-checkpoint

(reading checkpoint)

Time = 1
...
(0) 11:38:59 [impl::SolverInterfaceImpl]:476 in advance: iteration: 3 of 10, time-window: 1, time: 1 of 200, time-window-size: 2, max-timestep-length: 1, ongoing: yes, time-window-complete: no,

Time = 2
...
(0) 11:39:00 [impl::SolverInterfaceImpl]:476 in advance: iteration: 4 of 10, time-window: 1, time: 0 of 200, time-window-size: 2, max-timestep-length: 2, ongoing: yes, time-window-complete: no, read-iteration-checkpoint

(reading checkpoint)

Time = 1
...
(hangs?)

The Solid log (laplacianFoam, also SIMPLE) looks as follows:

Time = 1
...
(0) 11:38:58 [impl::SolverInterfaceImpl]:476 in advance: iteration: 1 of 10, time-window: 1, time: 1 of 200, time-window-size: 2, max-timestep-length: 1, ongoing: yes, time-window-complete: no,

Time = 2
...
(0) 11:38:59 [impl::SolverInterfaceImpl]:476 in advance: iteration: 2 of 10, time-window: 1, time: 0 of 200, time-window-size: 2, max-timestep-length: 2, ongoing: yes, time-window-complete: no, read-iteration-checkpoint

(reading checkpoint)

Time = 1
...
(0) 11:38:59 [impl::SolverInterfaceImpl]:476 in advance: iteration: 2 of 10, time-window: 1, time: 1 of 200, time-window-size: 2, max-timestep-length: 1, ongoing: yes, time-window-complete: no,

Time = 2
...
(0) 11:38:59 [impl::SolverInterfaceImpl]:476 in advance: iteration: 3 of 10, time-window: 1, time: 0 of 200, time-window-size: 2, max-timestep-length: 2, ongoing: yes, time-window-complete: no, read-iteration-checkpoint

(reading checkpoint)

Time = 1
...
(0) 11:38:59 [impl::SolverInterfaceImpl]:476 in advance: iteration: 3 of 10, time-window: 1, time: 1 of 200, time-window-size: 2, max-timestep-length: 1, ongoing: yes, time-window-complete: no,

Time = 2
...
(0) 11:39:00 [impl::SolverInterfaceImpl]:476 in advance: iteration: 4 of 10, time-window: 1, time: 0 of 200, time-window-size: 2, max-timestep-length: 2, ongoing: yes, time-window-complete: no, read-iteration-checkpoint

(reading checkpoint)

Time = 1
...
(0) 11:39:00 [impl::SolverInterfaceImpl]:476 in advance: iteration: 4 of 10, time-window: 1, time: 1 of 200, time-window-size: 2, max-timestep-length: 1, ongoing: yes, time-window-complete: no,

Time = 2
...
(0) 11:39:00 [impl::SolverInterfaceImpl]:476 in advance: iteration: 5 of 10, time-window: 1, time: 0 of 200, time-window-size: 2, max-timestep-length: 2, ongoing: yes, time-window-complete: no, read-iteration-checkpoint

(reading checkpoint)

Time = 1
...
(0) 11:39:00 [impl::SolverInterfaceImpl]:476 in advance: iteration: 5 of 10, time-window: 1, time: 1 of 200, time-window-size: 2, max-timestep-length: 1, ongoing: yes, time-window-complete: no,

Time = 2
...
(hangs?)

I am particularly confused on why the solvers hang. Last time I experienced something like this, it was due to mixed MPI versions (one MPI version used in OpenFOAM, another one in preCICE), and it was occurring arbitrarily. Could that be an issue?

Other than that, the only difference is that the OpenFOAM adapter calculates the heat flux differently, which could lead to more or fewer iterations.

Could it be that OpenFOAM crashes at the end, but you don’t see the error message for some reason? (e.g., redirecting the stdinfo to a log file, but not the stderr).

Do you still have this issue?