CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Very basic problem with surfaceScalarField definition (http://www.cfd-online.com/Forums/openfoam/95127-very-basic-problem-surfacescalarfield-definition.html)

feldy77 December 7, 2011 05:31

Very basic problem with surfaceScalarField definition
 
Dear Foamers,
I am realy stuck with very simple problem. I am intersted in definition new
surfaceScalarField which will correspond to to the flux of new variable phitag.
I want to do it within my own function by this way:

#include "surfaceInterpolationScheme.H"
#include "linear.H"
#include "fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

void MV(volVectorField*FunU,volScalarField*FunV, volVectorField*ResU, volVectorField*ResV, const fvMesh&mesh )
{

surfaceScalarField phitag
(
IOobject
(
"phitag",
mesh.time(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(FunU) & mesh.Sf()
);
}
The compilation results in error related with mesh.time() and with linearInterpolate .
Namely :
no matching function for call to 'linearInterpolate(Foam::volVectorField*&)'
Any suggestions please,
Yuri

stevenvanharen December 7, 2011 10:09

Maybe try:

Code:

linearInterpolate(&FunU) & mesh.Sf()
It looks like there is some problem with the fact that you pass a pointer to the function?

How are you going to use this piece of code?

anon_a December 7, 2011 10:16

Have you tried this?

Code:

fvc::interpolate(FunU) & mesh.Sf()
You can find something similar for phi in some solvers.

EDIT: Sorry, didn't see the pointer.

feldy77 December 7, 2011 21:11

Thank you for you help,
the code is compiled by changing to

linearInterpolate(*FunU) & mesh.Sf()

Now the problem is what to do with

mesh.time()
If remove the line the code is passing compilation but it is not clear for me what the constructor takes by deffault.
Does anybody know where I can look at comprehensive description of IOobject constructor to understand how it works.

mturcios777 December 8, 2011 14:13

Look at the OF source docs online (http://www.openfoam.com/docs/cpp/), and search for IOobject. This will give you everything you want to know about this class (as well as any others you care to search for).


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