CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   BouyantSimpleFoam + Thermal Source (http://www.cfd-online.com/Forums/openfoam-solving/65135-bouyantsimplefoam-thermal-source.html)

Antonin June 5, 2009 05:00

BouyantSimpleFoam + Thermal Source
 
1 Attachment(s)
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 :Attachment 400)
Antonin

psosnows June 10, 2009 20:20

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


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