|
[Sponsors] |
Is there a way to write only the probe locations instead the whole fields? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 26, 2016, 11:47 |
Is there a way to write only the probe locations instead the whole fields?
|
#1 |
New Member
Jean Schuster
Join Date: Jan 2015
Posts: 8
Rep Power: 11 |
Hi guys.
I'm running a case that consist in a rectangular box with dimensions height , for the streamwise direction and in the spanwise direction, with about 700 K cells in total. The OpenFoam version used is the 2.4.0 running over Debian 8. The solver used is the buoyantPimpleFoam. The simulation runs well, and I've concluded 1 hour of simulation. Now I want to change some parametres like temperature and continue the simulation from 1 hour to another few hours. As I already have the full fields of the initial 1 hour of simulation, the subsequent full fields are no longer necessary. I wonder if I could write only the probe locations instead of the whole fields after i restart the simulation from 1 hour, and write the full fields after a certain number of write intervals (like at every 500 write intervals), in case I need to restart the simulation. I'm asking that because i'm running out of disk quota on the cluster, which is about 7.5 TB. I'm hopefull that someone can help me, since I'm not very familiar with object-oriente programming. Thanks in advance. |
|
October 3, 2016, 10:46 |
|
#3 | |
New Member
Jean Schuster
Join Date: Jan 2015
Posts: 8
Rep Power: 11 |
Quote:
I friend of mine made some changes in the buoyantPimpleFoam.C file as you can see bellow: Code:
\*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "rhoThermo.H" #include "turbulenceModel.H" #include "radiationModel.H" #include "fvIOoptionList.H" #include "pimpleControl.H" #include "fixedFluxPressureFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" #include "readGravitationalAcceleration.H" #include "createFields.H" #include "createFvOptions.H" #include "createRadiationModel.H" #include "initContinuityErrs.H" #include "readTimeControls.H" #include "compressibleCourantNo.H" #include "setInitialDeltaT.H" pimpleControl pimple(mesh); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // /* Info<< "\n#Starting time loop\n" << endl;*/ IOdictionary controlDict(IOobject("controlDict", runTime.system(),mesh,IOobject::MUST_READ,IOobject ::AUTO_WRITE)); scalar wi = readScalar(controlDict.lookup("writeInterval")); scalar deltat = readScalar(controlDict.lookup("deltaT")); scalar st = readScalar(controlDict.lookup("startTime")); Info<< "#wi = " << wi << endl; Info<< "#deltat = " << deltat << endl; Info<< "#st = " << st << endl; while (runTime.run()) { #include "readTimeControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" /******************************************/ IOdictionary pLocs ( IOobject ( "probeLocations", runTime.constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ); const pointField& probeLocations(pLocs.lookup("probeLocations")); labelList probeCells(probeLocations.size(), -1); forAll(probeLocations, pI) { probeCells[pI] = mesh.findCell(probeLocations[pI]); } /******************************************/ runTime++; Info<< "#Time = " << runTime.timeName() << nl << endl; #include "rhoEqn.H" // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { #include "UEqn.H" #include "EEqn.H" // --- Pressure corrector loop while (pimple.correct()) { #include "pEqn.H" } if (pimple.turbCorr()) { turbulence->correct(); } } rho = thermo.rho(); /* runTime.write();*/ /* Info<< "#ExecutionTime = " << runTime.elapsedCpuTime() << " s" << "# ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl;*/ /*******************************************/ Info<< "#passo = " << (runTime.value()-st)/deltat << endl; if ( (int)((runTime.value()-st)/deltat) % (int)wi == 0) forAll(probeCells, pI) { if(probeCells[pI] != -1) { label cellNo = probeCells[pI]; Info << runTime.timeName() << " " << pI << ". Location: " << probeLocations[pI] << ", alphaSgs: " << alphaSgs[cellNo] << ", k: " << k[cellNo] << ", muSgs: " << muSgs[cellNo] << ", p: " << p[cellNo] << ", phi: " << phi[cellNo] << ", pMean: " << pMean[cellNo] << ", pPrime2Mean: " << pPrime2Mean[cellNo] << ", p_rgh: " << p_rgh[cellNo] << ", T: " << T[cellNo] << ", U: " << U[cellNo] << ", UMean: " << UMean[cellNo] << ", UPrime2Mean: " << UPrime2Mean[cellNo] //add any other fields here << endl; } } /*******************************************/ } /* Info<< "End\n" << endl;*/ return 0; } // ************************************************************************* // https://drive.google.com/open?id=0B-...0JxZjlpWV9pSk0 The new solver was named buoyantPimpleFoamD and compiles ok. The intention was to make the solver read a file called probeLocations inside the constant folder, this file contains the fields and locations that I want to probe, then write only the probes in a text file through the command "buoyantPimpleFoamD | grep Location > data". When I try to run the case with the new solver it gives me the following error: Code:
#0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 ? at ??:? #4 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #5 ? at ??:? Could some one help me debug this error? |
||
October 4, 2016, 03:19 |
|
#4 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
Did you even have a look at the link I provided? The changes made to the solver are unnecessary.
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
October 4, 2016, 12:39 |
|
#5 | |
New Member
Jean Schuster
Join Date: Jan 2015
Posts: 8
Rep Power: 11 |
Quote:
At first it was still writting the whole fields in each time steps together whit the probes. Then a set a purgeTime in the controlDict and now is working the way I wanted. Your solution was a way easier than what I had in my mind, at first i couldnt belive it. Thank you so much. |
||
October 5, 2016, 03:05 |
|
#6 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
Try setting writeInterval to whatever large value you want to have, and adding "outputInterval 1;" to the secion where you define the probe instead of purging the field data.
Edit: You also need to set "outputControl" accordingly (probably "timeStep").
__________________
*On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer. |
|
October 5, 2016, 11:57 |
|
#7 |
New Member
Jean Schuster
Join Date: Jan 2015
Posts: 8
Rep Power: 11 |
I added "outputControl timeStep;" and "outputInterval 1;" in the probes function and set "writeInterval 600;", so my probes will be written according my deltaT and the time folder will be written at every 600s of simulation, once I've set "writeControl runTime;".
Correct me if i'm wrong. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Plotting Velocity Probe File with gnuplot | McCharles | OpenFOAM Post-Processing | 9 | November 18, 2019 08:44 |
Empty Probe File - Probes not working | rvmedina20 | OpenFOAM Post-Processing | 3 | May 11, 2016 20:36 |
Probe for X or Y velocity | msrinath80 | OpenFOAM Running, Solving & CFD | 29 | July 22, 2015 18:46 |
Line Probe Smoothing | badger1 | STAR-CCM+ | 1 | May 21, 2013 23:36 |
PostChannel | maka | OpenFOAM Post-Processing | 5 | July 22, 2009 10:15 |