In v2.2.0, there has been significant redesign of thermophysical modelling, to enable more flexible handling of multiple materials, e.g. in multiphase flows, and conjugate heat transfer. Detailed changes to the thermodynamics are described in subsequent sections below. For multiphase flows, the resulting changes are:
- includes updated thermodynamics to use the run-time selectable form of the total energy equation for each phase, so that is possible to select different energy forms (h or e) separately for the two phases (see below for details).
- includes updated thermodynamics to use the run-time selectable form of thermodynamics, but solves for the mixture temperature equation, derived from the internal energy equation, in order to maintain boundedness and realisablility.
An example simulation with compressibleTwoPhaseEulerFoam is shown below of a mixer vessel containing cold water at 300K. Hot oil enters as 1mm droplets at 600K through a sparger towards the base of the vessel. The vessel blades rotate at 50 r.p.m., simulated using multiple reference frames (MRF).
The resulting images show flow results for the dispersed oil phase:
- Top left: phase fraction between 0% (blue) and 100% (red);
- Top right: streamtubes of velocity between 0 (blue) and 1.5 m/s (red);
- Bottom left: temperature, between 300K (blue) and 600K (red);
- Bottom right: velocity, between 0 (blue) and 2 m/s (red).
- depth charge -
bubble column -
Prior to the current release of OpenFOAM, each solver that includes an energy equation has been hard-coded to solve for a particular form of energy, e.g. internal energy or enthalpy , and use the corresponding thermodynamics package. This limits the applicability of any solver because different fluids and classes of flow problems are solved optimally using a particular form of energy. For example, is the preferred form of energy for liquids, can be preferable for steady-state and some classes transient gaseous problems, particularly combustion.
A new framework has been built in version 2.2.0 to enable solvers to be rewritten in terms of a general form of energy, referred to as he (meaning “ or ”). The framework allows the user to select the form of energy and corresponding thermodynamics package at run-time. In addition, in most solvers the energy equation is written in a form to conserve total energy at convergence, e.g. see rhoPimpleFoam/EEqn.H:
fvm::ddt(rho, he) + fvm::div(phi, he)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
he.name() == "e"
- fvm::laplacian(turbulence->alphaEff(), he)
In this code the energy he might be chosen to be either internal energy e or enthalpy h at run-time. Depending on the form of energy, the appropriate source term is selected from the name of the energy through he.name(). The choice of energy type is checked against the options the solver support in createFields.H:
- Source code
- Energy equation - $FOAM_SOLVERS/compressible/rhoPimpleFoam/EEqn.H
In addition to being able to select the form of energy, e.g. or , the user may
select at run-time whether the energy includes heat of formation or not. We
refer to absolute energy where heat of formation is included, and sensible energy
where it is not. For example absolute enthalpy is related to sensible enthalpy
where and are the mass fraction and heat of formation, respectively, of specie . In most cases, we use the sensible form of energy, for which it is easier to account for energy change due to reactions.
In previous releases, the selection of a thermodynamics package used a single, complex string derived from the C++ templating used in the creation of the thermodynamic package itself, e.g.
Unknown psiThermo type
Valid psiThermo types are:
type mixture transport thermo equationOfState specie energy
hePsiThermo homogeneousMixture const hConst perfectGas specie sensibleEnthalpy
hePsiThermo homogeneousMixture sutherland hConst perfectGas specie sensibleEnthalpy
hePsiThermo homogeneousMixture sutherland janaf perfectGas specie sensibleEnthalpy
hePsiThermo inhomogeneousMixture const hConst perfectGas specie sensibleEnthalpy
hePsiThermo inhomogeneousMixture sutherland hConst perfectGas specie sensibleEnthalpy
hePsiThermo inhomogeneousMixture sutherland janaf perfectGas specie sensibleEnthalpy
hePsiThermo multiComponentMixture const hConst perfectGas specie sensibleEnthalpy
hePsiThermo multiComponentMixture sutherland janaf perfectGas specie sensibleEnthalpy
hePsiThermo pureMixture const eConst perfectGas specie sensibleInternalEnergy
OpenFOAM can emulate heat transfer across thin solid structures, or “baffles”. Baffles are represented as boundary patches of the mesh and can be created as part of the mesh generation process, e.g. with snappyHexMesh. Heat transfer through baffles are therefore implemented in OpenFOAM as boundary conditions, which have been consolidated in the latest version, using the new thermodynamics packages (see above). The available thermal baffle models are included in the following boundary conditions:
- This boundary condition can be applied to transfer thermal energy between both sides of the baffle. Heat transfer is solved for across a 3D region created by extrudeToRegionMesh, so in effect, the thermalBaffle has zero physical thickness in the flow domain, but non-zero thickness for thermal calculations. Across the encapsulated mesh region the boundary condition solves for a transient 3D heat equation during every solver iteration. The user can now select the thermodynamic models including radiation, with an option to specify a volumetric heat source (W/mˆ3) within the baffle region. An example setup for the 3D thermal baffle an image from a simple case demonstrating its use are shown below.
- This boundary condition is a 1D approximation of the thermalBaffle boundary condition solving a steady-state analytical model for heat transfer across the baffle.
value uniform 300;
value uniform 300;
- Circuit board cooling -
- Source Code
- thermalBaffle boundary condition -
thermalBaffle1D boundary condition -
Under certain conditions it is preferable to solve for enthalpy but without including the pressure-work term (dpdt), e.g. when solving steady-state gaseous flow. An optional dpdt switch is available in the thermophysicalProperties file that will deactivate the pressure-work term if set to no; by default, it is set to yes.
- vertical channel -