-
-
Notifications
You must be signed in to change notification settings - Fork 85
OpenFOAM setup (solid)
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 parameterDT
, 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 commandblockMesh
. 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.
The 0/T file defines the following for the interface:
interface
{
type fixedValue;
value $internalField;
}
The type fixedValue
is important, since we want to read temperature values in this patch. The value
is not important, as it is overwritten. However, the file reader of ParaView requires a value to be set for the initial time. See the adapter's configuration page for more.
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 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
andread-data: Temperature
for the Solid. - We set
type fixedValue
for the temperature at the interface for the Solid. - We set
write-data: Temperature
andread-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.
More information on precice.org. Subscribe to the preCICE mailing list.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Please use "precice.org" for the attribution.