CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Compilation error when trying to interpolate a dimensionedScalar& (https://www.cfd-online.com/Forums/openfoam-programming-development/124319-compilation-error-when-trying-interpolate-dimensionedscalar.html)

ThomasV October 2, 2013 04:52

Compilation error when trying to interpolate a dimensionedScalar&
 
Hi!

I ran into another problem and don't know what I did wrong when writing my solver...
I want to do a fvc::interpolate() command on a dimensionedScalar. The scalar is created similar to the twoPhaseEulerFoam solver:
Code:

    const dimensionedScalar& rhoa = phasea->rho();
The interpolation command looks like this:
Code:

    surfaceScalarField rhoaf = fvc::interpolate(rhoa);
I now get the following error when compiling though:
Quote:

pEqn.H:30:53: Fehler: keine passende Funktion für Aufruf von »interpolate(const Foam::dimensionedScalar&)«
That is the compiler is unable to get a function which fits to the interpolate call of the dimensionedScalar&. I don't know at which point I did something wrong as even in the twoPhaseEulerFoam code rhoa is used within an interpolate command...

ThomasV October 2, 2013 07:49

I think I got closer to the solution. I guess it's not possible to interpolate a dimensionedScalar as its meant for volScalarFields only. As rhoa never shows up alone in an interpolation command of the twoPhaseEulerFoam solver I guess it cancels itself with some other components thus forming a valid interpolate statement...

I also found this definition of rhoa in one of the papers I'm reading:
Code:

    rhoa = phasea->rho();
Maybe it can work this way but unfortunately this seems to have problems in terms of the scope making its usage invalid. I'll see if I can figure out a way around that problem...

wyldckat October 5, 2013 07:07

Greetings Thomas,

I didn't manage to properly read your questions, but I read that you mentioned "fvc::interpolate", so perhaps this little example of mine can help: https://github.com/wyldckat/reconstr...rpolate-fields

Best regards,
Bruno


All times are GMT -4. The time now is 02:47.