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

Add temperature to pisoFoam

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

Like Tree4Likes
  • 1 Post By danvica
  • 1 Post By wyldckat
  • 1 Post By Matt_B
  • 1 Post By uli

Reply
 
LinkBack Thread Tools Display Modes
Old   March 20, 2012, 07:15
Default Add temperature to pisoFoam
  #1
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 8
danvica is on a distinguished road
I'm trying to add temperature field to pisoFoam.

I followed the icoFoam tutorial, applied to pisoFoam files, and everything seems fine but the turbolence models. It let me work with laminar model only.

Some notes:
- I'm using BlueCape windows porting.
- Compiling the new solver returns me lots of warning concerning missing header files (but developer guide says it's ok)
- Following the Developer guide you have to edit the solver changing CourantNo.H into CourantNo.T.H. But I miss this file. Leaving the original name let the solver be compiled.

My creteFields.h is as following:
Code:
Info<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
    IOobject
    (
        "transportProperties",
        runTime.constant(),
        mesh,
        IOobject::MUST_READ,
        IOobject::NO_WRITE
    )
);
dimensionedScalar DT
(
     transportProperties.lookup("DT")
);
 
    Info<< "Reading field p\n" << endl;
    volScalarField p
    (
        IOobject
        (
            "p",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );
    Info<< "Reading field U\n" << endl;
    volVectorField U
    (
        IOobject
        (
            "U",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );
Info<< "Reading field T\n" <<endl;
volScalarField T
(
    IOobject
    (
         "T",
         runTime.timeName(),
         mesh,
         IOobject::MUST_READ,
         IOobject::AUTO_WRITE
     ),
     mesh
);
#   include "createPhi.H"
 
    label pRefCell = 0;
    scalar pRefValue = 0.0;
    setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
 
    singlePhaseTransportModel laminarTransport(U, phi);
    autoPtr<incompressible::turbulenceModel> turbulence
    (
        incompressible::turbulenceModel::New(U, phi, laminarTransport)
    );
Just newbie questions:

- why in the original pisoFoam file the transportProperties Dict was missing ?
- why in the very last lines turbolence is specified using just laminarTransport ?


I tested a case with the laminar model and the result seems ok.

Any help is really appreciated.

Daniele
y_jiang likes this.
danvica is offline   Reply With Quote

Old   March 21, 2012, 01:57
Default
  #2
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 8
danvica is on a distinguished road
I tried to follow the guideline of this thread: http://www.cfd-online.com/Forums/ope...implefoam.html

but the problem still remains. I've just the laminar turbolence model.

I think I'm missing something very stupid but I don't know where since I compiled a modified version of pisoFoam.

BTW, now I don't have any missing headers compiling problem.

I'll try to compile an exact copy of original pisoFoam solver and see whether the problem is there too.

Daniele
danvica is offline   Reply With Quote

Old   March 21, 2012, 03:15
Default
  #3
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 8
danvica is on a distinguished road
Strange... even the original pisoFoam solver has the same problem, no other turbolence models than laminar.

The exact error is:

--> FOAM FATAL ERROR:
Unknow turbolenceModel type RASModel

Valid turbolenceModel types:

1
(
laminar
)

From function turbolenceModel::New(&const volVectorField&, const surfaceScalarField&, transportModel&, const word&) in file turbolenceModel.C at line 111.


Any help ?


Daniele
danvica is offline   Reply With Quote

Old   March 21, 2012, 09:09
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,503
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Daniele,

I've already replied to you via email. For other forum readers, the latest problem is fixed on blueCFD by running:
Code:
wmake
wmakeVerifyExeDependencies ./
wmake
Where the second command looks for missing DLLs that have to be loaded by force and the third command rebuilds with the necessary forced loads.

Keep in mind that wmakeVerifyExeDependencies is available only on blueCFD's modifications to OpenFOAM source code and this script can be found via Google as well

Best regards,
Bruno
anmartin likes this.
wyldckat is offline   Reply With Quote

Old   March 21, 2012, 14:07
Default
  #5
Senior Member
 
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 8
danvica is on a distinguished road
It works ! (well, what else ? )

Thanks for the fast support.

Daniele
danvica is offline   Reply With Quote

Old   July 30, 2012, 20:27
Default
  #6
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 233
Rep Power: 7
Mojtaba.a is on a distinguished road
Send a message via Yahoo to Mojtaba.a
Quote:
Originally Posted by danvica View Post
I'm trying to add temperature field to pisoFoam.

I followed the icoFoam tutorial, applied to pisoFoam files, and everything seems fine but the turbolence models. It let me work with laminar model only.

Some notes:
- I'm using BlueCape windows porting.
- Compiling the new solver returns me lots of warning concerning missing header files (but developer guide says it's ok)
- Following the Developer guide you have to edit the solver changing CourantNo.H into CourantNo.T.H. But I miss this file. Leaving the original name let the solver be compiled.

My creteFields.h is as following:
Code:
Info<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
    IOobject
    (
        "transportProperties",
        runTime.constant(),
        mesh,
        IOobject::MUST_READ,
        IOobject::NO_WRITE
    )
);
dimensionedScalar DT
(
     transportProperties.lookup("DT")
);
 
    Info<< "Reading field p\n" << endl;
    volScalarField p
    (
        IOobject
        (
            "p",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );
    Info<< "Reading field U\n" << endl;
    volVectorField U
    (
        IOobject
        (
            "U",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );
Info<< "Reading field T\n" <<endl;
volScalarField T
(
    IOobject
    (
         "T",
         runTime.timeName(),
         mesh,
         IOobject::MUST_READ,
         IOobject::AUTO_WRITE
     ),
     mesh
);
#   include "createPhi.H"
 
    label pRefCell = 0;
    scalar pRefValue = 0.0;
    setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
 
    singlePhaseTransportModel laminarTransport(U, phi);
    autoPtr<incompressible::turbulenceModel> turbulence
    (
        incompressible::turbulenceModel::New(U, phi, laminarTransport)
    );
Just newbie questions:

- why in the original pisoFoam file the transportProperties Dict was missing ?
- why in the very last lines turbolence is specified using just laminarTransport ?


I tested a case with the laminar model and the result seems ok.

Any help is really appreciated.

Daniele
Hi Danvica. I have implemented temperature field into pisoFoam, too. but i got some problems. I have no idea what is CourantNo.T.H. have you used it in your solver?my problem is when i run the case everything seems to work fine. but after I check my results in paraview there is no change in T field in time. i have added the same equation which was added to icoFoam in tutorial. I wonder if i have put TEqn.H into the source of the solver in correct place. i did it just like icoFoam tutorial. whats wrong?
Regards
Mojtaba
Mojtaba.a is offline   Reply With Quote

Old   July 30, 2012, 21:42
Default
  #7
Senior Member
 
Mojtaba.a's Avatar
 
Mojtaba Amiraslanpour
Join Date: Jun 2011
Location: Zanjan, Iran
Posts: 233
Rep Power: 7
Mojtaba.a is on a distinguished road
Send a message via Yahoo to Mojtaba.a
I found the solution myself. I was putting TEqn.h in the wrong place in source code. I was putting TEqn after PISO loop, mentioned in this link:

http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam

I put it at the first of the PISO loop which was mentioned in here:

http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2009/programmingTutorial.pdf

And problem solved.
Mojtaba.a is offline   Reply With Quote

Old   August 27, 2012, 04:27
Default Troubles to add temperature to pisoFoam
  #8
New Member
 
Join Date: Feb 2012
Posts: 28
Rep Power: 5
Matt_B is on a distinguished road
Hi you all,
I found this thread which is as closer as possible to my current case.
I managed to add temperature to pisoFoam and I followed hints found on the forum and even on the wikipage "How to add temperature to icoFoam". The steps are the following:

SOLVER FOLDER
1) I created a new solver called "pisoFoamT" copying and pasting from the already available "pisoFoam".
2) I added in createFields.H the code for reading new T volScalarField and a new dictionary called "thermophysicalProperties" in the "constant" folder of the new case.
3) I created new "TEqn.H" for the temperature transport equation.
4) In "Make" first I changed in "files" reference from "pisoFoam.C" to "pisoFomT.C", then in "options" I added the address and the new libraries to manage T transport ("specie" and "basicThermophysicalModels").

