|
[Sponsors] |
Problem calculating grad(U) while adding a source term |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 26, 2022, 16:19 |
Problem calculating grad(U) while adding a source term
|
#1 |
New Member
Dimas
Join Date: Oct 2021
Posts: 5
Rep Power: 5 |
Hi everyone! Im trying to compile a source term which uses grad(U) for the force calculation in OpenFOAM 2.4.0. For some reason the following line does not work:
Code:
volTensorField gradU = fvc::grad(U); Code:
error: no matching function for call to ‘grad(const vectorField&)’ volTensorField gradU = fvc::grad(U); ^ In file included from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.H:124:0, from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvc.H:49, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:61, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:51:1: note: candidate: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::outerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::grad(const Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>&) grad ^ /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:51:1: note: template argument deduction/substitution failed: In file included from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374:0, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:439:35: note: ‘const vectorField {aka const Foam::Field<Foam::Vector<double> >}’ is not derived from ‘const Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>’ volTensorField gradU = fvc::grad(U); ^ In file included from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.H:124:0, from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvc.H:49, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:61, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:68:1: note: candidate: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::outerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::grad(const Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >&) grad ^ /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:68:1: note: template argument deduction/substitution failed: In file included from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374:0, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:439:35: note: ‘const vectorField {aka const Foam::Field<Foam::Vector<double> >}’ is not derived from ‘const Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >’ volTensorField gradU = fvc::grad(U); ^ In file included from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.H:124:0, from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvc.H:49, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:61, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:91:1: note: candidate: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::outerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::grad(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&) grad ^ /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:91:1: note: template argument deduction/substitution failed: In file included from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374:0, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:439:35: note: ‘const vectorField {aka const Foam::Field<Foam::Vector<double> >}’ is not derived from ‘const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>’ volTensorField gradU = fvc::grad(U); ^ In file included from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.H:124:0, from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvc.H:49, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:61, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:113:1: note: candidate: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::outerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::grad(const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&, const Foam::word&) grad ^ /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:113:1: note: template argument deduction/substitution failed: In file included from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374:0, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:439:35: note: ‘const vectorField {aka const Foam::Field<Foam::Vector<double> >}’ is not derived from ‘const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >’ volTensorField gradU = fvc::grad(U); ^ In file included from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.H:124:0, from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvc.H:49, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:61, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:142:1: note: candidate: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::outerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::grad(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) grad ^ /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:142:1: note: template argument deduction/substitution failed: In file included from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374:0, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:439:35: note: ‘const vectorField {aka const Foam::Field<Foam::Vector<double> >}’ is not derived from ‘const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>’ volTensorField gradU = fvc::grad(U); ^ In file included from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.H:124:0, from /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvc.H:49, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:61, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:159:1: note: candidate: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::outerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::grad(const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&) grad ^ /home/dbarile/OpenFOAM/OpenFOAM-2.4.0/src/finiteVolume/lnInclude/fvcGrad.C:159:1: note: template argument deduction/substitution failed: In file included from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.H:374:0, from sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_Source.C:58: sources/derived/actuationDiskV10b_calib_Source/actuationDiskV10b_calib_SourceTemplates.C:439:35: note: ‘const vectorField {aka const Foam::Field<Foam::Vector<double> >}’ is not derived from ‘const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >’ volTensorField gradU = fvc::grad(U); |
|
October 6, 2022, 00:47 |
|
#2 |
Member
Tatsuya Shimizu
Join Date: Jul 2012
Posts: 42
Rep Power: 14 |
Hi
The error occurs because the "U" used in your code is a vectorField. NOTE: How to convert vectorField to volVectorField How to convert vectorField to volVectorField NOTE: difference volVectorField and vectorField difference volVectorField and vectorField
__________________
Our Work: https://www.idaj.co.jp/product/ennovacfd/openfoam_gui/ Powered by Ennova : https://ennova-cfd.com/ Ennova's Channel Partners : http://www.wolfdynamics.com/ |
|
October 12, 2022, 17:00 |
|
#3 | |
New Member
Dimas
Join Date: Oct 2021
Posts: 5
Rep Power: 5 |
Quote:
Thank you very much LongGe! Now it's working fine |
||
Tags |
grad u, no matching function, source term |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with coded source term for multiphaseEulerFoam | shuji_type97 | OpenFOAM Running, Solving & CFD | 2 | July 22, 2022 02:37 |
SU2-7.0.1 on ubuntu 18.04 | hyunko | SU2 Installation | 7 | March 16, 2020 05:37 |
polynomial BC | srv537 | OpenFOAM Pre-Processing | 4 | December 3, 2016 10:07 |
[foam-extend.org] problem when installing foam-extend-1.6 | Thomas pan | OpenFOAM Installation | 7 | September 9, 2015 22:53 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |