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

BouyantSimpleFoam + Thermal Source

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 5, 2009, 05:00
Arrow BouyantSimpleFoam + Thermal Source
  #1
New Member
 
Antonin
Join Date: Apr 2009
Location: France
Posts: 7
Rep Power: 17
Antonin is on a distinguished road
Hello,

I am using openfoam 1.5 on ubuntu (installed from ppa repo)
I want to create a thermal source in my geometries using the recompilation to buoyantSimpleFoam (look like to add temperature transport to icoFoam :http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam)

I wrote in hEqn.H :
{
fvScalarMatrix hEqn
(
fvm::div(phi, h)
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p))
- p*fvc::div(phi/fvc::interpolate(rho))
+Qsource /*thermal source */
);

hEqn.relax();

eqnResidual = hEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);

thermo->correct();
}


I want to initialize Qsource in thermophisicalPropreties fields so i write in creatFields:

dimensionedVector Qsource
(
thermophysicalProperties.lookup("Qsource")
);


But when i run the wmake this mistake appears :

antonin@biquad:~/OpenFOAM/antonin-1.5/solvers/my_buoyantSimpleFoam$ wmake
SOURCE=my_buoyantSimpleFoam.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/usr/lib/OpenFOAM-1.5/src/finiteVolume/cfdTools -I/usr/lib/OpenFOAM-1.5/src/finiteVolume/lnInclude -I/usr/lib/OpenFOAM-1.5/src/thermophysicalModels/basic/lnInclude -I/usr/lib/OpenFOAM-1.5/src/turbulenceModels/RAS -IlnInclude -I. -I/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/usr/lib/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc/my_buoyantSimpleFoam.o
In file included from my_buoyantSimpleFoam.C:47:
createFields.H: In function ‘int main(int, char**)’:
createFields.H:28: erreur: ‘thermophysicalProperties’ was not declared in this scope
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/FieldFunctions.C: In function ‘void Foam::add(Foam::Field<typename Foam::typeOfSum<arg1, arg2>::type>&, const Foam::UList<T>&, const Foam::UList<Type2>&) [with Type1 = double, Type2 = Foam::Vector<double>]’:
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/GeometricFieldFunctions.C:951: instantiated from ‘void Foam::add(Foam::GeometricField<typename Foam::typeOfSum<arg1, arg2>::type, PatchField, GeoMesh>&, const Foam::GeometricField<TypeR, PatchField, GeoMesh>&, const Foam::GeometricField<Type1, PatchField, GeoMesh>&) [with Type1 = double, Type2 = Foam::Vector<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]’
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/GeometricFieldFunctions.C:951: instantiated from ‘Foam::tmp<Foam::GeometricField<typename Foam::typeOfSum<arg1, arg2>::type, PatchField, GeoMesh> > Foam:: operator+(const Foam::tmp<Foam::GeometricField<TypeR, PatchField, GeoMesh> >&, const Foam::GeometricField<Type1, PatchField, GeoMesh>&) [with Type1 = double, Type2 = Foam::Vector<double>, PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]’
hEqn.H:10: instantiated from here
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/FieldFunctions.C:696: erreur: no match for ‘operator+’ in ‘((const Foam::UList<double>*)f1)->Foam::UList<T>:: operator[] [with T = double](i) + ((const Foam::UList<Foam::Vector<double> >*)f2)->Foam::UList<T>:: operator[] [with T = Foam::Vector<double>](i)’
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dictionary.H:366: note: candidats sont: Foam::dictionary Foam:: operator+(const Foam::dictionary&, const Foam::dictionary&)
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionSet.H:254: note: Foam::dimensionSet Foam:: operator+(const Foam::dimensionSet&, const Foam::dimensionSet&)
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedScalar.H:50: note: Foam::dimensionedScalar Foam:: operator+(const Foam::dimensionedScalar&, Foam::scalar)
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/dimensionedScalar.H:51: note: Foam::dimensionedScalar Foam:: operator+(Foam::scalar, const Foam::dimensionedScalar&)
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/scalarField.H:78: note: Foam::tmp<Foam::Field<double> > Foam:: operator+(const Foam::scalar&, const Foam::UList<double>&)
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/scalarField.H:78: note: Foam::tmp<Foam::Field<double> > Foam:: operator+(const Foam::scalar&, const Foam::tmp<Foam::Field<double> >&)
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/scalarField.H:78: note: Foam::tmp<Foam::Field<double> > Foam:: operator+(const Foam::UList<double>&, const Foam::scalar&)
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/scalarField.H:78: note: Foam::tmp<Foam::Field<double> > Foam:: operator+(const Foam::tmp<Foam::Field<double> >&, const Foam::scalar&)
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/labelField.H:54: note: Foam::tmp<Foam::Field<int> > Foam:: operator+(const Foam::label&, const Foam::UList<int>&)
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/labelField.H:54: note: Foam::tmp<Foam::Field<int> > Foam:: operator+(const Foam::label&, const Foam::tmp<Foam::Field<int> >&)
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/labelField.H:54: note: Foam::tmp<Foam::Field<int> > Foam:: operator+(const Foam::UList<int>&, const Foam::label&)
/usr/lib/OpenFOAM-1.5/src/OpenFOAM/lnInclude/labelField.H:54: note: Foam::tmp<Foam::Field<int> > Foam:: operator+(const Foam::tmp<Foam::Field<int> >&, const Foam::label&)
make: *** [Make/linux64Gcc/my_buoyantSimpleFoam.o] Erreur 1


If you have any solution thanks to your replies.
(my fields :my_buoyantSimpleFoam.tar.gz)
Antonin
Antonin is offline   Reply With Quote

Old   June 10, 2009, 20:20
Default
  #2
Senior Member
 
Pawel Sosnowski
Join Date: Mar 2009
Location: Munich, Germany
Posts: 105
Rep Power: 18
psosnows is on a distinguished road
Hello,

you did not initialize thermophysicalProperties:
createFields.H: In function ‘int main(int, char**)’:
createFields.H:28: erreur: ‘thermophysicalProperties’ was not declared in this scope

before reading from an object you have to create it:
Code:
IOdictionary thermophysicalProperties
(
IOobject
(
"thermophysicalProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
and after that:
dimensionedVector Qsource
(
thermophysicalProperties.lookup("Qsource")
);


hope it helps

Pawel
psosnows 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
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
UDF Scalar Code: HT 1 Greg Perkins FLUENT 8 October 20, 2000 12:40
Info: Short Course On Thermal Design of Electronic Equipment Arnold Free Main CFD Forum 0 August 10, 1999 10:18


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