CASE FOLDER
1) Added T in "0" folder.
2) Added "thermophysicalProperties" in the "constant" folder with the thermo type.
3) In "System/ fvSchemes" I added correct operators to solve T equation and in "System/fvSolution" I added T with the proper solving method.

After that I reached the solver directory on the bash terminal, then I typed "wclean" to delete all the previous dependancies and then "wmake". The binary file seems generated correctly even because the wmake operation report an error in TEqn.H which to me is not very important at this stage, because it just says that one paramether is not declared, which I already knew.
The problem is that, running the case, the T equation is not calculated, is like ignored by the solver and of course the T has not changed at all along time steps. Going deeper and debugging by means of gdb, seems "pisoFoamT" wasn't recognized and was run "pisoFoam" instead, because the lines I added are completely ignored. So, if I added in "pisoFoamT.C" the line #include "TEqn.H", this is like skipped; the same if I enter createFields.H, here is correctly read p, U but T is skipped as well.
Doesn't anybody have any clue on what is happening here?

Thank you.

Matteo
y_jiang likes this.
Matt_B is offline   Reply With Quote

Old   August 27, 2012, 06:14
Default
  #9
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,503
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Matteo,

Quote:
Originally Posted by Matt_B View Post
The binary file seems generated correctly even because the wmake operation report an error in TEqn.H which to me is not very important at this stage, because it just says that one paramether is not declared, which I already knew.
Without having access to the code or at least show some of the changes you've actually made, I'll have to assume that the conclusion you've made above is incorrect, since you're expecting something to work, even when it didn't compile properly or as expected

