CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Implementing Radiation Model into buoyantBoussinesqPisoFoam compiling error

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 16, 2009, 08:51
Default Implementing Radiation Model into buoyantBoussinesqPisoFoam compiling error
  #1
New Member
 
Fabian Hampp
Join Date: Dec 2009
Location: Abu Dhabi
Posts: 8
Rep Power: 7
Fabian is on a distinguished road
Hi All,



I am trying to implement a radiation model into the existing buoyantBoussinesqPisoFoam solver. I have just recently started to work with OpenFOAM and this is the first time for me to try to build my own solver; hence please excuse some beginner mistakes...

I copied the directory "OpenFOAM/OpenFOAM-1.6/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam" to "OpenFOAM/fhampp-1.6/applications/solvers/" and renamed the directory and accordingly the .C file to "buoyantBoussinesqPisoRadiationFoam". Then I changed the files "Make/files" and "Make/options" as follows.

Make/files
buoyantBoussinesqPisoRadiationFoam.C
EXE = $FOAM_USER_SOLVERS/buoyantBoussinesqPisoRadiationFoam

Make/options
EXE_INC = \
-I$FOAM_SOLVERS/heatTransfer/buoyantBoussinesqSimpleFoam \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/incompressible/RAS/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel
EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lradiation \
-lfiniteVolume \
-lmeshTools \
-lincompressibleRASModels \
-lincompressibleTransportModels

I also copied the readTransportProperties.H file from the directory "OpenFOAM/OpenFOAM-1.6/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam" into my directory


readTransportProperties.H
singlePhaseTransportModel laminarTransport(U, phi);
// Thermal expansion coefficient [1/K]
dimensionedScalar beta(laminarTransport.lookup("beta"));
// Reference temperature [K]
dimensionedScalar TRef(laminarTransport.lookup("TRef"));
// Laminar Prandtl number
dimensionedScalar Pr(laminarTransport.lookup("Pr"));
// Turbulent Prandtl number
dimensionedScalar Prt(laminarTransport.lookup("Prt"));

Then I modified my .C file corresponding to the buoyantSimpleRadiationFoam.C as follows (red text is added)


buoyantBoussinesqPisoRadiationFoam.C
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "RASModel.H"
#include "basicPsiThermo.H"
#include "fixedGradientFvPatchFields.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createRadiationModel.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
p.storePrevIter();
rho.storePrevIter();
#include "UEqn.H"
#include "hEqn.H"
#include "TEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "pEqn.H"
}
turbulence->correct();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}

I also copied hEqn.H from the solver "buoyantPisoFoam" and modified it according to "buoyantSimpleRadiationFoam" as follows.

hEqn.H
{
fvScalarMatrix hEqn
(
fvm::ddt(rho, h)
+ fvm::div(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
+ radiation->Sh(thermo)
);
hEqn.relax();
hEqn.solve();
thermo.correct();
}

Now things starting to get complicated, at least with my programming knowledge.

This is the compiling error:

Making dependency list for source file buoyantBoussinesqPisoRadiationFoam.C
SOURCE=buoyantBoussinesqPisoRadiationFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -IOAM_SOLVERS/heatTransfer/buoyantBoussinesqSimpleFoam -I/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/cfdTools -I/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -I/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/basic/lnInclude -I/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/radiation/lnInclude -I/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels -I/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels/incompressible/RAS/lnInclude -I/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/transportModels -I/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/transportModels/incompressible/singlePhaseTransportModel -IlnInclude -I. -I/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/buoyantBoussinesqPisoRadiationFoam.o
In file included from buoyantBoussinesqPisoRadiationFoam.C:65:
/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/radiation/lnInclude/createRadiationModel.H: In function ‘int main(int, char**)’:
/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/radiation/lnInclude/createRadiationModel.H:3: error: ‘thermo’ was not declared in this scope
buoyantBoussinesqPisoRadiationFoam.C:85: error: ‘rho’ was not declared in this scope
In file included from buoyantBoussinesqPisoRadiationFoam.C:88:
hEqn.H:4: error: ‘h’ was not declared in this scope
hEqn.H:6: error: ‘class Foam::incompressible::RASModel’ has no member named ‘alphaEff’
hEqn.H:8: error: ‘DpDt’ was not declared in this scope
/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:11: warning: unused variable ‘transonic’
/home/fhampp/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:14: warning: unused variable ‘nOuterCorr’
make: *** [Make/linux64GccDPOpt/buoyantBoussinesqPisoRadiationFoam.o] Error 1


Here my questions:
1st:do I have to solve the enthalpy or only if I have compressible flow?
2nd: as far as I understand the first error, I have to declare "thermo" before I use "createRadiationModel.H" but I have no idea where.
3rd:I guess similar problem with hEqn.H
4th: Is it even possible to combine those two models in a relatively easy way or do I have to start from scratch writing a new solver?
5th: Can you recommend any good programming tutorials for OpenFOAM?


I appreciate any help and if you need any further details, please let me know.
Thanks a lot in advance,
best regards, Fabian
Fabian is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile calcMassFlowC aurore OpenFOAM Programming & Development 12 March 18, 2014 05:22
Building error of 15dev for OpenSUSE 111 on AMD64 machine waynezw0618 OpenFOAM Installation 1 February 18, 2009 11:12
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
Compiling OpenFOAM13 on AMD64 with OpenSUSE 101 silent_missile OpenFOAM Installation 5 August 10, 2007 07:31
a question of open ".cas" and ".dat" files fanzhong Meng FLUENT 4 May 15, 2006 11:40


All times are GMT -4. The time now is 05:02.