|
[Sponsors] |
March 20, 2012, 07:15 |
Add temperature to pisoFoam
|
#1 |
Senior Member
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 17 |
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) ); - 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 |
|
March 21, 2012, 01:57 |
|
#2 |
Senior Member
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 17 |
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 |
|
March 21, 2012, 03:15 |
|
#3 |
Senior Member
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 17 |
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 |
|
March 21, 2012, 09:09 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
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 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
__________________
|
|
March 21, 2012, 14:07 |
|
#5 |
Senior Member
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 17 |
It works ! (well, what else ? )
Thanks for the fast support. Daniele |
|
July 30, 2012, 21:27 |
|
#6 | |
Senior Member
|
Quote:
Regards Mojtaba |
||
July 30, 2012, 22:42 |
|
#7 |
Senior Member
|
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. |
|
August 27, 2012, 05:27 |
Troubles to add temperature to pisoFoam
|
#8 |
Member
Join Date: Feb 2012
Posts: 35
Rep Power: 14 |
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 |
|
August 27, 2012, 07:14 |
|
#9 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Matteo,
Quote:
Either way, have you done the other tutorial first? The one to add temperature to icoFoam? Best regards, Bruno
__________________
|
||
August 27, 2012, 13:09 |
|
#10 | |
Member
Join Date: Feb 2012
Posts: 35
Rep Power: 14 |
Quote:
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 |
||
September 3, 2012, 18:08 |
|
#11 |
New Member
Join Date: Jun 2012
Posts: 25
Rep Power: 14 |
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 |
|
September 5, 2012, 06:30 |
|
#12 |
Member
Join Date: Feb 2012
Posts: 35
Rep Power: 14 |
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: http://www.cfd-online.com/Forums/ope...cal-model.html I will post on this thread the latest version of my pisoFoamT solver files. See ya! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with zeroGradient wall BC for temperature - Total temperature loss | cboss | OpenFOAM | 12 | October 1, 2018 07:36 |
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 12:54 |
Sequential calculation of Temperature and mass tra | J.W.Ryu | FLUENT | 7 | June 18, 2002 08:12 |