Adaptive mesh refinement fails when field relaxation is applied
Summary
If field relaxation combined with adaptive mesh refinement are used together, a simulation will fail. The following error is produced:
GAMGPCG: Solving for p_rgh, Initial residual = 9.32957e-07, Final residual = 5.87573e-11, No Iterations 3
[1]
[1]
[1] --> FOAM FATAL ERROR:
[1] Field<scalar> f1(15738), Field<scalar> f2(15738) and Field<scalar> f3(8906)
for operation f1 = f2 - f3
[1]
[1] From function void Foam::checkFields(const Foam::UList<T>&, const Foam::UList<Key>&, const Foam::UList<Type3>&, const char*) [with Type1 = double; Type2 = double; Type3 = double]
[1] in file /home/gavin/code/OpenFOAM-plus/src/OpenFOAM/lnInclude/FieldM.H at line 76.
My code is on commit d9cbe69c.
This can be easily reproduced. Just go to tutorials/multiphase/interFoam/RAS/motorBike, set nOuterCorrectors to 2, and add relaxation to any field.