CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   add temperature (https://www.cfd-online.com/Forums/openfoam/103794-add-temperature.html)

libia87 June 27, 2012 04:13

add temperature
 
HI!

I do the tutorial how to add temperature, but I want to add concentration, and the changes I made is to put C instead of T... with the same formula
I dont understand why the program gives me an error:

Making dependency list for source file my_Buoyant.C
SOURCE=my_Buoyant.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I../buoyantBoussinesqSimpleFoam -I/opt/openfoam210/src/finiteVolume/lnInclude -I/opt/openfoam210/src/turbulenceModels -I/opt/openfoam210/src/turbulenceModels/incompressible/RAS/lnInclude -I/opt/openfoam210/src/transportModels -I/opt/openfoam210/src/transportModels/incompressible/singlePhaseTransportModel -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/my_Buoyant.o
In file included from my_Buoyant.C:86:
CEqn.H: In function ‘int main(int, char**)’:
CEqn.H:7: error: no matching function for call to ‘Foam::fvMatrix<double>::fvMatrix(Foam::tmp<Foam:: fvMatrix<Foam::Vector<double> > >)’
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:418: note: candidates are: Foam::fvMatrix<Type>::fvMatrix(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, Foam::Istream&) [with Type = double]
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:361: note: Foam::fvMatrix<Type>::fvMatrix(const Foam::tmp<Foam::fvMatrix<Type> >&) [with Type = double]
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:330: note: Foam::fvMatrix<Type>::fvMatrix(const Foam::fvMatrix<Type>&) [with Type = double]
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:273: note: Foam::fvMatrix<Type>::fvMatrix(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::dimensionSet&) [with Type = double]
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H:38: warning: unused variable ‘maxDeltaT’
my_Buoyant.C:110: error: expected ‘}’ at end of input
make: *** [Make/linux64GccDPOpt/my_Buoyant.o] Error 1


Does anyone knows why appears this error?

nimasam June 27, 2012 06:22

first "wclean" to clean previous .dep file
then use wmake

libia87 June 27, 2012 06:23

the same error appears...

libia87 June 27, 2012 06:24

CEqn.H:7: error: no matching function for call to ‘Foam::fvMatrix<double>::fvMatrix(Foam::tmp<F oam:: fvMatrix<Foam::Vector<double> > >)’
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:418: note: candidates are: Foam::fvMatrix<Type>::fvMatrix(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, Foam::Istream&) [with Type = double]

anon_a June 27, 2012 06:27

Could you copy-paste the 7th line of CEqn.H? (that's where the error is, CEqn.H:7)

libia87 June 27, 2012 06:31

{
fvScalarMatrix CEqn
(
fvm::ddt(C)
+ fvm::div(phi, C)
- fvm::laplacian(DC, C)
);

CEqn.solve();

}

the 7th line is );

anon_a June 27, 2012 06:55

Could you try again without the { } ?
I think these make the concentration (C) a temporary object (tmp) and as a result you can not use any of the constructors.
And even if you could, it would be deleted from memory after the }.

nimasam June 27, 2012 07:20

Quote:

Originally Posted by libia87 (Post 368520)
CEqn.H:7: error: no matching function for call to ‘Foam::fvMatrix<double>::fvMatrix(Foam::tmp<Foam:: fvMatrix<Foam::Vector<double> > >)’
/opt/openfoam210/src/finiteVolume/lnInclude/fvMatrix.C:418: note: candidates are: Foam::fvMatrix<Type>::fvMatrix(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, Foam::Istream&) [with Type = double]

you should define C as volScalarField, it seems you define it as scalar


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