![]() |
I edited the last two paragraphs of my earlier reply to make them clearer.
Your suggestion to add symlink by the solver is neat. I'm not familiar with OpenFOAM's code structure so won't immediately try my hands making changes though, in case I might end up spending more time mopping up errors that I inject than getting the solver to automatically install symbolic links for the volume field files. |
The best way is always to copy the solver completely:
Code:
cp -r icoUncoupledKinematicParcelFoam arbitraryName Change the file accordingly: Code:
icoUncoupledKinematicParcelFoam.C // You can change this name - has to be the same as the source file It is common practice to name the directory of the new solver, the source file of the new solver and the application name identically. A copy of the existing solver allows you to destroy the solver without losing the original files. Additionally, one can make a repository to have all changes in the history :) |
Thanks. That tip gives me the temerity to tinker.
As an aside, how does one extract origIds, seed positions and ages of particles that escape, from a MPPICFoam solver simulation? I will take that information and try to replicate in icoUncoupledKinematicParcelFoam for a closer look in isolation using fine output time intervals. In ParaView, when viewing particles of MPPICFoam's Lagrangian fields, I often wish to "grab" the particles that escape and just replay the whole time sequence without the rest of the particles in order to pin down their trajectories, but I have had no luck so far in coming out with a simple way. All I could do was play with 'rescale to custom data range' repeatedly narrowing each time the range. |
Quote:
|
You can use the objectFunction for such purpose. Simply add the following to your kinematicCloud properties file:
Code:
cloudFunctions |
Thanks very much. This is great!!! Am developing a better feel for this suite of tools each time I get a tip-off from you.
Based on your tip-off, I searched by "patchPostProcessing," which turned up a few hits. I'm bookmarking them below so I will find them easily next time and likely other users would too. (1) (23/12/2019) https://www.openfoam.com/releases/op...processing.php ; (2) https://openfoam.org/release/2-3-0/physical-modelling/; (3) https://www.cfd-online.com/Forums/op...-surface.html; (4) https://www.cfd-online.com/Forums/op...gh-patch.html; and, (5) https://www.cfd-online.com/Forums/op...rocessing.html This will keep me busy for a day. |
Update:
The postprocessing output comes in the form of a text file for each of the patches named in the patchPostProcessing dictionary in each of the time directories, like below (1 escape parcel at time 0.7767173, age 0.0691692s, origId 867): Quote:
The inlet patch (with rebound for particles), is empty except for the first row (labels). I was hoping the input patch post processing will report the origId and coordinates when the parcels are injected, which I then can use to set the injected parcel coordinates in icoKinematicCloudFoam. That hope is dashed. ========================== Now, armed with the origId and Time of escape, I can step to the time(s) snapshots before escape and use Threshold filter to display just this parcel. But it's just one snapshot. What are my alternatives? (1) Is there a function object to output origId and coordinates at much smaller time steps separate from the writeout time step? Since the number of parcels is only in the thousands, it seems not far fetched that this possibility exists in the source codes. (2) Is there a function object to record the launch coordinates and origId for all particles injected? The data has to be somewhere. The question is how to get it out into a text file. Would be very nice to have both. =================== A 'band-aid' way of doing (1) is to re-run the Lagrangian solver at the much finer time steps for tracing the desired parcels but with writing of the volume fields all turned off to save disk space. As Tobias and Ali suggested above for a different solver through editing the createField.h header file to change 'AUTO_WRITE' to 'NO_WRITE' for the respective volume field's IOobject. Compiling a 2nd version of the solver is necessary for this band-aid to work. Run the original version for the original, coarse write-out time step. Run the 2nd version for the new, finer write-out time step to write out Lagrangian fields only. Of course it will better if in one run the solver can use two different write-out time steps, and let user control--through controlDict--what fields to use which write-out time steps. ============== On 2nd thought, that band-aid for (1) will work only if the parcels are injected at exactly the same positions with the same velocities and the same particle diameters, etc., etc., everytime the simulation is re-run. But is it true? I have a feel it is controlled by a random variable, since I set the diameter to 'normal distribution'. Which is good, because a random process driven injector will help to discover something interesting that a pre-determined injector will miss. I think I can just skip the first part of (1) -- i.e. the part about running first time to output volume fields at coarse time steps -- and straightaway go for the 2nd part -- i.e. writing out only the Lagrangian fields and doing so at the finer time step. |
Quote:
|
Setting MIN=origID and MAX=origID does it.
|
Quote:
|
Quote:
Without this remaining obstacle, I can use even smaller writeout time steps. The fields aren't named in any of the header and source files at any level below the DPM directory. Anyone knows where to find them to turn off the write out? ===================== For now, I use a one-line script to watch for new named files under time directories and delete them every 3 minutes: Code:
watch -n 180 'find proc*/?.*/*.bulk -type f -mmin +3 -exec rm {} \;' Picking out and tracing escaped particles with fine time step works really well. But still have to manually find under the postProcessing directory the time subdirectories where the ascii files' sizes are larger than the minimal--the minimal files just have the first row consisting of labels--, copy them out to a separate new directory, manually collect the data lines into a new text file, and pick out the particles' origId, ages, diameter, etc., etc., from the respective lines (particles), and then go back to manually threshold each origId in ParaView. I did all that. But, going forward, I would like to automate this. Without having to touch the source codes of ParaView, it seems the best way forward is to write a shell/Python script to automate all those manual steps, and then use the origIds thus collected to go back to prune the Lagrangian fields under kinematicCloud and kinematicCloudTracks directories to remove entries for all particles whose origIds don't belong among those collected. I am looking for a ready code to convert the fields from binary to ascii. Utilities/miscellaneous/foamFormatConvert.C may be an example on how to do this. ============= For now, I use a one-line shell script to collect all lines from all postprocessing files under directory 'postProcessing/lagrangian/kinematicCloud/patchPostProcessing1' for patch '*outlet.post'' larger than 300 characters into a file 'escapes.post': Code:
find ./?.*/*outlet.post -type f -size +300c -exec ls -l {} \; -exec cat {} \; >> escapes.post Code:
#!/usr/bin/perl |
All times are GMT -4. The time now is 17:03. |