k13113y |
September 13, 2016 09:45 |
Hmm I seem to be getting an error when I try to compile.
Code:
Info<< "Reading field energyFlux\n" <<endl;
const vector energyFlux=p_rgh*U;
volVectorField energyFlux
(
IOobject
(
"energyFlux",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
);
Code:
In file included from /opt/openfoam4/src/OpenFOAM/lnInclude/postProcess.H:129:0,
from interEnergyFluxFoam.C:58:
./createFields.H: In function ‘int main(int, char**)’:
./createFields.H:32:30: error: conversion from ‘Foam::tmp<Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >’ to non-scalar type ‘const vector {aka const Foam::Vector<double>}’ requested
const vector energyFlux=p_rgh*U;
^
./createFields.H:36:5: error: conflicting declaration ‘Foam::volVectorField energyFlux’
(
^
./createFields.H:32:14: note: previous declaration as ‘const vector energyFlux’
const vector energyFlux=p_rgh*U;
^
./createFields.H:43:42: error: ‘Foam::volScalarField {aka class Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘dimension’
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
./createFields.H:43:54: error: ‘Foam::volVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘dimension’
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
./createFields.H:43:22: error: expected primary-expression before ‘(’ token
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
./createFields.H:43:42: error: ‘Foam::volScalarField {aka class Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘dimension’
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
./createFields.H:43:54: error: ‘Foam::volVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘dimension’
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
./createFields.H:43:64: error: expected primary-expression before ‘)’ token
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
In file included from interEnergyFluxFoam.C:67:0:
createFields.H:32:30: error: conversion from ‘Foam::tmp<Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> >’ to non-scalar type ‘const vector {aka const Foam::Vector<double>}’ requested
const vector energyFlux=p_rgh*U;
^
createFields.H:36:5: error: conflicting declaration ‘Foam::volVectorField energyFlux’
(
^
createFields.H:32:14: note: previous declaration as ‘const vector energyFlux’
const vector energyFlux=p_rgh*U;
^
createFields.H:43:42: error: ‘Foam::volScalarField {aka class Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘dimension’
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
createFields.H:43:54: error: ‘Foam::volVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘dimension’
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
createFields.H:43:22: error: expected primary-expression before ‘(’ token
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
createFields.H:43:42: error: ‘Foam::volScalarField {aka class Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘dimension’
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
createFields.H:43:54: error: ‘Foam::volVectorField {aka class Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>}’ has no member named ‘dimension’
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
createFields.H:43:64: error: expected primary-expression before ‘)’ token
dimensionedScalar("energyFlux",p_rgh.dimension*U.dimension,)
^
/opt/openfoam4/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/interEnergyFluxFoam.o' failed
make: *** [Make/linux64GccDPInt32Opt/interEnergyFluxFoam.o] Error 1
I tried removing the dimension and the const variable and the application compiled but the file never appeared in the output.
|