adding temperature to simpleFoam
Hello,
Has any of you foamers added temperature to simpleFoam successfully? Regards, Carlos |
|
Thanks Elvis, I'm building it. It is taking me a while to understand how to implement the Temperature equation for a "steady state" for simpleFoam. I am making analogies with the buoyantBoussinesqSimpleFoam solver in a first step, but I am not sure.
Anyway, up to the 12th iteration I get an error message. If I make a step forward implementing simpleTempFoam, i'll post it here. Thanks again, Carlos |
Hi,
Instead of implementing temperature yourself you could use rhoSimpleFoam. This solver has already the solution of the enthalpy equation included. rgds Bjorn |
Hi Bjorn,
Is it possible to use water as heat transfer media in rhoSimpleFoam? I haven't been able to change perfectGas in the thermophysicalproperties file. |
Ok, I did not realize that your problem had water as medium. So, you probably need to implement the temperature equation after all.
Have you by the way checked the thermomodel: icoPolynomial Incompressible polynomial equation of state, e.g. for liquids as indicated in the User Manual? rgds Bjorn |
Hello everyone,
I m a relatively new foamer and I mostly work with simpleFoam. I wanted as well to add temperature calculation for my flow as Carlos, so I followed as Bjorn suggested the rhosimpleFoam solver and the instructions from OpenFoam Wiki on how to add temperature to IcoFoam. A lot of erros appeared at the first place but I managed to overcome them, builded the new solver with the temperature and no errors appear. I use Paraview for postprocessing and the problem is that U,p, nu (I work with non - Newtonian flow) is printed normally but I cannot see anywhere the T variable to select to view the results. Did anybody had that problem?I would appreciate any comments. Kindly, Nickolas |
Also, in the past I have succesfully carried out the addition of temperature to icoFoam and Paraview gave me the results as suggested from OpenFoam Wiki about that subject.
Thanx |
Hi Nickolas,
just a guess, but have you defined the scalarField for T with option "IOobject::AUTO_WRITE"? Code:
Info << "Reading field T\n" << endl; Code:
T.write() Martin |
Yes that is correct. Below I m sending the createFields.H file of my created solver:
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 ); //adding from here Info<< "Reading field T\n" <<endl; volScalarField T ( IOobject ( "T", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); //to here # include "createPhi.H" label pRefCell = 0; scalar pRefValue = 0.0; setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); singlePhaseTransportModel laminarTransport(U, phi); dimensionedScalar DT ( mesh.solutionDict().subDict("SIMPLE").lookup("DT") ); autoPtr<incompressible::RASModel> turbulence ( incompressible::RASModel::New(U, phi, laminarTransport) So besides that I can add at the end the line you suggested and leave the option IOobject::AUTO_WRITE the same? |
The AUTO_WRITE option is fine, don't know why it doesn't work.
You can add the T.write() additionally, for example in your runTime loop: Code:
while (runTime.loop()) Code:
. . . |
4 Attachment(s)
Martin,
First of all thanks a lot for the useful information. I tried the method you told me but the problem still remains the same. So I found a similar solver to see if things work out, the solver is the buoyantBoussinesqSimpleFoam. I modified my simpleFoam solver to match with the Boussinesq one. Actually at Boussinesq there is already the code on how to add the temperature but I think in my case I dont implement it correct. I'm attaching some of the files of the solver to check if I have done anything wrong. Please, I m open to any thoughts, comments! Kindly, Nickolas |
2 Attachment(s)
Hi Nickolas,
in the attachment you find the reviewed solver and a test case. I made two minor changes to your solver in createFields.H and TEqn.H, have a look at comments with "@ Nickolas:". To run the test case use: blockMesh my_simpleFoam You can run it in parallel, too. It's configured for 4 cpu cores. Have fun Martin |
Hi Martin,
With your suggestions I was able to perform the simulations and the temperature was calculated! Thank you very much. I am now able to understand the code better. Nontheless, I need to validate my results with the theory to check if everythhing works ok, but for the time being the temperature field is plotted. I have another question concerning the "relaxation factors" that I see in the "fvsolution" file. How these factors affect the results of the simulation and I would like to know if there any standard values. Does it have to do with the flow field (meaning Newtonian approximation, non - Newtonian approximation) or the mesh? Or is it just a short of numerical technique? I found OpenFOAM very interesting and I would like to learn as much as possible although I m not very strong at c++. Do you happen to know any books or internet sites for me to study regarding these matter? Again thanks a lot for your comments! Kindly, Nickolas |
Quote:
I have taken this file to add Temperature to the simpleFoam solver, I have followed the the instructions in the openfom wiki, but I'm having an error. Cheers. Quote:
|
Andres, /opt/ is a directory that can only be written to with administrator rights. If you compile the solver in your home directory all should be well.
|
Quote:
Quote:
|
Did you execute wclean before you tried to wmake again?
|
Quote:
Quote:
|
Does readSIMPLEcontrols.H exist in "/opt/openfoam200/src/finiteVolume/lnInclude/"?
|
All times are GMT -4. The time now is 07:46. |