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

adding temperature field to icofoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 26, 2012, 05:21
Default adding temperature field to icofoam
  #1
Member
 
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15
houkensjtu is on a distinguished road
hi foamers!

I have followed the instruction on openfoam wiki to add a temperature field calculation to my icofoam.
I found that in my newest openfoam-2.1.1 installation, T and DT has already included in createFields.H, which means needs no change I think.
However in icoFoam.C, I found that there is no code to solve for temperature. This seems strange because temperature variables is now included in createFields.H.

And finally I wmake my icoFoam solver according to openfoam wiki and I got errors like this:

houken@ubuntu:~/OpenFOAM/houken-2.1.x/applications/solvers/my_icoFoam$ wmake
SOURCE=my_icoFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-100 -I/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPDebug/my_icoFoam.o
my_icoFoam.C: In function ‘int main(int, char**)’:
my_icoFoam.C:104:23: error: no matching function for call to ‘ddt(<unresolved overloaded function type>)’
my_icoFoam.C:104:23: note: candidates are:
/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvmDdt.C:45:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::ddt(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvmDdt.C:60:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::ddt(const Foam:ne&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvmDdt.C:72:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::ddt(const dimensionedScalar&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvmDdt.C:88:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::ddt(const volScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
my_icoFoam.C:105:30: error: no matching function for call to ‘div(Foam::surfaceScalarField&, <unresolved overloaded function type>)’
my_icoFoam.C:105:30: note: candidates are:
/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvmDiv.C:45:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const surfaceScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&)
/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvmDiv.C:62:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&)
/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvmDiv.C:77:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const surfaceScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/fvmDiv.C:88:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)
my_icoFoam.C:106:30: error: ‘DT’ was not declared in this scope
/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’ [-Wunused-variable]
/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/readPISOControls.H:12:16: warning: unused variable ‘momentumPredictor’ [-Wunused-variable]
/home/houken/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’ [-Wunused-variable]
make: *** [Make/linux64GccDPDebug/my_icoFoam.o] Error 1

Sorry to paste long code here, plz help me!
houkensjtu is offline   Reply With Quote

Old   September 26, 2012, 05:45
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
It sounds a bit unlikely to me that T and DT are created in the default icoFoam solver. In my 2.1.0 installation, these are not defined in createFields.H.

You get an errormessage at line 104, can you give the relevant part of the code that you implemented there?
Bernhard is offline   Reply With Quote

Old   September 26, 2012, 07:12
Default
  #3
Member
 
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15
houkensjtu is on a distinguished road
Quote:
Originally Posted by Bernhard View Post
It sounds a bit unlikely to me that T and DT are created in the default icoFoam solver. In my 2.1.0 installation, these are not defined in createFields.H.

You get an errormessage at line 104, can you give the relevant part of the code that you implemented there?

here is the piece of code i add to icofoam.C

//add these lines...
fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(DT, T)
);

TEqn.solve();
//done adding lines...

I just copied this from openfoam wiki...
houkensjtu is offline   Reply With Quote

Old   September 26, 2012, 07:30
Default
  #4
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
Then please check your createFields.H again, because I think T and DT are not properly defined.
Bernhard is offline   Reply With Quote

Old   September 26, 2012, 07:36
Default
  #5
Member
 
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15
houkensjtu is on a distinguished road
Quote:
Originally Posted by Bernhard View Post
Then please check your createFields.H again, because I think T and DT are not properly defined.
Here is my creatFields.H, which I have not modified anything.
Obviously T and DT is defined here.
Only the order is different from wiki's one...


Info<< "Reading field T\n" << endl;

volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);


Info<< "Reading transportProperties\n" << endl;

IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);


Info<< "Reading diffusivity DT\n" << endl;

dimensionedScalar DT
(
transportProperties.lookup("DT")
);
houkensjtu is offline   Reply With Quote

Old   September 26, 2012, 23:20
Default
  #6
Member
 
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15
houkensjtu is on a distinguished road
Quote:
Originally Posted by Bernhard View Post
Then please check your createFields.H again, because I think T and DT are not properly defined.
I got it.
There are many createFields.H in OF with different contents. I thought there is only one common "createFields.H" and the one I checkup is in applications/solvers/basic/laplacianFoam/ !
houkensjtu is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 05:49
Adding temperature equation to porousSimpleFoam David_010 OpenFOAM Programming & Development 9 February 14, 2018 02:22
How to add temperature to icoFoam - correct? uli OpenFOAM Programming & Development 3 July 31, 2012 17:48
I wish to find the proper model to validate the temperature field. G.H.Lee Main CFD Forum 1 May 6, 1999 03:05
Question concering about validating Temperature field ghlee Main CFD Forum 1 December 1, 1998 13:36


All times are GMT -4. The time now is 06:49.