Skip to content

OpenFOAM setup (solid)

Makis Chourdakis edited this page Nov 28, 2017 · 7 revisions

OpenFOAM has solvers that can also be used for solids. In this tutorial, we use the basic solver laplacianFoam. Most of the configuration files are similar to the Fluid participant.

The case directory for the solid is very similar to the one for the fluid, with less files:

  • 0/: State of the domain at time=0. In other words: the initial and boundary conditions.
    • T: Temperature field
  • constant/: Model properties
    • transportProperties: Basic transport properties. Solvers that do not use the thermophysical models library use this file. The solver reads only the parameter DT, that is the thermal diffusivity. Since this kind of solver does not read the density or specific heat, we provide the conductivity as a constant in this file and only the adapter reads it.
  • system/: Solver properties
    • blockMeshDict: Mesh properties. The mesh is produced with the command blockMesh. In this case, we only have one block, without any grading.
    • controlDict: Time step length, end time, output settings etc
    • fvSchemes: Finite Volume Schemes - the numerical schemes
    • fvSolution: Finite Volume Solution - the numerical solvers' parameters
  • Solid.foam: An empty file that serves as a reference to ParaView
  • precice-adapter-config.yml: Our adapter's configuration file

Let's see what is different from the Fluid participant.

Model properties

The laplacianFoam is a basic solver, meaning that it does not use any thermophysical or turbulence model libraries. It only solves a laplacian equation, which in this case can model the heat conduction on the solid.

This equation has a parameter DT, which describes the thermal diffusivity. The adapter also needs the thermal conductivity, which it cannot compute from the available information. Therefore, we read it as an additional scalar from the constant/transportProperties:

DT    DT  [ 0  2 -1  0 0 0 0 ] 1;
k     k   [ 1  1 -3 -1 0 0 0 ] 100;

The value for k needs to be in accordance with DT: k = DT * rho * Cp, for the assumed values of density and heat capacity (choose your values).

The adapter's configuration file

The precice-adapter-config.yml file needs to be in the top of the case directory. In this case, it contains the following:

participant: Solid

precice-config-file: precice-config.xml

interfaces:
- mesh: Solid-Mesh
  patches:
  - interface
  write-data: Heat-Flux
read-data: Temperature

Again, we want to perform a Dirichlet-Neumann coupling. We specify that the Solid participant should write heat fluxes and it should read temperatures. Therefore:

  • We set write-data: Heat-Flux and read-data: Temperature for the Solid.
  • We set type fixedValue for the temperature at the interface for the Solid.
  • We set write-data: Temperature and read-data: Heat-Flux for the Fluid.
  • We set type fixedGradient for the temperature at the interface for the Fluid.

Read more at the adapter's configuration page.