EASY FIX: Include linear EOS in active thermophysical models
DESCRIPTION OF PROBLEM
The thermo-phyiscal Equation of State linear
has two problems:
- It is not included in any of the possible combinations listed in
rhoThermos.H
, so it cannot be used by any density-based thermodynamic objects (this is clearly not the intended behavior); - Its class name is "linear" (probably accidentally, based on the
#ifndef
pre-processor directives in its header file), which leads to intractable naming conflicts.
I first noticed this in v2306, but based on my quick read of the code, it appears that it is still present in v2406.
PROPOSED RESOLUTION
- To allow thermodynamic objects to access the
linear
EOS within OpenFOAM solvers that use density-based thermodynamics (i.e., thermodynamics based onrhoThermo
), include the following in\src\thermophysicalModels\basic\rhoThermo**\rhoThermos.H**
:
#include "../specie/equationOfState/linear/linear.H"
makeThermos
( rhoThermo, heRhoThermo, pureMixture, constTransport,
sensibleEnthalpy, hConstThermo, linear, specie);
makeThermos
( rhoThermo, heRhoThermo, pureMixture, constTransport,
sensibleEnthalpy, eConstThermo, linear, specie);
makeThermos
( rhoThermo, heRhoThermo, pureMixture, constTransport,
sensibleInternalEnergy, hConstThermo, linear, specie);
makeThermos
( rhoThermo, heRhoThermo, pureMixture, constTransport,
sensibleInternalEnergy, eConstThermo, linear, specie);
- To resolve severe naming conflicts (that occur with
fvCFD.H
, and are thus basically unavoidable in most cases), three files (see\src\thermophysicalModels\specie\equationOfState\linear
) and the classdefs they contain need to be renamed:linear.H
-->linearEOS.H
linearI.H
-->linearEOSI.H
, etc.Foam::linear
-->Foam::linearEOS
, etc.
LIKELY RESULT
This shouldn't have any downsides. As mentioned, I think that both the problems above stem from oversights, and are not the intended behavior; the fixes I've mentioned make the linear thermo-physical model selectable as an option in thermophysicalProperties
dictionaries, and also make the header files usable in other solver code (at time of writing, linear.H
cannot be used with any solver that calls fvCFD.H
since it will produce a naming conflict from two conflicting definitions of Foam::linear
.)
Edited by Dominic Jarecki