|
[Sponsors] |
August 8, 2012, 09:31 |
problem in running a modified solver
|
#1 |
Senior Member
|
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 thank you |
|
August 8, 2012, 11:15 |
|
#2 |
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
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. |
|
August 8, 2012, 11:27 |
|
#3 | |
Senior Member
|
Quote:
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()); From where do you understand the origin of this error? |
||
August 8, 2012, 18:34 |
|
#4 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
"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:perator-(const Foam::dimensionSet........ |
|
August 9, 2012, 17:08 |
|
#5 | |
Senior Member
|
Quote:
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()); 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 Last edited by adambarfi; August 9, 2012 at 17:42. |
||
August 10, 2012, 16:52 |
|
#6 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
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) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error, running a modified version of twoPhaseEulerFoam | foamer | OpenFOAM Running, Solving & CFD | 0 | March 11, 2012 17:17 |
Compilation problem after modifying a solver. | PetSul | OpenFOAM Running, Solving & CFD | 2 | October 1, 2009 18:28 |
patching problem unsteady solver | yellow-stuff | Main CFD Forum | 0 | September 25, 2009 02:26 |
Coupled solver energy equation problem | lucioantonio | FLUENT | 0 | April 3, 2009 11:21 |
problem in CFX solver about isolated volumes | Yuan | CFX | 2 | August 16, 2004 23:54 |