CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] OpenQBMM compile error (v6,7,8,dev) (https://www.cfd-online.com/Forums/openfoam-installation/229060-openqbmm-compile-error-v6-7-8-dev.html)

mrishi July 24, 2020 18:40

OpenQBMM compile error (v6,7,8,dev)
 
I encounter the following error trying to compile the OpenQBMM code pulled from github (https://github.com/OpenQBMM).
It appears across versions 6 through 8 and dev. It should be noted that 8 and dev have consolidated the transportModel and TurbulenceModel libraries into one (MomentumTransportModel), so the Make/options has to be changed accordingly.

What is puzzling me is that such a trivial compilation issue (type conversion) could not have survived as part of the code, and further no issue has been raised on the project git, so I am not sure what I am doing wrong here - I merely downloaded and compiled on docker images in macOS (6,7,8 and dev) as well as a built from source OF-6 on Ubuntu 18.04 and encountered the same error.

Code:

In file included from ../quadratureNode/lnInclude/quadratureNode.H:316:0,
                from ../quadratureNode/lnInclude/quadratureNodes.H:43,
                from ../fieldMomentInversion/lnInclude/fieldMomentInversion.H:45,
                from lnInclude/quadratureApproximation.H:53,
                from monoKineticQuadratureApproximation/monoKineticQuadratureApproximation.H:47,
                from monoKineticQuadratureApproximation/monoKineticQuadratureApproximation.C:31:
../quadratureNode/lnInclude/quadratureNode.C: In instantiation of 'Foam::autoPtr<Foam::quadratureNode<scalarType, vectorType> > Foam::quadratureNode<scalarType, vectorType>::clone() const [with scalarType = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>; vectorType = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>]':
/opt/openfoam-dev/src/OpenFOAM/lnInclude/PtrListIO.C:86:24:  required from 'void Foam::PtrList<T>::read(Foam::Istream&, const INew&) [with INew = Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >::iNew; T = Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >]'
/opt/openfoam-dev/src/OpenFOAM/lnInclude/PtrListIO.C:162:9:  required from 'Foam::PtrList<T>::PtrList(Foam::Istream&, const INew&) [with INew = Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >::iNew; T = Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >]'
../../mappedPtrList/mappedPtrList.C:153:13:  required from 'Foam::mappedPtrList<mappedType>::mappedPtrList(Foam::Istream&, const INew&) [with INew = Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >::iNew; mappedType = Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >]'
lnInclude/quadratureApproximation.C:142:9:  required from 'Foam::quadratureApproximation<momentType, nodeType>::quadratureApproximation(const Foam::word&, const Foam::fvMesh&, const Foam::word&) [with momentType = Foam::moment<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > >; nodeType = Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >]'
monoKineticQuadratureApproximation/monoKineticQuadratureApproximation.C:67:68:  required from here
../quadratureNode/lnInclude/quadratureNode.C:509:12: error: could not convert 'nullptr' from 'std::nullptr_t' to 'Foam::autoPtr<Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > >'
    return nullptr;
            ^~~~~~~
In file included from ../moments/moment.H:226:0,
                from ../moments/moments.H:43,
                from ../moments/momentFieldSets.H:43,
                from ../fieldMomentInversion/lnInclude/fieldMomentInversion.H:48,
                from lnInclude/quadratureApproximation.H:53,
                from monoKineticQuadratureApproximation/monoKineticQuadratureApproximation.H:47,
                from monoKineticQuadratureApproximation/monoKineticQuadratureApproximation.C:31:
../moments/moment.C: In instantiation of 'Foam::autoPtr<Foam::moment<fieldType, nodeType> > Foam::moment<fieldType, nodeType>::clone() const [with fieldType = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>; nodeType = Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >]':
/opt/openfoam-dev/src/OpenFOAM/lnInclude/PtrListIO.C:86:24:  required from 'void Foam::PtrList<T>::read(Foam::Istream&, const INew&) [with INew = Foam::moment<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > >::iNew; T = Foam::moment<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > >]'
/opt/openfoam-dev/src/OpenFOAM/lnInclude/PtrListIO.C:162:9:  required from 'Foam::PtrList<T>::PtrList(Foam::Istream&, const INew&) [with INew = Foam::moment<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > >::iNew; T = Foam::moment<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > >]'
../../mappedPtrList/mappedPtrList.C:153:13:  required from 'Foam::mappedPtrList<mappedType>::mappedPtrList(Foam::Istream&, const INew&) [with INew = Foam::moment<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > >::iNew; mappedType = Foam::moment<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > >]'
../moments/momentFieldSet.C:59:21:  required from 'Foam::momentFieldSet<momentType, nodeType>::momentFieldSet(const Foam::word&, const Foam::dictionary&, const Foam::fvMesh&, const Foam::autoPtr<Foam::mappedPtrList<nodeType> >&, const Foam::word&) [with momentType = Foam::moment<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > >; nodeType = Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >]'
lnInclude/quadratureApproximation.C:89:26:  required from 'Foam::quadratureApproximation<momentType, nodeType>::quadratureApproximation(const Foam::word&, const Foam::fvMesh&, const Foam::word&) [with momentType = Foam::moment<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > >; nodeType = Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >]'
monoKineticQuadratureApproximation/monoKineticQuadratureApproximation.C:67:68:  required from here
../moments/moment.C:158:12: error: could not convert 'nullptr' from 'std::nullptr_t' to 'Foam::autoPtr<Foam::moment<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::quadratureNode<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > > >'
    return nullptr;
            ^~~~~~~
/opt/openfoam-dev/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/monoKineticQuadratureApproximation/monoKineticQuadratureApproximation.o' failed


mrishi July 25, 2020 05:42

To clarify, it can be resolved by changing the return statement from

Code:

return nullPtr;
in moment.C to
Code:

return autoPtr<moment<fieldType, nodeType>>(NULL);
and similarly in quadratureNode.C to
Code:

return autoPtr<moment<scalarType, vectorType>>(NULL);
Infact, the same is done in earlier stable branch of the code (OpenQBMM-4.0.0) built for OF-6 (of course it is very outdated). I am trying to understand why this element was changed subsequently, and how come it has not led to this issue that I encounter.

alberto July 26, 2020 21:03

Hi Rishi,

you are probably using OpenFOAM-dev, while the master branch requires ESI-OpenFOAM v2006. Due to the repeated breaking changes in OpenFOAM-dev, this is not our version of reference anymore. See here http://www.openqbmm.org/2020/05/17/n...nch-structure/

The code that compiles against OpenFOAM 7 is still available in the development-openfoam.org branch ( https://github.com/OpenQBMM/OpenQBMM...t-openfoam.org ). At the moment, a port to OpenFOAM 8 is not being considered, so I would suggest you use the ESI release, of which OpenQBMM has become a module (https://www.openfoam.com/releases/op...erics-OpenQBMM) and will continue being supported in the future.

P.S. This is an issue specific to OpenQBMM, so please, in the future, report on our issue tracker: https://github.com/OpenQBMM/OpenQBMM/issues not in two different forums, one of which we do not monitor. :D

Best,
AP


All times are GMT -4. The time now is 17:49.