CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   problem in running a modified solver (http://www.cfd-online.com/Forums/openfoam/105749-problem-running-modified-solver.html)

adambarfi August 8, 2012 08:31

problem in running a modified solver
 
hi everybody,

I made some changes in buoyantSimpleFoam and I want to solve my problem with this new solver. the new solver name is buoyantSimpleFoamMod. I used wmake but the following errors appear:

Code:

mostafa@mostafa-desktop:~/OpenFOAM/mostafa-2.0.1/run/applications/solvers/heatTransfer/buoyantSimpleFoamMod$ wmake
Making dependency list for source file buoyantSimpleFoamMod.C
SOURCE=buoyantSimpleFoamMod.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam201/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam201/src/turbulenceModels -I/opt/openfoam201/src/turbulenceModels/compressible/RAS/lnInclude -I/opt/openfoam201/src/finiteVolume/cfdTools -I/opt/openfoam201/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam201/src/OpenFOAM/lnInclude -I/opt/openfoam201/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/buoyantSimpleFoamMod.o
In file included from buoyantSimpleFoamMod.C:46:
createFields.H: In function ‘int main(int, char**)’:
createFields.H:56: error: no match for ‘operator-’ in ‘g - Foam::Vector<double>(((const double&)((const double*)(&0.0))), ((const double&)((const double*)(&1.0e+0))), ((const double&)((const double*)(&0.0))))’
/opt/openfoam201/src/OpenFOAM/lnInclude/dimensionSet.H:255: note: candidates are: Foam::dimensionSet Foam::operator-(const Foam::dimensionSet&)
/opt/openfoam201/src/OpenFOAM/lnInclude/dimensionSet.H:263: note:                Foam::dimensionSet Foam::operator-(const Foam::dimensionSet&, const Foam::dimensionSet&)
/opt/openfoam201/src/OpenFOAM/lnInclude/dimensionedScalar.H:52: note:                Foam::dimensionedScalar Foam::operator-(const Foam::dimensionedScalar&, Foam::scalar)
/opt/openfoam201/src/OpenFOAM/lnInclude/dimensionedScalar.H:53: note:                Foam::dimensionedScalar Foam::operator-(Foam::scalar, const Foam::dimensionedScalar&)
/opt/openfoam201/src/OpenFOAM/lnInclude/scalarField.H:78: note:                Foam::tmp<Foam::Field<double> > Foam::operator-(const Foam::scalar&, const Foam::UList<double>&)
/opt/openfoam201/src/OpenFOAM/lnInclude/scalarField.H:78: note:                Foam::tmp<Foam::Field<double> > Foam::operator-(const Foam::scalar&, const Foam::tmp<Foam::Field<double> >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/scalarField.H:78: note:                Foam::tmp<Foam::Field<double> > Foam::operator-(const Foam::UList<double>&, const Foam::scalar&)
/opt/openfoam201/src/OpenFOAM/lnInclude/scalarField.H:78: note:                Foam::tmp<Foam::Field<double> > Foam::operator-(const Foam::tmp<Foam::Field<double> >&, const Foam::scalar&)
/opt/openfoam201/src/OpenFOAM/lnInclude/labelField.H:54: note:                Foam::tmp<Foam::Field<int> > Foam::operator-(const Foam::label&, const Foam::UList<int>&)
/opt/openfoam201/src/OpenFOAM/lnInclude/labelField.H:54: note:                Foam::tmp<Foam::Field<int> > Foam::operator-(const Foam::label&, const Foam::tmp<Foam::Field<int> >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/labelField.H:54: note:                Foam::tmp<Foam::Field<int> > Foam::operator-(const Foam::UList<int>&, const Foam::label&)
/opt/openfoam201/src/OpenFOAM/lnInclude/labelField.H:54: note:                Foam::tmp<Foam::Field<int> > Foam::operator-(const Foam::tmp<Foam::Field<int> >&, const Foam::label&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:61: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::UList<Foam::DiagTensor<double> >&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:61: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::UList<Foam::DiagTensor<double> >&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:61: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::tmp<Foam::Field<Foam::DiagTensor<double> > >&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:61: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::tmp<Foam::Field<Foam::DiagTensor<double> > >&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:64: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::diagTensor&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:64: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::diagTensor&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:64: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::UList<Foam::DiagTensor<double> >&, const Foam::tensor&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:64: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::tmp<Foam::Field<Foam::DiagTensor<double> > >&, const Foam::tensor&)
/opt/openfoam201/src/OpenFOAM/lnInclude/vectorTensorTransformI.H:283: note:                Foam::vectorTensorTransform Foam::operator-(const Foam::vectorTensorTransform&, const Foam::vector&)
/opt/openfoam201/src/OpenFOAM/lnInclude/quaternionI.H:273: note:                Foam::quaternion Foam::operator-(const Foam::quaternion&)
/opt/openfoam201/src/OpenFOAM/lnInclude/quaternionI.H:279: note:                Foam::quaternion Foam::operator-(const Foam::quaternion&, const Foam::quaternion&)
/opt/openfoam201/src/OpenFOAM/lnInclude/septernionI.H:190: note:                Foam::septernion Foam::operator-(const Foam::septernion&, const Foam::vector&)
createFields.H:57: error: no match for ‘operator-’ in ‘g - Foam::Vector<double>(((const double&)((const double*)(&0.0))), ((const double&)((const double*)(&1.0e+0))), ((const double&)((const double*)(&0.0))))’
/opt/openfoam201/src/OpenFOAM/lnInclude/dimensionSet.H:255: note: candidates are: Foam::dimensionSet Foam::operator-(const Foam::dimensionSet&)
/opt/openfoam201/src/OpenFOAM/lnInclude/dimensionSet.H:263: note:                Foam::dimensionSet Foam::operator-(const Foam::dimensionSet&, const Foam::dimensionSet&)
/opt/openfoam201/src/OpenFOAM/lnInclude/dimensionedScalar.H:52: note:                Foam::dimensionedScalar Foam::operator-(const Foam::dimensionedScalar&, Foam::scalar)
/opt/openfoam201/src/OpenFOAM/lnInclude/dimensionedScalar.H:53: note:                Foam::dimensionedScalar Foam::operator-(Foam::scalar, const Foam::dimensionedScalar&)
/opt/openfoam201/src/OpenFOAM/lnInclude/scalarField.H:78: note:                Foam::tmp<Foam::Field<double> > Foam::operator-(const Foam::scalar&, const Foam::UList<double>&)
/opt/openfoam201/src/OpenFOAM/lnInclude/scalarField.H:78: note:                Foam::tmp<Foam::Field<double> > Foam::operator-(const Foam::scalar&, const Foam::tmp<Foam::Field<double> >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/scalarField.H:78: note:                Foam::tmp<Foam::Field<double> > Foam::operator-(const Foam::UList<double>&, const Foam::scalar&)
/opt/openfoam201/src/OpenFOAM/lnInclude/scalarField.H:78: note:                Foam::tmp<Foam::Field<double> > Foam::operator-(const Foam::tmp<Foam::Field<double> >&, const Foam::scalar&)
/opt/openfoam201/src/OpenFOAM/lnInclude/labelField.H:54: note:                Foam::tmp<Foam::Field<int> > Foam::operator-(const Foam::label&, const Foam::UList<int>&)
/opt/openfoam201/src/OpenFOAM/lnInclude/labelField.H:54: note:                Foam::tmp<Foam::Field<int> > Foam::operator-(const Foam::label&, const Foam::tmp<Foam::Field<int> >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/labelField.H:54: note:                Foam::tmp<Foam::Field<int> > Foam::operator-(const Foam::UList<int>&, const Foam::label&)
/opt/openfoam201/src/OpenFOAM/lnInclude/labelField.H:54: note:                Foam::tmp<Foam::Field<int> > Foam::operator-(const Foam::tmp<Foam::Field<int> >&, const Foam::label&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:61: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::UList<Foam::DiagTensor<double> >&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:61: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::UList<Foam::DiagTensor<double> >&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:61: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::tmp<Foam::Field<Foam::DiagTensor<double> > >&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:61: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::tmp<Foam::Field<Foam::DiagTensor<double> > >&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:64: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::diagTensor&, const Foam::UList<Foam::Tensor<double> >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:64: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::diagTensor&, const Foam::tmp<Foam::Field<Foam::Tensor<double> > >&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:64: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::UList<Foam::DiagTensor<double> >&, const Foam::tensor&)
/opt/openfoam201/src/OpenFOAM/lnInclude/diagTensorField.H:64: note:                Foam::tmp<Foam::Field<Foam::Tensor<double> > > Foam::operator-(const Foam::tmp<Foam::Field<Foam::DiagTensor<double> > >&, const Foam::tensor&)
/opt/openfoam201/src/OpenFOAM/lnInclude/vectorTensorTransformI.H:283: note:                Foam::vectorTensorTransform Foam::operator-(const Foam::vectorTensorTransform&, const Foam::vector&)
/opt/openfoam201/src/OpenFOAM/lnInclude/quaternionI.H:273: note:                Foam::quaternion Foam::operator-(const Foam::quaternion&)
/opt/openfoam201/src/OpenFOAM/lnInclude/quaternionI.H:279: note:                Foam::quaternion Foam::operator-(const Foam::quaternion&, const Foam::quaternion&)
/opt/openfoam201/src/OpenFOAM/lnInclude/septernionI.H:190: note:                Foam::septernion Foam::operator-(const Foam::septernion&, const Foam::vector&)
make: *** [Make/linux64GccDPOpt/buoyantSimpleFoamMod.o] Error 1

anybody knows what should I do? this is my first time that I make changes in a solver.

thank you

adhiraj August 8, 2012 10:15

Can you post the part of the code that causes the problem?
You are trying to subtract something from the variable and that is not allowed, it seems.

adambarfi August 8, 2012 10:27

Quote:

Originally Posted by adhiraj (Post 376029)
Can you post the part of the code that causes the problem?
You are trying to subtract something from the variable and that is not allowed, it seems.

Dear Adhiraj,

in createFields.H I made this changes:

Code:

    Info<< "Calculating field g.h\n" << endl;
    volScalarField gh("gh", ((((g - vector(0,1,0)) & mesh.C()) + vector(0,1,0)) & mesh.C());
    surfaceScalarField ghf("ghf", ((((g - vector(0,1,0)) & mesh.C()) + vector(0,1,0)) & mesh.Cf());

but do you see any error!?!?
From where do you understand the origin of this error?

nimasam August 8, 2012 17:34

"g" is dimensionedVactor
so you can not add or subtract it form a vector!
so you should define a dimension for your vector


P.S.

this is error:
g - Foam::Vector<double>(((const double&)
and solution is below it:
candidates are: Foam::dimensionSet Foam::operator-(const Foam::dimensionSet........

adambarfi August 9, 2012 16:08

Quote:

Originally Posted by nimasam (Post 376094)
"g" is dimensionedVactor
so you can not add or subtract it form a vector!
so you should define a dimension for your vector


P.S.

this is error:
g - Foam::Vector<double>(((const double&)
and solution is below it:
candidates are: Foam::dimensionSet Foam::operator-(const Foam::dimensionSet........

Thank you Nima,

I made this changes:

Code:

dimensionedVector un
    (
      "un",
      dimensionSet(0,1,-2,0,0,0,0),
      vector(0,1,0),
    );

    Info<< "Calculating field g.h\n" << endl;
    volScalarField gh("gh", ((((g + un) & mesh.C()) & un) - un) & mesh.C());
    surfaceScalarField ghf("ghf", ((((g + un) & mesh.Cf()) & un) - un) & mesh.Cf());

and after wmake this errors appear:
Code:

Making dependency list for source file buoyantSimpleFoamMod.C
SOURCE=buoyantSimpleFoamMod.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam201/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam201/src/turbulenceModels -I/opt/openfoam201/src/turbulenceModels/compressible/RAS/lnInclude -I/opt/openfoam201/src/finiteVolume/cfdTools -I/opt/openfoam201/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam201/src/OpenFOAM/lnInclude -I/opt/openfoam201/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/buoyantSimpleFoamMod.o
In file included from buoyantSimpleFoamMod.C:46:
createFields.H: In function ‘int main(int, char**)’:
createFields.H:61: error: expected primary-expression before ‘)’ token
In file included from /opt/openfoam201/src/OpenFOAM/lnInclude/doubleFloat.H:30,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/floatScalar.H:38,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/scalar.H:39,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/IOstream.H:49,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/Ostream.H:39,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/OSstream.H:40,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/messageStream.H:211,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/error.H:51,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/UListI.H:26,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/UList.H:365,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/List.H:43,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/labelList.H:48,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/UPstream.H:43,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/Pstream.H:42,
                from /opt/openfoam201/src/OpenFOAM/lnInclude/parRun.H:35,
                from /opt/openfoam201/src/finiteVolume/lnInclude/fvCFD.H:4,
                from buoyantSimpleFoamMod.C:32:
/opt/openfoam201/src/OpenFOAM/lnInclude/products.H: At global scope:
/opt/openfoam201/src/OpenFOAM/lnInclude/products.H: In instantiation of ‘Foam::innerProduct<double, Foam::Vector<double> >’:
createFields.H:64:  instantiated from here
/opt/openfoam201/src/OpenFOAM/lnInclude/products.H:97: error: no type named ‘type’ in ‘class Foam::typeOfRank<double, -0x00000000000000001>’
In file included from buoyantSimpleFoamMod.C:46:
createFields.H: In function ‘int main(int, char**)’:
createFields.H:64: error: no match for ‘operator&’ in ‘Foam::operator&(const Foam::dimensioned<Type>&, const Foam::GeometricField<Type1, PatchField, GeoMesh>&) [with Form = Foam::Vector<double>, Type = Foam::Vector<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh](((const Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&)((const Foam::volVectorField*)mesh.Foam::fvMesh::C()))) & un’
/opt/openfoam201/src/OpenFOAM/lnInclude/wordI.H:167: note: candidates are: Foam::word Foam::operator&(const Foam::word&, const Foam::word&)
/opt/openfoam201/src/OpenFOAM/lnInclude/dimensionSet.H:281: note:                Foam::dimensionSet Foam::operator&(const Foam::dimensionSet&, const Foam::dimensionSet&)
/opt/openfoam201/src/OpenFOAM/lnInclude/PackedBoolList.H:266: note:                Foam::PackedBoolList Foam::operator&(const Foam::PackedBoolList&, const Foam::PackedBoolList&)
/opt/openfoam201/src/OpenFOAM/lnInclude/vectorTensorTransformI.H:293: note:                Foam::vectorTensorTransform Foam::operator&(const Foam::vectorTensorTransform&, const Foam::vectorTensorTransform&)
/opt/openfoam201/src/OpenFOAM/lnInclude/quaternionI.H:289: note:                Foam::scalar Foam::operator&(const Foam::quaternion&, const Foam::quaternion&)
/usr/include/c++/4.4/bits/ios_base.h:162: note:                std::_Ios_Iostate std::operator&(std::_Ios_Iostate, std::_Ios_Iostate)
/usr/include/c++/4.4/bits/ios_base.h:124: note:                std::_Ios_Openmode std::operator&(std::_Ios_Openmode, std::_Ios_Openmode)
/usr/include/c++/4.4/bits/ios_base.h:84: note:                std::_Ios_Fmtflags std::operator&(std::_Ios_Fmtflags, std::_Ios_Fmtflags)
createFields.H:65: error: no match for ‘operator&’ in ‘Foam::operator&(const Foam::dimensioned<Type>&, const Foam::GeometricField<Type1, PatchField, GeoMesh>&) [with Form = Foam::Vector<double>, Type = Foam::Vector<double>, PatchField = Foam::fvsPatchField, GeoMesh = Foam::surfaceMesh](((const Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>&)((const Foam::surfaceVectorField*)mesh.Foam::fvMesh::Cf()))) & un’
/opt/openfoam201/src/OpenFOAM/lnInclude/wordI.H:167: note: candidates are: Foam::word Foam::operator&(const Foam::word&, const Foam::word&)
/opt/openfoam201/src/OpenFOAM/lnInclude/dimensionSet.H:281: note:                Foam::dimensionSet Foam::operator&(const Foam::dimensionSet&, const Foam::dimensionSet&)
/opt/openfoam201/src/OpenFOAM/lnInclude/PackedBoolList.H:266: note:                Foam::PackedBoolList Foam::operator&(const Foam::PackedBoolList&, const Foam::PackedBoolList&)
/opt/openfoam201/src/OpenFOAM/lnInclude/vectorTensorTransformI.H:293: note:                Foam::vectorTensorTransform Foam::operator&(const Foam::vectorTensorTransform&, const Foam::vectorTensorTransform&)
/opt/openfoam201/src/OpenFOAM/lnInclude/quaternionI.H:289: note:                Foam::scalar Foam::operator&(const Foam::quaternion&, const Foam::quaternion&)
/usr/include/c++/4.4/bits/ios_base.h:162: note:                std::_Ios_Iostate std::operator&(std::_Ios_Iostate, std::_Ios_Iostate)
/usr/include/c++/4.4/bits/ios_base.h:124: note:                std::_Ios_Openmode std::operator&(std::_Ios_Openmode, std::_Ios_Openmode)
/usr/include/c++/4.4/bits/ios_base.h:84: note:                std::_Ios_Fmtflags std::operator&(std::_Ios_Fmtflags, std::_Ios_Fmtflags)
make: *** [Make/linux64GccDPOpt/buoyantSimpleFoamMod.o] Error 1

thank you

nimasam August 10, 2012 15:52

the error line is obvious from warning!
creatFields.H line 61! (why?)
if you look at it carefully you will find that you enter extra ","
omit "," after vector(0,1,0)


All times are GMT -4. The time now is 01:38.