how to write temperature to a file
Dear All,
I am running buoyantSimpleFoam and I would like to save the temperature of a patch (my_outlet) in a text file. What I would like to do is to save either the sum ot the temperature of each cell (that belongs to the patch) or writing the temperature of the cells in a line. In the first case I'll have a file with 1 column and n lines (with n = number of iterations), while in the second case I'll have a m x n file (where m = number of cell belonging to the patch). How can I do this? Any idea? Thanks a lot, Samuele |
you should use face object
just add these lines to control dict functions { faceObj1 { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl outputTime; // Output to log&file (true) or to file only log true; // Output field values as well valueOutput true; // Type of source: patch/faceZone/sampledSurface source patch; // if patch or faceZone: name of patch or faceZone sourceName movingWall; //// if sampledSurface: dictionary with a sampledSurface //// Note: will not sample surface fields. //sampledSurfaceDict //{ // // Sampling on triSurface // type sampledTriSurfaceMesh; // surface integrationPlane.stl; // source cells; // sample cells or boundaryFaces // interpolate true; //} // Operation: areaAverage/sum/weightedAverage ... operation areaAverage; fields ( p phi // surface fields not supported for sampledSurface U ); } this will write your patch value for each time steps solved |
Dear Niaz,
thanks a lot for answering. It really helped. Just a question: do you know where I can find a list of available functions (probes, faceObj1..)? Thanks a lot, Samuele |
Dear sam
there are two functions which is helpful 1- src/sampling 2- src/postproceesing/functionobjects in each folder you can find a controldict that show you how to use it |
hey guys,
this seems to be quite useful for me. Could you please make it a bit more clear, how exactly we set the commands for writing the Temperature in a file, as a function of time? I tried to use the commands posted above but without success thanks in advance |
Just paste this code
Code:
functions Then you'll have a file with the temperature! Does this help? |
hey Samuele, thanks a lot for your immediate response!
well, I pasted what you wrote but unfortunately it doesnt work. The only thing I have changed is the sourceName movingWall; and I entered the name of my outlet. I get this message: --> FOAM FATAL ERROR: request for objectRegistry region0 from objectRegistry aplo1 failed available objects of type objectRegistry are 3 ( fluid pla1 pla2 ) From function objectRegistry::lookupObject<Type>(const word&) const in file db/objectRegistry/objectRegistryTemplates.C at line 131. where fluid, pla1, pla2 are the regions in my problem. (pla1 & pla2 are solid) I would be really grateful if you help me through this. cordially, giorgos |
Is your outlet defined as a patch?
Could you copy your constant/polyMesh/boundary? Thanks, Samuele |
hey Samuele,
thanks again for your consideration! So, yes my outlet is defined as patch (it seems to work ok - the fluid is actually going out). here is the constant/polyMesh/boundary my outlet at this point is bottom (sometimes will be also the top) akres-ar and akres_de are the solid walls outside of the domain Code:
5 |
Hi,
I try to write the system/controlDict for you. You should add these lines, at the end: Code:
functions |
hey Samuele,
thanks again. Unfortunately, this didnt work also. It gives me the same message that I have posted earlier. request for objectRegistry region0 from objectRegistry aplo1 failed available objects of type objectRegistry are....... I am using the latest version, OF-2.1.1 If you find an idea to solve this I will be really grateful... ciao |
Could you share your case with me?
I could test it and give it the solution (if I can find it!).. Samuele email: samuele.zampini@gmail.com |
I sent it! very nice of you!
|
Update for OFv6
This is a very old thread. But maybe this will help someone else save a few minutes. For OF v6 following works very well.
Add this to controlDict: Code:
functions |
All times are GMT -4. The time now is 13:26. |