CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to convert from GeometricField to fvMatrix (http://www.cfd-online.com/Forums/openfoam-solving/58068-how-convert-geometricfield-fvmatrix.html)

waynezw0618 January 21, 2009 19:01

Hi everyone: i have faced a e
 
Hi everyone:
i have faced a error message in OF1.5 as :
Potentialke/Potentialke.C:384: error: conversion from 'Foam::tmp<foam::geometricfield<foam::vector<doubl e>, Foam::fvPatchField, Foam::volMesh> >' to non-scalar type 'Foam::tmp<foam::fvmatrix<foam::vector<double> > >' requested

and in line 384 of Potentialke.C,i have the code :


tmp<fvvectormatrix> Potentialke::divR() const

{

return

(

fvc::grad(Tphi_)

+scalar(2)*fvc::curl(Tpsi_)

);

}


and the Tphi and Tpsi is defined as :

volScalarField Tphi_;

volVectorField Tpsi_;

how can i resolve it?

thanks!

yours wayne

waynezw0618 January 22, 2009 12:12

by the way how about change it
 
by the way how about change it to:
tmp<fvvectormatrix> Potentialke::divR(U) const

{

return (
fvm::div(phi_, U)
- fvm::Sp(fvc::div(phi_), U)
+ fvc::grad(Tphi_)
+ fvc::curl(Tpsi_)
);

}

because i think the first two term :
fvm::div(phi_, U)
- fvm::Sp(fvc::div(phi_), U)
will resulting div(U),which should be zero for incompressible flow?

can anyone help me ?

yours wayne


All times are GMT -4. The time now is 11:59.