|
[Sponsors] |
May 22, 2013, 02:58 |
Save data only from a plane
|
#1 |
Member
Luca
Join Date: Mar 2013
Posts: 68
Rep Power: 13 |
I need to run a 2M cells simulation and i need to save the pressure and the speed on a surface for about 9000 time steps.
The way I proceed right now is to save all the cells value for the 9000 time steps and THEN sample the value on the surface I need. The problem is that, this way, I create an huge amount of datas (about 1TB) to extract from it 5GB of datas that i actually need. Moreover the sample utility is slower than pisoFoam (both are running on parallel on 60 cores). Is there a more efficient way to do this operation? I thought I could delete the time-steps folders with the purgeWrite option, but to do so I need to sample the surface during the pisoFoam execution. Is this possible? |
|
May 22, 2013, 05:52 |
|
#2 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17 |
When you say a "plane", is it a patch ?
If yes, you can edit your solver, create a new field where you copy only the data of the desired patch. 1) create the field Code:
volScalarField ExportPressure ( IOobject ( "ExportPressure", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh ); Code:
label patchWallID = mesh.boundaryMesh().findPatchID("wall"); const fvPatch& patchWallFaces = mesh.boundary()[patchWallID]; 3) Loop over the cells of your patch to save the data Code:
forAll(patchWallFaces, facei) { ExportPressure.boundaryField()[patchWallID][facei] = P.boundaryField()[patchWallID][facei] ; } Code:
ExportPressure.boundaryField()[patchWallID] = P.boundaryField()[patchWallID]; However, if you want to export it at each time step (no matter what), just add the following code after "calculating" the step 3: Code:
ExportPressure.write(); |
|
May 22, 2013, 06:40 |
|
#3 |
Member
Luca
Join Date: Mar 2013
Posts: 68
Rep Power: 13 |
Thank you very much Fredo.
Actually my "plane" is not a patch, but it's a plane I define in sampleDict with a point and a normal inside my domain. Code:
surfaces ( constantPlane { type plane; name in; basePoint ( 0 0 25 ); normalVector ( 1 0 0 ); } ); Moreover (I'm sorry i forgot to say it before), I need this data to be read by the BC timeVaryingMappedFixedValue. To obtain so I set the output format in sampleDict to foamFile and then i need to do some minor manipulation. What kind of format are the data written with your method? Moreover I'm sorry, but I'm not an expert with OF. So, the commands you wrote me where have to be written? Inside pisoFoam.C or something like that? Anyway, even if it's not "perfect" it's a good solution. I will give it a deep look and maybe a try. Thank you very much. |
|
May 22, 2013, 07:21 |
|
#4 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17 |
yeah, the code needs to be included in the solver code.
1) in the createField.H 2) / 3) and 4) can be included inside the C file (pisoFoam.C I guess). The output file looks like the one enclosed. I have exported the temperature only on the wall patch from the Temperature Field T. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 03:09 |
Get data over a plane | mali28 | Fluent UDF and Scheme Programming | 1 | May 25, 2012 14:52 |
Error importing symmetry plane data | prikeyma | FLUENT | 0 | September 1, 2010 12:44 |
Smallest binary file format to save large data | Zonexo | Main CFD Forum | 2 | June 2, 2008 21:25 |
how to save uds' data in each time-step ? | xiaodong | FLUENT | 0 | March 26, 2008 12:28 |