Well the errors that it's throwing: it's a mix of
missing/improper declaration in your corresponding header file,
Some syntax errors semi colon etc
You may have pasted stuff in wrong brackets etc because it is strange to see tmp is not declared.
Tl:dr this will work if you diligently look around nearby files where objects are declared etc.. just dig around files to get some inspiration - not necessarily interFoam etc... see how tmp is used, how const is used, in H and C files