Error arise after alpha smooth modification in interfaceProperties::calculateK
Dear All:
Now I am using interFoam to simulate 2-phase flow. I smoothed the alpha by some changes in interfaceProperties.c in Foam::interfaceProperties::calculateK() according to Laplacian filter(3.51) in Onno Ubbink's thesis. No error arise in recompilation of interfaceProperties.c and interFoam.c . But when I call interFoam calculating a case, error arised: Quote:
Code:
void Foam::interfaceProperties::calculateK() The last line caused the error. I am new to OpenFoam. Maybe this is a simple question.:confused: So anyone has the hint ? Thanks !:) Yin |
You are misusing references (the ampersand '&').
1. volScalarField theActualObject; 2. volScalarField& referenceToObject = objectToWhichItRefers; 1 is an actual instance of an object that takes up real memory. 2 is a reference to another object stored elsewhere, and notice it *must* be initialized by the object it points to right away. Only use the '&' if you know the object exists already somewhere else. Hope that helps. |
Hi, David:
Thank you for your reply. Yeah, you are right. I am just too new to C++ and OpenFOAM:D. I will check whether I can manage it. Cheers, Yin |
Hi,
Have you been able to resolve this? Also, I am trying to implement the same smoother in alphaEqnSubCycle.C instead of at interfaceProperties.C Was there a specific reason why the implementation is at interfaceProperties.C and not after calculating alpha at alphaEqnSubCycle.C?\ Thanks, |
Hi,
Yes, later I found smoothing alpha has little influence on my result. So I just quit. We only need the smoothed alpha for surface tension calculation, so I directly modify in interfaceproperties.C, I think this is more convenient. But I am not sure. Yin |
Quote:
So it seems convenient to use a smoothed alpha field only for the calculation of interface properties. |
All times are GMT -4. The time now is 10:14. |