|
[Sponsors] |
November 26, 2014, 10:30 |
error in operator& use
|
#1 |
New Member
Bharat Bhushan Sharma
Join Date: Nov 2014
Posts: 8
Rep Power: 11 |
Dear All Foamers,
I am bit new to openfoam programming and have been working on writing a solver based on existing solver. But I am getting following error. Can you tell me what is the problem. Actually same piece of code works very well in other solvers but in my code, while compiling I get error's mentioned below. CODE: Code:
surfaceScalarField phiUf("phiUf",(fvc::interpolate(phiU,"phiU")) & mesh.Sf()); //- phiH surfaceScalarField phiH("phiH", (fsf*Kf*(ROL-ROV)*hlg*g/nuv) & mesh.Sf()); Code:
updateSbProperties.H:95:51: error: no match for ‘operator&’ in ‘Foam::fvc::interpolate(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&) [with Type = double]((* & Foam::word(((const char*)"phiU"), 1))) & mesh.Foam::fvMesh::Sf()’ updateSbProperties.H:95:51: note: candidates are: /opt/openfoam230/src/OpenFOAM/lnInclude/wordI.H:167:19: note: Foam::word Foam::operator&(const Foam::word&, const Foam::word&) /opt/openfoam230/src/OpenFOAM/lnInclude/wordI.H:167:19: note: no known conversion for argument 1 from ‘Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >’ to ‘const Foam::word&’ /opt/openfoam230/src/OpenFOAM/lnInclude/FieldFunctions.C:774:1: note: template<class Type1, class Type2> Foam::tmp<Foam::Field<typename Foam::innerProduct<Type1, Type2>::type> > Foam::operator&(const Foam::UList<T>&, const Foam::UList<StringType>&) /opt/openfoam230/src/OpenFOAM/lnInclude/FieldFunctions.C:774:1: note: template<class Type1, class Type2> Foam::tmp<Foam::Field<typename Foam::innerProduct<Type1, Type2>::type> > Foam::operator&(const Foam::UList<T>&, const Foam::tmp<Foam::Field<Type2> >&) /opt/openfoam230/src/OpenFOAM/lnInclude/FieldFunctions.C:774:1: note: template<class Type1, class Type2> Foam::tmp<Foam::Field<typename Foam::innerProduct<Type1, Type2>::type> > Foam::operator&(const Foam::tmp<Foam::Field<Type> >&, const Foam::UList<StringType>&) /opt/openfoam230/src/OpenFOAM/lnInclude/FieldFunctions.C:774:1: note: template<class Type1, class Type2> Foam::tmp<Foam::Field<typename Foam::innerProduct<Type1, Type2>::type> > Foam::operator&(const Foam::tmp<Foam::Field<Type> >&, const Foam::tmp<Foam::Field<Type2> >&) Please tell me how to sort it out. Thanks & Regards, Bharat Bhushan Sharma Last edited by wyldckat; December 6, 2014 at 06:49. Reason: Added [CODE][/CODE] |
|
November 26, 2014, 10:43 |
|
#2 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
What OF version are you using?
I'm not an expert, but judging from the error and judging from a search on "fvc::interpolate" (in OF-2.3.x), I can't help but notice that your interpolate has two arguments, whereas the search results always (I went through the first 40 results) have one argument. So change Code:
surfaceScalarField phiUf("phiUf",(fvc::interpolate(phiU,"phiU")) & mesh.Sf()); Code:
surfaceScalarField phiUf("phiUf",(fvc::interpolate(phiU)) & mesh.Sf()); |
|
November 26, 2014, 18:58 |
|
#3 | |
New Member
Bharat Bhushan Sharma
Join Date: Nov 2014
Posts: 8
Rep Power: 11 |
Quote:
. I tried your suggestion but same errors came again. I think it has some thing to do with the datatype of return value of fvc::interpolate(phiU). Thanks for your reply. ANd mine is version 2.3.0-OF. Please somebody suggest me what I have to do to remove this error. Thanks & Regards, BHarat Bhushan Sharma |
||
December 6, 2014, 06:53 |
|
#4 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@Bharat Bhushan Sharma: The problem is that you're trying to interpolate a surface scalar field, which isn't a standard interpolation in OpenFOAM. As detailed here: https://github.com/wyldckat/reconstr...te-fields/wiki Quote:
Bruno |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|