linearTsubDiameter, Anglart, H., Nylund, O., Kurul, N., & Podowski, M. Z. (1997)
Summary
The definition of bubble diameter in linearTsubDiameter.C seems to be faulty. There are two issues. First, wrongly calculated subcooling temperature. The value is negative if subcooling appears, yet it should be positive. That results in constant maximum diameter at subcooled temperatures and diameter decrease with superheating. The default values of subcooling temperature in OpenFOAM are defined as positive, in contrast with calculated values. Second, the linear interpolation to get the actual diameter is not correct.
Steps to reproduce
I attach two python codes plotting the actual diameter against subcooling temperature. The original version is coded in anglartNylund_OF.py and the fix in anglartNylund_fix.py. anglartNylund_OF.py anglartNylund_fix.py
In the plot from anglartNylund_OF.py, it is noticeable, that the actual diameter reaches its minimum at 11.5 K subcool (actually superheat) and higher. Although it should reach it just at 13.5 K.
The second file anglartNylund_fix.py give already fixed results.
Let me know if you need to demonstrate the effect of wrongly calculated subcooling within OpenFOAM. However, I believe it is quite clear.
Example case
N/A
What is the current bug behaviour?
Described above
What is the expected correct behavior?
Described above
Relevant logs and/or images
N/A
Environment information
- OpenFOAM version : OpenFOAM-v2012
- Operating system :
- Hardware info :
- Compiler :
Possible fixes
Change following code
void Foam::diameterModels::linearTsub::correct()
{
// Lookup the fluid model
const phaseSystem& fluid =
refCast<const phaseSystem>
(
phase_.mesh().lookupObject<phaseSystem>("phaseProperties")
);
const phaseModel& liquid(fluid.phases()[liquidPhaseName_]);
if (phase_.mesh().foundObject<saturationModel>("saturationModel"))
{
const saturationModel& satModel =
phase_.mesh().lookupObject<saturationModel>("saturationModel");
const volScalarField Tsub
(
liquid.thermo().T() - satModel.Tsat(liquid.thermo().p())
);
d_ = max
(
d1_,
min
(
d2_,
(d1_*(Tsub - Tsub2_) + d2_*(Tsub - Tsub1_))/(Tsub2_ - Tsub1_)
)
);
}
}
into
void Foam::diameterModels::linearTsub::correct()
{
// Lookup the fluid model
const phaseSystem& fluid =
refCast<const phaseSystem>
(
phase_.mesh().lookupObject<phaseSystem>("phaseProperties")
);
const phaseModel& liquid(fluid.phases()[liquidPhaseName_]);
if (phase_.mesh().foundObject<saturationModel>("saturationModel"))
{
const saturationModel& satModel =
phase_.mesh().lookupObject<saturationModel>("saturationModel");
const volScalarField Tsub
(
satModel.Tsat(liquid.thermo().p()) - liquid.thermo().T()
);
d_ = max
(
d1_,
min
(
d2_,
(d1_*(Tsub - Tsub2_) - d2_*(Tsub - Tsub1_))/(Tsub1_ - Tsub2_)
)
);
}
}
Thus, flip saturation and liquid temperature at linearTsubDiameter.C:129 and change the equation on at linearTsubDiameter.C:138