CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

add temperature

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 27, 2012, 04:13
Default add temperature
  #1
Member
 
anonymous
Join Date: Mar 2012
Posts: 45
Rep Power: 14
libia87 is on a distinguished road
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?
libia87 is offline   Reply With Quote

Old   June 27, 2012, 06:22
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
first "wclean" to clean previous .dep file
then use wmake
nimasam is offline   Reply With Quote

Old   June 27, 2012, 06:23
Default
  #3
Member
 
anonymous
Join Date: Mar 2012
Posts: 45
Rep Power: 14
libia87 is on a distinguished road
the same error appears...
libia87 is offline   Reply With Quote

Old   June 27, 2012, 06:24
Default
  #4
Member
 
anonymous
Join Date: Mar 2012
Posts: 45
Rep Power: 14
libia87 is on a distinguished road
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]
libia87 is offline   Reply With Quote

Old   June 27, 2012, 06:27
Default
  #5
Disabled
 
Join Date: Mar 2011
Posts: 174
Rep Power: 15
anon_a is on a distinguished road
Could you copy-paste the 7th line of CEqn.H? (that's where the error is, CEqn.H:7)
anon_a is offline   Reply With Quote

Old   June 27, 2012, 06:31
Default
  #6
Member
 
anonymous
Join Date: Mar 2012
Posts: 45
Rep Power: 14
libia87 is on a distinguished road
{
fvScalarMatrix CEqn
(
fvm::ddt(C)
+ fvm::div(phi, C)
- fvm::laplacian(DC, C)
);

CEqn.solve();

}

the 7th line is );
libia87 is offline   Reply With Quote

Old   June 27, 2012, 06:55
Default
  #7
Disabled
 
Join Date: Mar 2011
Posts: 174
Rep Power: 15
anon_a is on a distinguished road
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 }.
anon_a is offline   Reply With Quote

Old   June 27, 2012, 07:20
Default
  #8
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
Quote:
Originally Posted by libia87 View Post
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
nimasam is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with zeroGradient wall BC for temperature - Total temperature loss cboss OpenFOAM 12 October 1, 2018 06:36
Density of fluid with respect to temperature and pressure akash_max CFX 4 November 6, 2011 09:00
High temperature methane+air Peter FLUENT 5 January 26, 2009 18:04
water temperature in heated container ali Main CFD Forum 3 July 23, 2007 11:54
Sequential calculation of Temperature and mass tra J.W.Ryu FLUENT 7 June 18, 2002 07:12


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