Either way, have you done the other tutorial first? The one to add temperature to icoFoam?

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   August 27, 2012, 12:09
Default
  #10
New Member
 
Join Date: Feb 2012
Posts: 28
Rep Power: 5
Matt_B is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Matteo,


Without having access to the code or at least show some of the changes you've actually made, I'll have to assume that the conclusion you've made above is incorrect, since you're expecting something to work, even when it didn't compile properly or as expected

Either way, have you done the other tutorial first? The one to add temperature to icoFoam?

Best regards,
Bruno
You are right Bruno, but my intention was just to find out if I forgot or did wrong the simpler steps....without posting the code. Anyway, I found that when I compile with wmake, it doesn't yield the expected file "pisoFoamT.o" reporting one error. I think that't the origin of my troubles. Maybe I have to work it out better to understand how to avoid this error.
By the way, I already made step by step the "How to add temperature to icoFoam" without any big deal.
Thank you Bruno, if I keep having troubles I'll post it
Matt_B is offline   Reply With Quote

Old   September 3, 2012, 17:08
Default
  #11
uli
New Member
 
Join Date: Jun 2012
Posts: 25
Rep Power: 5
uli is on a distinguished road
hi Matt

I also modified pisoFoam to solve for temperature. I did not introduce "thermophysicalProperties" nor "TEqn.H" but just added the code to solve energy equation to the pisoFoamT.C file. Except that I did the same you did and so far it works.

Have you found a solution to your problem yet? What comes to my mind are two points:

Did you change "pisoFoam" to "pisoFoamT" in your controldict file?
Did you call pisoFoamT instead of pisoFoam when starting your simulation?

Uli
y_jiang likes this.
uli is offline   Reply With Quote

Old   September 5, 2012, 05:30
Default
  #12
New Member
 
Join Date: Feb 2012
Posts: 28
Rep Power: 5
Matt_B is on a distinguished road
Hi uli,
thanks for your reply and to try to help me I appreciate that.
By the way, I made lots of progress and now I'm able to run my code with temperature equation and thermophysical properties, which was my goal actually. I suggest you to read the following thread I opened after this:

Problem in modified pisoFoam with temperature equation + thermophysical model

I will post on this thread the latest version of my pisoFoamT solver files.

See ya!
Matt_B 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
Problem with zeroGradient wall BC for temperature - Total temperature loss cboss OpenFOAM 10 March 5, 2015 07:57
Density of fluid with respect to temperature and pressure akash_max CFX 4 November 6, 2011 10:00
Temperature Rise Ashok kumar FLUENT 1 January 2, 2009 21:26
water temperature in heated container ali Main CFD Forum 3 July 23, 2007 11:54
Sequential calculation of Temperature and mass tra J.W.Ryu FLUENT 7 June 18, 2002 07:12


All times are GMT -4. The time now is 14:17.