CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   buoyantBoussinesqPimpleFoam for Condensation with a new Boundary condition (http://www.cfd-online.com/Forums/openfoam-programming-development/107633-buoyantboussinesqpimplefoam-condensation-new-boundary-condition.html)

unnikrsn October 2, 2012 08:25

buoyantBoussinesqPimpleFoam for Condensation with a new Boundary condition
 
Hi

I am having the same problem. I am working with the buoyantBoussinesqPimpleFoam for Condensation with a new Boundary condition defined within the solver.

I have the problem defining the laminarTransport and Phi in the readTransportProperties.H & createFields.H


When i don't define #include "readTransportProperties.H" in CreateFields.H

createFields.H:96: error: ‘laminarTransport’ was not declared in this scope

When i define #include "readTransportProperties.H" in CreateFields.H

readTransportProperties.H:29: error: ‘phi’ was not declared in this scope


In the Make/options File

EXE_INC = \
-I../buoyantBoussinesqSimpleFoam \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/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 \
-lfiniteVolume \
-lmeshTools \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleTransportModels

Kindly guide me.. If i am making a lot of Mistakes.

Thanks & Regards
Unnikrishnan-

wyldckat October 2, 2012 17:12

Greetings Unnikrishnan,

I've moved your post from the thread http://www.cfd-online.com/Forums/ope...eld-1-6-x.html to this new thread, because this is a programming question, not a bug related report!

As for your question, I have a few questions of my own, in order to figure out what is going on:
  1. Are you modifying the original source code of the solver "buoyantBoussinesqPimpleFoam" directly at "applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam"?
  2. Or are you modifying a copy of the solver "buoyantBoussinesqPimpleFoam"?
The reason for these questions is simple:
  1. If you're modifying directly in the original source code, then the reason for those errors is because you accidentally erased the line in bold at the file "createFields.H":
    Code:

        Info<< "Reading field U\n" << endl;
        volVectorField U
        (
            IOobject
            (
                "U",
                runTime.timeName(),
                mesh,
                IOobject::MUST_READ,
                IOobject::AUTO_WRITE
            ),
            mesh
        );

        #include "createPhi.H"

        #include "readTransportProperties.H"

        Info<< "Creating turbulence model\n" << endl;
        autoPtr<incompressible::RASModel> turbulence
        (
            incompressible::RASModel::New(U, phi, laminarTransport)
        );

  2. If you're working on a copied folder, then it might be because the sibling folder "buoyantBoussinesqSimpleFoam" is missing. You can check if it exists by running:
    Code:

    ls -l ../buoyantBoussinesqSimpleFoam/
Best regards,
Bruno

unnikrsn October 3, 2012 01:04

Dear Bruno,

Thankyou for the reply.

I had copied the Solver Folder to a new Location..
/home/atmoun/OpenFOAM/atmoun-2.0.1/applications/solvers/buoyantBoussinesqPimpleFoam_Unni

the Original Solver is at the location
/opt/openfoam201/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam

& I checked the createFields.H &

#include "condensationWallFvPatchScalarField.H"
#include "readTransportProperties.H"
#include "createPhi.H"

is all present in the file at the exact same location.

But when i run wmake.. i get the following error..

atmoun@server:~/OpenFOAM/atmoun-2.0.1/applications/solvers/buoyantBoussinesqPimpleFoam_Unni$ wmake
Making dependency list for source file buoyantBoussinesqPimpleFoam_Unni.C
Making dependency list for source file condensationWallFvPatchScalarField.C
SOURCE=buoyantBoussinesqPimpleFoam_Unni.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I../buoyantBoussinesqSimpleFoam_Unni -I/opt/openfoam201/src/finiteVolume/cfdTools -I/opt/openfoam201/src/finiteVolume/lnInclude -I/opt/openfoam201/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam201/src/turbulenceModels -I/opt/openfoam201/src/turbulenceModels/incompressible/RAS/lnInclude -I/opt/openfoam201/src/transportModels -I/opt/openfoam201/src/transportModels/incompressible/singlePhaseTransportModel -IlnInclude -I. -I/opt/openfoam201/src/OpenFOAM/lnInclude -I/opt/openfoam201/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/buoyantBoussinesqPimpleFoam_Unni.o
In file included from createFields.H:93,
from buoyantBoussinesqPimpleFoam_Unni.C:68:
readTransportProperties.H: In function ‘int main(int, char**)’:
readTransportProperties.H:29: error: ‘phi’ was not declared in this scope
/opt/openfoam201/src/finiteVolume/lnInclude/readTimeControls.H:38: warning: unused variable ‘maxDeltaT’
make: *** [Make/linux64GccDPOpt/buoyantBoussinesqPimpleFoam_Unni.o] Error 1
atmoun@server:~/OpenFOAM/atmoun-2.0.1/applications/solvers/buoyantBoussinesqPimpleFoam_Unni$



About the sibling folder "buoyantBoussinesqSimpleFoam" was missing. :(
But now i have added the "buoyantBoussinesqSimpleFoam" folder to
/home/atmoun/OpenFOAM/atmoun-2.0.1/applications/solvers/

atmoun@server:~/OpenFOAM/atmoun-2.0.1/applications/solvers/buoyantBoussinesqPimpleFoam_Unni$ wmake
Making dependency list for source file buoyantBoussinesqPimpleFoam_Unni.C
Making dependency list for source file condensationWallFvPatchScalarField.C
SOURCE=buoyantBoussinesqPimpleFoam_Unni.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I../buoyantBoussinesqSimpleFoam -I/opt/openfoam201/src/finiteVolume/cfdTools -I/opt/openfoam201/src/finiteVolume/lnInclude -I/opt/openfoam201/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam201/src/turbulenceModels -I/opt/openfoam201/src/turbulenceModels/incompressible/RAS/lnInclude -I/opt/openfoam201/src/transportModels -I/opt/openfoam201/src/transportModels/incompressible/singlePhaseTransportModel -IlnInclude -I. -I/opt/openfoam201/src/OpenFOAM/lnInclude -I/opt/openfoam201/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/buoyantBoussinesqPimpleFoam_Unni.o
In file included from createFields.H:93,
from buoyantBoussinesqPimpleFoam_Unni.C:68:
readTransportProperties.H: In function ‘int main(int, char**)’:
readTransportProperties.H:29: error: ‘phi’ was not declared in this scope
/opt/openfoam201/src/finiteVolume/lnInclude/readTimeControls.H:38: warning: unused variable ‘maxDeltaT’
make: *** [Make/linux64GccDPOpt/buoyantBoussinesqPimpleFoam_Unni.o] Error 1
atmoun@server:~/OpenFOAM/atmoun-2.0.1/applications/solvers/buoyantBoussinesqPimpleFoam_Unni$



Could you please help me.. with what this 2 errors are..

readTransportProperties.H: In function ‘int main(int, char**)’:
readTransportProperties.H:29: error: ‘phi’ was not declared in this scope


Thanks & Regards
Unnikrishnan

wyldckat October 3, 2012 17:18

Hi Unnikrishnan,

OK, I've tested just now with an OpenFOAM 2.0.1 installation the following steps:
Code:

mkdir -p $FOAM_RUN
cd $FOAM_RUN

cp -r /opt/openfoam201/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam buoyantBoussinesqPimpleFoam_unni

cp /opt/openfoam201/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/readTransportProperties.H buoyantBoussinesqPimpleFoam_unni/

I then edited the file "Make/files":
Code:

gedit buoyantBoussinesqPimpleFoam_unni/Make/files
And changed the last line to be like this:
Code:

EXE = $(FOAM_USER_APPBIN)/buoyantBoussinesqPimpleFoam_unni
After saving the file, I built the solver like this:
Code:

wmake buoyantBoussinesqPimpleFoam_unni
And it built without any problems!

Best regards,
Bruno

unnikrsn October 5, 2012 02:59

Thankyou Bruno.

You are correct, I made a few mistakes in my new solver. Now it is working fine.

The Mistakes I made was When I copied the readTransportProperties.H from another solver.
I missed to include the line
#include "createPhi.H"

Now there is no problem with the
readTransportProperties.H:29: error: ‘phi’ was not declared in this scope

& in the sibling folder "buoyantBoussinesqSimpleFoam"
I forgot :( then edited the file "Make/files":
EXE = $(FOAM_USER_APPBIN)/buoyantBoussinesqSimpleFoam_unni

Now that the solver is working.. I am having problem only with the boundary condition.
I will check the Boundary condition for mistake and If i am finding it difficult.

I will come back to the Forum.. But thanks a lot for the help.

Thanks & Regards
Unnikrishnan.


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