|
[Sponsors] |
September 26, 2012, 05:21 |
adding temperature field to icofoam
|
#1 |
Member
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15 |
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! |
|
September 26, 2012, 05:45 |
|
#2 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
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? |
|
September 26, 2012, 07:12 |
|
#3 | |
Member
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15 |
Quote:
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... |
||
September 26, 2012, 07:30 |
|
#4 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
Then please check your createFields.H again, because I think T and DT are not properly defined.
|
|
September 26, 2012, 07:36 |
|
#5 | |
Member
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15 |
Quote:
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") ); |
||
September 26, 2012, 23:20 |
|
#6 | |
Member
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15 |
Quote:
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/ ! |
||
|
|
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 |