scalarTransport FO uses relative fluxes if correctPhi is set to yes
Summary
In pimpleFoam, fluxes are made relative to the mesh motion if correctPhi is set to yes in fvSolution. However, if a transport equation is solved after the p-U-coupling, e.g. using the scalarTransport function object, absolute fluxes are required because sinks/sources would be introduced otherwise (see the attached picture).
Steps to reproduce
Run the attached example case (modified contaminatedDroplet2D). Modifications:
-
correctPhi yes;
in fvSolution - scalarTransport FO + accompanying files; field name is S
What is the current bug behaviour?
The scalar field S computed by the scalarTransport FO becomes unbounded.
What is the expected correct behavior?
The scalar field should be strictly bounded to [0...1].
Relevant logs and/or images
Environment information
- OpenFOAM version : v2006
- Operating system : Manjaro Linux
- Hardware info : ThinkPad T460s
- Compiler : g++ 10.2.0
Possible fixes
I am not sure about a general solution, but adding fvc::makeAbsolute(phi, U);
before scalarTransport is computed solves the problem in case of pimpleFoam.
Cheers, Andre