A minus sign is missing in Lee.C of icoReactingMultiphaseInterFoam
Summary
I think there is a bug in Lee.C of icoReactingMultiphaseInterFoam.
The line 162 of Lee.C: coeff*pos(Tactivate_ - refValue)
is incorrect, thus, the solidification process does not work.
A minus sign is missing. -coeff*pos(Tactivate_ - refValue)
would be correct.
Previously, I posted a same topic at CFD online.
https://www.cfd-online.com/Forums/openfoam-bugs/231579-bug-lee-c-icoreactingmultiphaseinterfoam.html
There, I wrote the reason why the minus sign is required.
Steps to reproduce
Try a simulation with Lee type massTransferModel. Use parameter C < 0.
Example case
solidMelting2D_heating_cooling.zip
I attached the example case.
It is originally solidMelting2D tutorial.
I changed its parameters, as follows.
In system/controlDict, endTime and writeInterval were changed.
endTime 200;
writeInterval 2;
In 0/T, left and right boundaryField were changed.
The left wall heats their with 1000 W for first 50 sec.
After 50 sec, left wall cools their with -1000 W.
For right wall, the fixedValue is set.
In constant/phaseProperties, massTransferModel for a phase change from liquid to solid was add, like as,
(liquid to solid)
{
type Lee;
C -40;
Tactivate 302.78;
}
What is the current bug behaviour?
The figure shows alpha.solid.
First, as expected, the solid phase showed a melt.
However, in the middle of simulation (after t = 36s), the simulation failed.
What is the expected correct behavior?
This simulation was carried out by modified Lee.C.
For first 50 sec, the solid phase showed a melt.
After 50 sec, the liquid phase showed a solidification.
Environment information
- OpenFOAM version : v2006
- Operating system : ubuntu
- Compiler : gcc
Possible fixes
Modify the line 162 of Lee.C, like as -coeff*pos(Tactivate_ - refValue)
would be correct.
Best regards